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

Method runStructNewOp

lib/executor/engine/refInstr.cpp:114–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114Expect<void> Executor::runStructNewOp(Runtime::StackManager &StackMgr,
115 const uint32_t TypeIdx,
116 const bool IsDefault) const noexcept {
117 if (IsDefault) {
118 StackMgr.push(*structNew(StackMgr, TypeIdx));
119 } else {
120 const auto &CompType = getCompositeTypeByIdx(StackMgr, TypeIdx);
121 const uint32_t N = static_cast<uint32_t>(CompType.getFieldTypes().size());
122 std::vector<ValVariant> Vals = StackMgr.pop(N);
123 StackMgr.push(*structNew(StackMgr, TypeIdx, Vals));
124 }
125 return {};
126}
127
128Expect<void> Executor::runStructGetOp(Runtime::StackManager &StackMgr,
129 const uint32_t TypeIdx,

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
popMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected