| 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 cc0713f3d26bdaaef07a86985ec0a556ca169b6e..0692342072dbc1c26a601f8034936dcc74e4f57e 100644
|
| --- a/test/cctest/interpreter/bytecode-expectations-printer.cc
|
| +++ b/test/cctest/interpreter/bytecode-expectations-printer.cc
|
| @@ -96,7 +96,7 @@ void BytecodeExpectationsPrinter::PrintEscapedString(
|
| }
|
|
|
| namespace {
|
| -i::Runtime::FunctionId IndexToFunctionId(int index) {
|
| +i::Runtime::FunctionId IndexToFunctionId(uint32_t index) {
|
| return static_cast<i::Runtime::FunctionId>(index);
|
| }
|
| } // namespace
|
| @@ -105,7 +105,8 @@ void BytecodeExpectationsPrinter::PrintBytecodeOperand(
|
| std::ostream& stream, const BytecodeArrayIterator& bytecode_iter,
|
| const Bytecode& bytecode, int op_index, int parameter_count) const {
|
| OperandType op_type = Bytecodes::GetOperandType(bytecode, op_index);
|
| - OperandSize op_size = Bytecodes::GetOperandSize(bytecode, op_index);
|
| + OperandSize op_size = Bytecodes::GetOperandSize(
|
| + bytecode, op_index, bytecode_iter.current_operand_scale());
|
|
|
| const char* size_tag;
|
| switch (op_size) {
|
| @@ -115,6 +116,9 @@ void BytecodeExpectationsPrinter::PrintBytecodeOperand(
|
| case OperandSize::kShort:
|
| size_tag = "16";
|
| break;
|
| + case OperandSize::kQuad:
|
| + size_tag = "32";
|
| + break;
|
| default:
|
| UNREACHABLE();
|
| return;
|
| @@ -143,20 +147,27 @@ void BytecodeExpectationsPrinter::PrintBytecodeOperand(
|
| } else {
|
| stream << 'U' << size_tag << '(';
|
|
|
| - if (op_index == 0 && Bytecodes::IsCallRuntime(bytecode)) {
|
| - DCHECK_EQ(op_type, OperandType::kIdx16);
|
| - int operand = bytecode_iter.GetIndexOperand(op_index);
|
| - stream << "Runtime::k"
|
| - << 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)) {
|
| - stream << bytecode_iter.GetRegisterCountOperand(op_index);
|
| - } else if (Bytecodes::IsIndexOperandType(op_type)) {
|
| - stream << bytecode_iter.GetIndexOperand(op_index);
|
| - } else {
|
| - UNREACHABLE();
|
| + switch (op_type) {
|
| + case OperandType::kFlag8:
|
| + stream << bytecode_iter.GetFlagOperand(op_index);
|
| + break;
|
| + case OperandType::kIdx:
|
| + stream << bytecode_iter.GetIndexOperand(op_index);
|
| + break;
|
| + case OperandType::kImm:
|
| + stream << bytecode_iter.GetImmediateOperand(op_index);
|
| + break;
|
| + case OperandType::kRegCount:
|
| + stream << bytecode_iter.GetRegisterCountOperand(op_index);
|
| + break;
|
| + case OperandType::kRuntimeId: {
|
| + uint32_t operand = bytecode_iter.GetRuntimeIdOperand(op_index);
|
| + stream << "Runtime::k"
|
| + << i::Runtime::FunctionForId(IndexToFunctionId(operand))->name;
|
| + break;
|
| + }
|
| + default:
|
| + UNREACHABLE();
|
| }
|
|
|
| stream << ')';
|
| @@ -168,6 +179,19 @@ void BytecodeExpectationsPrinter::PrintBytecode(
|
| int parameter_count) const {
|
| Bytecode bytecode = bytecode_iter.current_bytecode();
|
|
|
| + switch (bytecode_iter.current_operand_scale()) {
|
| + case 1:
|
| + break;
|
| + case 2:
|
| + stream << "B(" << Bytecodes::ToString(Bytecode::kWide) << "), ";
|
| + break;
|
| + case 4:
|
| + stream << "B(" << Bytecodes::ToString(Bytecode::kExtraWide) << "), ";
|
| + break;
|
| + default:
|
| + UNREACHABLE();
|
| + break;
|
| + }
|
| stream << "B(" << Bytecodes::ToString(bytecode) << ')';
|
|
|
| int operands_count = Bytecodes::NumberOfOperands(bytecode);
|
|
|