[heap] Remove the unused Map parameter from the marking barrier
Change-Id: I5d82528cd07c263bfbedfdd3a090bcd4f67ef55d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2428593 Reviewed-by: Leszek Swirski <leszeks@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#70117}
This commit is contained in:
parent
78c42a1f8e
commit
0b8c39162c
@ -238,11 +238,11 @@ void WriteBarrier::Marking(JSArrayBuffer host,
|
||||
MarkingSlow(*heap, host, extension);
|
||||
}
|
||||
|
||||
void WriteBarrier::Marking(Map host, DescriptorArray descriptor_array,
|
||||
void WriteBarrier::Marking(DescriptorArray descriptor_array,
|
||||
int number_of_own_descriptors) {
|
||||
auto heap = GetHeapIfMarking(host);
|
||||
auto heap = GetHeapIfMarking(descriptor_array);
|
||||
if (!heap) return;
|
||||
MarkingSlow(*heap, host, descriptor_array, number_of_own_descriptors);
|
||||
MarkingSlow(*heap, descriptor_array, number_of_own_descriptors);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
@ -52,13 +52,12 @@ void WriteBarrier::MarkingSlow(Heap* heap, JSArrayBuffer host,
|
||||
marking_barrier->Write(host, extension);
|
||||
}
|
||||
|
||||
void WriteBarrier::MarkingSlow(Heap* heap, Map host,
|
||||
DescriptorArray descriptor_array,
|
||||
void WriteBarrier::MarkingSlow(Heap* heap, DescriptorArray descriptor_array,
|
||||
int number_of_own_descriptors) {
|
||||
MarkingBarrier* marking_barrier = current_marking_barrier
|
||||
? current_marking_barrier
|
||||
: heap->marking_barrier();
|
||||
marking_barrier->Write(host, descriptor_array, number_of_own_descriptors);
|
||||
marking_barrier->Write(descriptor_array, number_of_own_descriptors);
|
||||
}
|
||||
|
||||
int WriteBarrier::MarkingFromCode(Address raw_host, Address raw_slot) {
|
||||
|
@ -51,8 +51,7 @@ class V8_EXPORT_PRIVATE WriteBarrier {
|
||||
MaybeObject value);
|
||||
static inline void Marking(Code host, RelocInfo*, HeapObject value);
|
||||
static inline void Marking(JSArrayBuffer host, ArrayBufferExtension*);
|
||||
static inline void Marking(Map host, DescriptorArray,
|
||||
int number_of_own_descriptors);
|
||||
static inline void Marking(DescriptorArray, int number_of_own_descriptors);
|
||||
// It is invoked from generated code and has to take raw addresses.
|
||||
static int MarkingFromCode(Address raw_host, Address raw_slot);
|
||||
|
||||
@ -65,7 +64,7 @@ class V8_EXPORT_PRIVATE WriteBarrier {
|
||||
static void MarkingSlow(Heap* heap, Code host, RelocInfo*, HeapObject value);
|
||||
static void MarkingSlow(Heap* heap, JSArrayBuffer host,
|
||||
ArrayBufferExtension*);
|
||||
static void MarkingSlow(Heap* heap, Map host, DescriptorArray,
|
||||
static void MarkingSlow(Heap* heap, DescriptorArray,
|
||||
int number_of_own_descriptors);
|
||||
static inline base::Optional<Heap*> GetHeapIfMarking(HeapObject object);
|
||||
};
|
||||
|
@ -126,12 +126,11 @@ void MainMarkingVisitor<MarkingState>::RecordRelocSlot(Code host,
|
||||
|
||||
template <typename MarkingState>
|
||||
void MainMarkingVisitor<MarkingState>::MarkDescriptorArrayFromWriteBarrier(
|
||||
HeapObject host, DescriptorArray descriptors,
|
||||
int number_of_own_descriptors) {
|
||||
DescriptorArray descriptors, int number_of_own_descriptors) {
|
||||
// This is necessary because the Scavenger records slots only for the
|
||||
// promoted black objects and the marking visitor of DescriptorArray skips
|
||||
// the descriptors marked by the visitor.VisitDescriptors() below.
|
||||
this->MarkDescriptorArrayBlack(host, descriptors);
|
||||
this->MarkDescriptorArrayBlack(descriptors);
|
||||
this->VisitDescriptors(descriptors, number_of_own_descriptors);
|
||||
}
|
||||
|
||||
|
@ -1636,10 +1636,9 @@ void MarkCompactCollector::RevisitObject(HeapObject obj) {
|
||||
}
|
||||
|
||||
void MarkCompactCollector::MarkDescriptorArrayFromWriteBarrier(
|
||||
HeapObject host, DescriptorArray descriptors,
|
||||
int number_of_own_descriptors) {
|
||||
DescriptorArray descriptors, int number_of_own_descriptors) {
|
||||
marking_visitor_->MarkDescriptorArrayFromWriteBarrier(
|
||||
host, descriptors, number_of_own_descriptors);
|
||||
descriptors, number_of_own_descriptors);
|
||||
}
|
||||
|
||||
void MarkCompactCollector::ProcessEphemeronsUntilFixpoint() {
|
||||
|
@ -395,8 +395,7 @@ class MainMarkingVisitor final
|
||||
V8_UNLIKELY(revisiting_object_);
|
||||
}
|
||||
|
||||
void MarkDescriptorArrayFromWriteBarrier(HeapObject host,
|
||||
DescriptorArray descriptors,
|
||||
void MarkDescriptorArrayFromWriteBarrier(DescriptorArray descriptors,
|
||||
int number_of_own_descriptors);
|
||||
|
||||
private:
|
||||
@ -583,8 +582,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
|
||||
void RevisitObject(HeapObject obj);
|
||||
// Ensures that all descriptors int range [0, number_of_own_descripts)
|
||||
// are visited.
|
||||
void MarkDescriptorArrayFromWriteBarrier(HeapObject host,
|
||||
DescriptorArray array,
|
||||
void MarkDescriptorArrayFromWriteBarrier(DescriptorArray array,
|
||||
int number_of_own_descriptors);
|
||||
|
||||
// Drains the main thread marking worklist until the specified number of
|
||||
|
@ -67,13 +67,13 @@ void MarkingBarrier::Write(JSArrayBuffer host,
|
||||
extension->Mark();
|
||||
}
|
||||
|
||||
void MarkingBarrier::Write(Map host, DescriptorArray descriptor_array,
|
||||
void MarkingBarrier::Write(DescriptorArray descriptor_array,
|
||||
int number_of_own_descriptors) {
|
||||
DCHECK(is_main_thread_barrier_);
|
||||
int16_t raw_marked = descriptor_array.raw_number_of_marked_descriptors();
|
||||
if (NumberOfMarkedDescriptors::decode(collector_->epoch(), raw_marked) <
|
||||
number_of_own_descriptors) {
|
||||
collector_->MarkDescriptorArrayFromWriteBarrier(host, descriptor_array,
|
||||
collector_->MarkDescriptorArrayFromWriteBarrier(descriptor_array,
|
||||
number_of_own_descriptors);
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class MarkingBarrier {
|
||||
void Write(HeapObject host, HeapObjectSlot, HeapObject value);
|
||||
void Write(Code host, RelocInfo*, HeapObject value);
|
||||
void Write(JSArrayBuffer host, ArrayBufferExtension*);
|
||||
void Write(Map host, DescriptorArray, int number_of_own_descriptors);
|
||||
void Write(DescriptorArray, int number_of_own_descriptors);
|
||||
|
||||
// Returns true if the slot needs to be recorded.
|
||||
inline bool MarkValue(HeapObject host, HeapObject value);
|
||||
|
@ -351,7 +351,7 @@ int MarkingVisitorBase<ConcreteVisitor, MarkingState>::VisitWeakCell(
|
||||
template <typename ConcreteVisitor, typename MarkingState>
|
||||
size_t
|
||||
MarkingVisitorBase<ConcreteVisitor, MarkingState>::MarkDescriptorArrayBlack(
|
||||
HeapObject host, DescriptorArray descriptors) {
|
||||
DescriptorArray descriptors) {
|
||||
concrete_visitor()->marking_state()->WhiteToGrey(descriptors);
|
||||
if (concrete_visitor()->marking_state()->GreyToBlack(descriptors)) {
|
||||
VisitPointer(descriptors, descriptors.map_slot());
|
||||
@ -402,7 +402,7 @@ int MarkingVisitorBase<ConcreteVisitor, MarkingState>::VisitMap(Map meta_map,
|
||||
// slot holding the descriptor array will be implicitly recorded when the
|
||||
// pointer fields of this map are visited.
|
||||
DescriptorArray descriptors = map.synchronized_instance_descriptors();
|
||||
size += MarkDescriptorArrayBlack(map, descriptors);
|
||||
size += MarkDescriptorArrayBlack(descriptors);
|
||||
int number_of_own_descriptors = map.NumberOfOwnDescriptors();
|
||||
if (number_of_own_descriptors) {
|
||||
// It is possible that the concurrent marker observes the
|
||||
|
@ -227,8 +227,7 @@ class MarkingVisitorBase : public HeapVisitor<int, ConcreteVisitor> {
|
||||
// Marks the descriptor array black without pushing it on the marking work
|
||||
// list and visits its header. Returns the size of the descriptor array
|
||||
// if it was successully marked as black.
|
||||
V8_INLINE size_t MarkDescriptorArrayBlack(HeapObject host,
|
||||
DescriptorArray descriptors);
|
||||
V8_INLINE size_t MarkDescriptorArrayBlack(DescriptorArray descriptors);
|
||||
// Marks the object grey and pushes it on the marking work list.
|
||||
V8_INLINE void MarkObject(HeapObject host, HeapObject obj);
|
||||
|
||||
|
@ -698,7 +698,7 @@ void Map::AppendDescriptor(Isolate* isolate, Descriptor* desc) {
|
||||
descriptors.Append(desc);
|
||||
SetNumberOfOwnDescriptors(number_of_own_descriptors + 1);
|
||||
#ifndef V8_DISABLE_WRITE_BARRIERS
|
||||
WriteBarrier::Marking(*this, descriptors, number_of_own_descriptors + 1);
|
||||
WriteBarrier::Marking(descriptors, number_of_own_descriptors + 1);
|
||||
#endif
|
||||
}
|
||||
// Properly mark the map if the {desc} is an "interesting symbol".
|
||||
|
@ -635,8 +635,7 @@ void Map::ReplaceDescriptors(Isolate* isolate, DescriptorArray new_descriptors,
|
||||
// all its elements.
|
||||
Map current = *this;
|
||||
#ifndef V8_DISABLE_WRITE_BARRIERS
|
||||
WriteBarrier::Marking(current, to_replace,
|
||||
to_replace.number_of_descriptors());
|
||||
WriteBarrier::Marking(to_replace, to_replace.number_of_descriptors());
|
||||
#endif
|
||||
while (current.instance_descriptors(isolate) == to_replace) {
|
||||
Object next = current.GetBackPointer(isolate);
|
||||
@ -1133,8 +1132,7 @@ void Map::EnsureDescriptorSlack(Isolate* isolate, Handle<Map> map, int slack) {
|
||||
// descriptors will not be trimmed in the mark-compactor, we need to mark
|
||||
// all its elements.
|
||||
#ifndef V8_DISABLE_WRITE_BARRIERS
|
||||
WriteBarrier::Marking(*map, *descriptors,
|
||||
descriptors->number_of_descriptors());
|
||||
WriteBarrier::Marking(*descriptors, descriptors->number_of_descriptors());
|
||||
#endif
|
||||
|
||||
Map current = *map;
|
||||
@ -2577,7 +2575,7 @@ void Map::SetInstanceDescriptors(Isolate* isolate, DescriptorArray descriptors,
|
||||
set_synchronized_instance_descriptors(descriptors);
|
||||
SetNumberOfOwnDescriptors(number_of_own_descriptors);
|
||||
#ifndef V8_DISABLE_WRITE_BARRIERS
|
||||
WriteBarrier::Marking(*this, descriptors, number_of_own_descriptors);
|
||||
WriteBarrier::Marking(descriptors, number_of_own_descriptors);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user