| 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/compiler/interpreter-assembler.h" | 5 #include "src/compiler/interpreter-assembler.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); | 298 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); |
| 299 return BytecodeOperandShort(operand_index); | 299 return BytecodeOperandShort(operand_index); |
| 300 case interpreter::OperandSize::kNone: | 300 case interpreter::OperandSize::kNone: |
| 301 UNREACHABLE(); | 301 UNREACHABLE(); |
| 302 } | 302 } |
| 303 return nullptr; | 303 return nullptr; |
| 304 } | 304 } |
| 305 | 305 |
| 306 | 306 |
| 307 Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) { | 307 Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) { |
| 308 switch (interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)) { | 308 interpreter::OperandType operand_type = |
| 309 case interpreter::OperandType::kMaybeReg8: | 309 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index); |
| 310 case interpreter::OperandType::kReg8: | 310 if (interpreter::Bytecodes::IsRegisterOperandType(operand_type)) { |
| 311 case interpreter::OperandType::kRegPair8: | 311 interpreter::OperandSize operand_size = |
| 312 case interpreter::OperandType::kRegTriple8: | 312 interpreter::Bytecodes::SizeOfOperand(operand_type); |
| 313 DCHECK_EQ( | 313 if (operand_size == interpreter::OperandSize::kByte) { |
| 314 interpreter::OperandSize::kByte, | |
| 315 interpreter::Bytecodes::GetOperandSize(bytecode_, operand_index)); | |
| 316 return BytecodeOperandSignExtended(operand_index); | 314 return BytecodeOperandSignExtended(operand_index); |
| 317 case interpreter::OperandType::kMaybeReg16: | 315 } else if (operand_size == interpreter::OperandSize::kShort) { |
| 318 case interpreter::OperandType::kReg16: | |
| 319 case interpreter::OperandType::kRegPair16: | |
| 320 case interpreter::OperandType::kRegTriple16: | |
| 321 DCHECK_EQ( | |
| 322 interpreter::OperandSize::kShort, | |
| 323 interpreter::Bytecodes::GetOperandSize(bytecode_, operand_index)); | |
| 324 return BytecodeOperandShortSignExtended(operand_index); | 316 return BytecodeOperandShortSignExtended(operand_index); |
| 325 case interpreter::OperandType::kNone: | 317 } |
| 326 case interpreter::OperandType::kIdx8: | |
| 327 case interpreter::OperandType::kIdx16: | |
| 328 case interpreter::OperandType::kImm8: | |
| 329 case interpreter::OperandType::kRegCount8: | |
| 330 case interpreter::OperandType::kRegCount16: | |
| 331 UNREACHABLE(); | |
| 332 } | 318 } |
| 319 UNREACHABLE(); |
| 333 return nullptr; | 320 return nullptr; |
| 334 } | 321 } |
| 335 | 322 |
| 336 | 323 |
| 337 Node* InterpreterAssembler::Int32Constant(int value) { | 324 Node* InterpreterAssembler::Int32Constant(int value) { |
| 338 return raw_assembler_->Int32Constant(value); | 325 return raw_assembler_->Int32Constant(value); |
| 339 } | 326 } |
| 340 | 327 |
| 341 | 328 |
| 342 Node* InterpreterAssembler::IntPtrConstant(intptr_t value) { | 329 Node* InterpreterAssembler::IntPtrConstant(intptr_t value) { |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 return raw_assembler_->call_descriptor(); | 742 return raw_assembler_->call_descriptor(); |
| 756 } | 743 } |
| 757 | 744 |
| 758 | 745 |
| 759 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 746 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
| 760 | 747 |
| 761 | 748 |
| 762 } // namespace compiler | 749 } // namespace compiler |
| 763 } // namespace internal | 750 } // namespace internal |
| 764 } // namespace v8 | 751 } // namespace v8 |
| OLD | NEW |