Reviewers: mvstanton,

Message:
PTAL

Description:
Only use the non-strict-arguments-stub if the store site is non-strict.

BUG=349874
LOG=N

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

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

Affected files (+8, -7 lines):
  M src/ic.cc
  A + test/mjsunit/regress-keyed-store-non-strict-arguments.js


Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index 2607bb3b68d53405be03865fe60538dea4e8b9e0..b780ea8f5dd98ae6dde436279547207351f05fcb 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1688,7 +1688,8 @@ MaybeObject* KeyedStoreIC::Store(Handle<Object> object,
         Handle<JSObject> receiver = Handle<JSObject>::cast(object);
         bool key_is_smi_like = key->IsSmi() || !key->ToSmi()->IsFailure();
         if (receiver->elements()->map() ==
-            isolate()->heap()->non_strict_arguments_elements_map()) {
+                isolate()->heap()->non_strict_arguments_elements_map() &&
+            strict_mode() == kNonStrictMode) {
           stub = non_strict_arguments_stub();
         } else if (key_is_smi_like &&
!(target().is_identical_to(non_strict_arguments_stub()))) {
Index: test/mjsunit/regress-keyed-store-non-strict-arguments.js
diff --git a/test/mjsunit/regress/regress-347912.js b/test/mjsunit/regress-keyed-store-non-strict-arguments.js
similarity index 58%
copy from test/mjsunit/regress/regress-347912.js
copy to test/mjsunit/regress-keyed-store-non-strict-arguments.js
index b609e36c3d4981219abcd1c244ab46f849b2863b..5b6096ace8661e53a60463b8fb2f74b225ca91d3 100644
--- a/test/mjsunit/regress/regress-347912.js
+++ b/test/mjsunit/regress-keyed-store-non-strict-arguments.js
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

-// Flags: --allow-natives-syntax
-
-var __v_4 = {};
-__v_2 = {};
-__v_2[1024] = 0;
-%DebugPrint(__v_4);
+function args(arg) { return arguments; }
+var a = args(false);
+(function () {
+  "use strict";
+  a["const" + 0] = 0;
+})();


--
--
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/groups/opt_out.

Reply via email to