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

Unified Diff: src/hydrogen-instructions.cc

Issue 61893018: Tweak minus zero detect of HChange (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: rebase Created 7 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 | « no previous file | test/mjsunit/compiler/minus-zero.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 39d59582beec3d1ba57cad734dc5713e5bdda976..ba8a702b3b9a4ece262defbcc47a330c6beefb7d 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -1589,9 +1589,16 @@ Range* HChange::InferRange(Zone* zone) {
Range* result = (input_range != NULL)
? input_range->Copy(zone)
: HValue::InferRange(zone);
- result->set_can_be_minus_zero(!to().IsSmiOrInteger32() ||
- !(CheckFlag(kAllUsesTruncatingToInt32) ||
- CheckFlag(kAllUsesTruncatingToSmi)));
+
+ if (from().IsSmiOrInteger32() ||
+ (from().IsTagged() && to().IsSmi())) {
+ // Smi/Integer32 can not be minus zero. TaggedToSmi will deopt for non-SMI.
+ result->set_can_be_minus_zero(false);
+ } else {
+ result->set_can_be_minus_zero(!to().IsSmiOrInteger32() ||
+ !(CheckFlag(kAllUsesTruncatingToInt32) ||
+ CheckFlag(kAllUsesTruncatingToSmi)));
+ }
if (to().IsSmi()) result->ClampToSmi();
return result;
}
« no previous file with comments | « no previous file | test/mjsunit/compiler/minus-zero.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698