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

Unified Diff: src/heap/scavenger.cc

Issue 2770253002: [heap] Enforce explicit MarkingState (Closed)
Patch Set: rebase Created 3 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/objects-visiting-inl.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/scavenger.cc
diff --git a/src/heap/scavenger.cc b/src/heap/scavenger.cc
index bbbd2f240efb9b67b7c82e96f0e86bf7f5c0e2c9..4a7bb134cf0f3bd36b2714812b139ad8ab39d8d1 100644
--- a/src/heap/scavenger.cc
+++ b/src/heap/scavenger.cc
@@ -200,8 +200,10 @@ class ScavengingVisitor : public StaticVisitorBase {
reinterpret_cast<base::AtomicWord>(target));
if (object_contents == POINTER_OBJECT) {
- heap->promotion_queue()->insert(target, object_size,
- ObjectMarking::IsBlack(object));
+ // TODO(mlippautz): Query collector for marking state.
+ heap->promotion_queue()->insert(
+ target, object_size,
+ ObjectMarking::IsBlack(object, MarkingState::Internal(object)));
}
heap->IncrementPromotedObjectsSize(object_size);
return true;
@@ -245,7 +247,9 @@ class ScavengingVisitor : public StaticVisitorBase {
DCHECK(map_word.IsForwardingAddress());
HeapObject* target = map_word.ToForwardingAddress();
- if (ObjectMarking::IsBlack(target)) {
+ // TODO(mlippautz): Notify collector of this object so we don't have to
+ // retrieve the state our of thin air.
+ if (ObjectMarking::IsBlack(target, MarkingState::Internal(target))) {
// This object is black and it might not be rescanned by marker.
// We should explicitly record code entry slot for compaction because
// promotion queue processing (IteratePromotedObjectPointers) will
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698