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

Unified Diff: runtime/vm/object_graph_test.cc

Issue 336683003: Light-weight stats counters for experiments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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
Index: runtime/vm/object_graph_test.cc
===================================================================
--- runtime/vm/object_graph_test.cc (revision 37279)
+++ runtime/vm/object_graph_test.cc (working copy)
@@ -8,11 +8,11 @@
namespace dart {
-class Counter : public ObjectGraph::Visitor {
+class CounterVisitor : public ObjectGraph::Visitor {
public:
// Records the number of objects and total size visited, excluding 'skip'
// and any objects only reachable through 'skip'.
- Counter(RawObject* skip, RawObject* expected_parent)
+ CounterVisitor(RawObject* skip, RawObject* expected_parent)
: count_(0), size_(0), skip_(skip), expected_parent_(expected_parent) { }
virtual Direction VisitObject(ObjectGraph::StackIterator* it) {
@@ -68,9 +68,9 @@
ObjectGraph graph(isolate);
{
// Compare count and size when 'b' is/isn't skipped.
- Counter with(Object::null(), Object::null());
+ CounterVisitor with(Object::null(), Object::null());
graph.IterateObjectsFrom(a, &with);
- Counter without(b_raw, a.raw());
+ CounterVisitor without(b_raw, a.raw());
graph.IterateObjectsFrom(a, &without);
// Only 'b' and 'c' were cut off.
EXPECT_EQ(2, with.count() - without.count());
@@ -80,9 +80,9 @@
{
// 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'.
- Counter with(Object::null(), Object::null());
+ CounterVisitor with(Object::null(), Object::null());
graph.IterateObjects(&with);
- Counter without(b_raw, a.raw());
+ CounterVisitor without(b_raw, a.raw());
graph.IterateObjects(&without);
EXPECT_EQ(2, with.count() - without.count());
EXPECT_EQ(b_size + c_size,
« runtime/vm/counters.cc ('K') | « runtime/vm/isolate.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698