Reviewers: danno, danno-g,

Message:
Committed patchset #1 manually as r20912 (presubmit successful).

Description:
Fix the Array.push simulate for non-effect context.

[email protected], [email protected]
BUG=

Committed: https://code.google.com/p/v8/source/detail?r=20912

Please review this at https://codereview.chromium.org/246543007/

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

Affected files (+6, -3 lines):
  M src/hydrogen.cc
  A + test/mjsunit/array-push11.js


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 95e190ed1c3711035843abe52ba5d4b59ef7b062..331aac8f5fa3306415572f51b78b81198367fc17 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7830,7 +7830,10 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
                                                elements_kind, STORE,
                                                NEVER_RETURN_HOLE,
STORE_AND_GROW_NO_TRANSITION);
+
+        if (!ast_context()->IsEffect()) Push(new_size);
         Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE);
+        if (!ast_context()->IsEffect()) Drop(1);
       }

       ast_context()->ReturnValue(new_size);
Index: test/mjsunit/array-push11.js
diff --git a/test/mjsunit/array-push10.js b/test/mjsunit/array-push11.js
similarity index 83%
copy from test/mjsunit/array-push10.js
copy to test/mjsunit/array-push11.js
index 223186e0ec986436e9d5bee993633421784e1101..118161a98ba5c1730438f97f1f5df5941fff47f2 100644
--- a/test/mjsunit/array-push10.js
+++ b/test/mjsunit/array-push11.js
@@ -4,12 +4,12 @@

 function __f_17(__v_9) {
  var __v_10 = 0;
- var count = 10000;
+ var count = 100000;
  while (count-- != 0) {
-   __v_9.push(0);
+   var l = __v_9.push(0);
    if (++__v_10 >= 2) return __v_9;
    __v_10 = {};
  }
 }

-__v_14 = __f_17([]);
+__f_17([]);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to