OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
6 | 6 |
7 #include "vm/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/profiler.h" | 10 #include "vm/profiler.h" |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 HANDLESCOPE(thread); | 982 HANDLESCOPE(thread); |
983 Profile profile(isolate); | 983 Profile profile(isolate); |
984 AllocationFilter filter(isolate, float32_list_class.id()); | 984 AllocationFilter filter(isolate, float32_list_class.id()); |
985 profile.Build(thread, &filter, Profile::kNoTags); | 985 profile.Build(thread, &filter, Profile::kNoTags); |
986 // We should have one allocation sample. | 986 // We should have one allocation sample. |
987 EXPECT_EQ(1, profile.sample_count()); | 987 EXPECT_EQ(1, profile.sample_count()); |
988 ProfileTrieWalker walker(&profile); | 988 ProfileTrieWalker walker(&profile); |
989 | 989 |
990 walker.Reset(Profile::kExclusiveCode); | 990 walker.Reset(Profile::kExclusiveCode); |
991 EXPECT(walker.Down()); | 991 EXPECT(walker.Down()); |
992 EXPECT_STREQ("_Float32Array._new", walker.CurrentName()); | |
993 EXPECT(walker.Down()); | |
994 EXPECT_STREQ("_Float32Array._Float32Array", walker.CurrentName()); | 992 EXPECT_STREQ("_Float32Array._Float32Array", walker.CurrentName()); |
995 EXPECT(walker.Down()); | 993 EXPECT(walker.Down()); |
996 EXPECT_STREQ("Float32List.Float32List", walker.CurrentName()); | 994 EXPECT_STREQ("Float32List.Float32List", walker.CurrentName()); |
997 EXPECT(walker.Down()); | 995 EXPECT(walker.Down()); |
998 EXPECT_STREQ("foo", walker.CurrentName()); | 996 EXPECT_STREQ("foo", walker.CurrentName()); |
999 EXPECT(!walker.Down()); | 997 EXPECT(!walker.Down()); |
1000 } | 998 } |
1001 | 999 |
1002 float32_list_class.SetTraceAllocation(false); | 1000 float32_list_class.SetTraceAllocation(false); |
1003 result = Dart_Invoke(lib, NewString("foo"), 0, NULL); | 1001 result = Dart_Invoke(lib, NewString("foo"), 0, NULL); |
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2297 EXPECT_EQ(1, walker.CurrentInclusiveTicks()); | 2295 EXPECT_EQ(1, walker.CurrentInclusiveTicks()); |
2298 EXPECT_EQ(0, walker.CurrentExclusiveTicks()); | 2296 EXPECT_EQ(0, walker.CurrentExclusiveTicks()); |
2299 EXPECT_STREQ("bacon", walker.CurrentToken()); | 2297 EXPECT_STREQ("bacon", walker.CurrentToken()); |
2300 EXPECT(!walker.Down()); | 2298 EXPECT(!walker.Down()); |
2301 } | 2299 } |
2302 } | 2300 } |
2303 | 2301 |
2304 #endif // !PRODUCT | 2302 #endif // !PRODUCT |
2305 | 2303 |
2306 } // namespace dart | 2304 } // namespace dart |
OLD | NEW |