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

Unified Diff: runtime/vm/object_test.cc

Issue 1212943010: Safer interface for heap iteration. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix release mode. Created 5 years, 5 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/object_graph.cc ('k') | runtime/vm/pages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_test.cc
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 028455deab2356593c5ce032d5c27fb5384cafc0..156fb485e132143d44f3dcad486a1fc55849abad 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -4248,19 +4248,9 @@ class ObjectAccumulator : public ObjectVisitor {
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->VisitObjects(&acc);
+ heap->IterateObjects(&acc);
for (intptr_t i = 0; i < objects.length(); ++i) {
JSONStream js;
objects[i]->PrintJSON(&js, false);
« no previous file with comments | « runtime/vm/object_graph.cc ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698