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

Unified Diff: runtime/vm/object_test.cc

Issue 729603004: Wait for concurrent sweeper in vm/cc/PrintJSON. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_test.cc
===================================================================
--- runtime/vm/object_test.cc (revision 41751)
+++ runtime/vm/object_test.cc (working copy)
@@ -4133,6 +4133,16 @@
TEST_CASE(PrintJSON) {
Heap* heap = Isolate::Current()->heap();
heap->CollectAllGarbage();
+ // We don't want to print garbage objects, so wait for concurrent sweeper.
+ // TODO(21620): Add heap iteration interface that excludes garbage (or
+ // use ObjectGraph).
+ PageSpace* old_space = heap->old_space();
+ {
+ MonitorLocker ml(old_space->tasks_lock());
+ while (old_space->tasks() > 0) {
+ ml.Wait();
+ }
+ }
GrowableArray<Object*> objects;
ObjectAccumulator acc(&objects);
heap->IterateObjects(&acc);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698