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

Method proxyTableGrow

lib/executor/engine/proxy.cpp:472–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472Expect<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
494Expect<uint64_t> Executor::proxyTableSize(Runtime::StackManager &StackMgr,
495 const uint32_t TableIdx) noexcept {

Callers

nothing calls this directly

Calls 4

getAddrTypeMethod · 0.80
growTableMethod · 0.80
likelyFunction · 0.50
getSizeMethod · 0.45

Tested by

no test coverage detected