[iwyu] Fix transitions.h
Move some methods to transitions-inl.h to avoid using methods defined in other inl headers. R=verwaest@chromium.org Bug: v8:7965 Change-Id: I0f5a97ffa4c5faad1687c1586ef2dbf5193939bb Reviewed-on: https://chromium-review.googlesource.com/c/1303299 Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/master@{#57080}
This commit is contained in:
parent
0d9ed95041
commit
119151251d
@ -98,6 +98,17 @@ PropertyDetails TransitionsAccessor::GetTargetDetails(Name* name, Map* target) {
|
||||
return descriptors->GetDetails(descriptor);
|
||||
}
|
||||
|
||||
// static
|
||||
PropertyDetails TransitionsAccessor::GetSimpleTargetDetails(Map* transition) {
|
||||
return transition->GetLastDescriptorDetails();
|
||||
}
|
||||
|
||||
// static
|
||||
Name* TransitionsAccessor::GetSimpleTransitionKey(Map* transition) {
|
||||
int descriptor = transition->LastAdded();
|
||||
return transition->instance_descriptors()->GetKey(descriptor);
|
||||
}
|
||||
|
||||
// static
|
||||
Map* TransitionsAccessor::GetTargetFromRaw(MaybeObject raw) {
|
||||
return Map::cast(raw->GetHeapObjectAssumeWeak());
|
||||
@ -146,6 +157,15 @@ bool TransitionArray::GetTargetIfExists(int transition_number, Isolate* isolate,
|
||||
return true;
|
||||
}
|
||||
|
||||
int TransitionArray::SearchNameForTesting(Name* name,
|
||||
int* out_insertion_index) {
|
||||
return SearchName(name, out_insertion_index);
|
||||
}
|
||||
|
||||
int TransitionArray::SearchSpecial(Symbol* symbol, int* out_insertion_index) {
|
||||
return SearchName(symbol, out_insertion_index);
|
||||
}
|
||||
|
||||
int TransitionArray::SearchName(Name* name, int* out_insertion_index) {
|
||||
DCHECK(name->IsUniqueName());
|
||||
return internal::Search<ALL_ENTRIES>(this, name, number_of_entries(),
|
||||
@ -200,6 +220,14 @@ void TransitionArray::Set(int transition_number, Name* key,
|
||||
WeakFixedArray::Set(ToTargetIndex(transition_number), target);
|
||||
}
|
||||
|
||||
Name* TransitionArray::GetSortedKey(int transition_number) {
|
||||
return GetKey(transition_number);
|
||||
}
|
||||
|
||||
int TransitionArray::number_of_entries() const {
|
||||
return number_of_transitions();
|
||||
}
|
||||
|
||||
int TransitionArray::Capacity() {
|
||||
if (length() <= kFirstIndex) return 0;
|
||||
return (length() - kFirstIndex) / kEntrySize;
|
||||
|
@ -145,14 +145,9 @@ class TransitionsAccessor {
|
||||
friend class MarkCompactCollector; // For HasSimpleTransitionTo.
|
||||
friend class TransitionArray;
|
||||
|
||||
static inline PropertyDetails GetSimpleTargetDetails(Map* transition) {
|
||||
return transition->GetLastDescriptorDetails();
|
||||
}
|
||||
static inline PropertyDetails GetSimpleTargetDetails(Map* transition);
|
||||
|
||||
static inline Name* GetSimpleTransitionKey(Map* transition) {
|
||||
int descriptor = transition->LastAdded();
|
||||
return transition->instance_descriptors()->GetKey(descriptor);
|
||||
}
|
||||
static inline Name* GetSimpleTransitionKey(Map* transition);
|
||||
|
||||
static inline Map* GetTargetFromRaw(MaybeObject raw);
|
||||
|
||||
@ -224,12 +219,11 @@ class TransitionArray : public WeakFixedArray {
|
||||
Map** target);
|
||||
|
||||
// Required for templatized Search interface.
|
||||
static const int kNotFound = -1;
|
||||
Name* GetSortedKey(int transition_number) {
|
||||
return GetKey(transition_number);
|
||||
}
|
||||
static constexpr int kNotFound = -1;
|
||||
|
||||
inline Name* GetSortedKey(int transition_number);
|
||||
int GetSortedKeyIndex(int transition_number) { return transition_number; }
|
||||
inline int number_of_entries() const { return number_of_transitions(); }
|
||||
inline int number_of_entries() const;
|
||||
#ifdef DEBUG
|
||||
bool IsSortedNoDuplicates(int valid_entries = -1);
|
||||
#endif
|
||||
@ -261,9 +255,7 @@ class TransitionArray : public WeakFixedArray {
|
||||
}
|
||||
|
||||
inline int SearchNameForTesting(Name* name,
|
||||
int* out_insertion_index = nullptr) {
|
||||
return SearchName(name, out_insertion_index);
|
||||
}
|
||||
int* out_insertion_index = nullptr);
|
||||
|
||||
private:
|
||||
friend class Factory;
|
||||
@ -303,9 +295,7 @@ class TransitionArray : public WeakFixedArray {
|
||||
|
||||
// Search a non-property transition (like elements kind, observe or frozen
|
||||
// transitions).
|
||||
inline int SearchSpecial(Symbol* symbol, int* out_insertion_index = nullptr) {
|
||||
return SearchName(symbol, out_insertion_index);
|
||||
}
|
||||
inline int SearchSpecial(Symbol* symbol, int* out_insertion_index = nullptr);
|
||||
// Search a first transition for a given property name.
|
||||
inline int SearchName(Name* name, int* out_insertion_index = nullptr);
|
||||
int SearchDetails(int transition, PropertyKind kind,
|
||||
|
@ -28,8 +28,6 @@ OUT_DIR = os.path.join(V8_DIR, 'check-header-includes')
|
||||
AUTO_EXCLUDE = [
|
||||
# flag-definitions.h needs a mode set for being included.
|
||||
'src/flag-definitions.h',
|
||||
# blacklist of headers we need to fix (https://crbug.com/v8/7965).
|
||||
'src/transitions.h',
|
||||
]
|
||||
AUTO_EXCLUDE_PATTERNS = [
|
||||
'src/base/atomicops_internals_.*',
|
||||
|
Loading…
Reference in New Issue
Block a user