| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/interpreter/bytecodes.h" | 5 #include "src/interpreter/bytecodes.h" |
| 6 | 6 |
| 7 #include "src/interpreter/bytecode-array-builder.h" | 7 #include "src/interpreter/bytecode-array-builder.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 | 120 |
| 121 os << bytecode << " "; | 121 os << bytecode << " "; |
| 122 | 122 |
| 123 const uint8_t* operands_start = bytecode_start + 1; | 123 const uint8_t* operands_start = bytecode_start + 1; |
| 124 int operands_size = bytecode_size - 1; | 124 int operands_size = bytecode_size - 1; |
| 125 for (int i = 0; i < operands_size; i++) { | 125 for (int i = 0; i < operands_size; i++) { |
| 126 OperandType op_type = GetOperandType(bytecode, i); | 126 OperandType op_type = GetOperandType(bytecode, i); |
| 127 uint8_t operand = operands_start[i]; | 127 uint8_t operand = operands_start[i]; |
| 128 switch (op_type) { | 128 switch (op_type) { |
| 129 case interpreter::OperandType::kIdx: |
| 130 os << "[" << static_cast<unsigned int>(operand) << "]"; |
| 131 break; |
| 129 case interpreter::OperandType::kImm8: | 132 case interpreter::OperandType::kImm8: |
| 130 os << "#" << static_cast<int>(operand); | 133 os << "#" << static_cast<int>(operand); |
| 131 break; | 134 break; |
| 132 case interpreter::OperandType::kReg: | 135 case interpreter::OperandType::kReg: |
| 133 os << "r" << Register::FromOperand(operand).index(); | 136 os << "r" << Register::FromOperand(operand).index(); |
| 134 break; | 137 break; |
| 135 case interpreter::OperandType::kNone: | 138 case interpreter::OperandType::kNone: |
| 136 UNREACHABLE(); | 139 UNREACHABLE(); |
| 137 break; | 140 break; |
| 138 } | 141 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 149 } | 152 } |
| 150 | 153 |
| 151 | 154 |
| 152 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type) { | 155 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type) { |
| 153 return os << Bytecodes::OperandTypeToString(operand_type); | 156 return os << Bytecodes::OperandTypeToString(operand_type); |
| 154 } | 157 } |
| 155 | 158 |
| 156 } // namespace interpreter | 159 } // namespace interpreter |
| 157 } // namespace internal | 160 } // namespace internal |
| 158 } // namespace v8 | 161 } // namespace v8 |
| OLD | NEW |