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

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

Issue 2476593002: [turbofan] Improve representation selection for HeapObject checking. (Closed)
Patch Set: REBASE and fix. Created 4 years, 1 month 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/representation-change.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index 9916d952bdda34d823ec8a10106f5fb479987ad1..3430db1b12cf39b923714417c522be2bb87dc73a 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -1353,7 +1353,7 @@ class RepresentationSelector {
case IrOpcode::kNumberConstant:
return VisitLeaf(node, MachineRepresentation::kTagged);
case IrOpcode::kHeapConstant:
- return VisitLeaf(node, MachineRepresentation::kTagged);
+ return VisitLeaf(node, MachineRepresentation::kTaggedPointer);
case IrOpcode::kBranch:
ProcessInput(node, 0, UseInfo::Bool());
@@ -1381,7 +1381,7 @@ class RepresentationSelector {
if (lower()) DeferReplacement(node, node->InputAt(0));
} else {
VisitInputs(node);
- SetOutput(node, MachineRepresentation::kTagged);
+ SetOutput(node, MachineRepresentation::kTaggedPointer);
}
return;
}
@@ -2092,7 +2092,7 @@ class RepresentationSelector {
case IrOpcode::kStringLessThan:
case IrOpcode::kStringLessThanOrEqual: {
return VisitBinop(node, UseInfo::AnyTagged(),
- MachineRepresentation::kTagged);
+ MachineRepresentation::kTaggedPointer);
}
case IrOpcode::kStringCharCodeAt: {
VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
@@ -2101,12 +2101,12 @@ class RepresentationSelector {
}
case IrOpcode::kStringFromCharCode: {
VisitUnop(node, UseInfo::TruncatingWord32(),
- MachineRepresentation::kTagged);
+ MachineRepresentation::kTaggedPointer);
return;
}
case IrOpcode::kStringFromCodePoint: {
VisitUnop(node, UseInfo::TruncatingWord32(),
- MachineRepresentation::kTagged);
+ MachineRepresentation::kTaggedPointer);
return;
}
@@ -2130,11 +2130,13 @@ class RepresentationSelector {
}
case IrOpcode::kCheckHeapObject: {
if (InputCannotBe(node, Type::SignedSmall())) {
- VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
- if (lower()) DeferReplacement(node, node->InputAt(0));
+ VisitUnop(node, UseInfo::AnyTagged(),
+ MachineRepresentation::kTaggedPointer);
} else {
- VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
+ VisitUnop(node, UseInfo::CheckedHeapObjectAsTaggedPointer(),
+ MachineRepresentation::kTaggedPointer);
}
+ if (lower()) DeferReplacement(node, node->InputAt(0));
return;
}
case IrOpcode::kCheckIf: {
@@ -2175,10 +2177,12 @@ class RepresentationSelector {
}
case IrOpcode::kCheckString: {
if (InputIs(node, Type::String())) {
- VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
+ VisitUnop(node, UseInfo::AnyTagged(),
+ MachineRepresentation::kTaggedPointer);
if (lower()) DeferReplacement(node, node->InputAt(0));
} else {
- VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
+ VisitUnop(node, UseInfo::AnyTagged(),
+ MachineRepresentation::kTaggedPointer);
}
return;
}
@@ -2186,7 +2190,7 @@ class RepresentationSelector {
case IrOpcode::kAllocate: {
ProcessInput(node, 0, UseInfo::TruncatingWord32());
ProcessRemainingInputs(node, 1);
- SetOutput(node, MachineRepresentation::kTagged);
+ SetOutput(node, MachineRepresentation::kTaggedPointer);
return;
}
case IrOpcode::kLoadField: {
@@ -2400,7 +2404,8 @@ class RepresentationSelector {
return;
}
case IrOpcode::kCheckTaggedHole: {
- VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
+ VisitUnop(node, UseInfo::AnyTagged(),
+ MachineRepresentation::kTaggedPointer);
return;
}
case IrOpcode::kConvertTaggedHoleToUndefined: {
@@ -2433,14 +2438,14 @@ class RepresentationSelector {
}
case IrOpcode::kEnsureWritableFastElements:
return VisitBinop(node, UseInfo::AnyTagged(),
- MachineRepresentation::kTagged);
+ MachineRepresentation::kTaggedPointer);
case IrOpcode::kMaybeGrowFastElements: {
ProcessInput(node, 0, UseInfo::AnyTagged()); // object
ProcessInput(node, 1, UseInfo::AnyTagged()); // elements
ProcessInput(node, 2, UseInfo::TruncatingWord32()); // index
ProcessInput(node, 3, UseInfo::TruncatingWord32()); // length
ProcessRemainingInputs(node, 4);
- SetOutput(node, MachineRepresentation::kTagged);
+ SetOutput(node, MachineRepresentation::kTaggedPointer);
return;
}
@@ -2465,6 +2470,11 @@ class RepresentationSelector {
case IrOpcode::kOsrGuard:
return VisitOsrGuard(node);
+ case IrOpcode::kFinishRegion:
+ VisitInputs(node);
+ // Assume the output is tagged pointer.
+ return SetOutput(node, MachineRepresentation::kTaggedPointer);
+
case IrOpcode::kReturn:
VisitReturn(node);
// Assume the output is tagged.
@@ -2486,7 +2496,6 @@ class RepresentationSelector {
case IrOpcode::kMerge:
case IrOpcode::kThrow:
case IrOpcode::kBeginRegion:
- case IrOpcode::kFinishRegion:
case IrOpcode::kProjection:
case IrOpcode::kObjectState:
case IrOpcode::kOsrValue:
« no previous file with comments | « src/compiler/representation-change.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698