| 18 | } |
| 19 | |
| 20 | Expect<void> |
| 21 | Executor::runMemoryGrowOp(Runtime::StackManager &StackMgr, |
| 22 | Runtime::Instance::MemoryInstance &MemInst) { |
| 23 | // Pop N, the number of pages to grow. |
| 24 | const auto AddrType = MemInst.getMemoryType().getLimit().getAddrType(); |
| 25 | uint64_t N = extractAddr(StackMgr.pop(), AddrType); |
| 26 | |
| 27 | // Grow the page and push the result. |
| 28 | const uint64_t CurrPageSize = MemInst.getPageSize(); |
| 29 | if (MemInst.growPage(N)) { |
| 30 | StackMgr.push(emplaceAddr(CurrPageSize, AddrType)); |
| 31 | } else { |
| 32 | StackMgr.push(emplaceAddr(static_cast<uint64_t>(-1), AddrType)); |
| 33 | } |
| 34 | return {}; |
| 35 | } |
| 36 | |
| 37 | Expect<void> Executor::runMemoryInitOp( |
| 38 | Runtime::StackManager &StackMgr, Runtime::Instance::MemoryInstance &MemInst, |
nothing calls this directly
no test coverage detected