Chromium Code Reviews| Index: src/ic/handler-compiler.cc |
| diff --git a/src/ic/handler-compiler.cc b/src/ic/handler-compiler.cc |
| index 3af36fac203974c572d55d2a317b8168892037b3..bc80b4372f49ae0e9b8c9bcdecf95720d4550fb8 100644 |
| --- a/src/ic/handler-compiler.cc |
| +++ b/src/ic/handler-compiler.cc |
| @@ -289,13 +289,23 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor( |
| break; |
| case LookupIterator::ACCESSOR: { |
| Handle<Object> accessors = it->GetAccessors(); |
| - inline_followup = accessors->IsExecutableAccessorInfo(); |
| - if (!inline_followup) break; |
| - Handle<ExecutableAccessorInfo> info = |
| - Handle<ExecutableAccessorInfo>::cast(accessors); |
| - inline_followup = info->getter() != NULL && |
| - ExecutableAccessorInfo::IsCompatibleReceiverType( |
| - isolate(), info, type()); |
| + if (accessors->IsExecutableAccessorInfo()) { |
| + Handle<ExecutableAccessorInfo> info = |
| + Handle<ExecutableAccessorInfo>::cast(accessors); |
| + inline_followup = info->getter() != NULL && |
| + ExecutableAccessorInfo::IsCompatibleReceiverType( |
| + isolate(), info, type()); |
| + } else if (accessors->IsAccessorPair()) { |
| + Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), |
| + isolate()); |
| + if (!getter->IsJSFunction()) break; |
| + if (!holder()->HasFastProperties()) break; |
|
Toon Verwaest
2015/02/02 12:40:55
it->GetHolder<JSObject>
|
| + auto function = Handle<JSFunction>::cast(getter); |
| + CallOptimization call_optimization(function); |
| + inline_followup = |
| + call_optimization.is_simple_api_call() && |
| + call_optimization.IsCompatibleReceiver(type(), holder()); |
|
Toon Verwaest
2015/02/02 12:40:55
Same here.
|
| + } |
| } |
| } |
| @@ -345,10 +355,20 @@ void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor( |
| break; |
| } |
| case LookupIterator::ACCESSOR: |
| - Handle<ExecutableAccessorInfo> info = |
| - Handle<ExecutableAccessorInfo>::cast(it->GetAccessors()); |
| - DCHECK_NOT_NULL(info->getter()); |
| - GenerateLoadCallback(reg, info); |
| + if (it->GetAccessors()->IsExecutableAccessorInfo()) { |
| + Handle<ExecutableAccessorInfo> info = |
| + Handle<ExecutableAccessorInfo>::cast(it->GetAccessors()); |
| + DCHECK_NOT_NULL(info->getter()); |
| + GenerateLoadCallback(reg, info); |
| + } else { |
| + auto function = handle(JSFunction::cast( |
| + AccessorPair::cast(*it->GetAccessors())->getter())); |
| + CallOptimization call_optimization(function); |
| + Handle<Map> receiver_map = IC::TypeToMap(*type(), isolate()); |
| + GenerateApiAccessorCall(masm(), call_optimization, receiver_map, |
| + receiver(), scratch2(), false, no_reg, reg, |
| + it->GetAccessorIndex()); |
| + } |
| } |
| } |