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

Method runTableFillOp

lib/executor/engine/tableInstr.cpp:128–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128Expect<void> Executor::runTableFillOp(Runtime::StackManager &StackMgr,
129 Runtime::Instance::TableInstance &TabInst,
130 const AST::Instruction &Instr) {
131 // Pop the length, ref_value, and offset from the stack.
132 const auto AddrType = TabInst.getTableType().getLimit().getAddrType();
133 uint64_t Len = extractAddr(StackMgr.pop(), AddrType);
134 RefVariant Val = StackMgr.pop().get<RefVariant>();
135 uint64_t Off = extractAddr(StackMgr.pop(), AddrType);
136
137 // Fill refs with ref_value.
138 return TabInst.fillRefs(Val, Off, Len).map_error([&Instr](auto E) {
139 spdlog::error(
140 ErrInfo::InfoInstruction(Instr.getOpCode(), Instr.getOffset()));
141 return E;
142 });
143}
144
145} // namespace Executor
146} // namespace WasmEdge

Callers

nothing calls this directly

Calls 8

extractAddrFunction · 0.85
InfoInstructionClass · 0.85
getAddrTypeMethod · 0.80
popMethod · 0.80
fillRefsMethod · 0.80
errorFunction · 0.50
getOpCodeMethod · 0.45
getOffsetMethod · 0.45

Tested by

no test coverage detected