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 #ifndef V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ | 5 #ifndef V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ |
6 #define V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ | 6 #define V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/base/smart-pointers.h" | 9 #include "src/base/smart-pointers.h" |
10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // Returns the offset from the BytecodeArrayPointer of the current bytecode. | 152 // Returns the offset from the BytecodeArrayPointer of the current bytecode. |
153 compiler::Node* BytecodeOffset(); | 153 compiler::Node* BytecodeOffset(); |
154 | 154 |
155 protected: | 155 protected: |
156 Bytecode bytecode() const { return bytecode_; } | 156 Bytecode bytecode() const { return bytecode_; } |
157 static bool TargetSupportsUnalignedAccess(); | 157 static bool TargetSupportsUnalignedAccess(); |
158 | 158 |
159 private: | 159 private: |
160 // Returns a tagged pointer to the current function's BytecodeArray object. | 160 // Returns a tagged pointer to the current function's BytecodeArray object. |
161 compiler::Node* BytecodeArrayTaggedPointer(); | 161 compiler::Node* BytecodeArrayTaggedPointer(); |
| 162 |
162 // Returns a raw pointer to first entry in the interpreter dispatch table. | 163 // Returns a raw pointer to first entry in the interpreter dispatch table. |
163 compiler::Node* DispatchTableRawPointer(); | 164 compiler::Node* DispatchTableRawPointer(); |
164 | 165 |
165 // Returns the accumulator value without checking whether bytecode | 166 // Returns the accumulator value without checking whether bytecode |
166 // uses it. This is intended to be used only in dispatch and in | 167 // uses it. This is intended to be used only in dispatch and in |
167 // tracing as these need to bypass accumulator use validity checks. | 168 // tracing as these need to bypass accumulator use validity checks. |
168 compiler::Node* GetAccumulatorUnchecked(); | 169 compiler::Node* GetAccumulatorUnchecked(); |
169 | 170 |
| 171 // Returns the frame pointer for the interpreted frame of the function being |
| 172 // interpreted. |
| 173 compiler::Node* GetInterpretedFramePointer(); |
| 174 |
170 // Saves and restores interpreter bytecode offset to the interpreter stack | 175 // Saves and restores interpreter bytecode offset to the interpreter stack |
171 // frame when performing a call. | 176 // frame when performing a call. |
172 void CallPrologue() override; | 177 void CallPrologue() override; |
173 void CallEpilogue() override; | 178 void CallEpilogue() override; |
174 | 179 |
175 // Increment the dispatch counter for the (current, next) bytecode pair. | 180 // Increment the dispatch counter for the (current, next) bytecode pair. |
176 void TraceBytecodeDispatch(compiler::Node* target_index); | 181 void TraceBytecodeDispatch(compiler::Node* target_index); |
177 | 182 |
178 // Traces the current bytecode by calling |function_id|. | 183 // Traces the current bytecode by calling |function_id|. |
179 void TraceBytecode(Runtime::FunctionId function_id); | 184 void TraceBytecode(Runtime::FunctionId function_id); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 compiler::Node* bytecode_offset); | 231 compiler::Node* bytecode_offset); |
227 | 232 |
228 // Dispatch to the bytecode handler with code entry point |handler_entry|. | 233 // Dispatch to the bytecode handler with code entry point |handler_entry|. |
229 compiler::Node* DispatchToBytecodeHandlerEntry( | 234 compiler::Node* DispatchToBytecodeHandlerEntry( |
230 compiler::Node* handler_entry, compiler::Node* bytecode_offset); | 235 compiler::Node* handler_entry, compiler::Node* bytecode_offset); |
231 | 236 |
232 OperandScale operand_scale() const { return operand_scale_; } | 237 OperandScale operand_scale() const { return operand_scale_; } |
233 | 238 |
234 Bytecode bytecode_; | 239 Bytecode bytecode_; |
235 OperandScale operand_scale_; | 240 OperandScale operand_scale_; |
| 241 CodeStubAssembler::Variable interpreted_frame_pointer_; |
236 CodeStubAssembler::Variable accumulator_; | 242 CodeStubAssembler::Variable accumulator_; |
237 AccumulatorUse accumulator_use_; | 243 AccumulatorUse accumulator_use_; |
238 bool made_call_; | 244 bool made_call_; |
239 | 245 |
240 bool disable_stack_check_across_call_; | 246 bool disable_stack_check_across_call_; |
241 compiler::Node* stack_pointer_before_call_; | 247 compiler::Node* stack_pointer_before_call_; |
242 | 248 |
243 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); | 249 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); |
244 }; | 250 }; |
245 | 251 |
246 } // namespace interpreter | 252 } // namespace interpreter |
247 } // namespace internal | 253 } // namespace internal |
248 } // namespace v8 | 254 } // namespace v8 |
249 | 255 |
250 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ | 256 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ |
OLD | NEW |