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

Unified Diff: src/hydrogen-dehoist.cc

Issue 22314012: Fix Array index dehoisting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix white-space. Created 7 years, 4 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-264203.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-dehoist.cc
diff --git a/src/hydrogen-dehoist.cc b/src/hydrogen-dehoist.cc
index 696d22c608e5b707635b13229cf0046dda4c3e03..67e6718998319d24158e901c2683f145282eb927 100644
--- a/src/hydrogen-dehoist.cc
+++ b/src/hydrogen-dehoist.cc
@@ -38,7 +38,7 @@ static void DehoistArrayIndex(ArrayInstructionInterface* array_operation) {
HConstant* constant;
HValue* subexpression;
HBinaryOperation* binary_operation = HBinaryOperation::cast(index);
- if (binary_operation->left()->IsConstant()) {
+ if (binary_operation->left()->IsConstant() && index->IsAdd()) {
subexpression = binary_operation->right();
constant = HConstant::cast(binary_operation->left());
} else if (binary_operation->right()->IsConstant()) {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-264203.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698