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 20 matching lines...) Expand all Loading... |
31 Bytecodes::ReturnCount(bytecode)), | 31 Bytecodes::ReturnCount(bytecode)), |
32 bytecode_(bytecode), | 32 bytecode_(bytecode), |
33 operand_scale_(operand_scale), | 33 operand_scale_(operand_scale), |
34 bytecode_offset_(this, MachineType::PointerRepresentation()), | 34 bytecode_offset_(this, MachineType::PointerRepresentation()), |
35 interpreted_frame_pointer_(this, MachineType::PointerRepresentation()), | 35 interpreted_frame_pointer_(this, MachineType::PointerRepresentation()), |
36 accumulator_(this, MachineRepresentation::kTagged), | 36 accumulator_(this, MachineRepresentation::kTagged), |
37 accumulator_use_(AccumulatorUse::kNone), | 37 accumulator_use_(AccumulatorUse::kNone), |
38 made_call_(false), | 38 made_call_(false), |
39 disable_stack_check_across_call_(false), | 39 disable_stack_check_across_call_(false), |
40 stack_pointer_before_call_(nullptr) { | 40 stack_pointer_before_call_(nullptr) { |
41 accumulator_.Bind( | 41 accumulator_.Bind(Parameter(InterpreterDispatchDescriptor::kAccumulator)); |
42 Parameter(InterpreterDispatchDescriptor::kAccumulatorParameter)); | |
43 bytecode_offset_.Bind( | 42 bytecode_offset_.Bind( |
44 Parameter(InterpreterDispatchDescriptor::kBytecodeOffsetParameter)); | 43 Parameter(InterpreterDispatchDescriptor::kBytecodeOffset)); |
45 if (FLAG_trace_ignition) { | 44 if (FLAG_trace_ignition) { |
46 TraceBytecode(Runtime::kInterpreterTraceBytecodeEntry); | 45 TraceBytecode(Runtime::kInterpreterTraceBytecodeEntry); |
47 } | 46 } |
48 } | 47 } |
49 | 48 |
50 InterpreterAssembler::~InterpreterAssembler() { | 49 InterpreterAssembler::~InterpreterAssembler() { |
51 // If the following check fails the handler does not use the | 50 // If the following check fails the handler does not use the |
52 // accumulator in the way described in the bytecode definitions in | 51 // accumulator in the way described in the bytecode definitions in |
53 // bytecodes.h. | 52 // bytecodes.h. |
54 DCHECK_EQ(accumulator_use_, Bytecodes::GetAccumulatorUse(bytecode_)); | 53 DCHECK_EQ(accumulator_use_, Bytecodes::GetAccumulatorUse(bytecode_)); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 Node* InterpreterAssembler::BytecodeOffset() { | 87 Node* InterpreterAssembler::BytecodeOffset() { |
89 return bytecode_offset_.value(); | 88 return bytecode_offset_.value(); |
90 } | 89 } |
91 | 90 |
92 Node* InterpreterAssembler::BytecodeArrayTaggedPointer() { | 91 Node* InterpreterAssembler::BytecodeArrayTaggedPointer() { |
93 if (made_call_) { | 92 if (made_call_) { |
94 // If we have made a call, restore bytecode array from stack frame in case | 93 // If we have made a call, restore bytecode array from stack frame in case |
95 // the debugger has swapped us to the patched debugger bytecode array. | 94 // the debugger has swapped us to the patched debugger bytecode array. |
96 return LoadRegister(Register::bytecode_array()); | 95 return LoadRegister(Register::bytecode_array()); |
97 } else { | 96 } else { |
98 return Parameter(InterpreterDispatchDescriptor::kBytecodeArrayParameter); | 97 return Parameter(InterpreterDispatchDescriptor::kBytecodeArray); |
99 } | 98 } |
100 } | 99 } |
101 | 100 |
102 Node* InterpreterAssembler::DispatchTableRawPointer() { | 101 Node* InterpreterAssembler::DispatchTableRawPointer() { |
103 return Parameter(InterpreterDispatchDescriptor::kDispatchTableParameter); | 102 return Parameter(InterpreterDispatchDescriptor::kDispatchTable); |
104 } | 103 } |
105 | 104 |
106 Node* InterpreterAssembler::RegisterLocation(Node* reg_index) { | 105 Node* InterpreterAssembler::RegisterLocation(Node* reg_index) { |
107 return IntPtrAdd(GetInterpretedFramePointer(), | 106 return IntPtrAdd(GetInterpretedFramePointer(), |
108 RegisterFrameOffset(reg_index)); | 107 RegisterFrameOffset(reg_index)); |
109 } | 108 } |
110 | 109 |
111 Node* InterpreterAssembler::RegisterFrameOffset(Node* index) { | 110 Node* InterpreterAssembler::RegisterFrameOffset(Node* index) { |
112 return WordShl(index, kPointerSizeLog2); | 111 return WordShl(index, kPointerSizeLog2); |
113 } | 112 } |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 Goto(&loop); | 988 Goto(&loop); |
990 } | 989 } |
991 Bind(&done_loop); | 990 Bind(&done_loop); |
992 | 991 |
993 return array; | 992 return array; |
994 } | 993 } |
995 | 994 |
996 } // namespace interpreter | 995 } // namespace interpreter |
997 } // namespace internal | 996 } // namespace internal |
998 } // namespace v8 | 997 } // namespace v8 |
OLD | NEW |