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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 Node* NumberConstant(double value); | 58 Node* NumberConstant(double value); |
59 Node* HeapConstant(Unique<HeapObject> object); | 59 Node* HeapConstant(Unique<HeapObject> object); |
60 | 60 |
61 // Tag and untag Smi values. | 61 // Tag and untag Smi values. |
62 Node* SmiTag(Node* value); | 62 Node* SmiTag(Node* value); |
63 Node* SmiUntag(Node* value); | 63 Node* SmiUntag(Node* value); |
64 | 64 |
65 // Load a field from an object on the heap. | 65 // Load a field from an object on the heap. |
66 Node* LoadObjectField(Node* object, int offset); | 66 Node* LoadObjectField(Node* object, int offset); |
67 | 67 |
| 68 // Load |slot_index| from a context. |
| 69 Node* LoadContextSlot(Node* context, int slot_index); |
| 70 |
68 // Load |slot_index| from the current context. | 71 // Load |slot_index| from the current context. |
69 Node* LoadContextSlot(int slot_index); | 72 Node* LoadContextSlot(int slot_index); |
70 | 73 |
71 // Call JS builtin. | 74 // Call JS builtin. |
72 Node* CallJSBuiltin(Builtins::JavaScript builtin, Node* receiver); | 75 Node* CallJSBuiltin(int context_index, Node* receiver); |
73 Node* CallJSBuiltin(Builtins::JavaScript builtin, Node* receiver, Node* arg1); | 76 Node* CallJSBuiltin(int context_index, Node* receiver, Node* arg1); |
74 | 77 |
75 // Returns from the function. | 78 // Returns from the function. |
76 void Return(); | 79 void Return(); |
77 | 80 |
78 // Dispatch to the bytecode. | 81 // Dispatch to the bytecode. |
79 void Dispatch(); | 82 void Dispatch(); |
80 | 83 |
81 protected: | 84 protected: |
82 // Close the graph. | 85 // Close the graph. |
83 void End(); | 86 void End(); |
(...skipping 14 matching lines...) Expand all Loading... |
98 // Returns a tagged pointer to the current context. | 101 // Returns a tagged pointer to the current context. |
99 Node* ContextTaggedPointer(); | 102 Node* ContextTaggedPointer(); |
100 | 103 |
101 // Returns the offset of register |index| relative to RegisterFilePointer(). | 104 // Returns the offset of register |index| relative to RegisterFilePointer(). |
102 Node* RegisterFrameOffset(Node* index); | 105 Node* RegisterFrameOffset(Node* index); |
103 | 106 |
104 Node* SmiShiftBitsConstant(); | 107 Node* SmiShiftBitsConstant(); |
105 Node* BytecodeOperand(int operand_index); | 108 Node* BytecodeOperand(int operand_index); |
106 Node* BytecodeOperandSignExtended(int operand_index); | 109 Node* BytecodeOperandSignExtended(int operand_index); |
107 | 110 |
108 Node* CallJSBuiltin(Builtins::JavaScript builtin, Node* receiver, | 111 Node* CallJSBuiltin(int context_index, Node* receiver, Node** js_args, |
109 Node** js_args, int js_arg_count); | 112 int js_arg_count); |
110 | 113 |
111 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not | 114 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not |
112 // update BytecodeOffset() itself. | 115 // update BytecodeOffset() itself. |
113 Node* Advance(int delta); | 116 Node* Advance(int delta); |
114 | 117 |
115 // Sets the end node of the graph. | 118 // Sets the end node of the graph. |
116 void SetEndInput(Node* input); | 119 void SetEndInput(Node* input); |
117 | 120 |
118 // Private helpers which delegate to RawMachineAssembler. | 121 // Private helpers which delegate to RawMachineAssembler. |
119 Isolate* isolate(); | 122 Isolate* isolate(); |
120 Schedule* schedule(); | 123 Schedule* schedule(); |
121 Zone* zone(); | 124 Zone* zone(); |
122 | 125 |
123 interpreter::Bytecode bytecode_; | 126 interpreter::Bytecode bytecode_; |
124 base::SmartPointer<RawMachineAssembler> raw_assembler_; | 127 base::SmartPointer<RawMachineAssembler> raw_assembler_; |
125 Node* end_node_; | 128 Node* end_node_; |
126 Node* accumulator_; | 129 Node* accumulator_; |
127 bool code_generated_; | 130 bool code_generated_; |
128 | 131 |
129 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); | 132 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); |
130 }; | 133 }; |
131 | 134 |
132 } // namespace interpreter | 135 } // namespace interpreter |
133 } // namespace internal | 136 } // namespace internal |
134 } // namespace v8 | 137 } // namespace v8 |
135 | 138 |
136 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ | 139 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ |
OLD | NEW |