11 log(std::format(
"Phasor::VM::{}(): v{}:\nnormal instance created {:#x}\n", __func__,
getVersion(),
21 log(std::format(
"Phasor::VM::{}(): v{}:\nfast instance created {:#x}\n", __func__,
getVersion(), (uintptr_t)
this));
30 log(std::format(
"Phasor::VM::{}(): v{}:\noperation instance created {:#x}\n", __func__,
getVersion(),
34 operation(op, operand1, operand2, operand3);
41 log(std::format(
"Phasor::VM::{}(): deconstructed {:#x}\n", __func__, (uintptr_t)
this));
Value operation(const OpCode &op, const int &operand1=0, const int &operand2=0, const int &operand3=0)
Execute a single operation.
std::string getVersion()
Get Phasor VM version.
void log(const Value &msg)
Log a Value to stdout.
void flush()
Flush stdout.
std::pmr::vector< Value > stack
void cleanup()
Clean up the virtual machine.
int run(const Bytecode &bytecode, const size_t startPC=0)
Run the virtual machine Exits -1 on uncaught exception.
std::pmr::monotonic_buffer_resource stack_pool
Stack.
A value in the Phasor VM.
The Phasor Programming Language and Runtime.
Complete bytecode structure.