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

Method proxyCall

lib/executor/engine/proxy.cpp:122–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122Expect<void> Executor::proxyCall(Runtime::StackManager &StackMgr,
123 const uint32_t FuncIdx, const ValVariant *Args,
124 ValVariant *Rets) noexcept {
125 const auto *FuncInst = getFuncInstByIdx(StackMgr, FuncIdx);
126 const auto &FuncType = FuncInst->getFuncType();
127 const uint32_t ParamsSize =
128 static_cast<uint32_t>(FuncType.getParamTypes().size());
129 const uint32_t ReturnsSize =
130 static_cast<uint32_t>(FuncType.getReturnTypes().size());
131
132 for (uint32_t I = 0; I < ParamsSize; ++I) {
133 StackMgr.push(Args[I]);
134 }
135
136 auto Instrs = FuncInst->getInstrs();
137 EXPECTED_TRY(auto StartIt, enterFunction(StackMgr, *FuncInst, Instrs.end()));
138 EXPECTED_TRY(execute(StackMgr, StartIt, Instrs.end()));
139
140 for (uint32_t I = 0; I < ReturnsSize; ++I) {
141 Rets[ReturnsSize - 1 - I] = StackMgr.pop();
142 }
143 return {};
144}
145
146Expect<void> Executor::proxyCallIndirect(Runtime::StackManager &StackMgr,
147 const uint32_t TableIdx,

Callers

nothing calls this directly

Calls 7

getParamTypesMethod · 0.80
pushMethod · 0.80
popMethod · 0.80
EXPECTED_TRYFunction · 0.70
sizeMethod · 0.45
getInstrsMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected