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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // located at |first_arg|. | 108 // located at |first_arg|. |
109 compiler::Node* CallRuntimeN(compiler::Node* function_id, | 109 compiler::Node* CallRuntimeN(compiler::Node* function_id, |
110 compiler::Node* context, | 110 compiler::Node* context, |
111 compiler::Node* first_arg, | 111 compiler::Node* first_arg, |
112 compiler::Node* arg_count, int return_size = 1); | 112 compiler::Node* arg_count, int return_size = 1); |
113 | 113 |
114 // Jump relative to the current bytecode by |jump_offset|. | 114 // Jump relative to the current bytecode by |jump_offset|. |
115 compiler::Node* Jump(compiler::Node* jump_offset); | 115 compiler::Node* Jump(compiler::Node* jump_offset); |
116 | 116 |
117 // Jump relative to the current bytecode by |jump_offset| if the | 117 // Jump relative to the current bytecode by |jump_offset| if the |
118 // |condition| is true. Helper function for JumpIfWordEqual and | |
119 // JumpIfWordNotEqual. | |
120 void JumpConditional(compiler::Node* condition, compiler::Node* jump_offset); | |
121 | |
122 // Jump relative to the current bytecode by |jump_offset| if the | |
123 // word values |lhs| and |rhs| are equal. | 118 // word values |lhs| and |rhs| are equal. |
124 void JumpIfWordEqual(compiler::Node* lhs, compiler::Node* rhs, | 119 void JumpIfWordEqual(compiler::Node* lhs, compiler::Node* rhs, |
125 compiler::Node* jump_offset); | 120 compiler::Node* jump_offset); |
126 | 121 |
127 // Jump relative to the current bytecode by |jump_offset| if the | 122 // Jump relative to the current bytecode by |jump_offset| if the |
128 // word values |lhs| and |rhs| are not equal. | 123 // word values |lhs| and |rhs| are not equal. |
129 void JumpIfWordNotEqual(compiler::Node* lhs, compiler::Node* rhs, | 124 void JumpIfWordNotEqual(compiler::Node* lhs, compiler::Node* rhs, |
130 compiler::Node* jump_offset); | 125 compiler::Node* jump_offset); |
131 | 126 |
132 // Perform a stack guard check. | 127 // Returns true if the stack guard check triggers an interrupt. |
133 void StackCheck(); | 128 compiler::Node* StackCheckTriggeredInterrupt(); |
134 | 129 |
135 // Returns from the function. | 130 // Returns from the function. |
136 compiler::Node* InterpreterReturn(); | 131 compiler::Node* InterpreterReturn(); |
137 | 132 |
138 // Dispatch to the bytecode. | 133 // Dispatch to the bytecode. |
139 compiler::Node* Dispatch(); | 134 compiler::Node* Dispatch(); |
140 | 135 |
141 // Dispatch to bytecode handler. | 136 // Dispatch to bytecode handler. |
142 compiler::Node* DispatchToBytecodeHandler(compiler::Node* handler) { | 137 compiler::Node* DispatchToBytecodeHandler(compiler::Node* handler) { |
143 return DispatchToBytecodeHandler(handler, BytecodeOffset()); | 138 return DispatchToBytecodeHandler(handler, BytecodeOffset()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 compiler::Node* BytecodeOperandUnsignedShort(int operand_index); | 195 compiler::Node* BytecodeOperandUnsignedShort(int operand_index); |
201 compiler::Node* BytecodeOperandSignedShort(int operand_index); | 196 compiler::Node* BytecodeOperandSignedShort(int operand_index); |
202 compiler::Node* BytecodeOperandUnsignedQuad(int operand_index); | 197 compiler::Node* BytecodeOperandUnsignedQuad(int operand_index); |
203 compiler::Node* BytecodeOperandSignedQuad(int operand_index); | 198 compiler::Node* BytecodeOperandSignedQuad(int operand_index); |
204 | 199 |
205 compiler::Node* BytecodeSignedOperand(int operand_index, | 200 compiler::Node* BytecodeSignedOperand(int operand_index, |
206 OperandSize operand_size); | 201 OperandSize operand_size); |
207 compiler::Node* BytecodeUnsignedOperand(int operand_index, | 202 compiler::Node* BytecodeUnsignedOperand(int operand_index, |
208 OperandSize operand_size); | 203 OperandSize operand_size); |
209 | 204 |
| 205 // Jump relative to the current bytecode by |jump_offset| if the |
| 206 // |condition| is true. Helper function for JumpIfWordEqual and |
| 207 // JumpIfWordNotEqual. |
| 208 void JumpConditional(compiler::Node* condition, compiler::Node* jump_offset); |
| 209 |
210 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not | 210 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not |
211 // update BytecodeOffset() itself. | 211 // update BytecodeOffset() itself. |
212 compiler::Node* Advance(int delta); | 212 compiler::Node* Advance(int delta); |
213 compiler::Node* Advance(compiler::Node* delta); | 213 compiler::Node* Advance(compiler::Node* delta); |
214 | 214 |
215 // Starts next instruction dispatch at |new_bytecode_offset|. | 215 // Starts next instruction dispatch at |new_bytecode_offset|. |
216 compiler::Node* DispatchTo(compiler::Node* new_bytecode_offset); | 216 compiler::Node* DispatchTo(compiler::Node* new_bytecode_offset); |
217 | 217 |
218 // Dispatch to the bytecode handler with code offset |handler|. | 218 // Dispatch to the bytecode handler with code offset |handler|. |
219 compiler::Node* DispatchToBytecodeHandler(compiler::Node* handler, | 219 compiler::Node* DispatchToBytecodeHandler(compiler::Node* handler, |
(...skipping 19 matching lines...) Expand all Loading... |
239 compiler::Node* stack_pointer_before_call_; | 239 compiler::Node* stack_pointer_before_call_; |
240 | 240 |
241 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); | 241 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); |
242 }; | 242 }; |
243 | 243 |
244 } // namespace interpreter | 244 } // namespace interpreter |
245 } // namespace internal | 245 } // namespace internal |
246 } // namespace v8 | 246 } // namespace v8 |
247 | 247 |
248 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ | 248 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ |
OLD | NEW |