MCPcopy Create free account
hub / github.com/WebAssembly/wabt / OnLocalGetExpr

Method OnLocalGetExpr

src/interp/binary-reader-interp.cc:1383–1398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1381}
1382
1383Result BinaryReaderInterp::OnLocalGetExpr(Index local_index) {
1384 // Get the translated index before calling validator_.OnLocalGet because it
1385 // will update the type stack size. We need the index to be relative to the
1386 // old stack size.
1387 Index translated_local_index = TranslateLocalIndex(local_index);
1388 CHECK_RESULT(
1389 validator_.OnLocalGet(GetLocation(), Var(local_index, GetLocation())));
1390
1391 Type type = func_->GetLocalType(local_index);
1392 if (type.IsRef()) {
1393 istream_.Emit(Opcode::InterpLocalGetRef, translated_local_index);
1394 } else {
1395 istream_.Emit(Opcode::LocalGet, translated_local_index);
1396 }
1397 return Result::Ok;
1398}
1399
1400Result BinaryReaderInterp::OnLocalSetExpr(Index local_index) {
1401 // See comment in OnLocalGetExpr above.

Callers

nothing calls this directly

Calls 5

EmitMethod · 0.80
VarClass · 0.50
OnLocalGetMethod · 0.45
GetLocalTypeMethod · 0.45
IsRefMethod · 0.45

Tested by

no test coverage detected