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; |
} |