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

Unified Diff: runtime/vm/profiler_test.cc

Issue 2968003004: Revert "The current growth strategy for growable arrays allocates a backing array of size 2 at (emp… (Closed)
Patch Set: Created 3 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/precompiler.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_test.cc
diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc
index f14deacd30680edf625c019d8b2572a36b1067c9..17f0fdc41ee36058bd50a75dcfd336b06bdc4650 100644
--- a/runtime/vm/profiler_test.cc
+++ b/runtime/vm/profiler_test.cc
@@ -1027,9 +1027,24 @@ TEST_CASE(Profiler_ArrayAllocation) {
Profile profile(isolate);
AllocationFilter filter(isolate->main_port(), array_class.id());
profile.Build(thread, &filter, Profile::kNoTags);
- // We should have no allocation samples, since empty
- // growable lists use a shared backing.
- EXPECT_EQ(0, profile.sample_count());
+ // We should still only have one allocation sample.
+ EXPECT_EQ(1, profile.sample_count());
+ ProfileTrieWalker walker(&profile);
+
+ walker.Reset(Profile::kExclusiveCode);
+ EXPECT(walker.Down());
+ EXPECT_STREQ("DRT_AllocateArray", walker.CurrentName());
+ EXPECT(walker.Down());
+ EXPECT_STREQ("[Stub] AllocateArray", walker.CurrentName());
+ EXPECT(walker.Down());
+ EXPECT_STREQ("new _List", walker.CurrentName());
+ EXPECT(walker.Down());
+ EXPECT_STREQ("new _GrowableList", walker.CurrentName());
+ EXPECT(walker.Down());
+ EXPECT_STREQ("new List._internal", walker.CurrentName());
+ EXPECT(walker.Down());
+ EXPECT_STREQ("bar", walker.CurrentName());
+ EXPECT(!walker.Down());
}
}
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698