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 // 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/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 Node* Invert(Node* node); | 155 Node* Invert(Node* node); |
156 Node* FunctionTable(); | 156 Node* FunctionTable(); |
157 | 157 |
158 //----------------------------------------------------------------------- | 158 //----------------------------------------------------------------------- |
159 // Operations that concern the linear memory. | 159 // Operations that concern the linear memory. |
160 //----------------------------------------------------------------------- | 160 //----------------------------------------------------------------------- |
161 Node* MemSize(uint32_t offset); | 161 Node* MemSize(uint32_t offset); |
162 Node* LoadGlobal(uint32_t index); | 162 Node* LoadGlobal(uint32_t index); |
163 Node* StoreGlobal(uint32_t index, Node* val); | 163 Node* StoreGlobal(uint32_t index, Node* val); |
164 Node* LoadMem(wasm::LocalType type, MachineType memtype, Node* index, | 164 Node* LoadMem(wasm::LocalType type, MachineType memtype, Node* index, |
165 uint32_t offset, wasm::WasmCodePosition position); | 165 uint32_t offset, uint32_t alignment, |
166 Node* StoreMem(MachineType type, Node* index, uint32_t offset, Node* val, | 166 wasm::WasmCodePosition position); |
| 167 Node* StoreMem(MachineType type, Node* index, uint32_t offset, |
| 168 uint32_t alignment, Node* val, |
167 wasm::WasmCodePosition position); | 169 wasm::WasmCodePosition position); |
168 | 170 |
169 static void PrintDebugName(Node* node); | 171 static void PrintDebugName(Node* node); |
170 | 172 |
171 Node* Control() { return *control_; } | 173 Node* Control() { return *control_; } |
172 Node* Effect() { return *effect_; } | 174 Node* Effect() { return *effect_; } |
173 | 175 |
174 void set_module(wasm::ModuleEnv* module) { this->module_ = module; } | 176 void set_module(wasm::ModuleEnv* module) { this->module_ = module; } |
175 | 177 |
176 void set_control_ptr(Node** control) { this->control_ = control; } | 178 void set_control_ptr(Node** control) { this->control_ = control; } |
(...skipping 30 matching lines...) Expand all Loading... |
207 | 209 |
208 // Internal helper methods. | 210 // Internal helper methods. |
209 JSGraph* jsgraph() { return jsgraph_; } | 211 JSGraph* jsgraph() { return jsgraph_; } |
210 Graph* graph(); | 212 Graph* graph(); |
211 | 213 |
212 Node* String(const char* string); | 214 Node* String(const char* string); |
213 Node* MemBuffer(uint32_t offset); | 215 Node* MemBuffer(uint32_t offset); |
214 void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset, | 216 void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset, |
215 wasm::WasmCodePosition position); | 217 wasm::WasmCodePosition position); |
216 | 218 |
| 219 MachineType GetTypeForUnalignedAccess(uint32_t alignment, |
| 220 bool signExtend = false); |
| 221 |
| 222 Node* GetUnalignedLoadOffsetNode(Node* baseOffset, int numberOfBytes, |
| 223 int stride, int current); |
| 224 |
| 225 Node* BuildUnalignedLoad(wasm::LocalType type, MachineType memtype, |
| 226 Node* index, uint32_t offset, uint32_t alignment); |
| 227 Node* GetUnalignedStoreOffsetNode(Node* baseOffset, int numberOfBytes, |
| 228 int stride, int current); |
| 229 Node* BuildUnalignedStore(MachineType memtype, Node* index, uint32_t offset, |
| 230 uint32_t alignment, Node* val); |
| 231 |
217 Node* MaskShiftCount32(Node* node); | 232 Node* MaskShiftCount32(Node* node); |
218 Node* MaskShiftCount64(Node* node); | 233 Node* MaskShiftCount64(Node* node); |
219 | 234 |
220 Node* BuildCCall(MachineSignature* sig, Node** args); | 235 Node* BuildCCall(MachineSignature* sig, Node** args); |
221 Node* BuildWasmCall(wasm::FunctionSig* sig, Node** args, | 236 Node* BuildWasmCall(wasm::FunctionSig* sig, Node** args, |
222 wasm::WasmCodePosition position); | 237 wasm::WasmCodePosition position); |
223 | 238 |
224 Node* BuildF32Neg(Node* input); | 239 Node* BuildF32Neg(Node* input); |
225 Node* BuildF64Neg(Node* input); | 240 Node* BuildF64Neg(Node* input); |
226 Node* BuildF32CopySign(Node* left, Node* right); | 241 Node* BuildF32CopySign(Node* left, Node* right); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 Node** buf = Buffer(new_count); | 343 Node** buf = Buffer(new_count); |
329 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*)); | 344 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*)); |
330 return buf; | 345 return buf; |
331 } | 346 } |
332 }; | 347 }; |
333 } // namespace compiler | 348 } // namespace compiler |
334 } // namespace internal | 349 } // namespace internal |
335 } // namespace v8 | 350 } // namespace v8 |
336 | 351 |
337 #endif // V8_COMPILER_WASM_COMPILER_H_ | 352 #endif // V8_COMPILER_WASM_COMPILER_H_ |
OLD | NEW |