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

[heap] Remove unused parameter from MC::MarkObject

BUG=chromium:651354

Change-Id: I8d74133ca9b21ce9e0612efc1e5ace41d1002dae
Reviewed-on: https://chromium-review.googlesource.com/440304Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43064}
parent f68267aa
...@@ -5625,8 +5625,7 @@ void Heap::RegisterExternallyReferencedObject(Object** object) { ...@@ -5625,8 +5625,7 @@ void Heap::RegisterExternallyReferencedObject(Object** object) {
IncrementalMarking::MarkGrey(this, heap_object); IncrementalMarking::MarkGrey(this, heap_object);
} else { } else {
DCHECK(mark_compact_collector()->in_use()); DCHECK(mark_compact_collector()->in_use());
MarkBit mark_bit = ObjectMarking::MarkBitFrom(heap_object); mark_compact_collector()->MarkObject(heap_object);
mark_compact_collector()->MarkObject(heap_object, mark_bit);
} }
} }
......
...@@ -27,9 +27,7 @@ void MarkCompactCollector::UnshiftBlack(HeapObject* obj) { ...@@ -27,9 +27,7 @@ void MarkCompactCollector::UnshiftBlack(HeapObject* obj) {
} }
} }
void MarkCompactCollector::MarkObject(HeapObject* obj) {
void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) {
DCHECK(ObjectMarking::MarkBitFrom(obj) == mark_bit);
if (ObjectMarking::IsWhite(obj)) { if (ObjectMarking::IsWhite(obj)) {
ObjectMarking::WhiteToBlack(obj); ObjectMarking::WhiteToBlack(obj);
PushBlack(obj); PushBlack(obj);
......
...@@ -1080,17 +1080,11 @@ class StaticYoungGenerationMarkingVisitor ...@@ -1080,17 +1080,11 @@ class StaticYoungGenerationMarkingVisitor
Object* target = *p; Object* target = *p;
if (heap->InNewSpace(target)) { if (heap->InNewSpace(target)) {
if (MarkRecursively(heap, HeapObject::cast(target))) return; if (MarkRecursively(heap, HeapObject::cast(target))) return;
PushOnMarkingDeque(heap, target); heap->mark_compact_collector()->MarkObject(HeapObject::cast(target));
} }
} }
protected: protected:
inline static void PushOnMarkingDeque(Heap* heap, Object* obj) {
HeapObject* object = HeapObject::cast(obj);
MarkBit mark_bit = ObjectMarking::MarkBitFrom(object);
heap->mark_compact_collector()->MarkObject(object, mark_bit);
}
inline static bool MarkRecursively(Heap* heap, HeapObject* object) { inline static bool MarkRecursively(Heap* heap, HeapObject* object) {
StackLimitCheck check(heap->isolate()); StackLimitCheck check(heap->isolate());
if (check.HasOverflowed()) return false; if (check.HasOverflowed()) return false;
...@@ -1127,8 +1121,7 @@ class MarkCompactMarkingVisitor ...@@ -1127,8 +1121,7 @@ class MarkCompactMarkingVisitor
// Marks the object black and pushes it on the marking stack. // Marks the object black and pushes it on the marking stack.
INLINE(static void MarkObject(Heap* heap, HeapObject* object)) { INLINE(static void MarkObject(Heap* heap, HeapObject* object)) {
MarkBit mark = ObjectMarking::MarkBitFrom(object); heap->mark_compact_collector()->MarkObject(object);
heap->mark_compact_collector()->MarkObject(object, mark);
} }
// Marks the object black without pushing it on the marking stack. // Marks the object black without pushing it on the marking stack.
...@@ -1147,8 +1140,7 @@ class MarkCompactMarkingVisitor ...@@ -1147,8 +1140,7 @@ class MarkCompactMarkingVisitor
if (!(*p)->IsHeapObject()) return; if (!(*p)->IsHeapObject()) return;
HeapObject* target_object = HeapObject::cast(*p); HeapObject* target_object = HeapObject::cast(*p);
collector->RecordSlot(object, p, target_object); collector->RecordSlot(object, p, target_object);
MarkBit mark = ObjectMarking::MarkBitFrom(target_object); collector->MarkObject(target_object);
collector->MarkObject(target_object, mark);
} }
...@@ -1163,8 +1155,7 @@ class MarkCompactMarkingVisitor ...@@ -1163,8 +1155,7 @@ class MarkCompactMarkingVisitor
Heap* heap = obj->GetHeap(); Heap* heap = obj->GetHeap();
ObjectMarking::WhiteToBlack(obj); ObjectMarking::WhiteToBlack(obj);
// Mark the map pointer and the body. // Mark the map pointer and the body.
MarkBit map_mark = ObjectMarking::MarkBitFrom(map); heap->mark_compact_collector()->MarkObject(map);
heap->mark_compact_collector()->MarkObject(map, map_mark);
IterateBody(map, obj); IterateBody(map, obj);
} }
...@@ -1300,10 +1291,8 @@ class SharedFunctionInfoMarkingVisitor : public ObjectVisitor { ...@@ -1300,10 +1291,8 @@ class SharedFunctionInfoMarkingVisitor : public ObjectVisitor {
Object* obj = *slot; Object* obj = *slot;
if (obj->IsSharedFunctionInfo()) { if (obj->IsSharedFunctionInfo()) {
SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(obj); SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(obj);
MarkBit shared_mark = ObjectMarking::MarkBitFrom(shared); collector_->MarkObject(shared->code());
MarkBit code_mark = ObjectMarking::MarkBitFrom(shared->code()); collector_->MarkObject(shared);
collector_->MarkObject(shared->code(), code_mark);
collector_->MarkObject(shared, shared_mark);
} }
} }
...@@ -1321,12 +1310,10 @@ void MarkCompactCollector::PrepareThreadForCodeFlushing(Isolate* isolate, ...@@ -1321,12 +1310,10 @@ void MarkCompactCollector::PrepareThreadForCodeFlushing(Isolate* isolate,
// actual optimized code object. // actual optimized code object.
StackFrame* frame = it.frame(); StackFrame* frame = it.frame();
Code* code = frame->unchecked_code(); Code* code = frame->unchecked_code();
MarkBit code_mark = ObjectMarking::MarkBitFrom(code); MarkObject(code);
MarkObject(code, code_mark);
if (frame->is_optimized()) { if (frame->is_optimized()) {
Code* optimized_code = frame->LookupCode(); Code* optimized_code = frame->LookupCode();
MarkBit optimized_code_mark = ObjectMarking::MarkBitFrom(optimized_code); MarkObject(optimized_code);
MarkObject(optimized_code, optimized_code_mark);
} }
} }
} }
...@@ -1391,8 +1378,7 @@ class RootMarkingVisitor : public ObjectVisitor { ...@@ -1391,8 +1378,7 @@ class RootMarkingVisitor : public ObjectVisitor {
switch (mode) { switch (mode) {
case MarkCompactMode::FULL: { case MarkCompactMode::FULL: {
// Mark the map pointer and body, and push them on the marking stack. // Mark the map pointer and body, and push them on the marking stack.
MarkBit map_mark = ObjectMarking::MarkBitFrom(map); collector_->MarkObject(map);
collector_->MarkObject(map, map_mark);
MarkCompactMarkingVisitor::IterateBody(map, object); MarkCompactMarkingVisitor::IterateBody(map, object);
} break; } break;
case MarkCompactMode::YOUNG_GENERATION: case MarkCompactMode::YOUNG_GENERATION:
...@@ -2047,8 +2033,7 @@ void MarkCompactCollector::EmptyMarkingDeque() { ...@@ -2047,8 +2033,7 @@ void MarkCompactCollector::EmptyMarkingDeque() {
Map* map = object->map(); Map* map = object->map();
switch (mode) { switch (mode) {
case MarkCompactMode::FULL: { case MarkCompactMode::FULL: {
MarkBit map_mark = ObjectMarking::MarkBitFrom(map); MarkObject(map);
MarkObject(map, map_mark);
MarkCompactMarkingVisitor::IterateBody(map, object); MarkCompactMarkingVisitor::IterateBody(map, object);
} break; } break;
case MarkCompactMode::YOUNG_GENERATION: { case MarkCompactMode::YOUNG_GENERATION: {
......
...@@ -656,7 +656,7 @@ class MarkCompactCollector { ...@@ -656,7 +656,7 @@ class MarkCompactCollector {
// Marks the object black and pushes it on the marking stack. // Marks the object black and pushes it on the marking stack.
// This is for non-incremental marking only. // This is for non-incremental marking only.
INLINE(void MarkObject(HeapObject* obj, MarkBit mark_bit)); INLINE(void MarkObject(HeapObject* obj));
// Mark the heap roots and all objects reachable from them. // Mark the heap roots and all objects reachable from them.
void MarkRoots(RootMarkingVisitor<MarkCompactMode::FULL>* visitor); void MarkRoots(RootMarkingVisitor<MarkCompactMode::FULL>* visitor);
......
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