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

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

Issue 2053523003: 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
« src/profiler/profiler-listener.cc ('K') | « 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 71c5ba874363b5941b44880ef259dde27b253d05..fa137030d475aa091abeee925b6683c84be6b772 100644
--- a/test/cctest/test-profile-generator.cc
+++ b/test/cctest/test-profile-generator.cc
@@ -347,9 +347,9 @@ TEST(RecordTickSample) {
CpuProfilesCollection profiles(CcTest::heap());
profiles.StartProfiling("", false);
ProfileGenerator generator(&profiles);
- CodeEntry* entry1 = profiles.NewCodeEntry(i::Logger::FUNCTION_TAG, "aaa");
- CodeEntry* entry2 = profiles.NewCodeEntry(i::Logger::FUNCTION_TAG, "bbb");
- CodeEntry* entry3 = profiles.NewCodeEntry(i::Logger::FUNCTION_TAG, "ccc");
+ 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");
generator.code_map()->AddCode(ToAddress(0x1500), entry1, 0x200);
generator.code_map()->AddCode(ToAddress(0x1700), entry2, 0x100);
generator.code_map()->AddCode(ToAddress(0x1900), entry3, 0x50);
@@ -397,6 +397,10 @@ TEST(RecordTickSample) {
ProfileNode* node4 = top_down_test_helper.Walk(entry1, entry3, entry1);
CHECK(node4);
CHECK_EQ(entry1, node4->entry());
+
+ delete entry1;
+ delete entry2;
+ delete entry3;
}
@@ -413,9 +417,9 @@ TEST(SampleIds) {
CpuProfilesCollection profiles(CcTest::heap());
profiles.StartProfiling("", true);
ProfileGenerator generator(&profiles);
- CodeEntry* entry1 = profiles.NewCodeEntry(i::Logger::FUNCTION_TAG, "aaa");
- CodeEntry* entry2 = profiles.NewCodeEntry(i::Logger::FUNCTION_TAG, "bbb");
- CodeEntry* entry3 = profiles.NewCodeEntry(i::Logger::FUNCTION_TAG, "ccc");
+ 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");
generator.code_map()->AddCode(ToAddress(0x1500), entry1, 0x200);
generator.code_map()->AddCode(ToAddress(0x1700), entry2, 0x100);
generator.code_map()->AddCode(ToAddress(0x1900), entry3, 0x50);
@@ -456,6 +460,10 @@ TEST(SampleIds) {
for (int i = 0; i < 3; i++) {
CHECK_EQ(expected_id[i], profile->sample(i)->id());
}
+
+ delete entry1;
+ delete entry2;
+ delete entry3;
}
@@ -464,7 +472,7 @@ TEST(NoSamples) {
CpuProfilesCollection profiles(CcTest::heap());
profiles.StartProfiling("", false);
ProfileGenerator generator(&profiles);
- CodeEntry* entry1 = profiles.NewCodeEntry(i::Logger::FUNCTION_TAG, "aaa");
+ CodeEntry* entry1 = new CodeEntry(i::Logger::FUNCTION_TAG, "aaa");
generator.code_map()->AddCode(ToAddress(0x1500), entry1, 0x200);
// We are building the following calls tree:
@@ -481,6 +489,8 @@ TEST(NoSamples) {
CHECK_EQ(3u, nodeId - 1);
CHECK_EQ(0, profile->samples_count());
+
+ delete entry1;
}
« src/profiler/profiler-listener.cc ('K') | « test/cctest/test-cpu-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698