| 204 | } |
| 205 | |
| 206 | Expect<void> Executor::proxyCallRef(Runtime::StackManager &StackMgr, |
| 207 | const RefVariant Ref, |
| 208 | const ValVariant *Args, |
| 209 | ValVariant *Rets) noexcept { |
| 210 | const auto *FuncInst = retrieveFuncRef(Ref); |
| 211 | const auto &FuncType = FuncInst->getFuncType(); |
| 212 | const uint32_t ParamsSize = |
| 213 | static_cast<uint32_t>(FuncType.getParamTypes().size()); |
| 214 | const uint32_t ReturnsSize = |
| 215 | static_cast<uint32_t>(FuncType.getReturnTypes().size()); |
| 216 | |
| 217 | for (uint32_t I = 0; I < ParamsSize; ++I) { |
| 218 | StackMgr.push(Args[I]); |
| 219 | } |
| 220 | |
| 221 | auto Instrs = FuncInst->getInstrs(); |
| 222 | EXPECTED_TRY(auto StartIt, enterFunction(StackMgr, *FuncInst, Instrs.end())); |
| 223 | EXPECTED_TRY(execute(StackMgr, StartIt, Instrs.end())); |
| 224 | |
| 225 | for (uint32_t I = 0; I < ReturnsSize; ++I) { |
| 226 | Rets[ReturnsSize - 1 - I] = StackMgr.pop(); |
| 227 | } |
| 228 | |
| 229 | return {}; |
| 230 | } |
| 231 | |
| 232 | Expect<RefVariant> Executor::proxyRefFunc(Runtime::StackManager &StackMgr, |
| 233 | const uint32_t FuncIdx) noexcept { |
nothing calls this directly
no test coverage detected