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

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

Issue 2222983002: [turbofan] Also consume number type feedback for abstract equality. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/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 e91ff0c13b3f32f01dea6595d7a9a09b049b4a0d..d72fc827591350c7b4283b89ee861cb23bb340d8 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -93,6 +93,8 @@ UseInfo CheckedUseInfoAsWord32FromHint(NumberOperationHint hint) {
return UseInfo::CheckedSignedSmallAsWord32();
case NumberOperationHint::kSigned32:
return UseInfo::CheckedSigned32AsWord32();
+ case NumberOperationHint::kNumber:
+ return UseInfo::CheckedNumberAsWord32();
case NumberOperationHint::kNumberOrOddball:
return UseInfo::CheckedNumberOrOddballAsWord32();
}
@@ -100,6 +102,22 @@ UseInfo CheckedUseInfoAsWord32FromHint(NumberOperationHint hint) {
return UseInfo::None();
}
+UseInfo CheckedUseInfoAsFloat64FromHint(NumberOperationHint hint) {
+ switch (hint) {
+ case NumberOperationHint::kSignedSmall:
+ case NumberOperationHint::kSigned32:
+ // Not used currently.
+ UNREACHABLE();
+ break;
+ case NumberOperationHint::kNumber:
+ return UseInfo::CheckedNumberAsFloat64();
+ case NumberOperationHint::kNumberOrOddball:
+ return UseInfo::CheckedNumberOrOddballAsFloat64();
+ }
+ UNREACHABLE();
+ return UseInfo::None();
+}
+
UseInfo TruncatingUseInfoFromRepresentation(MachineRepresentation rep) {
switch (rep) {
case MachineRepresentation::kTagged:
@@ -1347,18 +1365,21 @@ class RepresentationSelector {
}
// Try to use type feedback.
NumberOperationHint hint = NumberOperationHintOf(node->op());
-
- if (hint == NumberOperationHint::kSignedSmall) {
- VisitBinop(node, UseInfo::CheckedSigned32AsWord32(),
- MachineRepresentation::kBit);
- if (lower()) ChangeToPureOp(node, Int32Op(node));
- return;
+ switch (hint) {
+ case NumberOperationHint::kSignedSmall:
+ case NumberOperationHint::kSigned32:
+ VisitBinop(node, CheckedUseInfoAsWord32FromHint(hint),
+ MachineRepresentation::kBit);
+ if (lower()) ChangeToPureOp(node, Int32Op(node));
+ return;
+ case NumberOperationHint::kNumber:
+ case NumberOperationHint::kNumberOrOddball:
+ VisitBinop(node, CheckedUseInfoAsFloat64FromHint(hint),
+ MachineRepresentation::kBit);
+ if (lower()) ChangeToPureOp(node, Float64Op(node));
+ return;
}
- DCHECK_EQ(NumberOperationHint::kNumberOrOddball, hint);
- // default case => Float64 comparison
- VisitBinop(node, UseInfo::CheckedNumberOrOddballAsFloat64(),
- MachineRepresentation::kBit);
- if (lower()) ChangeToPureOp(node, Float64Op(node));
+ UNREACHABLE();
return;
}
« 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