| Index: src/ic/ic.cc
|
| diff --git a/src/ic/ic.cc b/src/ic/ic.cc
|
| index d0c0edb8f7d700c1c4bc7a582024878cd13962aa..8ac5a18dbde98f7ee131f8052b2e40070cdcc934 100644
|
| --- a/src/ic/ic.cc
|
| +++ b/src/ic/ic.cc
|
| @@ -1209,6 +1209,14 @@ static Handle<Object> TryConvertKey(Handle<Object> key, Isolate* isolate) {
|
|
|
|
|
| Handle<Code> KeyedLoadIC::LoadElementStub(Handle<HeapObject> receiver) {
|
| + // Don't handle megamorphic property accesses for INTERCEPTORS or CALLBACKS
|
| + // via megamorphic stubs, since they don't have a map in their relocation info
|
| + // and so the stubs can't be harvested for the object needed for a map check.
|
| + if (target()->type() != Code::NORMAL) {
|
| + TRACE_GENERIC_IC(isolate(), "KeyedIC", "non-NORMAL target type");
|
| + return generic_stub();
|
| + }
|
| +
|
| Handle<Map> receiver_map(receiver->map(), isolate());
|
| MapHandleList target_receiver_maps;
|
| TargetMaps(&target_receiver_maps);
|
| @@ -1277,7 +1285,11 @@ MaybeHandle<Object> KeyedLoadIC::Load(Handle<Object> object,
|
| } else if (FLAG_use_ic && !object->IsAccessCheckNeeded()) {
|
| if (object->IsJSObject() || (object->IsString() && key->IsNumber())) {
|
| Handle<HeapObject> receiver = Handle<HeapObject>::cast(object);
|
| - if (object->IsString() || !Object::ToSmi(isolate(), key).is_null()) {
|
| + if (receiver->IsJSObject() &&
|
| + Handle<JSObject>::cast(receiver)->HasIndexedInterceptor()) {
|
| + stub = indexed_interceptor_stub();
|
| + } else if (object->IsString() ||
|
| + !Object::ToSmi(isolate(), key).is_null()) {
|
| stub = LoadElementStub(receiver);
|
| }
|
| }
|
|
|