Index: src/ic.cc |
diff --git a/src/ic.cc b/src/ic.cc |
index d6eec9d4e023b49861fdd77673d9542a88bc957d..0c6fb42b5bfd4e52484ccde875869c1b3793aab9 100644 |
--- a/src/ic.cc |
+++ b/src/ic.cc |
@@ -988,14 +988,25 @@ void LoadIC::UpdateCaches(LookupResult* lookup, |
} |
break; |
case CALLBACKS: { |
- Handle<Object> callback_object(lookup->GetCallbackObject()); |
- if (!callback_object->IsAccessorInfo()) return; |
- Handle<AccessorInfo> callback = |
- Handle<AccessorInfo>::cast(callback_object); |
- if (v8::ToCData<Address>(callback->getter()) == 0) return; |
- if (!callback->IsCompatibleReceiver(*receiver)) return; |
- code = isolate()->stub_cache()->ComputeLoadCallback( |
- name, receiver, holder, callback); |
+ Handle<Object> callback(lookup->GetCallbackObject()); |
+ if (callback->IsAccessorInfo()) { |
+ Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback); |
+ if (v8::ToCData<Address>(info->getter()) == 0) return; |
+ if (!info->IsCompatibleReceiver(*receiver)) return; |
+ code = isolate()->stub_cache()->ComputeLoadCallback( |
+ name, receiver, holder, info); |
+ } else if (callback->IsAccessorPair()) { |
+ Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter()); |
+ if (!getter->IsJSFunction()) return; |
+ if (holder->IsGlobalObject()) return; |
+ if (!receiver->HasFastProperties()) return; |
+ code = isolate()->stub_cache()->ComputeLoadViaGetter( |
+ name, receiver, holder, Handle<JSFunction>::cast(getter)); |
+ } else { |
+ ASSERT(callback->IsForeign()); |
+ // No IC support for old-style native accessors. |
+ return; |
+ } |
break; |
} |
case INTERCEPTOR: |