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

Unified Diff: src/ic/ic.cc

Issue 1232823002: Fix keyed stores to strings convertible to indices (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/harmony/proxies.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index 4006f296a10b5503e708c0151866aba8d8756a7b..7d572ee4819263c6368c0e83c458aa6d072c7e46 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -1545,22 +1545,6 @@ MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name,
return TypeError(MessageTemplate::kNonObjectPropertyStore, object, name);
}
- // Check if the given name is an array index.
- uint32_t index;
- if (name->AsArrayIndex(&index)) {
- // Ignore other stores where the receiver is not a JSObject.
- // TODO(1475): Must check prototype chains of object wrappers.
- if (!object->IsJSObject()) return value;
- Handle<JSObject> receiver = Handle<JSObject>::cast(object);
-
- Handle<Object> result;
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate(), result,
- Object::SetElement(isolate(), receiver, index, value, language_mode()),
- Object);
- return value;
- }
-
// Observed objects are always modified through the runtime.
if (object->IsHeapObject() &&
Handle<HeapObject>::cast(object)->map()->is_observed()) {
@@ -2116,7 +2100,10 @@ MaybeHandle<Object> KeyedStoreIC::Store(Handle<Object> object,
Handle<Object> store_handle;
Handle<Code> stub = megamorphic_stub();
- if (key->IsInternalizedString() || key->IsSymbol()) {
+ uint32_t index;
+ if ((key->IsInternalizedString() &&
+ !String::cast(*key)->AsArrayIndex(&index)) ||
+ key->IsSymbol()) {
ASSIGN_RETURN_ON_EXCEPTION(
isolate(), store_handle,
StoreIC::Store(object, Handle<Name>::cast(key), value,
@@ -2156,8 +2143,6 @@ MaybeHandle<Object> KeyedStoreIC::Store(Handle<Object> object,
}
if (use_ic) {
- DCHECK(!object->IsAccessCheckNeeded());
-
if (object->IsJSObject()) {
Handle<JSObject> receiver = Handle<JSObject>::cast(object);
bool key_is_smi_like = !Object::ToSmi(isolate(), key).is_null();
« no previous file with comments | « no previous file | test/mjsunit/harmony/proxies.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698