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

Unified Diff: src/hydrogen.cc

Issue 12047015: Fix pattern detection for replacing shifts by rotation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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-2499.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 335a40c65ef21cac7328c5fcff4606d1532cba00..eb72a3d5c10421ea09eee9427344ff29d21d3622 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -8464,6 +8464,7 @@ static bool ShiftAmountsAllowReplaceByRotate(HValue* sa,
HValue* const32_minus_sa) {
if (!const32_minus_sa->IsSub()) return false;
HSub* sub = HSub::cast(const32_minus_sa);
+ if (sa != sub->right()) return false;
HValue* const32 = sub->left();
if (!const32->IsConstant() ||
HConstant::cast(const32)->Integer32Value() != 32) {
@@ -8492,6 +8493,7 @@ bool HOptimizedGraphBuilder::MatchRotateRight(HValue* left,
} else {
return false;
}
+ if (shl->left() != shr->left()) return false;
if (!ShiftAmountsAllowReplaceByRotate(shl->right(), shr->right()) &&
!ShiftAmountsAllowReplaceByRotate(shr->right(), shl->right())) {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2499.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698