Chromium Code Reviews| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 Node* arg2, Node* arg3, Node* arg4); | 131 Node* arg2, Node* arg3, Node* arg4); |
| 132 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1, | 132 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1, |
| 133 Node* arg2, Node* arg3, Node* arg4, Node* arg5); | 133 Node* arg2, Node* arg3, Node* arg4, Node* arg5); |
| 134 | 134 |
| 135 // Call runtime function. | 135 // Call runtime function. |
| 136 Node* CallRuntime(Node* function_id, Node* first_arg, Node* arg_count, | 136 Node* CallRuntime(Node* function_id, Node* first_arg, Node* arg_count, |
| 137 int return_size = 1); | 137 int return_size = 1); |
| 138 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1); | 138 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1); |
| 139 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2); | 139 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2); |
| 140 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2, | 140 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2, |
| 141 Node* arg3); | |
| 142 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2, | |
| 141 Node* arg3, Node* arg4); | 143 Node* arg3, Node* arg4); |
| 142 | 144 |
| 143 // Jump relative to the current bytecode by |jump_offset|. | 145 // Jump relative to the current bytecode by |jump_offset|. |
| 144 void Jump(Node* jump_offset); | 146 void Jump(Node* jump_offset); |
| 145 | 147 |
| 146 // Jump relative to the current bytecode by |jump_offset| if the | 148 // Jump relative to the current bytecode by |jump_offset| if the |
| 147 // word values |lhs| and |rhs| are equal. | 149 // word values |lhs| and |rhs| are equal. |
| 148 void JumpIfWordEqual(Node* lhs, Node* rhs, Node* jump_offset); | 150 void JumpIfWordEqual(Node* lhs, Node* rhs, Node* jump_offset); |
| 149 | 151 |
| 150 // Returns from the function. | 152 // Returns from the function. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 169 // Returns a tagged pointer to the current function's BytecodeArray object. | 171 // Returns a tagged pointer to the current function's BytecodeArray object. |
| 170 Node* BytecodeArrayTaggedPointer(); | 172 Node* BytecodeArrayTaggedPointer(); |
| 171 // Returns the offset from the BytecodeArrayPointer of the current bytecode. | 173 // Returns the offset from the BytecodeArrayPointer of the current bytecode. |
| 172 Node* BytecodeOffset(); | 174 Node* BytecodeOffset(); |
| 173 // Returns a raw pointer to first entry in the interpreter dispatch table. | 175 // Returns a raw pointer to first entry in the interpreter dispatch table. |
| 174 Node* DispatchTableRawPointer(); | 176 Node* DispatchTableRawPointer(); |
| 175 | 177 |
| 176 // Saves and restores interpreter bytecode offset to the interpreter stack | 178 // Saves and restores interpreter bytecode offset to the interpreter stack |
| 177 // frame when performing a call. | 179 // frame when performing a call. |
| 178 void CallPrologue(); | 180 void CallPrologue(); |
| 179 void CallEpilogue(); | 181 void CallEpilogue(); |
|
Michael Starzinger
2016/01/28 12:32:26
nit: Also the declaration of CallEpilogue can be d
rmcilroy
2016/01/28 16:39:51
Done.
| |
| 180 | 182 |
| 183 // Traces the current bytecode by calling |function_id|. | |
| 184 void TraceBytecode(Runtime::FunctionId function_id); | |
| 185 | |
| 181 // Returns the offset of register |index| relative to RegisterFilePointer(). | 186 // Returns the offset of register |index| relative to RegisterFilePointer(). |
| 182 Node* RegisterFrameOffset(Node* index); | 187 Node* RegisterFrameOffset(Node* index); |
| 183 | 188 |
| 184 Node* SmiShiftBitsConstant(); | 189 Node* SmiShiftBitsConstant(); |
| 185 Node* BytecodeOperand(int operand_index); | 190 Node* BytecodeOperand(int operand_index); |
| 186 Node* BytecodeOperandSignExtended(int operand_index); | 191 Node* BytecodeOperandSignExtended(int operand_index); |
| 187 Node* BytecodeOperandShort(int operand_index); | 192 Node* BytecodeOperandShort(int operand_index); |
| 188 Node* BytecodeOperandShortSignExtended(int operand_index); | 193 Node* BytecodeOperandShortSignExtended(int operand_index); |
| 189 | 194 |
| 190 Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args); | 195 Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 202 void AbortIfWordNotEqual(Node* lhs, Node* rhs, BailoutReason bailout_reason); | 207 void AbortIfWordNotEqual(Node* lhs, Node* rhs, BailoutReason bailout_reason); |
| 203 | 208 |
| 204 // Private helpers which delegate to RawMachineAssembler. | 209 // Private helpers which delegate to RawMachineAssembler. |
| 205 Isolate* isolate(); | 210 Isolate* isolate(); |
| 206 Zone* zone(); | 211 Zone* zone(); |
| 207 | 212 |
| 208 interpreter::Bytecode bytecode_; | 213 interpreter::Bytecode bytecode_; |
| 209 base::SmartPointer<RawMachineAssembler> raw_assembler_; | 214 base::SmartPointer<RawMachineAssembler> raw_assembler_; |
| 210 | 215 |
| 211 Node* accumulator_; | 216 Node* accumulator_; |
| 212 Node* bytecode_offset_; | 217 Node* bytecode_offset_; |
|
Michael Starzinger
2016/01/28 15:36:21
nit: Also, the {bytecode_offset} field can now be
rmcilroy
2016/01/28 16:39:51
Done.
| |
| 213 Node* context_; | 218 Node* context_; |
| 214 | 219 |
| 215 bool code_generated_; | 220 bool code_generated_; |
| 216 | 221 |
| 217 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); | 222 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); |
| 218 }; | 223 }; |
| 219 | 224 |
| 220 } // namespace compiler | 225 } // namespace compiler |
| 221 } // namespace internal | 226 } // namespace internal |
| 222 } // namespace v8 | 227 } // namespace v8 |
| 223 | 228 |
| 224 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ | 229 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ |
| OLD | NEW |