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" |
| 11 #include "src/base/smart-pointers.h" | 11 #include "src/base/smart-pointers.h" |
| 12 #include "src/builtins.h" | 12 #include "src/builtins.h" |
| 13 #include "src/frames.h" | 13 #include "src/frames.h" |
| 14 #include "src/interpreter/bytecodes.h" | 14 #include "src/interpreter/bytecodes.h" |
| 15 #include "src/runtime/runtime.h" | |
| 15 | 16 |
| 16 namespace v8 { | 17 namespace v8 { |
| 17 namespace internal { | 18 namespace internal { |
| 18 | 19 |
| 19 class CallInterfaceDescriptor; | 20 class CallInterfaceDescriptor; |
| 20 class Isolate; | 21 class Isolate; |
| 21 class Zone; | 22 class Zone; |
| 22 | 23 |
| 23 namespace compiler { | 24 namespace compiler { |
| 24 | 25 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 | 80 |
| 80 // Load the TypeFeedbackVector for the current function. | 81 // Load the TypeFeedbackVector for the current function. |
| 81 Node* LoadTypeFeedbackVector(); | 82 Node* LoadTypeFeedbackVector(); |
| 82 | 83 |
| 83 // Call an IC code stub. | 84 // Call an IC code stub. |
| 84 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1, | 85 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1, |
| 85 Node* arg2, Node* arg3, Node* arg4); | 86 Node* arg2, Node* arg3, Node* arg4); |
| 86 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1, | 87 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1, |
| 87 Node* arg2, Node* arg3, Node* arg4, Node* arg5); | 88 Node* arg2, Node* arg3, Node* arg4, Node* arg5); |
| 88 | 89 |
| 89 // Call JS builtin. | 90 // Call runtime function. |
| 90 Node* CallJSBuiltin(int context_index, Node* receiver); | 91 Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2); |
| 91 Node* CallJSBuiltin(int context_index, Node* receiver, Node* arg1); | |
| 92 | 92 |
| 93 // Returns from the function. | 93 // Returns from the function. |
| 94 void Return(); | 94 void Return(); |
| 95 | 95 |
| 96 // Dispatch to the bytecode. | 96 // Dispatch to the bytecode. |
| 97 void Dispatch(); | 97 void Dispatch(); |
| 98 | 98 |
| 99 protected: | 99 protected: |
| 100 // Close the graph. | 100 // Close the graph. |
| 101 void End(); | 101 void End(); |
| 102 | 102 |
| 103 // Protected helpers (for testing) which delegate to RawMachineAssembler. | 103 // Protected helpers (for testing) which delegate to RawMachineAssembler. |
| 104 CallDescriptor* call_descriptor() const; | 104 CallDescriptor* call_descriptor() const; |
| 105 Graph* graph(); | 105 Graph* graph(); |
| 106 | 106 |
| 107 private: | 107 private: |
| 108 // Returns a raw pointer to start of the register file on the stack. | 108 // Returns a raw pointer to start of the register file on the stack. |
| 109 Node* RegisterFileRawPointer(); | 109 Node* RegisterFileRawPointer(); |
| 110 // Returns a tagged pointer to the current function's BytecodeArray object. | 110 // Returns a tagged pointer to the current function's BytecodeArray object. |
| 111 Node* BytecodeArrayTaggedPointer(); | 111 Node* BytecodeArrayTaggedPointer(); |
| 112 // Returns the offset from the BytecodeArrayPointer of the current bytecode. | 112 // Returns the offset from the BytecodeArrayPointer of the current bytecode. |
| 113 Node* BytecodeOffset(); | 113 Node* BytecodeOffset(); |
| 114 // Returns a raw pointer to first entry in the interpreter dispatch table. | 114 // Returns a raw pointer to first entry in the interpreter dispatch table. |
| 115 Node* DispatchTableRawPointer(); | 115 Node* DispatchTableRawPointer(); |
| 116 // Returns a tagged pointer to the current context. | 116 // Returns a tagged pointer to the current context. |
| 117 Node* ContextTaggedPointer(); | 117 Node* ContextTaggedPointer(); |
| 118 | 118 |
| 119 // Returns an empty frame (used as a placeholder until we can actuall deopt). | |
|
rmcilroy
2015/09/10 10:28:25
We will never be deopting the interpreter bytecode
Benedikt Meurer
2015/09/10 10:31:12
Hm, you're right, the frame state can be empty her
rmcilroy
2015/09/10 10:43:22
If it's safe to do this, then yeah I would be fine
| |
| 120 Node* EmptyFrameState(); | |
| 121 | |
| 119 // Returns the offset of register |index| relative to RegisterFilePointer(). | 122 // Returns the offset of register |index| relative to RegisterFilePointer(). |
| 120 Node* RegisterFrameOffset(Node* index); | 123 Node* RegisterFrameOffset(Node* index); |
| 121 | 124 |
| 122 Node* SmiShiftBitsConstant(); | 125 Node* SmiShiftBitsConstant(); |
| 123 Node* BytecodeOperand(int operand_index); | 126 Node* BytecodeOperand(int operand_index); |
| 124 Node* BytecodeOperandSignExtended(int operand_index); | 127 Node* BytecodeOperandSignExtended(int operand_index); |
| 125 | 128 |
| 126 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node** args); | 129 Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node** args); |
| 127 Node* CallJSBuiltin(int context_index, Node* receiver, Node** js_args, | 130 Node* CallJSBuiltin(int context_index, Node* receiver, Node** js_args, |
| 128 int js_arg_count); | 131 int js_arg_count); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 146 bool code_generated_; | 149 bool code_generated_; |
| 147 | 150 |
| 148 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); | 151 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); |
| 149 }; | 152 }; |
| 150 | 153 |
| 151 } // namespace interpreter | 154 } // namespace interpreter |
| 152 } // namespace internal | 155 } // namespace internal |
| 153 } // namespace v8 | 156 } // namespace v8 |
| 154 | 157 |
| 155 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ | 158 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ |
| OLD | NEW |