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

Method branchToLabel

lib/executor/helper.cpp:249–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249Expect<void>
250Executor::branchToLabel(Runtime::StackManager &StackMgr,
251 const AST::Instruction::JumpDescriptor &JumpDesc,
252 AST::InstrView::iterator &PC) noexcept {
253 // Check the stop token.
254 if (unlikely(StopToken.exchange(0, std::memory_order_relaxed))) {
255 spdlog::error(ErrCode::Value::Interrupted);
256 return Unexpect(ErrCode::Value::Interrupted);
257 }
258
259 StackMgr.eraseValueStack(JumpDesc.StackEraseBegin, JumpDesc.StackEraseEnd);
260 // PC needs -1 here because the PC will increase in the next iteration.
261 PC += (JumpDesc.PCOffset - 1);
262 return {};
263}
264
265Expect<void> Executor::throwException(
266 Runtime::StackManager &StackMgr, Runtime::Instance::TagInstance &TagInst,

Callers

nothing calls this directly

Calls 5

unlikelyFunction · 0.85
UnexpectFunction · 0.85
exchangeMethod · 0.80
eraseValueStackMethod · 0.80
errorFunction · 0.50

Tested by

no test coverage detected