| 470 | } |
| 471 | |
| 472 | Expect<uint64_t> Executor::proxyTableGrow(Runtime::StackManager &StackMgr, |
| 473 | const uint32_t TableIdx, |
| 474 | const RefVariant Val, |
| 475 | const uint64_t NewSize) noexcept { |
| 476 | auto *TabInst = getTabInstByIdx(StackMgr, TableIdx); |
| 477 | assuming(TabInst); |
| 478 | const auto AddrType = TabInst->getTableType().getLimit().getAddrType(); |
| 479 | const uint64_t CurrTableSize = TabInst->getSize(); |
| 480 | if (likely(TabInst->growTable(NewSize, Val))) { |
| 481 | return CurrTableSize; |
| 482 | } else { |
| 483 | switch (AddrType) { |
| 484 | case AddressType::I32: |
| 485 | return static_cast<uint32_t>(-1); |
| 486 | case AddressType::I64: |
| 487 | return static_cast<uint64_t>(-1); |
| 488 | default: |
| 489 | assumingUnreachable(); |
| 490 | } |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | Expect<uint64_t> Executor::proxyTableSize(Runtime::StackManager &StackMgr, |
| 495 | const uint32_t TableIdx) noexcept { |
nothing calls this directly
no test coverage detected