| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 #elif V8_TARGET_BIG_ENDIAN | 185 #elif V8_TARGET_BIG_ENDIAN |
| 186 return raw_assembler_->WordOr(WordShl(first_byte, kBitsPerByte), | 186 return raw_assembler_->WordOr(WordShl(first_byte, kBitsPerByte), |
| 187 second_byte); | 187 second_byte); |
| 188 #else | 188 #else |
| 189 #error "Unknown Architecture" | 189 #error "Unknown Architecture" |
| 190 #endif | 190 #endif |
| 191 } | 191 } |
| 192 } | 192 } |
| 193 | 193 |
| 194 | 194 |
| 195 Node* InterpreterAssembler::BytecodeOperandCount8(int operand_index) { | 195 Node* InterpreterAssembler::BytecodeOperandCount(int operand_index) { |
| 196 DCHECK_EQ(interpreter::OperandType::kCount8, | 196 DCHECK_EQ(interpreter::OperandType::kCount8, |
| 197 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); | 197 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); |
| 198 return BytecodeOperand(operand_index); | 198 return BytecodeOperand(operand_index); |
| 199 } | 199 } |
| 200 | 200 |
| 201 | 201 |
| 202 Node* InterpreterAssembler::BytecodeOperandImm8(int operand_index) { | 202 Node* InterpreterAssembler::BytecodeOperandImm(int operand_index) { |
| 203 DCHECK_EQ(interpreter::OperandType::kImm8, | 203 DCHECK_EQ(interpreter::OperandType::kImm8, |
| 204 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); | 204 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); |
| 205 return BytecodeOperandSignExtended(operand_index); | 205 return BytecodeOperandSignExtended(operand_index); |
| 206 } | 206 } |
| 207 | 207 |
| 208 | 208 |
| 209 Node* InterpreterAssembler::BytecodeOperandIdx8(int operand_index) { | 209 Node* InterpreterAssembler::BytecodeOperandIdx(int operand_index) { |
| 210 DCHECK_EQ(interpreter::OperandType::kIdx8, | 210 switch (interpreter::Bytecodes::GetOperandSize(bytecode_, operand_index)) { |
| 211 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); | 211 case interpreter::OperandSize::kByte: |
| 212 return BytecodeOperand(operand_index); | 212 DCHECK_EQ( |
| 213 interpreter::OperandType::kIdx8, |
| 214 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); |
| 215 return BytecodeOperand(operand_index); |
| 216 case interpreter::OperandSize::kShort: |
| 217 DCHECK_EQ( |
| 218 interpreter::OperandType::kIdx16, |
| 219 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); |
| 220 return BytecodeOperandShort(operand_index); |
| 221 default: |
| 222 UNREACHABLE(); |
| 223 return nullptr; |
| 224 } |
| 213 } | 225 } |
| 214 | 226 |
| 215 | 227 |
| 216 Node* InterpreterAssembler::BytecodeOperandReg8(int operand_index) { | 228 Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) { |
| 217 DCHECK_EQ(interpreter::OperandType::kReg8, | 229 DCHECK_EQ(interpreter::OperandType::kReg8, |
| 218 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); | 230 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); |
| 219 return BytecodeOperandSignExtended(operand_index); | 231 return BytecodeOperandSignExtended(operand_index); |
| 220 } | 232 } |
| 221 | 233 |
| 222 | 234 |
| 223 Node* InterpreterAssembler::BytecodeOperandIdx16(int operand_index) { | |
| 224 DCHECK_EQ(interpreter::OperandType::kIdx16, | |
| 225 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); | |
| 226 return BytecodeOperandShort(operand_index); | |
| 227 } | |
| 228 | |
| 229 | |
| 230 Node* InterpreterAssembler::Int32Constant(int value) { | 235 Node* InterpreterAssembler::Int32Constant(int value) { |
| 231 return raw_assembler_->Int32Constant(value); | 236 return raw_assembler_->Int32Constant(value); |
| 232 } | 237 } |
| 233 | 238 |
| 234 | 239 |
| 235 Node* InterpreterAssembler::IntPtrConstant(intptr_t value) { | 240 Node* InterpreterAssembler::IntPtrConstant(intptr_t value) { |
| 236 return raw_assembler_->IntPtrConstant(value); | 241 return raw_assembler_->IntPtrConstant(value); |
| 237 } | 242 } |
| 238 | 243 |
| 239 | 244 |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 return raw_assembler_->schedule(); | 642 return raw_assembler_->schedule(); |
| 638 } | 643 } |
| 639 | 644 |
| 640 | 645 |
| 641 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 646 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
| 642 | 647 |
| 643 | 648 |
| 644 } // namespace compiler | 649 } // namespace compiler |
| 645 } // namespace internal | 650 } // namespace internal |
| 646 } // namespace v8 | 651 } // namespace v8 |
| OLD | NEW |