summaryrefslogtreecommitdiff
path: root/deps/v8/src/wasm/function-body-decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/wasm/function-body-decoder.cc')
-rw-r--r--deps/v8/src/wasm/function-body-decoder.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/deps/v8/src/wasm/function-body-decoder.cc b/deps/v8/src/wasm/function-body-decoder.cc
index 3113d1665b..63788bcc8d 100644
--- a/deps/v8/src/wasm/function-body-decoder.cc
+++ b/deps/v8/src/wasm/function-body-decoder.cc
@@ -59,8 +59,8 @@ unsigned OpcodeLength(const byte* pc, const byte* end) {
}
std::pair<uint32_t, uint32_t> StackEffect(const WasmModule* module,
- FunctionSig* sig, const byte* pc,
- const byte* end) {
+ const FunctionSig* sig,
+ const byte* pc, const byte* end) {
WasmFeatures unused_detected_features = WasmFeatures::None();
WasmDecoder<Decoder::kNoValidate> decoder(
module, WasmFeatures::All(), &unused_detected_features, sig, pc, end);
@@ -135,12 +135,12 @@ bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
if (decls.type_list[pos] == type) {
++count;
} else {
- os << " " << count << " " << ValueTypes::TypeName(type);
+ os << " " << count << " " << type.type_name();
type = decls.type_list[pos];
count = 1;
}
}
- os << " " << count << " " << ValueTypes::TypeName(type);
+ os << " " << count << " " << type.type_name();
}
os << std::endl;
if (line_numbers) line_numbers->push_back(kNoByteCode);
@@ -210,10 +210,12 @@ bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
}
}
+ os << " // " << WasmOpcodes::OpcodeName(opcode);
+
switch (opcode) {
case kExprElse:
case kExprCatch:
- os << " // @" << i.pc_offset();
+ os << " @" << i.pc_offset();
control_depth++;
break;
case kExprLoop:
@@ -222,38 +224,38 @@ bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
case kExprTry: {
BlockTypeImmediate<Decoder::kNoValidate> imm(WasmFeatures::All(), &i,
i.pc());
- os << " // @" << i.pc_offset();
+ os << " @" << i.pc_offset();
if (decoder.Complete(imm)) {
for (uint32_t i = 0; i < imm.out_arity(); i++) {
- os << " " << ValueTypes::TypeName(imm.out_type(i));
+ os << " " << imm.out_type(i).type_name();
}
}
control_depth++;
break;
}
case kExprEnd:
- os << " // @" << i.pc_offset();
+ os << " @" << i.pc_offset();
control_depth--;
break;
case kExprBr: {
BranchDepthImmediate<Decoder::kNoValidate> imm(&i, i.pc());
- os << " // depth=" << imm.depth;
+ os << " depth=" << imm.depth;
break;
}
case kExprBrIf: {
BranchDepthImmediate<Decoder::kNoValidate> imm(&i, i.pc());
- os << " // depth=" << imm.depth;
+ os << " depth=" << imm.depth;
break;
}
case kExprBrTable: {
BranchTableImmediate<Decoder::kNoValidate> imm(&i, i.pc());
- os << " // entries=" << imm.table_count;
+ os << " entries=" << imm.table_count;
break;
}
case kExprCallIndirect: {
CallIndirectImmediate<Decoder::kNoValidate> imm(WasmFeatures::All(), &i,
i.pc());
- os << " // sig #" << imm.sig_index;
+ os << " sig #" << imm.sig_index;
if (decoder.Complete(i.pc(), imm)) {
os << ": " << *imm.sig;
}
@@ -261,7 +263,7 @@ bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
}
case kExprCallFunction: {
CallFunctionImmediate<Decoder::kNoValidate> imm(&i, i.pc());
- os << " // function #" << imm.index;
+ os << " function #" << imm.index;
if (decoder.Complete(i.pc(), imm)) {
os << ": " << *imm.sig;
}