[iwyu] Fix lookup.h

R=marja@chromium.org

Bug: v8:7965
Change-Id: I740f7fa1ec19e269d15358fcf66862b15096e132
Reviewed-on: https://chromium-review.googlesource.com/c/1303295
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57062}
This commit is contained in:
Clemens Hammacher 2018-10-27 16:52:04 +02:00 committed by Commit Bot
parent 4659544389
commit e2662d1088
3 changed files with 50 additions and 33 deletions

View File

@ -17,6 +17,11 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
LookupIterator::LookupIterator(Isolate* isolate, Handle<Object> receiver,
Handle<Name> name, Configuration configuration)
: LookupIterator(isolate, receiver, name, GetRoot(isolate, receiver),
configuration) {}
LookupIterator::LookupIterator(Handle<Object> receiver, Handle<Name> name, LookupIterator::LookupIterator(Handle<Object> receiver, Handle<Name> name,
Handle<JSReceiver> holder, Handle<JSReceiver> holder,
Configuration configuration) Configuration configuration)
@ -43,6 +48,11 @@ LookupIterator::LookupIterator(Isolate* isolate, Handle<Object> receiver,
Start<false>(); Start<false>();
} }
LookupIterator::LookupIterator(Isolate* isolate, Handle<Object> receiver,
uint32_t index, Configuration configuration)
: LookupIterator(isolate, receiver, index,
GetRoot(isolate, receiver, index), configuration) {}
LookupIterator LookupIterator::PropertyOrElement( LookupIterator LookupIterator::PropertyOrElement(
Isolate* isolate, Handle<Object> receiver, Handle<Name> name, Isolate* isolate, Handle<Object> receiver, Handle<Name> name,
Handle<JSReceiver> holder, Configuration configuration) { Handle<JSReceiver> holder, Configuration configuration) {
@ -80,6 +90,22 @@ bool LookupIterator::is_dictionary_holder() const {
return !holder_->HasFastProperties(); return !holder_->HasFastProperties();
} }
Handle<Map> LookupIterator::transition_map() const {
DCHECK_EQ(TRANSITION, state_);
return Handle<Map>::cast(transition_);
}
Handle<PropertyCell> LookupIterator::transition_cell() const {
DCHECK_EQ(TRANSITION, state_);
return Handle<PropertyCell>::cast(transition_);
}
template <class T>
Handle<T> LookupIterator::GetHolder() const {
DCHECK(IsFound());
return Handle<T>::cast(holder_);
}
bool LookupIterator::ExtendingNonExtensible(Handle<JSReceiver> receiver) { bool LookupIterator::ExtendingNonExtensible(Handle<JSReceiver> receiver) {
DCHECK(receiver.is_identical_to(GetStoreTarget<JSReceiver>())); DCHECK(receiver.is_identical_to(GetStoreTarget<JSReceiver>()));
return !receiver->map()->is_extensible() && return !receiver->map()->is_extensible() &&
@ -107,6 +133,20 @@ void LookupIterator::UpdateProtector() {
} }
} }
int LookupIterator::descriptor_number() const {
DCHECK(!IsElement());
DCHECK(has_property_);
DCHECK(holder_->HasFastProperties());
return number_;
}
int LookupIterator::dictionary_entry() const {
DCHECK(!IsElement());
DCHECK(has_property_);
DCHECK(!holder_->HasFastProperties());
return number_;
}
LookupIterator::Configuration LookupIterator::ComputeConfiguration( LookupIterator::Configuration LookupIterator::ComputeConfiguration(
Configuration configuration, Handle<Name> name) { Configuration configuration, Handle<Name> name) {
return name->IsPrivate() ? OWN_SKIP_INTERCEPTOR : configuration; return name->IsPrivate() ? OWN_SKIP_INTERCEPTOR : configuration;

View File

@ -44,10 +44,9 @@ class V8_EXPORT_PRIVATE LookupIterator final {
BEFORE_PROPERTY = INTERCEPTOR BEFORE_PROPERTY = INTERCEPTOR
}; };
LookupIterator(Isolate* isolate, Handle<Object> receiver, Handle<Name> name, inline LookupIterator(Isolate* isolate, Handle<Object> receiver,
Configuration configuration = DEFAULT) Handle<Name> name,
: LookupIterator(isolate, receiver, name, GetRoot(isolate, receiver), Configuration configuration = DEFAULT);
configuration) {}
inline LookupIterator(Handle<Object> receiver, Handle<Name> name, inline LookupIterator(Handle<Object> receiver, Handle<Name> name,
Handle<JSReceiver> holder, Handle<JSReceiver> holder,
@ -57,10 +56,8 @@ class V8_EXPORT_PRIVATE LookupIterator final {
Handle<Name> name, Handle<JSReceiver> holder, Handle<Name> name, Handle<JSReceiver> holder,
Configuration configuration = DEFAULT); Configuration configuration = DEFAULT);
LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index, inline LookupIterator(Isolate* isolate, Handle<Object> receiver,
Configuration configuration = DEFAULT) uint32_t index, Configuration configuration = DEFAULT);
: LookupIterator(isolate, receiver, index,
GetRoot(isolate, receiver, index), configuration) {}
LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index, LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index,
Handle<JSReceiver> holder, Handle<JSReceiver> holder,
@ -130,19 +127,10 @@ class V8_EXPORT_PRIVATE LookupIterator final {
template <class T> template <class T>
inline Handle<T> GetStoreTarget() const; inline Handle<T> GetStoreTarget() const;
inline bool is_dictionary_holder() const; inline bool is_dictionary_holder() const;
Handle<Map> transition_map() const { inline Handle<Map> transition_map() const;
DCHECK_EQ(TRANSITION, state_); inline Handle<PropertyCell> transition_cell() const;
return Handle<Map>::cast(transition_);
}
Handle<PropertyCell> transition_cell() const {
DCHECK_EQ(TRANSITION, state_);
return Handle<PropertyCell>::cast(transition_);
}
template <class T> template <class T>
Handle<T> GetHolder() const { inline Handle<T> GetHolder() const;
DCHECK(IsFound());
return Handle<T>::cast(holder_);
}
bool HolderIsReceiver() const; bool HolderIsReceiver() const;
bool HolderIsReceiverOrHiddenPrototype() const; bool HolderIsReceiverOrHiddenPrototype() const;
@ -259,18 +247,8 @@ class V8_EXPORT_PRIVATE LookupIterator final {
bool check_interceptor() const { bool check_interceptor() const {
return (configuration_ & kInterceptor) != 0; return (configuration_ & kInterceptor) != 0;
} }
int descriptor_number() const { inline int descriptor_number() const;
DCHECK(!IsElement()); inline int dictionary_entry() const;
DCHECK(has_property_);
DCHECK(holder_->HasFastProperties());
return number_;
}
int dictionary_entry() const {
DCHECK(!IsElement());
DCHECK(has_property_);
DCHECK(!holder_->HasFastProperties());
return number_;
}
static inline Configuration ComputeConfiguration( static inline Configuration ComputeConfiguration(
Configuration configuration, Handle<Name> name); Configuration configuration, Handle<Name> name);

View File

@ -34,7 +34,6 @@ AUTO_EXCLUDE = [
'src/compiler/raw-machine-assembler.h', 'src/compiler/raw-machine-assembler.h',
'src/dateparser-inl.h', 'src/dateparser-inl.h',
'src/ic/ic.h', 'src/ic/ic.h',
'src/lookup.h',
'src/regexp/jsregexp.h', 'src/regexp/jsregexp.h',
'src/snapshot/object-deserializer.h', 'src/snapshot/object-deserializer.h',
'src/transitions.h', 'src/transitions.h',