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

Unified Diff: runtime/vm/profiler_test.cc

Issue 1584223006: Remove signature classes from the VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 11 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 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.
« 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