Chromium Code Reviews| Index: src/lookup.cc |
| diff --git a/src/lookup.cc b/src/lookup.cc |
| index fa6d579122b618554de15db315a823262c5dfc52..b10ece526fded9373afe49c3ebe9a554970776df 100644 |
| --- a/src/lookup.cc |
| +++ b/src/lookup.cc |
| @@ -842,5 +842,27 @@ Handle<InterceptorInfo> LookupIterator::GetInterceptorForFailedAccessCheck() |
| return Handle<InterceptorInfo>(); |
| } |
| +bool LookupIterator::TryLookupCachedProperty() { |
| + return state() == LookupIterator::ACCESSOR && |
| + GetAccessors()->IsAccessorPair() && LookupCachedProperty(); |
| +} |
| + |
| +bool LookupIterator::LookupCachedProperty() { |
| + DCHECK_EQ(state(), LookupIterator::ACCESSOR); |
| + DCHECK(GetAccessors()->IsAccessorPair()); |
| + |
| + Handle<Object> getter(Handle<AccessorPair>::cast(GetAccessors())->getter(), |
|
Toon Verwaest
2016/11/04 10:19:52
AccessorPair::cast(*GetAccessors())->getter(), iso
vogelheim
2016/11/04 12:34:42
Didn't fit :)
Since I need two lines anyway, I gav
|
| + isolate()); |
| + MaybeHandle<Name> maybe_name = |
| + FunctionTemplateInfo::TryGetCachedPropertyName(isolate(), getter); |
| + if (maybe_name.is_null()) return false; |
| + |
| + // We have found a cached property! Modify the iterator accordingly. |
| + name_ = maybe_name.ToHandleChecked(); |
| + Restart(); |
| + CHECK_EQ(state(), LookupIterator::DATA); |
| + return true; |
| +} |
| + |
| } // namespace internal |
| } // namespace v8 |