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_COMPILER_INTERPRETER_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_INTERPRETER_ASSEMBLER_H_ |
6 #define V8_COMPILER_INTERPRETER_ASSEMBLER_H_ | 6 #define V8_COMPILER_INTERPRETER_ASSEMBLER_H_ |
7 | 7 |
8 // Clients of this interface shouldn't depend on lots of compiler internals. | 8 // Clients of this interface shouldn't depend on lots of compiler internals. |
9 // Do not include anything from src/compiler here! | 9 // Do not include anything from src/compiler here! |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // receiver) and the first argument located at |first_arg|. | 103 // receiver) and the first argument located at |first_arg|. |
104 Node* CallJS(Node* function, Node* first_arg, Node* arg_count); | 104 Node* CallJS(Node* function, Node* first_arg, Node* arg_count); |
105 | 105 |
106 // Call an IC code stub. | 106 // Call an IC code stub. |
107 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1, | 107 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1, |
108 Node* arg2, Node* arg3, Node* arg4); | 108 Node* arg2, Node* arg3, Node* arg4); |
109 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1, | 109 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1, |
110 Node* arg2, Node* arg3, Node* arg4, Node* arg5); | 110 Node* arg2, Node* arg3, Node* arg4, Node* arg5); |
111 | 111 |
112 // Call runtime function. | 112 // Call runtime function. |
| 113 Node* CallRuntime(Node* function_id, Node* first_arg, Node* arg_count); |
113 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1); | 114 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1); |
114 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2); | 115 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2); |
115 | 116 |
116 // Jump relative to the current bytecode by |jump_offset|. | 117 // Jump relative to the current bytecode by |jump_offset|. |
117 void Jump(Node* jump_offset); | 118 void Jump(Node* jump_offset); |
118 | 119 |
119 // Jump relative to the current bytecode by |jump_offset| if the | 120 // Jump relative to the current bytecode by |jump_offset| if the |
120 // word values |lhs| and |rhs| are equal. | 121 // word values |lhs| and |rhs| are equal. |
121 void JumpIfWordEqual(Node* lhs, Node* rhs, Node* jump_offset); | 122 void JumpIfWordEqual(Node* lhs, Node* rhs, Node* jump_offset); |
122 | 123 |
(...skipping 26 matching lines...) Expand all Loading... |
149 Node* ContextTaggedPointer(); | 150 Node* ContextTaggedPointer(); |
150 | 151 |
151 // Returns the offset of register |index| relative to RegisterFilePointer(). | 152 // Returns the offset of register |index| relative to RegisterFilePointer(). |
152 Node* RegisterFrameOffset(Node* index); | 153 Node* RegisterFrameOffset(Node* index); |
153 | 154 |
154 Node* SmiShiftBitsConstant(); | 155 Node* SmiShiftBitsConstant(); |
155 Node* BytecodeOperand(int operand_index); | 156 Node* BytecodeOperand(int operand_index); |
156 Node* BytecodeOperandSignExtended(int operand_index); | 157 Node* BytecodeOperandSignExtended(int operand_index); |
157 Node* BytecodeOperandShort(int operand_index); | 158 Node* BytecodeOperandShort(int operand_index); |
158 | 159 |
| 160 Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args); |
159 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node** args); | 161 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node** args); |
160 Node* CallJSBuiltin(int context_index, Node* receiver, Node** js_args, | 162 Node* CallJSBuiltin(int context_index, Node* receiver, Node** js_args, |
161 int js_arg_count); | 163 int js_arg_count); |
162 | 164 |
163 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not | 165 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not |
164 // update BytecodeOffset() itself. | 166 // update BytecodeOffset() itself. |
165 Node* Advance(int delta); | 167 Node* Advance(int delta); |
166 Node* Advance(Node* delta); | 168 Node* Advance(Node* delta); |
167 | 169 |
168 // Starts next instruction dispatch at |new_bytecode_offset|. | 170 // Starts next instruction dispatch at |new_bytecode_offset|. |
169 void DispatchTo(Node* new_bytecode_offset); | 171 void DispatchTo(Node* new_bytecode_offset); |
170 | 172 |
| 173 // Abort operations for debug code. |
| 174 void AbortIfWordNotEqual(Node* lhs, Node* rhs, BailoutReason bailout_reason); |
| 175 |
171 // Adds an end node of the graph. | 176 // Adds an end node of the graph. |
172 void AddEndInput(Node* input); | 177 void AddEndInput(Node* input); |
173 | 178 |
174 // Private helpers which delegate to RawMachineAssembler. | 179 // Private helpers which delegate to RawMachineAssembler. |
175 Isolate* isolate(); | 180 Isolate* isolate(); |
176 Schedule* schedule(); | 181 Schedule* schedule(); |
177 Zone* zone(); | 182 Zone* zone(); |
178 | 183 |
179 interpreter::Bytecode bytecode_; | 184 interpreter::Bytecode bytecode_; |
180 base::SmartPointer<RawMachineAssembler> raw_assembler_; | 185 base::SmartPointer<RawMachineAssembler> raw_assembler_; |
181 ZoneVector<Node*> end_nodes_; | 186 ZoneVector<Node*> end_nodes_; |
182 Node* accumulator_; | 187 Node* accumulator_; |
183 bool code_generated_; | 188 bool code_generated_; |
184 | 189 |
185 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); | 190 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); |
186 }; | 191 }; |
187 | 192 |
188 } // namespace compiler | 193 } // namespace compiler |
189 } // namespace internal | 194 } // namespace internal |
190 } // namespace v8 | 195 } // namespace v8 |
191 | 196 |
192 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ | 197 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ |
OLD | NEW |