Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1179)

Unified Diff: src/heap/incremental-marking.cc

Issue 1007793002: Extract code to mark an object during incremental marking (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/incremental-marking.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc
index 76c05de6065be5da1c51e8a7f7f8894f1eed82fb..97135d76661d76fd1b556b8de566bb3765ccee57 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -251,13 +251,7 @@ class IncrementalMarkingMarkingVisitor
// Marks the object grey and pushes it on the marking stack.
INLINE(static void MarkObject(Heap* heap, Object* obj)) {
- HeapObject* heap_object = HeapObject::cast(obj);
- MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
- if (mark_bit.data_only()) {
- MarkBlackOrKeepGrey(heap_object, mark_bit, heap_object->Size());
- } else if (Marking::IsWhite(mark_bit)) {
- heap->incremental_marking()->WhiteToGreyAndPush(heap_object, mark_bit);
- }
+ IncrementalMarking::MarkObject(heap, obj);
}
// Marks the object black without pushing it on the marking stack.
@@ -280,7 +274,7 @@ class IncrementalMarkingRootMarkingVisitor : public ObjectVisitor {
public:
explicit IncrementalMarkingRootMarkingVisitor(
IncrementalMarking* incremental_marking)
- : incremental_marking_(incremental_marking) {}
+ : heap_(incremental_marking->heap()) {}
void VisitPointer(Object** p) { MarkObjectByPointer(p); }
@@ -293,18 +287,10 @@ class IncrementalMarkingRootMarkingVisitor : public ObjectVisitor {
Object* obj = *p;
if (!obj->IsHeapObject()) return;
- HeapObject* heap_object = HeapObject::cast(obj);
- MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
- if (mark_bit.data_only()) {
- MarkBlackOrKeepGrey(heap_object, mark_bit, heap_object->Size());
- } else {
- if (Marking::IsWhite(mark_bit)) {
- incremental_marking_->WhiteToGreyAndPush(heap_object, mark_bit);
- }
- }
+ IncrementalMarking::MarkObject(heap_, obj);
}
- IncrementalMarking* incremental_marking_;
+ Heap* heap_;
};
@@ -639,6 +625,17 @@ void IncrementalMarking::VisitObject(Map* map, HeapObject* obj, int size) {
}
+void IncrementalMarking::MarkObject(Heap* heap, Object* obj) {
+ HeapObject* heap_object = HeapObject::cast(obj);
+ MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
+ if (mark_bit.data_only()) {
+ MarkBlackOrKeepGrey(heap_object, mark_bit, heap_object->Size());
+ } else if (Marking::IsWhite(mark_bit)) {
+ heap->incremental_marking()->WhiteToGreyAndPush(heap_object, mark_bit);
+ }
+}
+
+
intptr_t IncrementalMarking::ProcessMarkingDeque(intptr_t bytes_to_process) {
intptr_t bytes_processed = 0;
Map* filler_map = heap_->one_pointer_filler_map();
« no previous file with comments | « src/heap/incremental-marking.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698