Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index f852ca0de39dee015d82e03b5f7f326910688c56..e2413a05c072630d7d74fdb754c9f70fd61a0ea2 100644 |
| --- a/src/objects.cc |
| +++ b/src/objects.cc |
| @@ -1325,6 +1325,11 @@ MaybeHandle<Object> Object::GetPropertyWithAccessor(LookupIterator* it) { |
| // const declaration would conflict with the getter. |
| DCHECK(!structure->IsForeign()); |
| + // Accessor with 'cached' private property. |
| + if (it->TryLookupCacheProperty()) { |
| + return Object::GetProperty(it); |
|
Toon Verwaest
2016/10/21 08:22:14
Why not do GetProperty directly in TryLookupCached
vogelheim
2016/11/03 16:12:24
Hmm. That would seem to do the wrong thing for the
|
| + } |
| + |
| // API style callbacks. |
| if (structure->IsAccessorInfo()) { |
| Handle<JSObject> holder = it->GetHolder<JSObject>(); |
| @@ -20218,5 +20223,19 @@ Handle<JSModuleNamespace> Module::GetModuleNamespace(Handle<Module> module) { |
| return ns; |
| } |
| +MaybeHandle<Name> FunctionTemplateInfo::TryGetCachePropertyName( |
| + Isolate* isolate, Handle<Object> getter) { |
| + if (getter->IsFunctionTemplateInfo()) { |
|
Toon Verwaest
2016/10/21 08:22:14
It should be easy to support JSFunctions backed by
vogelheim
2016/11/03 16:12:24
Do we have a use case for that?
(I'm generally fo
|
| + Handle<FunctionTemplateInfo> fti = |
| + Handle<FunctionTemplateInfo>::cast(getter); |
| + // Check if the accessor is backed by a private property (cached accessor). |
| + if (!fti->cache_property()->IsTheHole(isolate)) { |
| + Handle<Name> name = handle(Name::cast(fti->cache_property())); |
| + return MaybeHandle<Name>(name); |
| + } |
| + } |
| + return MaybeHandle<Name>(); |
| +} |
| + |
| } // namespace internal |
| } // namespace v8 |