Phasor 2.2.0
Stack VM based Programming Language
Loading...
Searching...
No Matches
NativeRuntime_library.cpp File Reference
#include "../../CLI/Runtime/NativeRuntime.hpp"
#include <iostream>
#include <vector>
#include <cstring>
#include <sstream>
Include dependency graph for NativeRuntime_library.cpp:

Go to the source code of this file.

Macros

#define DLLEXPORT

Functions

std::vector< std::string > splits (const std::string &input)
DLLEXPORT void exec (const unsigned char embeddedBytecode[], size_t embeddedBytecodeSize, const char *moduleName, const void *nativeFunctionsVector, const int argc, const char **argv)
 Executes pre-compiled Phasor bytecode.
DLLEXPORT void jitExec (const char *script, const char *moduleName, const void *nativeFunctionsVector)
 Executes a Phasor script using Just-In-Time (JIT) compilation.
DLLEXPORT void executeScript (void *vm, const char *script)
 Executes a Phasor script within an existing VM instance.

Macro Definition Documentation

◆ DLLEXPORT

#define DLLEXPORT

Definition at line 15 of file NativeRuntime_library.cpp.

Function Documentation

◆ exec()

DLLEXPORT void exec ( const unsigned char embeddedBytecode[],
size_t embeddedBytecodeSize,
const char * moduleName,
const void * nativeFunctionsVector,
const int argc,
const char ** argv )

Executes pre-compiled Phasor bytecode.

Parameters
embeddedBytecodeAn array of unsigned chars containing the Phasor bytecode.
embeddedBytecodeSizeThe size of the bytecode array.
moduleNameThe name of the module, used for error reporting.
nativeFunctionsVectorA pointer to a vector of pairs, where each pair contains a function name and a function pointer.
argcThe number of command-line arguments.
argvAn array of strings representing the command-line arguments.

Definition at line 37 of file NativeRuntime_library.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeScript()

DLLEXPORT void executeScript ( void * vm,
const char * script )

Executes a Phasor script within an existing VM instance.

Parameters
vmA pointer to the Phasor VM instance.
scriptA string containing the Phasor script to execute.

Definition at line 97 of file NativeRuntime_library.cpp.

Here is the call graph for this function:

◆ jitExec()

DLLEXPORT void jitExec ( const char * script,
const char * moduleName,
const void * nativeFunctionsVector )

Executes a Phasor script using Just-In-Time (JIT) compilation.

Parameters
scriptA string containing the Phasor script to execute.
moduleNameThe name of the module, used for error reporting.
nativeFunctionsVectorA pointer to a vector of pairs, where each pair contains a function name and a function pointer.

Definition at line 68 of file NativeRuntime_library.cpp.

Here is the call graph for this function:

◆ splits()

std::vector< std::string > splits ( const std::string & input)

Definition at line 22 of file NativeRuntime_library.cpp.