From: verwaest@chromium.org Date: Thu, 6 Mar 2014 12:19:06 +0000 (+0000) Subject: Only use the non-strict-arguments-stub if the store site is non-strict. X-Git-Tag: upstream/4.7.83~10481 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd6f3ef0883233100a512c8c6ecbefc6f072ea0d;p=platform%2Fupstream%2Fv8.git Only use the non-strict-arguments-stub if the store site is non-strict. BUG=349874 LOG=N R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/176843018 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19690 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/ic.cc b/src/ic.cc index 2607bb3..3c9f1b6 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -1689,7 +1689,9 @@ MaybeObject* KeyedStoreIC::Store(Handle object, bool key_is_smi_like = key->IsSmi() || !key->ToSmi()->IsFailure(); if (receiver->elements()->map() == isolate()->heap()->non_strict_arguments_elements_map()) { - stub = non_strict_arguments_stub(); + if (strict_mode() == kNonStrictMode) { + stub = non_strict_arguments_stub(); + } } else if (key_is_smi_like && !(target().is_identical_to(non_strict_arguments_stub()))) { // We should go generic if receiver isn't a dictionary, but our diff --git a/test/mjsunit/regress-keyed-store-non-strict-arguments.js b/test/mjsunit/regress-keyed-store-non-strict-arguments.js new file mode 100644 index 0000000..865d600 --- /dev/null +++ b/test/mjsunit/regress-keyed-store-non-strict-arguments.js @@ -0,0 +1,16 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +function args(arg) { return arguments; } +var a = args(false); + +(function () { + "use strict"; + a["const" + 0] = 0; +})(); + +(function () { + "use strict"; + a[0] = 0; +})();