diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-02-14 11:27:26 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-02-22 15:55:42 +0100 |
commit | 7a77daf24344db7942e34c962b0f1ee729ab7af5 (patch) | |
tree | e7cbe7bf4e2f4b802a8f5bc18336c546cd6a0d7f /deps/v8/src/lookup.cc | |
parent | 5f08871ee93ea739148cc49e0f7679e33c70295a (diff) | |
download | node-new-7a77daf24344db7942e34c962b0f1ee729ab7af5.tar.gz |
deps: update V8 to 5.6.326.55
PR-URL: https://github.com/nodejs/node/pull/10992
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/src/lookup.cc')
-rw-r--r-- | deps/v8/src/lookup.cc | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/deps/v8/src/lookup.cc b/deps/v8/src/lookup.cc index b6c0b92a17..186823df84 100644 --- a/deps/v8/src/lookup.cc +++ b/deps/v8/src/lookup.cc @@ -129,7 +129,8 @@ Handle<JSReceiver> LookupIterator::GetRootForNonJSReceiver( Handle<JSValue>::cast(result)->set_value(*receiver); return result; } - auto root = handle(receiver->GetRootMap(isolate)->prototype(), isolate); + auto root = + handle(receiver->GetPrototypeChainRootMap(isolate)->prototype(), isolate); if (root->IsNull(isolate)) { unsigned int magic = 0xbbbbbbbb; isolate->PushStackTraceAndDie(magic, *receiver, NULL, magic); @@ -193,6 +194,11 @@ void LookupIterator::InternalUpdateProtector() { } else if (*name_ == heap()->has_instance_symbol()) { if (!isolate_->IsHasInstanceLookupChainIntact()) return; isolate_->InvalidateHasInstanceProtector(); + } else if (*name_ == heap()->iterator_symbol()) { + if (!isolate_->IsArrayIteratorLookupChainIntact()) return; + if (holder_->IsJSArray()) { + isolate_->InvalidateArrayIteratorProtector(); + } } } @@ -601,6 +607,12 @@ Handle<Object> LookupIterator::FetchValue() const { return handle(result, isolate_); } +int LookupIterator::GetFieldDescriptorIndex() const { + DCHECK(has_property_); + DCHECK(holder_->HasFastProperties()); + DCHECK_EQ(v8::internal::DATA, property_details_.type()); + return descriptor_number(); +} int LookupIterator::GetAccessorIndex() const { DCHECK(has_property_); @@ -797,7 +809,8 @@ LookupIterator::State LookupIterator::LookupInRegularHolder( JSObject* js_object = JSObject::cast(holder); ElementsAccessor* accessor = js_object->GetElementsAccessor(); FixedArrayBase* backing_store = js_object->elements(); - number_ = accessor->GetEntryForIndex(js_object, backing_store, index_); + number_ = + accessor->GetEntryForIndex(isolate_, js_object, backing_store, index_); if (number_ == kMaxUInt32) { return holder->IsJSTypedArray() ? INTEGER_INDEXED_EXOTIC : NOT_FOUND; } @@ -843,5 +856,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()); + + AccessorPair* accessor_pair = AccessorPair::cast(*GetAccessors()); + Handle<Object> getter(accessor_pair->getter(), 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 |