nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
nk::VM Class Reference

Classes

struct  FrameView
struct  PausedState

Public Member Functions

 VM (Engine &engine)
Value execute (const BytecodeChunk &chunk, const Value *args=nullptr, uint8_t nargs=0)
ExecStatus startExecution (const BytecodeChunk &chunk, const Value *args=nullptr, uint8_t nargs=0, DebugAction initialAction=DebugAction::StepInto)
ExecStatus resumeExecution ()
bool isPaused () const
Value takeResult ()
std::vector< Value > callReentrant (const BytecodeChunk &chunk, Span< const Value > args, size_t nargout, const std::string &ownerClass=std::string(), bool isCtor=false, const Value *ctorSeed=nullptr)
bool pushCallbackFrame (const Value &handle, Span< const Value > args, size_t nargout, std::shared_ptr< VmContinuation > cont)
std::unique_ptr< PausedState > savePausedState ()
void restorePausedState (std::unique_ptr< PausedState > state)
void setCompiledFuncs (const std::unordered_map< std::string, BytecodeChunk > *funcs)
void setCompiledFuncs (const std::unordered_map< std::string, BytecodeChunk > *funcs, const std::unordered_map< std::string, BytecodeChunk > *scriptLocal)
const BytecodeChunk * findCompiledFunc (const std::string &name) const
const std::vector< std::pair< std::string, Value > > & lastVarMap () const
void clearLastVarMap ()
void setFrameDynVars (std::unordered_map< std::string, Value > *dv)
FrameView currentFrameView ()
size_t frameCount () const
FrameView frameViewAt (size_t depthFromTop)
int callDepth () const
const std::string & currentMethodClass () const
bool currentMethodIsCtor () const
void setMaxRecursionDepth (int d)
Environment * callerEnvAtDepth (int n)
void assignInCallerFrame (int n, const std::string &name, const Value &val)
void setStopOnError (bool b)
bool atErrorPause () const
const std::string & errorPauseMessage () const
void writeToFrameMatchingEnv (Environment *env, const std::string &name, const Value &val)
const std::vector< std::string > & currentFrameCallerArgNames () const
std::unordered_map< std::string, Value > snapshotFrameVars (Environment *frameEnv)
void setNextFrameDynVars (std::unordered_map< std::string, Value > *dv)

Public Attributes

Environment * inheritedScope_ = nullptr
bool inReentrantEval_ = false
bool stopOnError_ = false
bool atErrorPause_ = false
std::exception_ptr pausedError_
std::string errorPauseMsg_

Detailed Description

Definition at line 23 of file vm.hpp.

Member Function Documentation

◆ atErrorPause()

bool nk::VM::atErrorPause ( ) const
inline

Definition at line 198 of file vm.hpp.

◆ callDepth()

int nk::VM::callDepth ( ) const
inline

Definition at line 149 of file vm.hpp.

◆ clearLastVarMap()

void nk::VM::clearLastVarMap ( )
inline

Definition at line 111 of file vm.hpp.

◆ currentFrameCallerArgNames()

const std::vector< std::string > & nk::VM::currentFrameCallerArgNames ( ) const
inline

Definition at line 216 of file vm.hpp.

◆ currentFrameView()

FrameView nk::VM::currentFrameView ( )
inline

Definition at line 125 of file vm.hpp.

◆ currentMethodClass()

const std::string & nk::VM::currentMethodClass ( ) const
inline

Definition at line 154 of file vm.hpp.

◆ currentMethodIsCtor()

bool nk::VM::currentMethodIsCtor ( ) const
inline

Definition at line 159 of file vm.hpp.

◆ errorPauseMessage()

const std::string & nk::VM::errorPauseMessage ( ) const
inline

Definition at line 199 of file vm.hpp.

◆ findCompiledFunc()

const BytecodeChunk * nk::VM::findCompiledFunc ( const std::string & name) const
inline

Definition at line 94 of file vm.hpp.

◆ frameCount()

size_t nk::VM::frameCount ( ) const
inline

Definition at line 134 of file vm.hpp.

◆ frameViewAt()

FrameView nk::VM::frameViewAt ( size_t depthFromTop)
inline

Definition at line 140 of file vm.hpp.

◆ isPaused()

bool nk::VM::isPaused ( ) const
inline

Definition at line 40 of file vm.hpp.

◆ lastVarMap()

const std::vector< std::pair< std::string, Value > > & nk::VM::lastVarMap ( ) const
inline

Definition at line 110 of file vm.hpp.

◆ setCompiledFuncs() [1/2]

void nk::VM::setCompiledFuncs ( const std::unordered_map< std::string, BytecodeChunk > * funcs)
inline

Definition at line 79 of file vm.hpp.

◆ setCompiledFuncs() [2/2]

void nk::VM::setCompiledFuncs ( const std::unordered_map< std::string, BytecodeChunk > * funcs,
const std::unordered_map< std::string, BytecodeChunk > * scriptLocal )
inline

Definition at line 84 of file vm.hpp.

◆ setMaxRecursionDepth()

void nk::VM::setMaxRecursionDepth ( int d)
inline

Definition at line 164 of file vm.hpp.

◆ setNextFrameDynVars()

void nk::VM::setNextFrameDynVars ( std::unordered_map< std::string, Value > * dv)
inline

Definition at line 235 of file vm.hpp.

◆ setStopOnError()

void nk::VM::setStopOnError ( bool b)
inline

Definition at line 197 of file vm.hpp.

◆ takeResult()

Value nk::VM::takeResult ( )
inline

Definition at line 41 of file vm.hpp.

Member Data Documentation

◆ atErrorPause_

bool nk::VM::atErrorPause_ = false

Definition at line 202 of file vm.hpp.

◆ errorPauseMsg_

std::string nk::VM::errorPauseMsg_

Definition at line 204 of file vm.hpp.

◆ inheritedScope_

Environment* nk::VM::inheritedScope_ = nullptr

Definition at line 185 of file vm.hpp.

◆ inReentrantEval_

bool nk::VM::inReentrantEval_ = false

Definition at line 189 of file vm.hpp.

◆ pausedError_

std::exception_ptr nk::VM::pausedError_

Definition at line 203 of file vm.hpp.

◆ stopOnError_

bool nk::VM::stopOnError_ = false

Definition at line 201 of file vm.hpp.


The documentation for this class was generated from the following file: