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

Unified Diff: src/compiler/raw-machine-assembler.h

Issue 2122853002: Implement UnaligedLoad and UnaligedStore turbofan operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nits. Fixes some errors Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ppc/instruction-selector-ppc.cc ('k') | src/compiler/raw-machine-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/raw-machine-assembler.h
diff --git a/src/compiler/raw-machine-assembler.h b/src/compiler/raw-machine-assembler.h
index 1f27a9ab00f2e30cfedb1d66b3d2efd89fb14798..62b31ccb553ae16e2ecce46bf1cd17a8c60b3f05 100644
--- a/src/compiler/raw-machine-assembler.h
+++ b/src/compiler/raw-machine-assembler.h
@@ -40,7 +40,10 @@ class RawMachineAssembler {
Isolate* isolate, Graph* graph, CallDescriptor* call_descriptor,
MachineRepresentation word = MachineType::PointerRepresentation(),
MachineOperatorBuilder::Flags flags =
- MachineOperatorBuilder::Flag::kNoFlags);
+ MachineOperatorBuilder::Flag::kNoFlags,
+ MachineOperatorBuilder::AlignmentRequirements alignment_requirements =
+ MachineOperatorBuilder::AlignmentRequirements::
+ FullUnalignedAccessSupport());
~RawMachineAssembler() {}
Isolate* isolate() const { return isolate_; }
@@ -133,6 +136,34 @@ class RawMachineAssembler {
base, index, value);
}
+ // Unaligned memory operations
+ Node* UnalignedLoad(MachineType rep, Node* base) {
+ return UnalignedLoad(rep, base, IntPtrConstant(0));
+ }
+ Node* UnalignedLoad(MachineType rep, Node* base, Node* index) {
+ if (machine()->UnalignedLoadSupported(rep, 1)) {
+ return AddNode(machine()->Load(rep), base, index);
+ } else {
+ return AddNode(machine()->UnalignedLoad(rep), base, index);
+ }
+ }
+ Node* UnalignedStore(MachineRepresentation rep, Node* base, Node* value) {
+ return UnalignedStore(rep, base, IntPtrConstant(0), value);
+ }
+ Node* UnalignedStore(MachineRepresentation rep, Node* base, Node* index,
+ Node* value) {
+ MachineType t = MachineType::TypeForRepresentation(rep);
+ if (machine()->UnalignedStoreSupported(t, 1)) {
+ return AddNode(machine()->Store(StoreRepresentation(
+ rep, WriteBarrierKind::kNoWriteBarrier)),
+ base, index, value);
+ } else {
+ return AddNode(
+ machine()->UnalignedStore(UnalignedStoreRepresentation(rep)), base,
+ index, value);
+ }
+ }
+
// Atomic memory operations.
Node* AtomicLoad(MachineType rep, Node* base, Node* index) {
return AddNode(machine()->AtomicLoad(rep), base, index);
@@ -647,6 +678,14 @@ class RawMachineAssembler {
Node* StoreToPointer(void* address, MachineRepresentation rep, Node* node) {
return Store(rep, PointerConstant(address), node, kNoWriteBarrier);
}
+ Node* UnalignedLoadFromPointer(void* address, MachineType rep,
+ int32_t offset = 0) {
+ return UnalignedLoad(rep, PointerConstant(address), Int32Constant(offset));
+ }
+ Node* UnalignedStoreToPointer(void* address, MachineRepresentation rep,
+ Node* node) {
+ return UnalignedStore(rep, PointerConstant(address), node);
+ }
Node* StringConstant(const char* string) {
return HeapConstant(isolate()->factory()->InternalizeUtf8String(string));
}
« no previous file with comments | « src/compiler/ppc/instruction-selector-ppc.cc ('k') | src/compiler/raw-machine-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698