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

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

Issue 1409353005: [Crankshaft] Don't do HMathFloorOfDiv optimization for kUint32 values (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « no previous file | test/mjsunit/regress/regress-4507.js » ('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 95fde48edbda56f4f223545267f2b89f5d624e23..91deb9c2330a9d72c9a11e17c0e791175af96dfa 100644
--- a/src/crankshaft/hydrogen-instructions.cc
+++ b/src/crankshaft/hydrogen-instructions.cc
@@ -1581,9 +1581,10 @@ HValue* HUnaryMathOperation::Canonicalize() {
HDiv* hdiv = HDiv::cast(value());
HValue* left = hdiv->left();
- if (left->representation().IsInteger32()) {
+ if (left->representation().IsInteger32() && !left->CheckFlag(kUint32)) {
// A value with an integer representation does not need to be transformed.
- } else if (left->IsChange() && HChange::cast(left)->from().IsInteger32()) {
+ } else if (left->IsChange() && HChange::cast(left)->from().IsInteger32() &&
+ !HChange::cast(left)->value()->CheckFlag(kUint32)) {
// 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()) {
@@ -1597,10 +1598,12 @@ HValue* HUnaryMathOperation::Canonicalize() {
if (right->IsInteger32Constant()) {
right = Prepend(HConstant::cast(right)->CopyToRepresentation(
Representation::Integer32(), right->block()->zone()));
- } else if (right->representation().IsInteger32()) {
+ } else if (right->representation().IsInteger32() &&
+ !right->CheckFlag(kUint32)) {
// A value with an integer representation does not need to be transformed.
} else if (right->IsChange() &&
- HChange::cast(right)->from().IsInteger32()) {
+ HChange::cast(right)->from().IsInteger32() &&
+ !HChange::cast(right)->value()->CheckFlag(kUint32)) {
// 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()) {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-4507.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698