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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 compiler::Node* ExportRegisterFile(compiler::Node* array); | 60 compiler::Node* ExportRegisterFile(compiler::Node* array); |
61 compiler::Node* ImportRegisterFile(compiler::Node* array); | 61 compiler::Node* ImportRegisterFile(compiler::Node* array); |
62 | 62 |
63 // Loads from and stores to the interpreter register file. | 63 // Loads from and stores to the interpreter register file. |
64 compiler::Node* LoadRegister(Register reg); | 64 compiler::Node* LoadRegister(Register reg); |
65 compiler::Node* LoadRegister(compiler::Node* reg_index); | 65 compiler::Node* LoadRegister(compiler::Node* reg_index); |
66 compiler::Node* StoreRegister(compiler::Node* value, Register reg); | 66 compiler::Node* StoreRegister(compiler::Node* value, Register reg); |
67 compiler::Node* StoreRegister(compiler::Node* value, | 67 compiler::Node* StoreRegister(compiler::Node* value, |
68 compiler::Node* reg_index); | 68 compiler::Node* reg_index); |
69 | 69 |
| 70 // Build nodes for Star and don't dispatch |
| 71 compiler::Node* StoreAccumulatorToRegister(); |
| 72 |
70 // Returns the next consecutive register. | 73 // Returns the next consecutive register. |
71 compiler::Node* NextRegister(compiler::Node* reg_index); | 74 compiler::Node* NextRegister(compiler::Node* reg_index); |
72 | 75 |
73 // Returns the location in memory of the register |reg_index| in the | 76 // Returns the location in memory of the register |reg_index| in the |
74 // interpreter register file. | 77 // interpreter register file. |
75 compiler::Node* RegisterLocation(compiler::Node* reg_index); | 78 compiler::Node* RegisterLocation(compiler::Node* reg_index); |
76 | 79 |
77 // Load constant at |index| in the constant pool. | 80 // Load constant at |index| in the constant pool. |
78 compiler::Node* LoadConstantPoolEntry(compiler::Node* index); | 81 compiler::Node* LoadConstantPoolEntry(compiler::Node* index); |
79 | 82 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 compiler::Node* BytecodeSignedOperand(int operand_index, | 214 compiler::Node* BytecodeSignedOperand(int operand_index, |
212 OperandSize operand_size); | 215 OperandSize operand_size); |
213 compiler::Node* BytecodeUnsignedOperand(int operand_index, | 216 compiler::Node* BytecodeUnsignedOperand(int operand_index, |
214 OperandSize operand_size); | 217 OperandSize operand_size); |
215 | 218 |
216 // Jump relative to the current bytecode by |jump_offset| if the | 219 // Jump relative to the current bytecode by |jump_offset| if the |
217 // |condition| is true. Helper function for JumpIfWordEqual and | 220 // |condition| is true. Helper function for JumpIfWordEqual and |
218 // JumpIfWordNotEqual. | 221 // JumpIfWordNotEqual. |
219 void JumpConditional(compiler::Node* condition, compiler::Node* jump_offset); | 222 void JumpConditional(compiler::Node* condition, compiler::Node* jump_offset); |
220 | 223 |
| 224 // Returns BytecodeOffset() advanced by the current bytecode's size. |
| 225 // Note: this does not update BytecodeOffset() itself. |
| 226 compiler::Node* Advance(); |
| 227 |
221 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not | 228 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not |
222 // update BytecodeOffset() itself. | 229 // update BytecodeOffset() itself. |
223 compiler::Node* Advance(int delta); | 230 compiler::Node* Advance(int delta); |
224 compiler::Node* Advance(compiler::Node* delta); | 231 compiler::Node* Advance(compiler::Node* delta); |
225 | 232 |
| 233 // Load the bytecode at |bytecode_offset|. |
| 234 compiler::Node* LoadBytecode(compiler::Node* bytecode_offset); |
| 235 |
226 // Starts next instruction dispatch at |new_bytecode_offset|. | 236 // Starts next instruction dispatch at |new_bytecode_offset|. |
227 compiler::Node* DispatchTo(compiler::Node* new_bytecode_offset); | 237 compiler::Node* DispatchTo(compiler::Node* new_bytecode_offset); |
228 | 238 |
| 239 // Look ahead for Star and inline it, will bind the next bytecode to dispatch |
| 240 // to, to |target_bytecode| and its offset to |target_offset|. |
| 241 void InlineDispatchToStar(Variable& target_bytecode, Variable& target_offset); |
| 242 |
| 243 // Dispatch to |target_bytecode| at |new_bytecode_offset|. |
| 244 // |target_bytecode| should be equivalent to loading from the offset. |
| 245 compiler::Node* DispatchToLoaded(compiler::Node* target_bytecode, |
| 246 compiler::Node* new_bytecode_offset); |
| 247 |
229 // Dispatch to the bytecode handler with code offset |handler|. | 248 // Dispatch to the bytecode handler with code offset |handler|. |
230 compiler::Node* DispatchToBytecodeHandler(compiler::Node* handler, | 249 compiler::Node* DispatchToBytecodeHandler(compiler::Node* handler, |
231 compiler::Node* bytecode_offset); | 250 compiler::Node* bytecode_offset); |
232 | 251 |
233 // Dispatch to the bytecode handler with code entry point |handler_entry|. | 252 // Dispatch to the bytecode handler with code entry point |handler_entry|. |
234 compiler::Node* DispatchToBytecodeHandlerEntry( | 253 compiler::Node* DispatchToBytecodeHandlerEntry( |
235 compiler::Node* handler_entry, compiler::Node* bytecode_offset); | 254 compiler::Node* handler_entry, compiler::Node* bytecode_offset); |
236 | 255 |
237 OperandScale operand_scale() const { return operand_scale_; } | 256 OperandScale operand_scale() const { return operand_scale_; } |
238 | 257 |
239 Bytecode bytecode_; | 258 Bytecode bytecode_; |
| 259 CodeStubAssembler::Variable bytecode_offset_; |
240 OperandScale operand_scale_; | 260 OperandScale operand_scale_; |
241 CodeStubAssembler::Variable interpreted_frame_pointer_; | 261 CodeStubAssembler::Variable interpreted_frame_pointer_; |
242 CodeStubAssembler::Variable accumulator_; | 262 CodeStubAssembler::Variable accumulator_; |
243 AccumulatorUse accumulator_use_; | 263 AccumulatorUse accumulator_use_; |
244 bool made_call_; | 264 bool made_call_; |
245 | 265 |
246 bool disable_stack_check_across_call_; | 266 bool disable_stack_check_across_call_; |
247 compiler::Node* stack_pointer_before_call_; | 267 compiler::Node* stack_pointer_before_call_; |
248 | 268 |
249 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); | 269 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); |
250 }; | 270 }; |
251 | 271 |
252 } // namespace interpreter | 272 } // namespace interpreter |
253 } // namespace internal | 273 } // namespace internal |
254 } // namespace v8 | 274 } // namespace v8 |
255 | 275 |
256 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ | 276 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ |
OLD | NEW |