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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 Node* Int64Constant(int64_t value); | 128 Node* Int64Constant(int64_t value); |
129 Node* Float32Constant(float value); | 129 Node* Float32Constant(float value); |
130 Node* Float64Constant(double value); | 130 Node* Float64Constant(double value); |
131 Node* HeapConstant(Handle<HeapObject> value); | 131 Node* HeapConstant(Handle<HeapObject> value); |
132 Node* Binop(wasm::WasmOpcode opcode, Node* left, Node* right, | 132 Node* Binop(wasm::WasmOpcode opcode, Node* left, Node* right, |
133 wasm::WasmCodePosition position = wasm::kNoCodePosition); | 133 wasm::WasmCodePosition position = wasm::kNoCodePosition); |
134 Node* Unop(wasm::WasmOpcode opcode, Node* input, | 134 Node* Unop(wasm::WasmOpcode opcode, Node* input, |
135 wasm::WasmCodePosition position = wasm::kNoCodePosition); | 135 wasm::WasmCodePosition position = wasm::kNoCodePosition); |
136 Node* GrowMemory(Node* input); | 136 Node* GrowMemory(Node* input); |
137 Node* Throw(Node* input); | 137 Node* Throw(Node* input); |
| 138 Node* Catch(Node* input, wasm::WasmCodePosition position); |
| 139 Node* IfSuccess(Node* input); |
| 140 Node* IfException(Node* input); |
138 unsigned InputCount(Node* node); | 141 unsigned InputCount(Node* node); |
139 bool IsPhiWithMerge(Node* phi, Node* merge); | 142 bool IsPhiWithMerge(Node* phi, Node* merge); |
| 143 bool DoesNotThrow(Node* node); |
140 void AppendToMerge(Node* merge, Node* from); | 144 void AppendToMerge(Node* merge, Node* from); |
141 void AppendToPhi(Node* phi, Node* from); | 145 void AppendToPhi(Node* phi, Node* from); |
142 | 146 |
143 void StackCheck(wasm::WasmCodePosition position); | 147 void StackCheck(wasm::WasmCodePosition position); |
144 | 148 |
145 //----------------------------------------------------------------------- | 149 //----------------------------------------------------------------------- |
146 // Operations that read and/or write {control} and {effect}. | 150 // Operations that read and/or write {control} and {effect}. |
147 //----------------------------------------------------------------------- | 151 //----------------------------------------------------------------------- |
148 Node* Branch(Node* cond, Node** true_node, Node** false_node); | 152 Node* Branch(Node* cond, Node** true_node, Node** false_node); |
149 Node* Switch(unsigned count, Node* key); | 153 Node* Switch(unsigned count, Node* key); |
150 Node* IfValue(int32_t value, Node* sw); | 154 Node* IfValue(int32_t value, Node* sw); |
151 Node* IfDefault(Node* sw); | 155 Node* IfDefault(Node* sw); |
152 Node* Return(unsigned count, Node** vals); | 156 Node* Return(unsigned count, Node** vals); |
153 Node* ReturnVoid(); | 157 Node* ReturnVoid(); |
154 Node* Unreachable(wasm::WasmCodePosition position); | 158 Node* Unreachable(wasm::WasmCodePosition position); |
155 | 159 |
156 Node** CallDirect(uint32_t index, Node** args, | 160 Node* CallDirect(uint32_t index, Node** args, Node*** rets, |
157 wasm::WasmCodePosition position); | 161 wasm::WasmCodePosition position); |
158 Node** CallIndirect(uint32_t index, Node** args, | 162 Node* CallIndirect(uint32_t index, Node** args, Node*** rets, |
159 wasm::WasmCodePosition position); | 163 wasm::WasmCodePosition position); |
160 | 164 |
161 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); | 165 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); |
162 void BuildWasmToJSWrapper(Handle<JSReceiver> target, wasm::FunctionSig* sig); | 166 void BuildWasmToJSWrapper(Handle<JSReceiver> target, wasm::FunctionSig* sig); |
163 | 167 |
164 Node* ToJS(Node* node, wasm::LocalType type); | 168 Node* ToJS(Node* node, wasm::LocalType type); |
165 Node* FromJS(Node* node, Node* context, wasm::LocalType type); | 169 Node* FromJS(Node* node, Node* context, wasm::LocalType type); |
166 Node* Invert(Node* node); | 170 Node* Invert(Node* node); |
167 Node* FunctionTable(uint32_t index); | 171 Node* FunctionTable(uint32_t index); |
168 | 172 |
169 //----------------------------------------------------------------------- | 173 //----------------------------------------------------------------------- |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset, | 237 void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset, |
234 wasm::WasmCodePosition position); | 238 wasm::WasmCodePosition position); |
235 | 239 |
236 Node* BuildChangeEndianness(Node* node, MachineType type, | 240 Node* BuildChangeEndianness(Node* node, MachineType type, |
237 wasm::LocalType wasmtype = wasm::kAstStmt); | 241 wasm::LocalType wasmtype = wasm::kAstStmt); |
238 | 242 |
239 Node* MaskShiftCount32(Node* node); | 243 Node* MaskShiftCount32(Node* node); |
240 Node* MaskShiftCount64(Node* node); | 244 Node* MaskShiftCount64(Node* node); |
241 | 245 |
242 Node* BuildCCall(MachineSignature* sig, Node** args); | 246 Node* BuildCCall(MachineSignature* sig, Node** args); |
243 Node** BuildWasmCall(wasm::FunctionSig* sig, Node** args, | 247 Node* BuildWasmCall(wasm::FunctionSig* sig, Node** args, Node*** rets, |
244 wasm::WasmCodePosition position); | 248 wasm::WasmCodePosition position); |
245 | 249 |
246 Node* BuildF32CopySign(Node* left, Node* right); | 250 Node* BuildF32CopySign(Node* left, Node* right); |
247 Node* BuildF64CopySign(Node* left, Node* right); | 251 Node* BuildF64CopySign(Node* left, Node* right); |
248 Node* BuildI32SConvertF32(Node* input, wasm::WasmCodePosition position); | 252 Node* BuildI32SConvertF32(Node* input, wasm::WasmCodePosition position); |
249 Node* BuildI32SConvertF64(Node* input, wasm::WasmCodePosition position); | 253 Node* BuildI32SConvertF64(Node* input, wasm::WasmCodePosition position); |
250 Node* BuildI32UConvertF32(Node* input, wasm::WasmCodePosition position); | 254 Node* BuildI32UConvertF32(Node* input, wasm::WasmCodePosition position); |
251 Node* BuildI32UConvertF64(Node* input, wasm::WasmCodePosition position); | 255 Node* BuildI32UConvertF64(Node* input, wasm::WasmCodePosition position); |
252 Node* BuildI32Ctz(Node* input); | 256 Node* BuildI32Ctz(Node* input); |
253 Node* BuildI32Popcnt(Node* input); | 257 Node* BuildI32Popcnt(Node* input); |
254 Node* BuildI64Ctz(Node* input); | 258 Node* BuildI64Ctz(Node* input); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 } | 346 } |
343 | 347 |
344 int AddParameterNodes(Node** args, int pos, int param_count, | 348 int AddParameterNodes(Node** args, int pos, int param_count, |
345 wasm::FunctionSig* sig); | 349 wasm::FunctionSig* sig); |
346 }; | 350 }; |
347 } // namespace compiler | 351 } // namespace compiler |
348 } // namespace internal | 352 } // namespace internal |
349 } // namespace v8 | 353 } // namespace v8 |
350 | 354 |
351 #endif // V8_COMPILER_WASM_COMPILER_H_ | 355 #endif // V8_COMPILER_WASM_COMPILER_H_ |
OLD | NEW |