Chromium Code Reviews| Index: test/cctest/interpreter/generate-bytecode-expectations.cc |
| diff --git a/test/cctest/interpreter/generate-bytecode-expectations.cc b/test/cctest/interpreter/generate-bytecode-expectations.cc |
| index 4fc54e12c91010fae925cd30e6ed9ffe0c95f4a3..de2c74cfa0d58c63e81b6a3568a2592ebd3a8a56 100644 |
| --- a/test/cctest/interpreter/generate-bytecode-expectations.cc |
| +++ b/test/cctest/interpreter/generate-bytecode-expectations.cc |
| @@ -146,8 +146,20 @@ void PrintBytecodeOperand(std::ostream& stream, |
| if (op_size != OperandSize::kByte) stream << size_tag; |
| stream << '(' << register_value.index() << ')'; |
| } else { |
| - uint32_t raw_value = bytecode_iter.GetRawOperand(op_index, op_type); |
| - stream << 'U' << size_tag << '(' << raw_value << ')'; |
| + stream << 'U' << size_tag << '('; |
| + |
| + 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)) { |
| + stream << bytecode_iter.GetCountOperand(op_index); |
|
rmcilroy
2016/02/10 15:26:12
Could you rename BytecodeIterator::GetCountOperand
Stefano Sanfilippo
2016/02/10 16:12:06
Done.
I have prepared a different CL, since this
|
| + } else if (Bytecodes::IsIndexOperandType(op_type)) { |
| + stream << bytecode_iter.GetIndexOperand(op_index); |
| + } else { |
| + UNREACHABLE(); |
| + } |
| + |
| + stream << ')'; |
| } |
| } |