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

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

Issue 2728113002: [heap] Remove Marking::AnyToGrey and change its callers to use simple marking functions. (Closed)
Patch Set: fixed comment Created 3 years, 10 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 | « no previous file | src/heap/mark-compact.h » ('j') | 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 64d8c056c8eba2b6721d46870c5c5d957e452074..b8ab1e926b85df7cf84073bbd7f4f9eca3cb8098 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -121,14 +121,6 @@ void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj) {
heap_->mark_compact_collector()->marking_deque()->Push(obj);
}
-
-static void MarkObjectGreyDoNotEnqueue(Object* obj) {
- if (obj->IsHeapObject()) {
- HeapObject* heap_obj = HeapObject::cast(obj);
- ObjectMarking::AnyToGrey(heap_obj);
- }
-}
-
void IncrementalMarking::TransferMark(Heap* heap, HeapObject* from,
HeapObject* to) {
DCHECK(MemoryChunk::FromAddress(from->address())->SweepingDone());
@@ -227,7 +219,14 @@ class IncrementalMarkingMarkingVisitor
// so the cache can be undefined.
Object* cache = context->get(Context::NORMALIZED_MAP_CACHE_INDEX);
if (!cache->IsUndefined(map->GetIsolate())) {
- MarkObjectGreyDoNotEnqueue(cache);
+ if (cache->IsHeapObject()) {
+ HeapObject* heap_obj = HeapObject::cast(cache);
+ // Mark the object grey if it is white, do not enque it into the marking
+ // deque.
+ if (ObjectMarking::IsWhite(heap_obj)) {
+ ObjectMarking::WhiteToGrey(heap_obj);
+ }
+ }
}
VisitNativeContext(map, context);
}
« no previous file with comments | « no previous file | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698