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

Unified Diff: runtime/vm/object_graph_test.cc

Issue 2566383002: ObjectGraph: Establish a HeapIterationScope *before* making the heap writable, least the sweeper in… (Closed)
Patch Set: . Created 4 years 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/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_graph_test.cc
diff --git a/runtime/vm/object_graph_test.cc b/runtime/vm/object_graph_test.cc
index 0b5c095826f3bb54a095e2b4cbc0fd4988e246a2..f840284fde0681dcdef46aa635b259d836e6498d 100644
--- a/runtime/vm/object_graph_test.cc
+++ b/runtime/vm/object_graph_test.cc
@@ -67,24 +67,27 @@ VM_TEST_CASE(ObjectGraph) {
d = Array::null();
ObjectGraph graph(thread);
{
- // Compare count and size when 'b' is/isn't skipped.
- CounterVisitor with(Object::null(), Object::null());
- graph.IterateObjectsFrom(a, &with);
- CounterVisitor without(b_raw, a.raw());
- graph.IterateObjectsFrom(a, &without);
- // Only 'b' and 'c' were cut off.
- EXPECT_EQ(2, with.count() - without.count());
- EXPECT_EQ(b_size + c_size, with.size() - without.size());
- }
- {
- // Like above, but iterate over the entire isolate. The counts and sizes
- // are thus larger, but the difference should still be just 'b' and 'c'.
- CounterVisitor with(Object::null(), Object::null());
- graph.IterateObjects(&with);
- CounterVisitor without(b_raw, a.raw());
- graph.IterateObjects(&without);
- EXPECT_EQ(2, with.count() - without.count());
- EXPECT_EQ(b_size + c_size, with.size() - without.size());
+ HeapIterationScope iteration_scope(true);
+ {
+ // Compare count and size when 'b' is/isn't skipped.
+ CounterVisitor with(Object::null(), Object::null());
+ graph.IterateObjectsFrom(a, &with);
+ CounterVisitor without(b_raw, a.raw());
+ graph.IterateObjectsFrom(a, &without);
+ // Only 'b' and 'c' were cut off.
+ EXPECT_EQ(2, with.count() - without.count());
+ EXPECT_EQ(b_size + c_size, with.size() - without.size());
+ }
+ {
+ // Like above, but iterate over the entire isolate. The counts and sizes
+ // are thus larger, but the difference should still be just 'b' and 'c'.
+ CounterVisitor with(Object::null(), Object::null());
+ graph.IterateObjects(&with);
+ CounterVisitor without(b_raw, a.raw());
+ graph.IterateObjects(&without);
+ EXPECT_EQ(2, with.count() - without.count());
+ EXPECT_EQ(b_size + c_size, with.size() - without.size());
+ }
}
EXPECT_EQ(a_size + b_size + c_size + d_size,
graph.SizeRetainedByInstance(a));
« no previous file with comments | « runtime/vm/object_graph.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698