[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 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,
Handle<JSReceiver> holder,
Configuration configuration)
@ -43,6 +48,11 @@ LookupIterator::LookupIterator(Isolate* isolate, Handle<Object> receiver,
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(
Isolate* isolate, Handle<Object> receiver, Handle<Name> name,
Handle<JSReceiver> holder, Configuration configuration) {
@ -80,6 +90,22 @@ bool LookupIterator::is_dictionary_holder() const {
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) {
DCHECK(receiver.is_identical_to(GetStoreTarget<JSReceiver>()));
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(
Configuration configuration, Handle<Name> name) {
return name->IsPrivate() ? OWN_SKIP_INTERCEPTOR : configuration;

View File

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

View File

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