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

Unified Diff: test/cctest/test-weakmaps.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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-weakmaps.cc
diff --git a/test/cctest/test-weakmaps.cc b/test/cctest/test-weakmaps.cc
index 2f28cb6c111d71bf487c8cb8c1dba401db7e987a..72116d43ca8d700685451d05e4e0da504bcbddea 100644
--- a/test/cctest/test-weakmaps.cc
+++ b/test/cctest/test-weakmaps.cc
@@ -255,3 +255,28 @@ TEST(Regress2060b) {
heap->CollectAllGarbage(Heap::kNoGCFlags);
heap->CollectAllGarbage(Heap::kNoGCFlags);
}
+
+
+TEST(Regress399527) {
+ CcTest::InitializeVM();
+ v8::HandleScope scope(CcTest::isolate());
+ Isolate* isolate = CcTest::i_isolate();
+ Heap* heap = isolate->heap();
+
+ {
+ HandleScope scope(isolate);
+ Handle<JSWeakMap> weak_map = AllocateJSWeakMap(isolate);
+ IncrementalMarking* marking = heap->incremental_marking();
+ if (marking->IsStopped()) {
Michael Starzinger 2014/08/04 15:15:37 Please use SimulateIncrementalMarking instead of t
Hannes Payer (out of office) 2014/08/04 15:31:44 Done.
+ marking->Start();
+ }
+
+ while (!Marking::IsBlack(Marking::MarkBitFrom(*weak_map))) {
+ marking->Step(MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD);
+ }
+ }
+ // The weak map is marked black here but leaving the handle scope will make
+ // the object unreachable. Aborting incremental marking will clear all the
+ // marking bits which makes the weak map garbage.
+ heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
+}
« no previous file with comments | « src/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698