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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 compiler::Node* BytecodeSignedOperand(int operand_index, | 211 compiler::Node* BytecodeSignedOperand(int operand_index, |
212 OperandSize operand_size); | 212 OperandSize operand_size); |
213 compiler::Node* BytecodeUnsignedOperand(int operand_index, | 213 compiler::Node* BytecodeUnsignedOperand(int operand_index, |
214 OperandSize operand_size); | 214 OperandSize operand_size); |
215 | 215 |
216 // Jump relative to the current bytecode by |jump_offset| if the | 216 // Jump relative to the current bytecode by |jump_offset| if the |
217 // |condition| is true. Helper function for JumpIfWordEqual and | 217 // |condition| is true. Helper function for JumpIfWordEqual and |
218 // JumpIfWordNotEqual. | 218 // JumpIfWordNotEqual. |
219 void JumpConditional(compiler::Node* condition, compiler::Node* jump_offset); | 219 void JumpConditional(compiler::Node* condition, compiler::Node* jump_offset); |
220 | 220 |
221 // Returns BytecodeOffset() advanced by the current bytecode's size. | |
222 // Note: this does not update BytecodeOffset() itself. | |
rmcilroy
2016/07/19 10:03:56
Now that you have a variable for bytecode_offset,
klaasb
2016/07/19 14:24:13
Done. Need to re-bind the offset to the previous o
| |
223 compiler::Node* Advance(); | |
224 | |
221 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not | 225 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not |
222 // update BytecodeOffset() itself. | 226 // update BytecodeOffset() itself. |
223 compiler::Node* Advance(int delta); | 227 compiler::Node* Advance(int delta); |
224 compiler::Node* Advance(compiler::Node* delta); | 228 compiler::Node* Advance(compiler::Node* delta); |
225 | 229 |
230 // Load the bytecode at |bytecode_offset|. | |
231 compiler::Node* LoadBytecode(compiler::Node* bytecode_offset); | |
232 | |
226 // Starts next instruction dispatch at |new_bytecode_offset|. | 233 // Starts next instruction dispatch at |new_bytecode_offset|. |
227 compiler::Node* DispatchTo(compiler::Node* new_bytecode_offset); | 234 compiler::Node* DispatchTo(compiler::Node* new_bytecode_offset); |
228 | 235 |
236 // Look ahead for Star and inline it, will bind the next bytecode to dispatch | |
237 // to, to |target_bytecode| and its offset to |target_offset|. | |
238 void StarDispatchLookahead(Variable& target_bytecode, | |
239 Variable& target_offset); | |
240 | |
241 // Build code for Star at |target_offset| and bind |target_offset| to the | |
242 // next offset after Star | |
243 void InlineStar(Variable& target_offset); | |
rmcilroy
2016/07/19 10:03:56
nit - could you move these above DispatchTo (group
klaasb
2016/07/19 14:24:13
Done.
| |
244 | |
245 // Dispatch to |target_bytecode| at |new_bytecode_offset|. | |
246 // |target_bytecode| should be equivalent to loading from the offset. | |
247 compiler::Node* DispatchToBytecode(compiler::Node* target_bytecode, | |
248 compiler::Node* new_bytecode_offset); | |
249 | |
229 // Dispatch to the bytecode handler with code offset |handler|. | 250 // Dispatch to the bytecode handler with code offset |handler|. |
230 compiler::Node* DispatchToBytecodeHandler(compiler::Node* handler, | 251 compiler::Node* DispatchToBytecodeHandler(compiler::Node* handler, |
231 compiler::Node* bytecode_offset); | 252 compiler::Node* bytecode_offset); |
232 | 253 |
233 // Dispatch to the bytecode handler with code entry point |handler_entry|. | 254 // Dispatch to the bytecode handler with code entry point |handler_entry|. |
234 compiler::Node* DispatchToBytecodeHandlerEntry( | 255 compiler::Node* DispatchToBytecodeHandlerEntry( |
235 compiler::Node* handler_entry, compiler::Node* bytecode_offset); | 256 compiler::Node* handler_entry, compiler::Node* bytecode_offset); |
236 | 257 |
237 OperandScale operand_scale() const { return operand_scale_; } | 258 OperandScale operand_scale() const { return operand_scale_; } |
238 | 259 |
239 Bytecode bytecode_; | 260 Bytecode bytecode_; |
261 CodeStubAssembler::Variable bytecode_offset_; | |
240 OperandScale operand_scale_; | 262 OperandScale operand_scale_; |
241 CodeStubAssembler::Variable interpreted_frame_pointer_; | 263 CodeStubAssembler::Variable interpreted_frame_pointer_; |
242 CodeStubAssembler::Variable accumulator_; | 264 CodeStubAssembler::Variable accumulator_; |
243 AccumulatorUse accumulator_use_; | 265 AccumulatorUse accumulator_use_; |
244 bool made_call_; | 266 bool made_call_; |
245 | 267 |
246 bool disable_stack_check_across_call_; | 268 bool disable_stack_check_across_call_; |
247 compiler::Node* stack_pointer_before_call_; | 269 compiler::Node* stack_pointer_before_call_; |
248 | 270 |
249 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); | 271 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); |
250 }; | 272 }; |
251 | 273 |
252 } // namespace interpreter | 274 } // namespace interpreter |
253 } // namespace internal | 275 } // namespace internal |
254 } // namespace v8 | 276 } // namespace v8 |
255 | 277 |
256 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ | 278 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ |
OLD | NEW |