Index: src/interpreter/bytecode-decoder.cc |
diff --git a/src/interpreter/bytecode-decoder.cc b/src/interpreter/bytecode-decoder.cc |
index 49751897ee8a46608829be148fdb2ae153b4835a..f003969d4ba0b20f4a12aa4d75740ef87074407d 100644 |
--- a/src/interpreter/bytecode-decoder.cc |
+++ b/src/interpreter/bytecode-decoder.cc |
@@ -6,7 +6,7 @@ |
#include <iomanip> |
-#include "src/utils.h" |
+#include "src/interpreter/interpreter-intrinsics.h" |
namespace v8 { |
namespace internal { |
@@ -67,6 +67,23 @@ uint32_t BytecodeDecoder::DecodeUnsignedOperand(const uint8_t* operand_start, |
return 0; |
} |
+namespace { |
+const char* NameForRuntimeId(uint32_t idx) { |
+ switch (idx) { |
+#define CASE(name, nargs, ressize) \ |
+ case Runtime::k##name: \ |
+ return #name; \ |
+ case Runtime::kInline##name: \ |
+ return #name; |
+ FOR_EACH_INTRINSIC(CASE) |
+#undef CASE |
+ default: |
+ UNREACHABLE(); |
+ return nullptr; |
+ } |
+} |
+} // anonymous namespace |
+ |
// static |
std::ostream& BytecodeDecoder::Decode(std::ostream& os, |
const uint8_t* bytecode_start, |
@@ -112,12 +129,21 @@ std::ostream& BytecodeDecoder::Decode(std::ostream& os, |
switch (op_type) { |
case interpreter::OperandType::kIdx: |
case interpreter::OperandType::kUImm: |
- case interpreter::OperandType::kRuntimeId: |
- case interpreter::OperandType::kIntrinsicId: |
os << "[" |
<< DecodeUnsignedOperand(operand_start, op_type, operand_scale) |
<< "]"; |
break; |
+ case interpreter::OperandType::kIntrinsicId: { |
+ auto id = static_cast<IntrinsicsHelper::IntrinsicId>( |
+ DecodeUnsignedOperand(operand_start, op_type, operand_scale)); |
+ os << "[" << NameForRuntimeId(IntrinsicsHelper::ToRuntimeId(id)) << "]"; |
+ break; |
+ } |
+ case interpreter::OperandType::kRuntimeId: |
+ os << "[" << NameForRuntimeId(DecodeUnsignedOperand( |
+ operand_start, op_type, operand_scale)) |
+ << "]"; |
+ break; |
case interpreter::OperandType::kImm: |
os << "[" << DecodeSignedOperand(operand_start, op_type, operand_scale) |
<< "]"; |