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

Unified Diff: src/ic/handler-compiler.cc

Issue 1699913002: Make NamedLoadHandlerCompiler::CompileLoadInterceptor behave correcly with lazy accessors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/handler-compiler.cc
diff --git a/src/ic/handler-compiler.cc b/src/ic/handler-compiler.cc
index 6a8a5db7637f5db283001b6825962d6ccf6fcaef..dfbb54fc1adab2515c0378890dfbdc999aec165e 100644
--- a/src/ic/handler-compiler.cc
+++ b/src/ic/handler-compiler.cc
@@ -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,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698