MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / pushFrame

Method pushFrame

include/runtime/stackmgr.h:104–124  ·  view source on GitHub ↗

Push a new frame entry to the stack.

Source from the content-addressed store, hash-verified

102
103 /// Push a new frame entry to the stack.
104 void pushFrame(const Instance::ModuleInstance *Module,
105 AST::InstrView::iterator From, uint32_t LocalNum = 0,
106 uint32_t Arity = 0, bool IsTailCall = false) noexcept {
107 if (!IsTailCall) {
108 FrameStack.emplace_back(Module, From, LocalNum, Arity,
109 static_cast<uint32_t>(ValueStack.size()));
110 } else {
111 assuming(!FrameStack.empty());
112 assuming(FrameStack.back().VPos >= FrameStack.back().Locals);
113 assuming(FrameStack.back().VPos - FrameStack.back().Locals <=
114 ValueStack.size() - LocalNum);
115 ValueStack.erase(ValueStack.begin() + FrameStack.back().VPos -
116 FrameStack.back().Locals,
117 ValueStack.end() - LocalNum);
118 FrameStack.back().Module = Module;
119 FrameStack.back().Locals = LocalNum;
120 FrameStack.back().Arity = Arity;
121 FrameStack.back().VPos = static_cast<uint32_t>(ValueStack.size());
122 FrameStack.back().HandlerStack.clear();
123 }
124 }
125
126 /// Unsafe pop top frame.
127 AST::InstrView::iterator popFrame() noexcept {

Callers 4

enterFunctionMethod · 0.80
instantiateMethod · 0.80
instantiateMethod · 0.80
runFunctionMethod · 0.80

Calls 7

backMethod · 0.80
eraseMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected