Commit 07c3e416 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[heap] Make the Marking class all static.

R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/1269313003

Cr-Commit-Position: refs/heads/master@{#30066}
parent 8b56ec9c
......@@ -136,7 +136,6 @@ Heap::Heap()
last_gc_time_(0.0),
mark_compact_collector_(this),
store_buffer_(this),
marking_(this),
incremental_marking_(this),
memory_reducer_(this),
full_codegen_bytes_generated_(0),
......@@ -3787,7 +3786,7 @@ FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object,
FixedArrayBase::cast(HeapObject::FromAddress(new_start));
// Maintain consistency of live bytes during incremental marking
marking()->TransferMark(object->address(), new_start);
Marking::TransferMark(this, object->address(), new_start);
AdjustLiveBytes(new_object, -bytes_to_trim, Heap::CONCURRENT_TO_SWEEPER);
// Notify the heap profiler of change in object layout.
......
......@@ -1428,8 +1428,6 @@ class Heap {
StoreBuffer* store_buffer() { return &store_buffer_; }
Marking* marking() { return &marking_; }
IncrementalMarking* incremental_marking() { return &incremental_marking_; }
ExternalStringTable* external_string_table() {
......@@ -2304,8 +2302,6 @@ class Heap {
StoreBuffer store_buffer_;
Marking marking_;
IncrementalMarking incremental_marking_;
GCIdleTimeHandler gc_idle_time_handler_;
......
......@@ -588,12 +588,12 @@ void MarkCompactCollector::RefillFreeList(PagedSpace* space) {
}
void Marking::TransferMark(Address old_start, Address new_start) {
void Marking::TransferMark(Heap* heap, Address old_start, Address new_start) {
// This is only used when resizing an object.
DCHECK(MemoryChunk::FromAddress(old_start) ==
MemoryChunk::FromAddress(new_start));
if (!heap_->incremental_marking()->IsMarking()) return;
if (!heap->incremental_marking()->IsMarking()) return;
// If the mark doesn't move, we don't check the color of the object.
// It doesn't matter whether the object is black, since it hasn't changed
......@@ -613,9 +613,9 @@ void Marking::TransferMark(Address old_start, Address new_start) {
return;
} else if (Marking::IsGrey(old_mark_bit)) {
Marking::GreyToWhite(old_mark_bit);
heap_->incremental_marking()->WhiteToGreyAndPush(
heap->incremental_marking()->WhiteToGreyAndPush(
HeapObject::FromAddress(new_start), new_mark_bit);
heap_->incremental_marking()->RestartIfNotMarking();
heap->incremental_marking()->RestartIfNotMarking();
}
#ifdef DEBUG
......
......@@ -26,10 +26,8 @@ class MarkingVisitor;
class RootMarkingVisitor;
class Marking {
class Marking : public AllStatic {
public:
explicit Marking(Heap* heap) : heap_(heap) {}
INLINE(static MarkBit MarkBitFrom(Address addr));
INLINE(static MarkBit MarkBitFrom(HeapObject* obj)) {
......@@ -120,7 +118,7 @@ class Marking {
static void ClearAllMarkBitsOfCellsContainedInRange(MarkBit start,
MarkBit end);
void TransferMark(Address old_start, Address new_start);
static void TransferMark(Heap* heap, Address old_start, Address new_start);
#ifdef DEBUG
enum ObjectColor {
......@@ -174,7 +172,7 @@ class Marking {
}
private:
Heap* heap_;
DISALLOW_IMPLICIT_CONSTRUCTORS(Marking);
};
// ----------------------------------------------------------------------------
......
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