Index: runtime/vm/profiler_test.cc |
diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc |
index 63ac759d663f9ef4f976a8cad0496adee1d9176d..4c309710ed3e2c942a918b6950b6f15a15dc42ef 100644 |
--- a/runtime/vm/profiler_test.cc |
+++ b/runtime/vm/profiler_test.cc |
@@ -853,7 +853,7 @@ TEST_CASE(Profiler_ContextAllocation) { |
} |
-TEST_CASE(Profiler_ClassAllocation) { |
+TEST_CASE(Profiler_ClosureAllocation) { |
DisableNativeProfileScope dnps; |
const char* kScript = |
"var msg1 = 'a';\n" |
@@ -875,12 +875,12 @@ TEST_CASE(Profiler_ClassAllocation) { |
root_library ^= Api::UnwrapHandle(lib); |
Isolate* isolate = thread->isolate(); |
- const Class& class_class = |
- Class::Handle(Object::class_class()); |
- EXPECT(!class_class.IsNull()); |
- class_class.SetTraceAllocation(true); |
+ const Class& closure_class = |
+ Class::Handle(Isolate::Current()->object_store()->closure_class()); |
+ EXPECT(!closure_class.IsNull()); |
+ closure_class.SetTraceAllocation(true); |
- // Invoke "foo" which during compilation, triggers a closure class allocation. |
+ // Invoke "foo" which during compilation, triggers a closure allocation. |
Dart_Handle result = Dart_Invoke(lib, NewString("foo"), 0, NULL); |
EXPECT_VALID(result); |
@@ -888,7 +888,7 @@ TEST_CASE(Profiler_ClassAllocation) { |
StackZone zone(thread); |
HANDLESCOPE(thread); |
Profile profile(isolate); |
- AllocationFilter filter(isolate, class_class.id()); |
+ AllocationFilter filter(isolate, closure_class.id()); |
filter.set_enable_vm_ticks(true); |
profile.Build(thread, &filter, Profile::kNoTags); |
// We should have one allocation sample. |
@@ -897,19 +897,14 @@ TEST_CASE(Profiler_ClassAllocation) { |
walker.Reset(Profile::kExclusiveCode); |
EXPECT(walker.Down()); |
-#if defined(TARGET_OS_WINDOWS) |
- // TODO(johnmccutchan): Hookup native symbol resolver on Windows. |
- EXPECT_SUBSTRING("[Native]", walker.CurrentName()); |
-#else |
- EXPECT_SUBSTRING("dart::Profiler::SampleAllocation", walker.CurrentName()); |
-#endif |
+ EXPECT_SUBSTRING("foo", walker.CurrentName()); |
EXPECT(!walker.Down()); |
} |
- // Disable allocation tracing for Class. |
- class_class.SetTraceAllocation(false); |
+ // Disable allocation tracing for Closure. |
+ closure_class.SetTraceAllocation(false); |
- // Invoke "bar" which during compilation, triggers a closure class allocation. |
+ // Invoke "bar" which during compilation, triggers a closure allocation. |
result = Dart_Invoke(lib, NewString("bar"), 0, NULL); |
EXPECT_VALID(result); |
@@ -917,7 +912,7 @@ TEST_CASE(Profiler_ClassAllocation) { |
StackZone zone(thread); |
HANDLESCOPE(thread); |
Profile profile(isolate); |
- AllocationFilter filter(isolate, class_class.id()); |
+ AllocationFilter filter(isolate, closure_class.id()); |
filter.set_enable_vm_ticks(true); |
profile.Build(thread, &filter, Profile::kNoTags); |
// We should still only have one allocation sample. |