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

Unified Diff: runtime/vm/gc_marker.cc

Issue 2930943002: Debug garbage collector does not correctly remove cross-gen garbage (Closed)
Patch Set: Created 3 years, 6 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 | runtime/vm/heap.h » ('j') | runtime/vm/heap.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/gc_marker.cc
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index ef11a9467867e676bc1d7dc75e407f3d6953d8be..6b6971bfa53104ca13ceaace097a02d3a7402333 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -191,7 +191,11 @@ class MarkingVisitorBase : public ObjectPointerVisitor {
// The key is marked so we make sure to properly visit all pointers
// originating from this weak property.
- VisitingOldObject(cur_weak);
+ if (cur_weak->IsOldObject()) {
+ VisitingOldObject(cur_weak);
+ } else {
+ VisitingOldObject(NULL);
+ }
cur_weak->VisitPointersNonvirtual(this);
} else {
// Requeue this weak property to be handled later.
@@ -217,7 +221,12 @@ class MarkingVisitorBase : public ObjectPointerVisitor {
do {
do {
// First drain the marking stacks.
- VisitingOldObject(raw_obj);
+ if (raw_obj->IsOldObject()) {
+ VisitingOldObject(raw_obj);
+ } else {
+ VisitingOldObject(NULL);
+ }
+
const intptr_t class_id = raw_obj->GetClassId();
if (class_id != kWeakPropertyCid) {
marked_bytes_ += raw_obj->VisitPointersNonvirtual(this);
@@ -306,7 +315,8 @@ class MarkingVisitorBase : public ObjectPointerVisitor {
void PushMarked(RawObject* raw_obj) {
ASSERT(raw_obj->IsHeapObject());
ASSERT((FLAG_verify_gc_contains)
- ? page_space_->Contains(RawObject::ToAddr(raw_obj))
+ ? ((page_space_->Contains(RawObject::ToAddr(raw_obj))) ||
+ (heap_->new_space()->Contains(RawObject::ToAddr(raw_obj))))
: true);
// Push the marked object on the marking stack.
@@ -335,6 +345,9 @@ class MarkingVisitorBase : public ObjectPointerVisitor {
// Fast exit if the raw object is marked.
if (raw_obj->IsMarked()) {
+ if (raw_obj->IsNewObject()) {
+ ProcessNewSpaceObject(raw_obj, p);
+ }
return;
}
@@ -346,7 +359,6 @@ class MarkingVisitorBase : public ObjectPointerVisitor {
// ...
if (raw_obj->IsNewObject()) {
ProcessNewSpaceObject(raw_obj, p);
- return;
}
if (!TryAcquireMarkBit(raw_obj)) {
@@ -472,9 +484,6 @@ void GCMarker::IterateRoots(Isolate* isolate,
isolate->VisitObjectPointers(visitor,
StackFrameIterator::kDontValidateFrames);
}
- if ((slice_index == 1) || (num_slices <= 1)) {
- heap_->new_space()->VisitObjectPointers(visitor);
- }
// For now, we just distinguish two parts of the root set, so any remaining
// slices are empty.
« no previous file with comments | « no previous file | runtime/vm/heap.h » ('j') | runtime/vm/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698