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

Unified Diff: runtime/vm/gc_marker.cc

Issue 18051007: - Revert r24564 and r24563 due to unexplained malloc corruption. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/vm/gc_marker.h ('k') | runtime/vm/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/gc_marker.cc
===================================================================
--- runtime/vm/gc_marker.cc (revision 24564)
+++ runtime/vm/gc_marker.cc (working copy)
@@ -379,21 +379,18 @@
}
-void GCMarker::ProcessWeakTables(PageSpace* page_space) {
- for (int sel = 0;
- sel < Heap::kNumWeakSelectors;
- sel++) {
- WeakTable* table = heap_->GetWeakTable(
- Heap::kOld, static_cast<Heap::WeakSelector>(sel));
- intptr_t size = table->size();
- for (intptr_t i = 0; i < size; i++) {
- if (table->IsValidEntryAt(i)) {
- RawObject* raw_obj = table->ObjectAt(i);
- ASSERT(raw_obj->IsHeapObject());
- if (!raw_obj->IsMarked()) {
- table->InvalidateAt(i);
- }
- }
+void GCMarker::ProcessPeerReferents(PageSpace* page_space) {
+ PageSpace::PeerTable* peer_table = page_space->GetPeerTable();
+ PageSpace::PeerTable::iterator it = peer_table->begin();
+ while (it != peer_table->end()) {
+ RawObject* raw_obj = it->first;
+ ASSERT(raw_obj->IsHeapObject());
+ if (raw_obj->IsMarked()) {
+ // The object has survived. Do nothing.
+ ++it;
+ } else {
+ // The object has become garbage. Remove its record.
+ peer_table->erase(it++);
}
}
}
@@ -411,7 +408,7 @@
MarkingWeakVisitor mark_weak;
IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks);
mark.Finalize();
- ProcessWeakTables(page_space);
+ ProcessPeerReferents(page_space);
Epilogue(isolate, invoke_api_callbacks);
}
« no previous file with comments | « runtime/vm/gc_marker.h ('k') | runtime/vm/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698