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

Unified Diff: src/mark-compact.cc

Issue 439233002: Remove all encountered weak maps from the list of weak collections when incremental marking is abor… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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/mark-compact.h ('k') | test/cctest/cctest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 9dbadacfb86b49785a7c78c43c8b5087f555fbc8..367b65a9e5fe4042e21fab914d28ceb9d4b09c39 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -968,6 +968,7 @@ void MarkCompactCollector::Prepare() {
if (was_marked_incrementally_ && abort_incremental_marking_) {
heap()->incremental_marking()->Abort();
ClearMarkbits();
+ AbortWeakCollections();
AbortCompaction();
was_marked_incrementally_ = false;
}
@@ -2800,6 +2801,20 @@ void MarkCompactCollector::ClearWeakCollections() {
}
+void MarkCompactCollector::AbortWeakCollections() {
+ GCTracer::Scope gc_scope(heap()->tracer(),
+ GCTracer::Scope::MC_WEAKCOLLECTION_ABORT);
+ Object* weak_collection_obj = heap()->encountered_weak_collections();
+ while (weak_collection_obj != Smi::FromInt(0)) {
+ JSWeakCollection* weak_collection =
+ reinterpret_cast<JSWeakCollection*>(weak_collection_obj);
+ weak_collection_obj = weak_collection->next();
+ weak_collection->set_next(heap()->undefined_value());
+ }
+ heap()->set_encountered_weak_collections(Smi::FromInt(0));
+}
+
+
void MarkCompactCollector::RecordMigratedSlot(Object* value, Address slot) {
if (heap_->InNewSpace(value)) {
heap_->store_buffer()->Mark(slot);
« no previous file with comments | « src/mark-compact.h ('k') | test/cctest/cctest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698