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

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

Issue 2061623002: Introduce JIT code events dispatcher for the isolate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebaseline 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 71c5ba874363b5941b44880ef259dde27b253d05..cd5303aad35726fc48459963005ff69fe4d2b760 100644
--- a/test/cctest/test-profile-generator.cc
+++ b/test/cctest/test-profile-generator.cc
@@ -51,17 +51,17 @@ TEST(ProfileNodeFindOrAddChild) {
CcTest::InitializeVM();
ProfileTree tree(CcTest::i_isolate());
ProfileNode* node = tree.root();
- CodeEntry entry1(i::Logger::FUNCTION_TAG, "aaa");
+ CodeEntry entry1(i::CodeEventListener::FUNCTION_TAG, "aaa");
ProfileNode* childNode1 = node->FindOrAddChild(&entry1);
CHECK(childNode1);
CHECK_EQ(childNode1, node->FindOrAddChild(&entry1));
- CodeEntry entry2(i::Logger::FUNCTION_TAG, "bbb");
+ CodeEntry entry2(i::CodeEventListener::FUNCTION_TAG, "bbb");
ProfileNode* childNode2 = node->FindOrAddChild(&entry2);
CHECK(childNode2);
CHECK_NE(childNode1, childNode2);
CHECK_EQ(childNode1, node->FindOrAddChild(&entry1));
CHECK_EQ(childNode2, node->FindOrAddChild(&entry2));
- CodeEntry entry3(i::Logger::FUNCTION_TAG, "ccc");
+ CodeEntry entry3(i::CodeEventListener::FUNCTION_TAG, "ccc");
ProfileNode* childNode3 = node->FindOrAddChild(&entry3);
CHECK(childNode3);
CHECK_NE(childNode1, childNode3);
@@ -77,15 +77,15 @@ TEST(ProfileNodeFindOrAddChildForSameFunction) {
const char* aaa = "aaa";
ProfileTree tree(CcTest::i_isolate());
ProfileNode* node = tree.root();
- CodeEntry entry1(i::Logger::FUNCTION_TAG, aaa);
+ CodeEntry entry1(i::CodeEventListener::FUNCTION_TAG, aaa);
ProfileNode* childNode1 = node->FindOrAddChild(&entry1);
CHECK(childNode1);
CHECK_EQ(childNode1, node->FindOrAddChild(&entry1));
// The same function again.
- CodeEntry entry2(i::Logger::FUNCTION_TAG, aaa);
+ CodeEntry entry2(i::CodeEventListener::FUNCTION_TAG, aaa);
CHECK_EQ(childNode1, node->FindOrAddChild(&entry2));
// Now with a different security token.
- CodeEntry entry3(i::Logger::FUNCTION_TAG, aaa);
+ CodeEntry entry3(i::CodeEventListener::FUNCTION_TAG, aaa);
CHECK_EQ(childNode1, node->FindOrAddChild(&entry3));
}
@@ -122,9 +122,9 @@ class ProfileTreeTestHelper {
TEST(ProfileTreeAddPathFromEnd) {
CcTest::InitializeVM();
- CodeEntry entry1(i::Logger::FUNCTION_TAG, "aaa");
- CodeEntry entry2(i::Logger::FUNCTION_TAG, "bbb");
- CodeEntry entry3(i::Logger::FUNCTION_TAG, "ccc");
+ CodeEntry entry1(i::CodeEventListener::FUNCTION_TAG, "aaa");
+ CodeEntry entry2(i::CodeEventListener::FUNCTION_TAG, "bbb");
+ CodeEntry entry3(i::CodeEventListener::FUNCTION_TAG, "ccc");
ProfileTree tree(CcTest::i_isolate());
ProfileTreeTestHelper helper(&tree);
CHECK(!helper.Walk(&entry1));
@@ -187,7 +187,7 @@ TEST(ProfileTreeCalculateTotalTicks) {
empty_tree.root()->IncrementSelfTicks();
CHECK_EQ(1u, empty_tree.root()->self_ticks());
- CodeEntry entry1(i::Logger::FUNCTION_TAG, "aaa");
+ CodeEntry entry1(i::CodeEventListener::FUNCTION_TAG, "aaa");
CodeEntry* e1_path[] = {&entry1};
std::vector<CodeEntry*> e1_path_vec(e1_path, e1_path + arraysize(e1_path));
@@ -201,7 +201,7 @@ TEST(ProfileTreeCalculateTotalTicks) {
CHECK_EQ(1u, single_child_tree.root()->self_ticks());
CHECK_EQ(1u, node1->self_ticks());
- CodeEntry entry2(i::Logger::FUNCTION_TAG, "bbb");
+ CodeEntry entry2(i::CodeEventListener::FUNCTION_TAG, "bbb");
CodeEntry* e2_e1_path[] = {&entry2, &entry1};
std::vector<CodeEntry*> e2_e1_path_vec(e2_e1_path,
e2_e1_path + arraysize(e2_e1_path));
@@ -227,7 +227,7 @@ TEST(ProfileTreeCalculateTotalTicks) {
CodeEntry* e2_path[] = {&entry2};
std::vector<CodeEntry*> e2_path_vec(e2_path, e2_path + arraysize(e2_path));
- CodeEntry entry3(i::Logger::FUNCTION_TAG, "ccc");
+ CodeEntry entry3(i::CodeEventListener::FUNCTION_TAG, "ccc");
CodeEntry* e3_path[] = {&entry3};
std::vector<CodeEntry*> e3_path_vec(e3_path, e3_path + arraysize(e3_path));
@@ -277,10 +277,10 @@ static inline i::Address ToAddress(int n) {
TEST(CodeMapAddCode) {
CodeMap code_map;
- CodeEntry entry1(i::Logger::FUNCTION_TAG, "aaa");
- CodeEntry entry2(i::Logger::FUNCTION_TAG, "bbb");
- CodeEntry entry3(i::Logger::FUNCTION_TAG, "ccc");
- CodeEntry entry4(i::Logger::FUNCTION_TAG, "ddd");
+ CodeEntry entry1(i::CodeEventListener::FUNCTION_TAG, "aaa");
+ CodeEntry entry2(i::CodeEventListener::FUNCTION_TAG, "bbb");
+ CodeEntry entry3(i::CodeEventListener::FUNCTION_TAG, "ccc");
+ CodeEntry entry4(i::CodeEventListener::FUNCTION_TAG, "ddd");
code_map.AddCode(ToAddress(0x1500), &entry1, 0x200);
code_map.AddCode(ToAddress(0x1700), &entry2, 0x100);
code_map.AddCode(ToAddress(0x1900), &entry3, 0x50);
@@ -307,8 +307,8 @@ TEST(CodeMapAddCode) {
TEST(CodeMapMoveAndDeleteCode) {
CodeMap code_map;
- CodeEntry entry1(i::Logger::FUNCTION_TAG, "aaa");
- CodeEntry entry2(i::Logger::FUNCTION_TAG, "bbb");
+ CodeEntry entry1(i::CodeEventListener::FUNCTION_TAG, "aaa");
+ CodeEntry entry2(i::CodeEventListener::FUNCTION_TAG, "bbb");
code_map.AddCode(ToAddress(0x1500), &entry1, 0x200);
code_map.AddCode(ToAddress(0x1700), &entry2, 0x100);
CHECK_EQ(&entry1, code_map.FindEntry(ToAddress(0x1500)));
@@ -316,7 +316,7 @@ TEST(CodeMapMoveAndDeleteCode) {
code_map.MoveCode(ToAddress(0x1500), ToAddress(0x1700)); // Deprecate bbb.
CHECK(!code_map.FindEntry(ToAddress(0x1500)));
CHECK_EQ(&entry1, code_map.FindEntry(ToAddress(0x1700)));
- CodeEntry entry3(i::Logger::FUNCTION_TAG, "ccc");
+ CodeEntry entry3(i::CodeEventListener::FUNCTION_TAG, "ccc");
code_map.AddCode(ToAddress(0x1750), &entry3, 0x100);
CHECK(!code_map.FindEntry(ToAddress(0x1700)));
CHECK_EQ(&entry3, code_map.FindEntry(ToAddress(0x1750)));
@@ -347,9 +347,12 @@ 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 =
+ 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);
@@ -413,9 +416,12 @@ 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 =
+ 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);
@@ -464,7 +470,8 @@ TEST(NoSamples) {
CpuProfilesCollection profiles(CcTest::heap());
profiles.StartProfiling("", false);
ProfileGenerator generator(&profiles);
- CodeEntry* entry1 = profiles.NewCodeEntry(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:
« 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