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

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

Issue 2149583002: [turbofan] Extend undefined-to-number truncation to all oddballs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/representation-change.cc ('k') | src/compiler/type-hint-analyzer.cc » ('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 c9d592c282aae49ad57806111d54a3db16af8d5f..2dfdf983bbb7ad263d66dcd757b7599836772759 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -1130,7 +1130,7 @@ class RepresentationSelector {
}
// default case => Float64Add/Sub
- VisitBinop(node, UseInfo::CheckedNumberOrUndefinedAsFloat64(),
+ VisitBinop(node, UseInfo::CheckedNumberOrOddballAsFloat64(),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) {
ChangeToPureOp(node, Float64Op(node));
@@ -1283,9 +1283,9 @@ class RepresentationSelector {
if (lower()) ChangeToPureOp(node, Int32Op(node));
return;
}
- DCHECK_EQ(CompareOperationHints::kNumber, hint);
+ DCHECK_EQ(CompareOperationHints::kNumberOrOddball, hint);
// default case => Float64 comparison
- VisitBinop(node, UseInfo::CheckedNumberOrUndefinedAsFloat64(),
+ VisitBinop(node, UseInfo::CheckedNumberOrOddballAsFloat64(),
MachineRepresentation::kBit);
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
@@ -1338,7 +1338,7 @@ class RepresentationSelector {
}
// Checked float64 x float64 => float64
DCHECK_EQ(IrOpcode::kSpeculativeNumberMultiply, node->opcode());
- VisitBinop(node, UseInfo::CheckedNumberOrUndefinedAsFloat64(),
+ VisitBinop(node, UseInfo::CheckedNumberOrOddballAsFloat64(),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
@@ -1409,7 +1409,7 @@ class RepresentationSelector {
}
// default case => Float64Div
- VisitBinop(node, UseInfo::CheckedNumberOrUndefinedAsFloat64(),
+ VisitBinop(node, UseInfo::CheckedNumberOrOddballAsFloat64(),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
@@ -1443,7 +1443,7 @@ class RepresentationSelector {
}
// Checked float64 x float64 => float64
DCHECK_EQ(IrOpcode::kSpeculativeNumberDivide, node->opcode());
- VisitBinop(node, UseInfo::CheckedNumberOrUndefinedAsFloat64(),
+ VisitBinop(node, UseInfo::CheckedNumberOrOddballAsFloat64(),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
@@ -1514,7 +1514,7 @@ class RepresentationSelector {
}
// default case => Float64Mod
- VisitBinop(node, UseInfo::CheckedNumberOrUndefinedAsFloat64(),
+ VisitBinop(node, UseInfo::CheckedNumberOrOddballAsFloat64(),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
@@ -1969,8 +1969,7 @@ class RepresentationSelector {
VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
if (lower()) lowering->DoStringToNumber(node);
} else if (truncation.TruncatesToWord32()) {
- // TODO(jarin): Extend this to Number \/ Oddball
- if (InputIs(node, Type::NumberOrUndefined())) {
+ if (InputIs(node, Type::NumberOrOddball())) {
VisitUnop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
if (lower()) DeferReplacement(node, node->InputAt(0));
@@ -1983,8 +1982,7 @@ class RepresentationSelector {
}
}
} else if (truncation.TruncatesToFloat64()) {
- // TODO(jarin): Extend this to Number \/ Oddball
- if (InputIs(node, Type::NumberOrUndefined())) {
+ if (InputIs(node, Type::NumberOrOddball())) {
VisitUnop(node, UseInfo::TruncatingFloat64(),
MachineRepresentation::kFloat64);
if (lower()) DeferReplacement(node, node->InputAt(0));
« no previous file with comments | « src/compiler/representation-change.cc ('k') | src/compiler/type-hint-analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698