VirtualMachine

implements virtual machine

Constructors

this
this(Environment globalEnv)

ctor

Members

Functions

copy
VirtualMachine copy(bool copyStack)

For coroutines and threads.

printChunk
void printChunk(Chunk chunk, bool printConstTable)

print a chunk instruction by instruction, using the const table to indicate values

printInstruction
void printInstruction(size_t ip, Chunk chunk)

prints an individual instruction without moving the ip

printStack
void printStack()

print the current contents of the stack

run
ScriptAny run(Chunk chunk, bool printDebugInfo, bool retCS)

run a chunk of bytecode with a given const table

runFunction
ScriptAny runFunction(ScriptFunction func, ScriptAny thisObj, ScriptAny[] args, ScriptAny yieldFunc)

For calling script functions with call or apply. Ugly hackish function that needs to be reworked.

Meta