Reviewers: Jakob,

Description:
Fix array index dehoisting.

BUG=141395
TEST=


Please review this at https://chromiumcodereview.appspot.com/10919214/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/hydrogen.cc


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;
     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()) {


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to