| 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/interpreter-assembler.h" | 5 #include "src/interpreter/interpreter-assembler.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 | 9 |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 bytecode_offset_(this, MachineType::PointerRepresentation()), | 32 bytecode_offset_(this, MachineType::PointerRepresentation()), |
| 33 interpreted_frame_pointer_(this, MachineType::PointerRepresentation()), | 33 interpreted_frame_pointer_(this, MachineType::PointerRepresentation()), |
| 34 accumulator_(this, MachineRepresentation::kTagged), | 34 accumulator_(this, MachineRepresentation::kTagged), |
| 35 accumulator_use_(AccumulatorUse::kNone), | 35 accumulator_use_(AccumulatorUse::kNone), |
| 36 made_call_(false), | 36 made_call_(false), |
| 37 disable_stack_check_across_call_(false), | 37 disable_stack_check_across_call_(false), |
| 38 stack_pointer_before_call_(nullptr) { | 38 stack_pointer_before_call_(nullptr) { |
| 39 accumulator_.Bind(Parameter(InterpreterDispatchDescriptor::kAccumulator)); | 39 accumulator_.Bind(Parameter(InterpreterDispatchDescriptor::kAccumulator)); |
| 40 bytecode_offset_.Bind( | 40 bytecode_offset_.Bind( |
| 41 Parameter(InterpreterDispatchDescriptor::kBytecodeOffset)); | 41 Parameter(InterpreterDispatchDescriptor::kBytecodeOffset)); |
| 42 |
| 42 if (FLAG_trace_ignition) { | 43 if (FLAG_trace_ignition) { |
| 43 TraceBytecode(Runtime::kInterpreterTraceBytecodeEntry); | 44 TraceBytecode(Runtime::kInterpreterTraceBytecodeEntry); |
| 44 } | 45 } |
| 45 RegisterCallGenerationCallbacks([this] { CallPrologue(); }, | 46 RegisterCallGenerationCallbacks([this] { CallPrologue(); }, |
| 46 [this] { CallEpilogue(); }); | 47 [this] { CallEpilogue(); }); |
| 47 } | 48 } |
| 48 | 49 |
| 49 InterpreterAssembler::~InterpreterAssembler() { | 50 InterpreterAssembler::~InterpreterAssembler() { |
| 50 // If the following check fails the handler does not use the | 51 // If the following check fails the handler does not use the |
| 51 // accumulator in the way described in the bytecode definitions in | 52 // accumulator in the way described in the bytecode definitions in |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 409 } |
| 409 | 410 |
| 410 Node* InterpreterAssembler::BytecodeOperandImmIntPtr(int operand_index) { | 411 Node* InterpreterAssembler::BytecodeOperandImmIntPtr(int operand_index) { |
| 411 return ChangeInt32ToIntPtr(BytecodeOperandImm(operand_index)); | 412 return ChangeInt32ToIntPtr(BytecodeOperandImm(operand_index)); |
| 412 } | 413 } |
| 413 | 414 |
| 414 Node* InterpreterAssembler::BytecodeOperandImmSmi(int operand_index) { | 415 Node* InterpreterAssembler::BytecodeOperandImmSmi(int operand_index) { |
| 415 return SmiFromWord32(BytecodeOperandImm(operand_index)); | 416 return SmiFromWord32(BytecodeOperandImm(operand_index)); |
| 416 } | 417 } |
| 417 | 418 |
| 418 Node* InterpreterAssembler::BytecodeOperandIdx(int operand_index) { | 419 Node* InterpreterAssembler::BytecodeOperandIdxInt32(int operand_index) { |
| 419 DCHECK(OperandType::kIdx == | 420 DCHECK(OperandType::kIdx == |
| 420 Bytecodes::GetOperandType(bytecode_, operand_index)); | 421 Bytecodes::GetOperandType(bytecode_, operand_index)); |
| 421 OperandSize operand_size = | 422 OperandSize operand_size = |
| 422 Bytecodes::GetOperandSize(bytecode_, operand_index, operand_scale()); | 423 Bytecodes::GetOperandSize(bytecode_, operand_index, operand_scale()); |
| 423 return ChangeUint32ToWord( | 424 return BytecodeUnsignedOperand(operand_index, operand_size); |
| 424 BytecodeUnsignedOperand(operand_index, operand_size)); | 425 } |
| 426 |
| 427 Node* InterpreterAssembler::BytecodeOperandIdx(int operand_index) { |
| 428 return ChangeUint32ToWord(BytecodeOperandIdxInt32(operand_index)); |
| 425 } | 429 } |
| 426 | 430 |
| 427 Node* InterpreterAssembler::BytecodeOperandIdxSmi(int operand_index) { | 431 Node* InterpreterAssembler::BytecodeOperandIdxSmi(int operand_index) { |
| 428 return SmiTag(BytecodeOperandIdx(operand_index)); | 432 return SmiTag(BytecodeOperandIdx(operand_index)); |
| 429 } | 433 } |
| 430 | 434 |
| 431 Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) { | 435 Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) { |
| 432 DCHECK(Bytecodes::IsRegisterOperandType( | 436 DCHECK(Bytecodes::IsRegisterOperandType( |
| 433 Bytecodes::GetOperandType(bytecode_, operand_index))); | 437 Bytecodes::GetOperandType(bytecode_, operand_index))); |
| 434 OperandSize operand_size = | 438 OperandSize operand_size = |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 Goto(&loop); | 1364 Goto(&loop); |
| 1361 } | 1365 } |
| 1362 Bind(&done_loop); | 1366 Bind(&done_loop); |
| 1363 | 1367 |
| 1364 return array; | 1368 return array; |
| 1365 } | 1369 } |
| 1366 | 1370 |
| 1367 } // namespace interpreter | 1371 } // namespace interpreter |
| 1368 } // namespace internal | 1372 } // namespace internal |
| 1369 } // namespace v8 | 1373 } // namespace v8 |
| OLD | NEW |