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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL); | 950 Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL); |
951 EXPECT_VALID(lib); | 951 EXPECT_VALID(lib); |
952 Library& root_library = Library::Handle(); | 952 Library& root_library = Library::Handle(); |
953 root_library ^= Api::UnwrapHandle(lib); | 953 root_library ^= Api::UnwrapHandle(lib); |
954 Isolate* isolate = thread->isolate(); | 954 Isolate* isolate = thread->isolate(); |
955 | 955 |
956 const Library& typed_data_library = | 956 const Library& typed_data_library = |
957 Library::Handle(isolate->object_store()->typed_data_library()); | 957 Library::Handle(isolate->object_store()->typed_data_library()); |
958 | 958 |
959 const Class& float32_list_class = | 959 const Class& float32_list_class = |
960 Class::Handle(GetClass(typed_data_library, "_Float32Array")); | 960 Class::Handle(GetClass(typed_data_library, "Float32List")); |
961 EXPECT(!float32_list_class.IsNull()); | 961 EXPECT(!float32_list_class.IsNull()); |
962 | 962 |
963 Dart_Handle result = Dart_Invoke(lib, NewString("foo"), 0, NULL); | 963 Dart_Handle result = Dart_Invoke(lib, NewString("foo"), 0, NULL); |
964 EXPECT_VALID(result); | 964 EXPECT_VALID(result); |
965 | 965 |
966 { | 966 { |
967 StackZone zone(thread); | 967 StackZone zone(thread); |
968 HANDLESCOPE(thread); | 968 HANDLESCOPE(thread); |
969 Profile profile(isolate); | 969 Profile profile(isolate); |
970 AllocationFilter filter(isolate, float32_list_class.id()); | 970 AllocationFilter filter(isolate, float32_list_class.id()); |
(...skipping 11 matching lines...) Expand all 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._Float32Array", walker.CurrentName()); | |
993 EXPECT(walker.Down()); | |
994 EXPECT_STREQ("Float32List.Float32List", walker.CurrentName()); | 992 EXPECT_STREQ("Float32List.Float32List", walker.CurrentName()); |
995 EXPECT(walker.Down()); | 993 EXPECT(walker.Down()); |
996 EXPECT_STREQ("foo", walker.CurrentName()); | 994 EXPECT_STREQ("foo", walker.CurrentName()); |
997 EXPECT(!walker.Down()); | 995 EXPECT(!walker.Down()); |
998 } | 996 } |
999 | 997 |
1000 float32_list_class.SetTraceAllocation(false); | 998 float32_list_class.SetTraceAllocation(false); |
1001 result = Dart_Invoke(lib, NewString("foo"), 0, NULL); | 999 result = Dart_Invoke(lib, NewString("foo"), 0, NULL); |
1002 EXPECT_VALID(result); | 1000 EXPECT_VALID(result); |
1003 | 1001 |
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2295 EXPECT_EQ(1, walker.CurrentInclusiveTicks()); | 2293 EXPECT_EQ(1, walker.CurrentInclusiveTicks()); |
2296 EXPECT_EQ(0, walker.CurrentExclusiveTicks()); | 2294 EXPECT_EQ(0, walker.CurrentExclusiveTicks()); |
2297 EXPECT_STREQ("bacon", walker.CurrentToken()); | 2295 EXPECT_STREQ("bacon", walker.CurrentToken()); |
2298 EXPECT(!walker.Down()); | 2296 EXPECT(!walker.Down()); |
2299 } | 2297 } |
2300 } | 2298 } |
2301 | 2299 |
2302 #endif // !PRODUCT | 2300 #endif // !PRODUCT |
2303 | 2301 |
2304 } // namespace dart | 2302 } // namespace dart |
OLD | NEW |