| 120 | } |
| 121 | |
| 122 | Expect<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 | |
| 146 | Expect<void> Executor::proxyCallIndirect(Runtime::StackManager &StackMgr, |
| 147 | const uint32_t TableIdx, |
nothing calls this directly
no test coverage detected