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