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

Unified Diff: test/cctest/test-profile-generator.cc

Issue 2079273003: Revert of Refactor CpuProfiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « test/cctest/test-cpu-profiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-profile-generator.cc
diff --git a/test/cctest/test-profile-generator.cc b/test/cctest/test-profile-generator.cc
index 7e59839414dc711ffffeb0290e47124773f78f5a..94dc442b3a5ad64332a423cf235539ea4a581c6c 100644
--- a/test/cctest/test-profile-generator.cc
+++ b/test/cctest/test-profile-generator.cc
@@ -348,9 +348,12 @@
profiles.set_cpu_profiler(CcTest::i_isolate()->cpu_profiler());
profiles.StartProfiling("", false);
ProfileGenerator generator(&profiles);
- CodeEntry* entry1 = new CodeEntry(i::Logger::FUNCTION_TAG, "aaa");
- CodeEntry* entry2 = new CodeEntry(i::Logger::FUNCTION_TAG, "bbb");
- CodeEntry* entry3 = new CodeEntry(i::Logger::FUNCTION_TAG, "ccc");
+ CodeEntry* entry1 =
+ profiles.NewCodeEntry(i::CodeEventListener::FUNCTION_TAG, "aaa");
+ CodeEntry* entry2 =
+ profiles.NewCodeEntry(i::CodeEventListener::FUNCTION_TAG, "bbb");
+ CodeEntry* entry3 =
+ profiles.NewCodeEntry(i::CodeEventListener::FUNCTION_TAG, "ccc");
generator.code_map()->AddCode(ToAddress(0x1500), entry1, 0x200);
generator.code_map()->AddCode(ToAddress(0x1700), entry2, 0x100);
generator.code_map()->AddCode(ToAddress(0x1900), entry3, 0x50);
@@ -398,10 +401,6 @@
ProfileNode* node4 = top_down_test_helper.Walk(entry1, entry3, entry1);
CHECK(node4);
CHECK_EQ(entry1, node4->entry());
-
- delete entry1;
- delete entry2;
- delete entry3;
}
@@ -419,9 +418,12 @@
profiles.set_cpu_profiler(CcTest::i_isolate()->cpu_profiler());
profiles.StartProfiling("", true);
ProfileGenerator generator(&profiles);
- CodeEntry* entry1 = new CodeEntry(i::Logger::FUNCTION_TAG, "aaa");
- CodeEntry* entry2 = new CodeEntry(i::Logger::FUNCTION_TAG, "bbb");
- CodeEntry* entry3 = new CodeEntry(i::Logger::FUNCTION_TAG, "ccc");
+ CodeEntry* entry1 =
+ profiles.NewCodeEntry(i::CodeEventListener::FUNCTION_TAG, "aaa");
+ CodeEntry* entry2 =
+ profiles.NewCodeEntry(i::CodeEventListener::FUNCTION_TAG, "bbb");
+ CodeEntry* entry3 =
+ profiles.NewCodeEntry(i::CodeEventListener::FUNCTION_TAG, "ccc");
generator.code_map()->AddCode(ToAddress(0x1500), entry1, 0x200);
generator.code_map()->AddCode(ToAddress(0x1700), entry2, 0x100);
generator.code_map()->AddCode(ToAddress(0x1900), entry3, 0x50);
@@ -462,10 +464,6 @@
for (int i = 0; i < 3; i++) {
CHECK_EQ(expected_id[i], profile->sample(i)->id());
}
-
- delete entry1;
- delete entry2;
- delete entry3;
}
@@ -475,7 +473,8 @@
profiles.set_cpu_profiler(CcTest::i_isolate()->cpu_profiler());
profiles.StartProfiling("", false);
ProfileGenerator generator(&profiles);
- CodeEntry* entry1 = new CodeEntry(i::Logger::FUNCTION_TAG, "aaa");
+ CodeEntry* entry1 =
+ profiles.NewCodeEntry(i::CodeEventListener::FUNCTION_TAG, "aaa");
generator.code_map()->AddCode(ToAddress(0x1500), entry1, 0x200);
// We are building the following calls tree:
@@ -492,8 +491,6 @@
CHECK_EQ(3u, nodeId - 1);
CHECK_EQ(0, profile->samples_count());
-
- delete entry1;
}
« no previous file with comments | « test/cctest/test-cpu-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698