Chromium Code Reviews| Index: test/cctest/interpreter/bytecode-expectations-printer.cc |
| diff --git a/test/cctest/interpreter/bytecode-expectations-printer.cc b/test/cctest/interpreter/bytecode-expectations-printer.cc |
| index d5e0456511528a13bf0f68c0d81c937fa06e44c8..d9a0952eae1786e23c3f4e68b73fa3f70132e2fd 100644 |
| --- a/test/cctest/interpreter/bytecode-expectations-printer.cc |
| +++ b/test/cctest/interpreter/bytecode-expectations-printer.cc |
| @@ -13,6 +13,7 @@ |
| #include "src/base/logging.h" |
| #include "src/base/smart-pointers.h" |
| #include "src/compiler.h" |
| +#include "src/runtime/runtime.h" |
| #include "src/interpreter/bytecode-array-iterator.h" |
| #include "src/interpreter/bytecode-generator.h" |
| @@ -94,6 +95,12 @@ void BytecodeExpectationsPrinter::PrintEscapedString( |
| } |
| } |
| +namespace { |
| +i::Runtime::FunctionId IndexToFunctionId(int index) { |
| + return static_cast<i::Runtime::FunctionId>(index); |
| +} |
| +} // namespace |
| + |
| void BytecodeExpectationsPrinter::PrintBytecodeOperand( |
| std::ostream& stream, const BytecodeArrayIterator& bytecode_iter, |
| const Bytecode& bytecode, int op_index, int parameter_count) const { |
| @@ -136,7 +143,11 @@ void BytecodeExpectationsPrinter::PrintBytecodeOperand( |
| } else { |
| stream << 'U' << size_tag << '('; |
| - if (Bytecodes::IsImmediateOperandType(op_type)) { |
| + if (op_index == 0 && Bytecodes::IsCallRuntime(bytecode)) { |
| + int operand = bytecode_iter.GetIndexOperand(op_index); |
|
rmcilroy
2016/02/23 17:53:23
Could you add a DCHECK here that op_index is a Idx
Stefano Sanfilippo
2016/02/23 17:59:24
Done.
|
| + stream << "Runtime::" |
| + << i::Runtime::FunctionForId(IndexToFunctionId(operand))->name; |
| + } else if (Bytecodes::IsImmediateOperandType(op_type)) { |
| // We need a cast, otherwise the result is printed as char. |
| stream << static_cast<int>(bytecode_iter.GetImmediateOperand(op_index)); |
| } else if (Bytecodes::IsRegisterCountOperandType(op_type)) { |