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