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

Unified Diff: src/ic.cc

Issue 19115002: Don't use StoreIC_ArrayLength on frozen arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | test/mjsunit/regress/regress-2711.js » ('j') | test/mjsunit/regress/regress-2711.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index a15863e1415955cb2824093df138acaf43e1cca2..f84b3b9248eae2b7061ef2f181ab24214cc9426f 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1662,12 +1662,14 @@ MaybeObject* StoreIC::Store(State state,
// Use specialized code for setting the length of arrays with fast
// properties. Slow properties might indicate redefinition of the length
- // property.
+ // property. Note that when redefined using Object.freeze, it's possible
+ // to have fast properties but a read-only length.
if (FLAG_use_ic &&
receiver->IsJSArray() &&
name->Equals(isolate()->heap()->length_string()) &&
Handle<JSArray>::cast(receiver)->AllowsSetElementsLength() &&
- receiver->HasFastProperties()) {
+ receiver->HasFastProperties() &&
+ !receiver->map()->is_frozen()) {
Mark Miller 2013/07/12 20:56:57 The issue also arises if the .length property is n
adamk 2013/07/12 21:00:09 See the comment above, and my note in the CL descr
Mark Miller 2013/07/12 21:08:02 Gotcha. Thanks for the clarification. Does that m
Mark Miller 2013/07/12 21:09:39 I meant "...may *now* go to beta with..."
adamk 2013/07/12 21:14:28 Replacing .push won't even help you; the underlyin
Handle<Code> stub =
StoreArrayLengthStub(kind(), strict_mode).GetCode(isolate());
set_target(*stub);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2711.js » ('j') | test/mjsunit/regress/regress-2711.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698