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

Unified Diff: src/hydrogen.cc

Issue 10919214: Fix array index dehoisting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 | no next file » | 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 75344bb513a0d13365ba32bff60330cd2a521301..66e69dc46bf3e102e4dd55e8f3dbbb15b7ee007b 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3748,6 +3748,8 @@ static void DehoistArrayIndex(ArrayInstructionInterface* array_operation) {
HValue* subexpression;
int32_t sign;
if (index->IsAdd()) {
+ if (!index->representation().IsInteger32())
+ return;
Jakob Kummerow 2012/09/11 13:16:24 {} please (or put it all on one line). Again below
sign = 1;
HAdd* add = HAdd::cast(index);
if (add->left()->IsConstant()) {
@@ -3760,6 +3762,8 @@ static void DehoistArrayIndex(ArrayInstructionInterface* array_operation) {
return;
}
} else if (index->IsSub()) {
+ if (!index->representation().IsInteger32())
+ return;
sign = -1;
HSub* sub = HSub::cast(index);
if (sub->left()->IsConstant()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698