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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 // We should have one allocation sample. | 839 // We should have one allocation sample. |
840 EXPECT_EQ(1, profile.sample_count()); | 840 EXPECT_EQ(1, profile.sample_count()); |
841 ProfileTrieWalker walker(&profile); | 841 ProfileTrieWalker walker(&profile); |
842 | 842 |
843 walker.Reset(Profile::kExclusiveCode); | 843 walker.Reset(Profile::kExclusiveCode); |
844 EXPECT(walker.Down()); | 844 EXPECT(walker.Down()); |
845 #if defined(TARGET_OS_WINDOWS) | 845 #if defined(TARGET_OS_WINDOWS) |
846 // TODO(johnmccutchan): Hookup native symbol resolver on Windows. | 846 // TODO(johnmccutchan): Hookup native symbol resolver on Windows. |
847 EXPECT_SUBSTRING("[Native]", walker.CurrentName()); | 847 EXPECT_SUBSTRING("[Native]", walker.CurrentName()); |
848 #else | 848 #else |
849 EXPECT_SUBSTRING("dart::Profiler::RecordAllocation", walker.CurrentName()); | 849 EXPECT_SUBSTRING("dart::Profiler::SampleAllocation", walker.CurrentName()); |
850 #endif | 850 #endif |
851 EXPECT(!walker.Down()); | 851 EXPECT(!walker.Down()); |
852 } | 852 } |
853 | 853 |
854 // Disable allocation tracing for Class. | 854 // Disable allocation tracing for Class. |
855 class_class.SetTraceAllocation(false); | 855 class_class.SetTraceAllocation(false); |
856 | 856 |
857 // Invoke "bar" which during compilation, triggers a closure class allocation. | 857 // Invoke "bar" which during compilation, triggers a closure class allocation. |
858 result = Dart_Invoke(lib, NewString("bar"), 0, NULL); | 858 result = Dart_Invoke(lib, NewString("bar"), 0, NULL); |
859 EXPECT_VALID(result); | 859 EXPECT_VALID(result); |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 EXPECT(walker.Down()); | 1473 EXPECT(walker.Down()); |
1474 EXPECT_STREQ("go", walker.CurrentName()); | 1474 EXPECT_STREQ("go", walker.CurrentName()); |
1475 EXPECT(walker.Down()); | 1475 EXPECT(walker.Down()); |
1476 EXPECT_STREQ("main", walker.CurrentName()); | 1476 EXPECT_STREQ("main", walker.CurrentName()); |
1477 EXPECT(!walker.Down()); | 1477 EXPECT(!walker.Down()); |
1478 } | 1478 } |
1479 } | 1479 } |
1480 | 1480 |
1481 } // namespace dart | 1481 } // namespace dart |
1482 | 1482 |
OLD | NEW |