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/builtins/builtins.h" | 9 #include "src/builtins/builtins.h" |
10 #include "src/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 compiler::Node* BytecodeOperandFlag(int operand_index); | 32 compiler::Node* BytecodeOperandFlag(int operand_index); |
33 // Returns the 32-bit zero-extended index immediate for bytecode operand | 33 // Returns the 32-bit zero-extended index immediate for bytecode operand |
34 // |operand_index| in the current bytecode. | 34 // |operand_index| in the current bytecode. |
35 compiler::Node* BytecodeOperandIdx(int operand_index); | 35 compiler::Node* BytecodeOperandIdx(int operand_index); |
36 // Returns the smi index immediate for bytecode operand |operand_index| | 36 // Returns the smi index immediate for bytecode operand |operand_index| |
37 // in the current bytecode. | 37 // in the current bytecode. |
38 compiler::Node* BytecodeOperandIdxSmi(int operand_index); | 38 compiler::Node* BytecodeOperandIdxSmi(int operand_index); |
39 // Returns the 32-bit unsigned immediate for bytecode operand |operand_index| | 39 // Returns the 32-bit unsigned immediate for bytecode operand |operand_index| |
40 // in the current bytecode. | 40 // in the current bytecode. |
41 compiler::Node* BytecodeOperandUImm(int operand_index); | 41 compiler::Node* BytecodeOperandUImm(int operand_index); |
| 42 // Returns the word-size unsigned immediate for bytecode operand |
| 43 // |operand_index| in the current bytecode. |
| 44 compiler::Node* BytecodeOperandUImmWord(int operand_index); |
42 // Returns the 32-bit signed immediate for bytecode operand |operand_index| | 45 // Returns the 32-bit signed immediate for bytecode operand |operand_index| |
43 // in the current bytecode. | 46 // in the current bytecode. |
44 compiler::Node* BytecodeOperandImm(int operand_index); | 47 compiler::Node* BytecodeOperandImm(int operand_index); |
45 // Returns the word-size signed immediate for bytecode operand |operand_index| | 48 // Returns the word-size signed immediate for bytecode operand |operand_index| |
46 // in the current bytecode. | 49 // in the current bytecode. |
47 compiler::Node* BytecodeOperandImmIntPtr(int operand_index); | 50 compiler::Node* BytecodeOperandImmIntPtr(int operand_index); |
48 // Returns the smi immediate for bytecode operand |operand_index| in the | 51 // Returns the smi immediate for bytecode operand |operand_index| in the |
49 // current bytecode. | 52 // current bytecode. |
50 compiler::Node* BytecodeOperandImmSmi(int operand_index); | 53 compiler::Node* BytecodeOperandImmSmi(int operand_index); |
51 // Returns the word-size sign-extended register index for bytecode operand | 54 // Returns the word-size sign-extended register index for bytecode operand |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 compiler::Node* type_feedback_vector); | 146 compiler::Node* type_feedback_vector); |
144 | 147 |
145 // Call runtime function with |arg_count| arguments and the first argument | 148 // Call runtime function with |arg_count| arguments and the first argument |
146 // located at |first_arg|. | 149 // located at |first_arg|. |
147 compiler::Node* CallRuntimeN(compiler::Node* function_id, | 150 compiler::Node* CallRuntimeN(compiler::Node* function_id, |
148 compiler::Node* context, | 151 compiler::Node* context, |
149 compiler::Node* first_arg, | 152 compiler::Node* first_arg, |
150 compiler::Node* arg_count, int return_size = 1); | 153 compiler::Node* arg_count, int return_size = 1); |
151 | 154 |
152 // Jump relative to the current bytecode by |jump_offset|. | 155 // Jump relative to the current bytecode by |jump_offset|. |
153 compiler::Node* Jump(compiler::Node* jump_offset); | 156 compiler::Node* Jump(compiler::Node* jump_offset, bool reverse = false); |
154 | 157 |
155 // Jump relative to the current bytecode by |jump_offset| if the | 158 // Jump relative to the current bytecode by |jump_offset| if the |
156 // word values |lhs| and |rhs| are equal. | 159 // word values |lhs| and |rhs| are equal. |
157 void JumpIfWordEqual(compiler::Node* lhs, compiler::Node* rhs, | 160 void JumpIfWordEqual(compiler::Node* lhs, compiler::Node* rhs, |
158 compiler::Node* jump_offset); | 161 compiler::Node* jump_offset); |
159 | 162 |
160 // Jump relative to the current bytecode by |jump_offset| if the | 163 // Jump relative to the current bytecode by |jump_offset| if the |
161 // word values |lhs| and |rhs| are not equal. | 164 // word values |lhs| and |rhs| are not equal. |
162 void JumpIfWordNotEqual(compiler::Node* lhs, compiler::Node* rhs, | 165 void JumpIfWordNotEqual(compiler::Node* lhs, compiler::Node* rhs, |
163 compiler::Node* jump_offset); | 166 compiler::Node* jump_offset); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // JumpIfWordNotEqual. | 268 // JumpIfWordNotEqual. |
266 void JumpConditional(compiler::Node* condition, compiler::Node* jump_offset); | 269 void JumpConditional(compiler::Node* condition, compiler::Node* jump_offset); |
267 | 270 |
268 // Updates and returns BytecodeOffset() advanced by the current bytecode's | 271 // Updates and returns BytecodeOffset() advanced by the current bytecode's |
269 // size. Traces the exit of the current bytecode. | 272 // size. Traces the exit of the current bytecode. |
270 compiler::Node* Advance(); | 273 compiler::Node* Advance(); |
271 | 274 |
272 // Updates and returns BytecodeOffset() advanced by delta bytecodes. | 275 // Updates and returns BytecodeOffset() advanced by delta bytecodes. |
273 // Traces the exit of the current bytecode. | 276 // Traces the exit of the current bytecode. |
274 compiler::Node* Advance(int delta); | 277 compiler::Node* Advance(int delta); |
275 compiler::Node* Advance(compiler::Node* delta); | 278 compiler::Node* Advance(compiler::Node* delta, bool reverse = false); |
276 | 279 |
277 // Load the bytecode at |bytecode_offset|. | 280 // Load the bytecode at |bytecode_offset|. |
278 compiler::Node* LoadBytecode(compiler::Node* bytecode_offset); | 281 compiler::Node* LoadBytecode(compiler::Node* bytecode_offset); |
279 | 282 |
280 // Look ahead for Star and inline it in a branch. Returns a new target | 283 // Look ahead for Star and inline it in a branch. Returns a new target |
281 // bytecode node for dispatch. | 284 // bytecode node for dispatch. |
282 compiler::Node* StarDispatchLookahead(compiler::Node* target_bytecode); | 285 compiler::Node* StarDispatchLookahead(compiler::Node* target_bytecode); |
283 | 286 |
284 // Build code for Star at the current BytecodeOffset() and Advance() to the | 287 // Build code for Star at the current BytecodeOffset() and Advance() to the |
285 // next dispatch offset. | 288 // next dispatch offset. |
(...skipping 26 matching lines...) Expand all Loading... |
312 compiler::Node* stack_pointer_before_call_; | 315 compiler::Node* stack_pointer_before_call_; |
313 | 316 |
314 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); | 317 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); |
315 }; | 318 }; |
316 | 319 |
317 } // namespace interpreter | 320 } // namespace interpreter |
318 } // namespace internal | 321 } // namespace internal |
319 } // namespace v8 | 322 } // namespace v8 |
320 | 323 |
321 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ | 324 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ |
OLD | NEW |