[heap] MarkingFromInternalFields write barrier bailout for MinorMC

This CL skips the MarkingFromInternalFields write barrier when
MinorMC concurrent marking is active, because we do not run Oilpan
young GCs yet.

Bug: v8:13012
Change-Id: Ib73dea8357be6d135290009258b5d172477a633b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3865464
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Leon Bettscheider <bettscheider@google.com>
Cr-Commit-Position: refs/heads/main@{#82895}
This commit is contained in:
Leon Bettscheider 2022-09-01 08:21:56 +00:00 committed by V8 LUCI CQ
parent 25506204b8
commit a7a0c7b581
2 changed files with 11 additions and 3 deletions

View File

@ -11,6 +11,7 @@
#include "src/common/code-memory-access-inl.h"
#include "src/common/globals.h"
#include "src/heap/heap-write-barrier.h"
#include "src/heap/marking-barrier.h"
#include "src/objects/code.h"
#include "src/objects/compressed-slots-inl.h"
#include "src/objects/fixed-array.h"
@ -354,6 +355,12 @@ void WriteBarrier::MarkingFromInternalFields(JSObject host) {
if (V8_ENABLE_THIRD_PARTY_HEAP_BOOL) return;
auto heap = GetHeapIfMarking(host);
if (!heap) return;
if (CurrentMarkingBarrier(heap.value())->is_minor()) {
// TODO(v8:13012): We do not currently mark Oilpan objects while MinorMC is
// active. Once Oilpan uses a generational GC with incremental marking and
// unified heap, this barrier will be needed again.
return;
}
MarkingSlowFromInternalFields(*heap, host);
}

View File

@ -45,6 +45,10 @@ class MarkingBarrier {
// Returns true if the slot needs to be recorded.
inline bool MarkValue(HeapObject host, HeapObject value);
bool is_minor() const {
return marking_barrier_type_ == MarkingBarrierType::kMinor;
}
private:
inline bool WhiteToGreyAndPush(HeapObject value);
@ -61,9 +65,6 @@ class MarkingBarrier {
template <typename TSlot>
inline void MarkRange(HeapObject value, TSlot start, TSlot end);
bool is_minor() const {
return marking_barrier_type_ == MarkingBarrierType::kMinor;
}
bool is_major() const {
return marking_barrier_type_ == MarkingBarrierType::kMajor;
}