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

Unified Diff: src/compiler/int64-lowering.cc

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/instruction-selector.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/int64-lowering.cc
diff --git a/src/compiler/int64-lowering.cc b/src/compiler/int64-lowering.cc
index 68d37723ef7ee1bd5722d866ce0adca0a64e19cb..320d481c5dde36188fc72685e64450756a8db3ba 100644
--- a/src/compiler/int64-lowering.cc
+++ b/src/compiler/int64-lowering.cc
@@ -132,16 +132,31 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, high_node);
break;
}
- case IrOpcode::kLoad: {
- LoadRepresentation load_rep = LoadRepresentationOf(node->op());
+ case IrOpcode::kLoad:
+ case IrOpcode::kUnalignedLoad: {
+ MachineRepresentation rep;
+ if (node->opcode() == IrOpcode::kLoad) {
+ rep = LoadRepresentationOf(node->op()).representation();
+ } else {
+ DCHECK(node->opcode() == IrOpcode::kUnalignedLoad);
+ rep = UnalignedLoadRepresentationOf(node->op()).representation();
+ }
- if (load_rep.representation() == MachineRepresentation::kWord64) {
+ if (rep == MachineRepresentation::kWord64) {
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
Node* index_low;
Node* index_high;
GetIndexNodes(index, index_low, index_high);
- const Operator* load_op = machine()->Load(MachineType::Int32());
+ const Operator* load_op;
+
+ if (node->opcode() == IrOpcode::kLoad) {
+ load_op = machine()->Load(MachineType::Int32());
+ } else {
+ DCHECK(node->opcode() == IrOpcode::kUnalignedLoad);
+ load_op = machine()->UnalignedLoad(MachineType::Int32());
+ }
+
Node* high_node;
if (node->InputCount() > 2) {
Node* effect_high = node->InputAt(2);
@@ -162,15 +177,21 @@ void Int64Lowering::LowerNode(Node* node) {
}
break;
}
- case IrOpcode::kStore: {
- StoreRepresentation store_rep = StoreRepresentationOf(node->op());
- if (store_rep.representation() == MachineRepresentation::kWord64) {
+ case IrOpcode::kStore:
+ case IrOpcode::kUnalignedStore: {
+ MachineRepresentation rep;
+ if (node->opcode() == IrOpcode::kStore) {
+ rep = StoreRepresentationOf(node->op()).representation();
+ } else {
+ DCHECK(node->opcode() == IrOpcode::kUnalignedStore);
+ rep = UnalignedStoreRepresentationOf(node->op());
+ }
+
+ if (rep == MachineRepresentation::kWord64) {
// We change the original store node to store the low word, and create
// a new store node to store the high word. The effect and control edges
// are copied from the original store to the new store node, the effect
// edge of the original store is redirected to the new store.
- WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind();
-
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
Node* index_low;
@@ -180,8 +201,16 @@ void Int64Lowering::LowerNode(Node* node) {
DCHECK(HasReplacementLow(value));
DCHECK(HasReplacementHigh(value));
- const Operator* store_op = machine()->Store(StoreRepresentation(
- MachineRepresentation::kWord32, write_barrier_kind));
+ const Operator* store_op;
+ if (node->opcode() == IrOpcode::kStore) {
+ WriteBarrierKind write_barrier_kind =
+ StoreRepresentationOf(node->op()).write_barrier_kind();
+ store_op = machine()->Store(StoreRepresentation(
+ MachineRepresentation::kWord32, write_barrier_kind));
+ } else {
+ DCHECK(node->opcode() == IrOpcode::kUnalignedStore);
+ store_op = machine()->UnalignedStore(MachineRepresentation::kWord32);
+ }
Node* high_node;
if (node->InputCount() > 3) {
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698