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/frames.h" | 7 #include "src/frames.h" |
8 #include "src/interpreter/bytecode-traits.h" | 8 #include "src/interpreter/bytecode-traits.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 int number_of_operands = NumberOfOperands(bytecode); | 203 int number_of_operands = NumberOfOperands(bytecode); |
204 for (int i = 0; i < number_of_operands; i++) { | 204 for (int i = 0; i < number_of_operands; i++) { |
205 OperandType op_type = GetOperandType(bytecode, i); | 205 OperandType op_type = GetOperandType(bytecode, i); |
206 const uint8_t* operand_start = | 206 const uint8_t* operand_start = |
207 &bytecode_start[GetOperandOffset(bytecode, i)]; | 207 &bytecode_start[GetOperandOffset(bytecode, i)]; |
208 switch (op_type) { | 208 switch (op_type) { |
209 case interpreter::OperandType::kCount8: | 209 case interpreter::OperandType::kCount8: |
210 os << "#" << static_cast<unsigned int>(*operand_start); | 210 os << "#" << static_cast<unsigned int>(*operand_start); |
211 break; | 211 break; |
| 212 case interpreter::OperandType::kCount16: |
| 213 os << '#' << ReadUnalignedUInt16(operand_start); |
| 214 break; |
212 case interpreter::OperandType::kIdx8: | 215 case interpreter::OperandType::kIdx8: |
213 os << "[" << static_cast<unsigned int>(*operand_start) << "]"; | 216 os << "[" << static_cast<unsigned int>(*operand_start) << "]"; |
214 break; | 217 break; |
215 case interpreter::OperandType::kIdx16: { | 218 case interpreter::OperandType::kIdx16: |
216 os << "[" << ReadUnalignedUInt16(operand_start) << "]"; | 219 os << "[" << ReadUnalignedUInt16(operand_start) << "]"; |
217 break; | 220 break; |
218 } | |
219 case interpreter::OperandType::kImm8: | 221 case interpreter::OperandType::kImm8: |
220 os << "#" << static_cast<int>(static_cast<int8_t>(*operand_start)); | 222 os << "#" << static_cast<int>(static_cast<int8_t>(*operand_start)); |
221 break; | 223 break; |
222 case interpreter::OperandType::kReg8: | 224 case interpreter::OperandType::kReg8: |
223 case interpreter::OperandType::kMaybeReg8: { | 225 case interpreter::OperandType::kMaybeReg8: { |
224 Register reg = Register::FromOperand(*operand_start); | 226 Register reg = Register::FromOperand(*operand_start); |
225 if (reg.is_function_context()) { | 227 if (reg.is_function_context()) { |
226 os << "<context>"; | 228 os << "<context>"; |
227 } else if (reg.is_function_closure()) { | 229 } else if (reg.is_function_closure()) { |
228 os << "<closure>"; | 230 os << "<closure>"; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 } | 342 } |
341 if (reg5.is_valid() && reg4.index() + 1 != reg5.index()) { | 343 if (reg5.is_valid() && reg4.index() + 1 != reg5.index()) { |
342 return false; | 344 return false; |
343 } | 345 } |
344 return true; | 346 return true; |
345 } | 347 } |
346 | 348 |
347 } // namespace interpreter | 349 } // namespace interpreter |
348 } // namespace internal | 350 } // namespace internal |
349 } // namespace v8 | 351 } // namespace v8 |
OLD | NEW |