Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Side by Side Diff: src/compiler/wasm-compiler.h

Issue 1928513002: Implement UnalignedLoad and UnalignedStore in WASM using LoadByte/Shift/Or and StoreByte/Shift/And. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix nits. Fix compilation error on Windows compiler Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/s390/instruction-selector-s390.cc ('k') | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « src/compiler/s390/instruction-selector-s390.cc ('k') | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698