Commit d4df8a89 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] Fix iwyu in heap/incremental-marking.h

Bug: v8:8015, v8:7490, v8:7965
Change-Id: Ic81c4c07b5b64ee3b77d7d1d245c3f5d32f9cdfa
Reviewed-on: https://chromium-review.googlesource.com/1238613
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56142}
parent 04dc784b
......@@ -6,6 +6,8 @@
#define V8_HEAP_INCREMENTAL_MARKING_INL_H_
#include "src/heap/incremental-marking.h"
#include "src/heap/mark-compact-inl.h"
#include "src/isolate.h"
#include "src/objects-inl.h"
#include "src/objects/maybe-object.h"
......@@ -13,6 +15,23 @@
namespace v8 {
namespace internal {
void IncrementalMarking::TransferColor(HeapObject* from, HeapObject* to) {
if (atomic_marking_state()->IsBlack(to)) {
DCHECK(black_allocation());
return;
}
DCHECK(atomic_marking_state()->IsWhite(to));
if (atomic_marking_state()->IsGrey(from)) {
bool success = atomic_marking_state()->WhiteToGrey(to);
DCHECK(success);
USE(success);
} else if (atomic_marking_state()->IsBlack(from)) {
bool success = atomic_marking_state()->WhiteToBlack(to);
DCHECK(success);
USE(success);
}
}
void IncrementalMarking::RecordWrite(HeapObject* obj, Object** slot,
Object* value) {
......
......@@ -100,23 +100,7 @@ class V8_EXPORT_PRIVATE IncrementalMarking {
void NotifyLeftTrimming(HeapObject* from, HeapObject* to);
V8_INLINE void TransferColor(HeapObject* from, HeapObject* to) {
if (atomic_marking_state()->IsBlack(to)) {
DCHECK(black_allocation());
return;
}
DCHECK(atomic_marking_state()->IsWhite(to));
if (atomic_marking_state()->IsGrey(from)) {
bool success = atomic_marking_state()->WhiteToGrey(to);
DCHECK(success);
USE(success);
} else if (atomic_marking_state()->IsBlack(from)) {
bool success = atomic_marking_state()->WhiteToBlack(to);
DCHECK(success);
USE(success);
}
}
V8_INLINE void TransferColor(HeapObject* from, HeapObject* to);
State state() const {
DCHECK(state_ == STOPPED || FLAG_incremental_marking);
......
......@@ -14,6 +14,28 @@
namespace v8 {
namespace internal {
template <typename ConcreteState, AccessMode access_mode>
bool MarkingStateBase<ConcreteState, access_mode>::GreyToBlack(
HeapObject* obj) {
MemoryChunk* p = MemoryChunk::FromAddress(obj->address());
MarkBit markbit = MarkBitFrom(p, obj->address());
if (!Marking::GreyToBlack<access_mode>(markbit)) return false;
static_cast<ConcreteState*>(this)->IncrementLiveBytes(p, obj->Size());
return true;
}
template <typename ConcreteState, AccessMode access_mode>
bool MarkingStateBase<ConcreteState, access_mode>::WhiteToGrey(
HeapObject* obj) {
return Marking::WhiteToGrey<access_mode>(MarkBitFrom(obj));
}
template <typename ConcreteState, AccessMode access_mode>
bool MarkingStateBase<ConcreteState, access_mode>::WhiteToBlack(
HeapObject* obj) {
return WhiteToGrey(obj) && GreyToBlack(obj);
}
template <FixedArrayVisitationMode fixed_array_mode,
TraceRetainingPathMode retaining_path_mode, typename MarkingState>
MarkingVisitor<fixed_array_mode, retaining_path_mode,
......
......@@ -17,7 +17,7 @@
#include "src/heap/array-buffer-collector.h"
#include "src/heap/array-buffer-tracker-inl.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/incremental-marking.h"
#include "src/heap/incremental-marking-inl.h"
#include "src/heap/invalidated-slots-inl.h"
#include "src/heap/item-parallel-job.h"
#include "src/heap/local-allocator-inl.h"
......
......@@ -63,21 +63,9 @@ class MarkingStateBase {
return Marking::IsBlackOrGrey<access_mode>(MarkBitFrom(obj));
}
V8_INLINE bool WhiteToGrey(HeapObject* obj) {
return Marking::WhiteToGrey<access_mode>(MarkBitFrom(obj));
}
V8_INLINE bool WhiteToBlack(HeapObject* obj) {
return WhiteToGrey(obj) && GreyToBlack(obj);
}
V8_INLINE bool GreyToBlack(HeapObject* obj) {
MemoryChunk* p = MemoryChunk::FromAddress(obj->address());
MarkBit markbit = MarkBitFrom(p, obj->address());
if (!Marking::GreyToBlack<access_mode>(markbit)) return false;
static_cast<ConcreteState*>(this)->IncrementLiveBytes(p, obj->Size());
return true;
}
V8_INLINE bool WhiteToGrey(HeapObject* obj);
V8_INLINE bool WhiteToBlack(HeapObject* obj);
V8_INLINE bool GreyToBlack(HeapObject* obj);
void ClearLiveness(MemoryChunk* chunk) {
static_cast<ConcreteState*>(this)->bitmap(chunk)->Clear();
......
......@@ -7,6 +7,7 @@
#include "src/heap/scavenger.h"
#include "src/heap/incremental-marking-inl.h"
#include "src/heap/local-allocator-inl.h"
#include "src/objects-inl.h"
#include "src/objects/map.h"
......
......@@ -15,7 +15,7 @@
#include "src/heap/concurrent-marking.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/heap-controller.h"
#include "src/heap/incremental-marking.h"
#include "src/heap/incremental-marking-inl.h"
#include "src/heap/mark-compact.h"
#include "src/heap/remembered-set.h"
#include "src/heap/slot-set.h"
......
......@@ -34,7 +34,6 @@ AUTO_EXCLUDE = [
'src/compiler/js-context-specialization.h',
'src/compiler/raw-machine-assembler.h',
'src/dateparser-inl.h',
'src/heap/incremental-marking.h',
'src/ic/ic.h',
'src/lookup.h',
'src/parsing/parser.h',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment