| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); | 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::ValueType 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); |
| 141 Node* Float64Constant(double value); | 141 Node* Float64Constant(double value); |
| 142 Node* HeapConstant(Handle<HeapObject> value); | 142 Node* HeapConstant(Handle<HeapObject> value); |
| 143 Node* Binop(wasm::WasmOpcode opcode, Node* left, Node* right, | 143 Node* Binop(wasm::WasmOpcode opcode, Node* left, Node* right, |
| 144 wasm::WasmCodePosition position = wasm::kNoCodePosition); | 144 wasm::WasmCodePosition position = wasm::kNoCodePosition); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 Node* Unreachable(wasm::WasmCodePosition position); | 176 Node* Unreachable(wasm::WasmCodePosition position); |
| 177 | 177 |
| 178 Node* CallDirect(uint32_t index, Node** args, Node*** rets, | 178 Node* CallDirect(uint32_t index, Node** args, Node*** rets, |
| 179 wasm::WasmCodePosition position); | 179 wasm::WasmCodePosition position); |
| 180 Node* CallIndirect(uint32_t index, Node** args, Node*** rets, | 180 Node* CallIndirect(uint32_t index, Node** args, Node*** rets, |
| 181 wasm::WasmCodePosition position); | 181 wasm::WasmCodePosition position); |
| 182 | 182 |
| 183 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); | 183 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); |
| 184 void BuildWasmToJSWrapper(Handle<JSReceiver> target, wasm::FunctionSig* sig); | 184 void BuildWasmToJSWrapper(Handle<JSReceiver> target, wasm::FunctionSig* sig); |
| 185 | 185 |
| 186 Node* ToJS(Node* node, wasm::LocalType type); | 186 Node* ToJS(Node* node, wasm::ValueType type); |
| 187 Node* FromJS(Node* node, Node* context, wasm::LocalType type); | 187 Node* FromJS(Node* node, Node* context, wasm::ValueType type); |
| 188 Node* Invert(Node* node); | 188 Node* Invert(Node* node); |
| 189 void EnsureFunctionTableNodes(); | 189 void EnsureFunctionTableNodes(); |
| 190 | 190 |
| 191 //----------------------------------------------------------------------- | 191 //----------------------------------------------------------------------- |
| 192 // Operations that concern the linear memory. | 192 // Operations that concern the linear memory. |
| 193 //----------------------------------------------------------------------- | 193 //----------------------------------------------------------------------- |
| 194 Node* CurrentMemoryPages(); | 194 Node* CurrentMemoryPages(); |
| 195 Node* GetGlobal(uint32_t index); | 195 Node* GetGlobal(uint32_t index); |
| 196 Node* SetGlobal(uint32_t index, Node* val); | 196 Node* SetGlobal(uint32_t index, Node* val); |
| 197 Node* LoadMem(wasm::LocalType type, MachineType memtype, Node* index, | 197 Node* LoadMem(wasm::ValueType type, MachineType memtype, Node* index, |
| 198 uint32_t offset, uint32_t alignment, | 198 uint32_t offset, uint32_t alignment, |
| 199 wasm::WasmCodePosition position); | 199 wasm::WasmCodePosition position); |
| 200 Node* StoreMem(MachineType type, Node* index, uint32_t offset, | 200 Node* StoreMem(MachineType type, Node* index, uint32_t offset, |
| 201 uint32_t alignment, Node* val, | 201 uint32_t alignment, Node* val, |
| 202 wasm::WasmCodePosition position); | 202 wasm::WasmCodePosition position); |
| 203 | 203 |
| 204 static void PrintDebugName(Node* node); | 204 static void PrintDebugName(Node* node); |
| 205 | 205 |
| 206 Node* Control() { return *control_; } | 206 Node* Control() { return *control_; } |
| 207 Node* Effect() { return *effect_; } | 207 Node* Effect() { return *effect_; } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 JSGraph* jsgraph() { return jsgraph_; } | 257 JSGraph* jsgraph() { return jsgraph_; } |
| 258 Graph* graph(); | 258 Graph* graph(); |
| 259 | 259 |
| 260 Node* String(const char* string); | 260 Node* String(const char* string); |
| 261 Node* MemSize(uint32_t offset); | 261 Node* MemSize(uint32_t offset); |
| 262 Node* MemBuffer(uint32_t offset); | 262 Node* MemBuffer(uint32_t offset); |
| 263 void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset, | 263 void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset, |
| 264 wasm::WasmCodePosition position); | 264 wasm::WasmCodePosition position); |
| 265 | 265 |
| 266 Node* BuildChangeEndianness(Node* node, MachineType type, | 266 Node* BuildChangeEndianness(Node* node, MachineType type, |
| 267 wasm::LocalType wasmtype = wasm::kAstStmt); | 267 wasm::ValueType wasmtype = wasm::kWasmStmt); |
| 268 | 268 |
| 269 Node* MaskShiftCount32(Node* node); | 269 Node* MaskShiftCount32(Node* node); |
| 270 Node* MaskShiftCount64(Node* node); | 270 Node* MaskShiftCount64(Node* node); |
| 271 | 271 |
| 272 Node* BuildCCall(MachineSignature* sig, Node** args); | 272 Node* BuildCCall(MachineSignature* sig, Node** args); |
| 273 Node* BuildWasmCall(wasm::FunctionSig* sig, Node** args, Node*** rets, | 273 Node* BuildWasmCall(wasm::FunctionSig* sig, Node** args, Node*** rets, |
| 274 wasm::WasmCodePosition position); | 274 wasm::WasmCodePosition position); |
| 275 | 275 |
| 276 Node* BuildF32CopySign(Node* left, Node* right); | 276 Node* BuildF32CopySign(Node* left, Node* right); |
| 277 Node* BuildF64CopySign(Node* left, Node* right); | 277 Node* BuildF64CopySign(Node* left, Node* right); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 } | 371 } |
| 372 | 372 |
| 373 int AddParameterNodes(Node** args, int pos, int param_count, | 373 int AddParameterNodes(Node** args, int pos, int param_count, |
| 374 wasm::FunctionSig* sig); | 374 wasm::FunctionSig* sig); |
| 375 }; | 375 }; |
| 376 } // namespace compiler | 376 } // namespace compiler |
| 377 } // namespace internal | 377 } // namespace internal |
| 378 } // namespace v8 | 378 } // namespace v8 |
| 379 | 379 |
| 380 #endif // V8_COMPILER_WASM_COMPILER_H_ | 380 #endif // V8_COMPILER_WASM_COMPILER_H_ |
| OLD | NEW |