Commit 70910752 authored by epertoso's avatar epertoso Committed by Commit bot

Make NamedLoadHandlerCompiler::CompileLoadInterceptor behave correcly with lazy accessors.

Before this fix, we always ended up calling Runtime_LoadPropertyWithInterceptor, which caused the performance regression reported in http://crbug.com/585764.

BUG=585764
LOG=y

Review URL: https://codereview.chromium.org/1699913002

Cr-Commit-Position: refs/heads/master@{#34025}
parent 7b59e3d7
......@@ -301,10 +301,11 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor(
Handle<JSObject> property_holder(it->GetHolder<JSObject>());
Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
isolate());
if (!getter->IsJSFunction()) break;
if (!(getter->IsJSFunction() || getter->IsFunctionTemplateInfo())) {
break;
}
if (!property_holder->HasFastProperties()) break;
auto function = Handle<JSFunction>::cast(getter);
CallOptimization call_optimization(function);
CallOptimization call_optimization(getter);
Handle<Map> receiver_map = map();
inline_followup = call_optimization.is_simple_api_call() &&
call_optimization.IsCompatibleReceiverMap(
......@@ -397,8 +398,8 @@ void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor(
DCHECK_NOT_NULL(info->getter());
GenerateLoadCallback(reg, info);
} else {
auto function = handle(JSFunction::cast(
AccessorPair::cast(*it->GetAccessors())->getter()));
Handle<Object> function = handle(
AccessorPair::cast(*it->GetAccessors())->getter(), isolate());
CallOptimization call_optimization(function);
GenerateApiAccessorCall(masm(), call_optimization, holder_map,
receiver(), scratch2(), false, no_reg, reg,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment