Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 996aafa9f61dcdaf7789666549be3480326adbb9..707a2cbe004c3b5ce051c880e0acd50efb187a1e 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -1362,6 +1362,11 @@ MaybeHandle<Object> Object::GetPropertyWithAccessor(LookupIterator* it) { |
return reboxed_result; |
} |
+ // AccessorPair with 'cached' private property. |
+ if (it->TryLookupCachedProperty()) { |
+ return Object::GetProperty(it); |
+ } |
+ |
// Regular accessor. |
Handle<Object> getter(AccessorPair::cast(*structure)->getter(), isolate); |
if (getter->IsFunctionTemplateInfo()) { |
@@ -20269,5 +20274,18 @@ Handle<JSModuleNamespace> Module::GetModuleNamespace(Handle<Module> module) { |
return ns; |
} |
+MaybeHandle<Name> FunctionTemplateInfo::TryGetCachedPropertyName( |
+ Isolate* isolate, Handle<Object> getter) { |
+ if (getter->IsFunctionTemplateInfo()) { |
+ Handle<FunctionTemplateInfo> fti = |
+ Handle<FunctionTemplateInfo>::cast(getter); |
+ // Check if the accessor uses a cached property. |
+ if (!fti->cached_property_name()->IsTheHole(isolate)) { |
+ return handle(Name::cast(fti->cached_property_name())); |
+ } |
+ } |
+ return MaybeHandle<Name>(); |
+} |
+ |
} // namespace internal |
} // namespace v8 |