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

Unified Diff: src/ic/ic.cc

Issue 685123007: Restore special interceptor stub for keyed loads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « src/ic/ic.h ('k') | src/ic/ic-compiler.cc » ('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 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);
}
}
« no previous file with comments | « src/ic/ic.h ('k') | src/ic/ic-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698