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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 // Accumulator. | 54 // Accumulator. |
55 Node* GetAccumulator(); | 55 Node* GetAccumulator(); |
56 void SetAccumulator(Node* value); | 56 void SetAccumulator(Node* value); |
57 | 57 |
58 // Context. | 58 // Context. |
59 Node* GetContext(); | 59 Node* GetContext(); |
60 void SetContext(Node* value); | 60 void SetContext(Node* value); |
61 | 61 |
62 // Loads from and stores to the interpreter register file. | 62 // Loads from and stores to the interpreter register file. |
| 63 Node* LoadRegister(int offset); |
63 Node* LoadRegister(interpreter::Register reg); | 64 Node* LoadRegister(interpreter::Register reg); |
64 Node* LoadRegister(Node* reg_index); | 65 Node* LoadRegister(Node* reg_index); |
| 66 Node* StoreRegister(Node* value, int offset); |
| 67 Node* StoreRegister(Node* value, interpreter::Register reg); |
65 Node* StoreRegister(Node* value, Node* reg_index); | 68 Node* StoreRegister(Node* value, Node* reg_index); |
66 | 69 |
67 // Returns the location in memory of the register |reg_index| in the | 70 // Returns the location in memory of the register |reg_index| in the |
68 // interpreter register file. | 71 // interpreter register file. |
69 Node* RegisterLocation(Node* reg_index); | 72 Node* RegisterLocation(Node* reg_index); |
70 | 73 |
71 // Constants. | 74 // Constants. |
72 Node* Int32Constant(int value); | 75 Node* Int32Constant(int value); |
73 Node* IntPtrConstant(intptr_t value); | 76 Node* IntPtrConstant(intptr_t value); |
74 Node* NumberConstant(double value); | 77 Node* NumberConstant(double value); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 private: | 159 private: |
157 // Returns a raw pointer to start of the register file on the stack. | 160 // Returns a raw pointer to start of the register file on the stack. |
158 Node* RegisterFileRawPointer(); | 161 Node* RegisterFileRawPointer(); |
159 // Returns a tagged pointer to the current function's BytecodeArray object. | 162 // Returns a tagged pointer to the current function's BytecodeArray object. |
160 Node* BytecodeArrayTaggedPointer(); | 163 Node* BytecodeArrayTaggedPointer(); |
161 // Returns the offset from the BytecodeArrayPointer of the current bytecode. | 164 // Returns the offset from the BytecodeArrayPointer of the current bytecode. |
162 Node* BytecodeOffset(); | 165 Node* BytecodeOffset(); |
163 // Returns a raw pointer to first entry in the interpreter dispatch table. | 166 // Returns a raw pointer to first entry in the interpreter dispatch table. |
164 Node* DispatchTableRawPointer(); | 167 Node* DispatchTableRawPointer(); |
165 | 168 |
| 169 // Saves and restores interpreter bytecode offset to the interpreter stack |
| 170 // frame when performing a call. |
| 171 void CallPrologue(); |
| 172 void CallEpilogue(); |
| 173 |
166 // Returns the offset of register |index| relative to RegisterFilePointer(). | 174 // Returns the offset of register |index| relative to RegisterFilePointer(). |
167 Node* RegisterFrameOffset(Node* index); | 175 Node* RegisterFrameOffset(Node* index); |
168 | 176 |
169 Node* SmiShiftBitsConstant(); | 177 Node* SmiShiftBitsConstant(); |
170 Node* BytecodeOperand(int operand_index); | 178 Node* BytecodeOperand(int operand_index); |
171 Node* BytecodeOperandSignExtended(int operand_index); | 179 Node* BytecodeOperandSignExtended(int operand_index); |
172 Node* BytecodeOperandShort(int operand_index); | 180 Node* BytecodeOperandShort(int operand_index); |
173 | 181 |
174 Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args); | 182 Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args); |
175 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node** args); | 183 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node** args); |
176 Node* CallJSBuiltin(int context_index, Node* receiver, Node** js_args, | |
177 int js_arg_count); | |
178 | 184 |
179 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not | 185 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not |
180 // update BytecodeOffset() itself. | 186 // update BytecodeOffset() itself. |
181 Node* Advance(int delta); | 187 Node* Advance(int delta); |
182 Node* Advance(Node* delta); | 188 Node* Advance(Node* delta); |
183 | 189 |
184 // Starts next instruction dispatch at |new_bytecode_offset|. | 190 // Starts next instruction dispatch at |new_bytecode_offset|. |
185 void DispatchTo(Node* new_bytecode_offset); | 191 void DispatchTo(Node* new_bytecode_offset); |
186 | 192 |
187 // Abort operations for debug code. | 193 // Abort operations for debug code. |
188 void AbortIfWordNotEqual(Node* lhs, Node* rhs, BailoutReason bailout_reason); | 194 void AbortIfWordNotEqual(Node* lhs, Node* rhs, BailoutReason bailout_reason); |
189 | 195 |
190 // Private helpers which delegate to RawMachineAssembler. | 196 // Private helpers which delegate to RawMachineAssembler. |
191 Isolate* isolate(); | 197 Isolate* isolate(); |
192 Zone* zone(); | 198 Zone* zone(); |
193 | 199 |
194 interpreter::Bytecode bytecode_; | 200 interpreter::Bytecode bytecode_; |
195 base::SmartPointer<RawMachineAssembler> raw_assembler_; | 201 base::SmartPointer<RawMachineAssembler> raw_assembler_; |
| 202 |
196 Node* accumulator_; | 203 Node* accumulator_; |
| 204 Node* bytecode_offset_; |
197 Node* context_; | 205 Node* context_; |
| 206 |
198 bool code_generated_; | 207 bool code_generated_; |
199 | 208 |
200 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); | 209 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); |
201 }; | 210 }; |
202 | 211 |
203 } // namespace compiler | 212 } // namespace compiler |
204 } // namespace internal | 213 } // namespace internal |
205 } // namespace v8 | 214 } // namespace v8 |
206 | 215 |
207 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ | 216 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ |
OLD | NEW |