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

Unified Diff: src/crankshaft/hydrogen-instructions.cc

Issue 2449353002: [crankshaft] Refactor kAllowUndefinedAsNaN to kTruncatingToNumber. (Closed)
Patch Set: Created 4 years, 2 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/crankshaft/hydrogen-instructions.h ('k') | src/crankshaft/hydrogen-mark-deoptimize.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen-instructions.cc
diff --git a/src/crankshaft/hydrogen-instructions.cc b/src/crankshaft/hydrogen-instructions.cc
index 435ea8cecf0e6c56ccc0e31d1da0490f3b74adf8..7273788bc734e8f4c54f91ed86da3bfa6836d244 100644
--- a/src/crankshaft/hydrogen-instructions.cc
+++ b/src/crankshaft/hydrogen-instructions.cc
@@ -1478,8 +1478,8 @@ std::ostream& HChange::PrintDataTo(std::ostream& os) const { // NOLINT
if (CanTruncateToSmi()) os << " truncating-smi";
if (CanTruncateToInt32()) os << " truncating-int32";
+ if (CanTruncateToNumber()) os << " truncating-number";
if (CheckFlag(kBailoutOnMinusZero)) os << " -0?";
- if (CheckFlag(kAllowUndefinedAsNaN)) os << " allow-undefined-as-nan";
return os;
}
@@ -1490,8 +1490,8 @@ HValue* HUnaryMathOperation::Canonicalize() {
if (val->IsChange()) val = HChange::cast(val)->value();
if (val->representation().IsSmiOrInteger32()) {
if (val->representation().Equals(representation())) return val;
- return Prepend(new(block()->zone()) HChange(
- val, representation(), false, false));
+ return Prepend(new (block()->zone())
+ HChange(val, representation(), false, false, true));
}
}
if (op() == kMathFloor && representation().IsSmiOrInteger32() &&
@@ -1506,8 +1506,8 @@ HValue* HUnaryMathOperation::Canonicalize() {
// A change from an integer32 can be replaced by the integer32 value.
left = HChange::cast(left)->value();
} else if (hdiv->observed_input_representation(1).IsSmiOrInteger32()) {
- left = Prepend(new(block()->zone()) HChange(
- left, Representation::Integer32(), false, false));
+ left = Prepend(new (block()->zone()) HChange(
+ left, Representation::Integer32(), false, false, true));
} else {
return this;
}
@@ -1525,8 +1525,8 @@ HValue* HUnaryMathOperation::Canonicalize() {
// A change from an integer32 can be replaced by the integer32 value.
right = HChange::cast(right)->value();
} else if (hdiv->observed_input_representation(2).IsSmiOrInteger32()) {
- right = Prepend(new(block()->zone()) HChange(
- right, Representation::Integer32(), false, false));
+ right = Prepend(new (block()->zone()) HChange(
+ right, Representation::Integer32(), false, false, true));
} else {
return this;
}
@@ -2866,7 +2866,7 @@ void HCompareNumericAndBranch::InferRepresentation(
// comparisons must cause a deopt when one of their arguments is undefined.
// See also v8:1434
if (Token::IsOrderedRelationalCompareOp(token_)) {
- SetFlag(kAllowUndefinedAsNaN);
+ SetFlag(kTruncatingToNumber);
}
}
ChangeRepresentation(rep);
@@ -2965,7 +2965,7 @@ bool HLoadKeyed::UsesMustHandleHole() const {
bool HLoadKeyed::AllUsesCanTreatHoleAsNaN() const {
return IsFastDoubleElementsKind(elements_kind()) &&
- CheckUsesForFlag(HValue::kAllowUndefinedAsNaN);
+ CheckUsesForFlag(HValue::kTruncatingToNumber);
}
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | src/crankshaft/hydrogen-mark-deoptimize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698