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_WASM_COMPILER_H_ | 5 #ifndef V8_COMPILER_WASM_COMPILER_H_ |
6 #define V8_COMPILER_WASM_COMPILER_H_ | 6 #define V8_COMPILER_WASM_COMPILER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 // Clients of this interface shouldn't depend on lots of compiler internals. | 10 // Clients of this interface shouldn't depend on lots of compiler internals. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 cur_bufsize_ = new_size; | 120 cur_bufsize_ = new_size; |
121 } | 121 } |
122 return cur_buffer_; | 122 return cur_buffer_; |
123 } | 123 } |
124 | 124 |
125 //----------------------------------------------------------------------- | 125 //----------------------------------------------------------------------- |
126 // Operations independent of {control} or {effect}. | 126 // Operations independent of {control} or {effect}. |
127 //----------------------------------------------------------------------- | 127 //----------------------------------------------------------------------- |
128 Node* Error(); | 128 Node* Error(); |
129 Node* Start(unsigned params); | 129 Node* Start(unsigned params); |
130 Node* Param(unsigned index, wasm::LocalType type); | 130 Node* Param(unsigned index); |
131 Node* Loop(Node* entry); | 131 Node* Loop(Node* entry); |
132 Node* Terminate(Node* effect, Node* control); | 132 Node* Terminate(Node* effect, Node* control); |
133 Node* Merge(unsigned count, Node** controls); | 133 Node* Merge(unsigned count, Node** controls); |
134 Node* Phi(wasm::LocalType type, unsigned count, Node** vals, Node* control); | 134 Node* Phi(wasm::LocalType type, unsigned count, Node** vals, Node* control); |
135 Node* EffectPhi(unsigned count, Node** effects, Node* control); | 135 Node* EffectPhi(unsigned count, Node** effects, Node* control); |
136 Node* NumberConstant(int32_t value); | 136 Node* NumberConstant(int32_t value); |
137 Node* Uint32Constant(uint32_t value); | 137 Node* Uint32Constant(uint32_t value); |
138 Node* Int32Constant(int32_t value); | 138 Node* Int32Constant(int32_t value); |
139 Node* Int64Constant(int64_t value); | 139 Node* Int64Constant(int64_t value); |
140 Node* Float32Constant(float value); | 140 Node* Float32Constant(float value); |
(...skipping 18 matching lines...) Expand all Loading... |
159 //----------------------------------------------------------------------- | 159 //----------------------------------------------------------------------- |
160 // Operations that read and/or write {control} and {effect}. | 160 // Operations that read and/or write {control} and {effect}. |
161 //----------------------------------------------------------------------- | 161 //----------------------------------------------------------------------- |
162 Node* BranchNoHint(Node* cond, Node** true_node, Node** false_node); | 162 Node* BranchNoHint(Node* cond, Node** true_node, Node** false_node); |
163 Node* BranchExpectTrue(Node* cond, Node** true_node, Node** false_node); | 163 Node* BranchExpectTrue(Node* cond, Node** true_node, Node** false_node); |
164 Node* BranchExpectFalse(Node* cond, Node** true_node, Node** false_node); | 164 Node* BranchExpectFalse(Node* cond, Node** true_node, Node** false_node); |
165 | 165 |
166 Node* Switch(unsigned count, Node* key); | 166 Node* Switch(unsigned count, Node* key); |
167 Node* IfValue(int32_t value, Node* sw); | 167 Node* IfValue(int32_t value, Node* sw); |
168 Node* IfDefault(Node* sw); | 168 Node* IfDefault(Node* sw); |
169 Node* Return(unsigned count, Node** vals); | 169 Node* Return(unsigned count, Node** nodes); |
| 170 template <typename... Nodes> |
| 171 Node* Return(Node* fst, Nodes*... more) { |
| 172 Node* arr[] = {fst, more...}; |
| 173 return Return(arraysize(arr), arr); |
| 174 } |
170 Node* ReturnVoid(); | 175 Node* ReturnVoid(); |
171 Node* Unreachable(wasm::WasmCodePosition position); | 176 Node* Unreachable(wasm::WasmCodePosition position); |
172 | 177 |
173 Node* CallDirect(uint32_t index, Node** args, Node*** rets, | 178 Node* CallDirect(uint32_t index, Node** args, Node*** rets, |
174 wasm::WasmCodePosition position); | 179 wasm::WasmCodePosition position); |
175 Node* CallIndirect(uint32_t index, Node** args, Node*** rets, | 180 Node* CallIndirect(uint32_t index, Node** args, Node*** rets, |
176 wasm::WasmCodePosition position); | 181 wasm::WasmCodePosition position); |
177 | 182 |
178 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); | 183 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); |
179 void BuildWasmToJSWrapper(Handle<JSReceiver> target, wasm::FunctionSig* sig); | 184 void BuildWasmToJSWrapper(Handle<JSReceiver> target, wasm::FunctionSig* sig); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 } | 371 } |
367 | 372 |
368 int AddParameterNodes(Node** args, int pos, int param_count, | 373 int AddParameterNodes(Node** args, int pos, int param_count, |
369 wasm::FunctionSig* sig); | 374 wasm::FunctionSig* sig); |
370 }; | 375 }; |
371 } // namespace compiler | 376 } // namespace compiler |
372 } // namespace internal | 377 } // namespace internal |
373 } // namespace v8 | 378 } // namespace v8 |
374 | 379 |
375 #endif // V8_COMPILER_WASM_COMPILER_H_ | 380 #endif // V8_COMPILER_WASM_COMPILER_H_ |
OLD | NEW |