Lines Matching refs:info

72   bool AddMethod(ProfileCompilationInfo* info,  in AddMethod()  argument
77 return info->AddMethod(ProfileMethodInfo(MethodReference(dex, method_idx)), in AddMethod()
82 bool AddMethod(ProfileCompilationInfo* info, in AddMethod() argument
87 return info->AddMethod( in AddMethod()
93 bool AddClass(ProfileCompilationInfo* info, in AddClass() argument
98 return info->AddClassesForDex(dex, classes.begin(), classes.end(), annotation); in AddClass()
106 const ProfileCompilationInfo& info, in GetMethod() argument
110 return info.GetHotMethodInfo(MethodReference(dex, method_idx), annotation); in GetMethod()
218 bool IsEmpty(const ProfileCompilationInfo& info) { in IsEmpty() argument
219 return info.IsEmpty(); in IsEmpty()
337 ProfileCompilationInfo info; in TEST_F() local
338 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ 1)); in TEST_F()
340 ASSERT_FALSE(AddMethod(&info, dex1_checksum_missmatch, /* method_idx= */ 2)); in TEST_F()
631 ProfileCompilationInfo info; in TEST_F() local
639 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ 0, inline_caches1)); in TEST_F()
640 ASSERT_FALSE(AddMethod(&info, dex2, /* method_idx= */ 0, inline_caches2)); in TEST_F()
648 ProfileCompilationInfo info; in TEST_F() local
669 ASSERT_TRUE(AddMethod(&info, dex1, method_idx, inline_caches)); in TEST_F()
670 ASSERT_TRUE(AddMethod(&info, dex2, method_idx, inline_caches)); in TEST_F()
679 info_backup.MergeWith(info); in TEST_F()
680 ASSERT_TRUE(info.MergeWith(info_reindexed)); in TEST_F()
682 ASSERT_TRUE(info.Equals(info_backup)); in TEST_F()
685 GetMethod(info, dex1, method_idx); in TEST_F()
689 GetMethod(info, dex2, method_idx); in TEST_F()
697 ProfileCompilationInfo info; in TEST_F() local
703 ASSERT_TRUE(AddMethod(&info, dex, /* method_idx= */ 0)); in TEST_F()
707 ASSERT_FALSE(AddMethod(&info, dex, /* method_idx= */ 0)); in TEST_F()
712 ProfileCompilationInfo info(/*for_boot_image=*/true); in TEST_F() local
718 ASSERT_TRUE(AddMethod(&info, dex, /* method_idx= */ 0)); in TEST_F()
722 ASSERT_FALSE(AddMethod(&info, dex, /* method_idx= */ 0)); in TEST_F()
776 auto run_test = [&dex1 = dex1, &dex2 = dex2](const ProfileCompilationInfo& info) { in TEST_F() argument
777 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, 2)).IsInProfile()); in TEST_F()
778 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, 4)).IsInProfile()); in TEST_F()
779 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 1)).IsStartup()); in TEST_F()
780 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, 3)).IsStartup()); in TEST_F()
781 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 5)).IsPostStartup()); in TEST_F()
782 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, 6)).IsStartup()); in TEST_F()
783 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex2, 2)).IsStartup()); in TEST_F()
784 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex2, 4)).IsPostStartup()); in TEST_F()
811 ProfileCompilationInfo info; in TEST_F() local
816 info.AddMethodsForDex(static_cast<Hotness::Flag>(Hotness::kFlagHot | Hotness::kFlagStartup), in TEST_F()
820 info.AddMethodsForDex(Hotness::kFlagStartup, in TEST_F()
824 info.AddMethodsForDex(Hotness::kFlagPostStartup, in TEST_F()
829 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex.get(), id)).IsHot()); in TEST_F()
830 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex.get(), id)).IsStartup()); in TEST_F()
833 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex.get(), id)).IsStartup()); in TEST_F()
836 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex.get(), id)).IsPostStartup()); in TEST_F()
838 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex.get(), 6)).IsPostStartup()); in TEST_F()
840 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex.get(), 0)).IsInProfile()); in TEST_F()
841 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex.get(), 4)).IsInProfile()); in TEST_F()
842 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex.get(), 7)).IsInProfile()); in TEST_F()
843 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex.get(), 1)).IsPostStartup()); in TEST_F()
844 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex.get(), 4)).IsStartup()); in TEST_F()
845 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex.get(), 6)).IsStartup()); in TEST_F()
913 ProfileCompilationInfo info; in TEST_F() local
914 AddMethod(&info, dex1, /* method_idx= */ 0); in TEST_F()
915 AddMethod(&info, dex2, /* method_idx= */ 0); in TEST_F()
918 ASSERT_TRUE(info.UpdateProfileKeys(dex_files)); in TEST_F()
923 GetMethod(info, dex.get(), /* method_idx= */ 0); in TEST_F()
937 ProfileCompilationInfo info; in TEST_F() local
938 AddMethod(&info, dex2, /* method_idx= */ 0); in TEST_F()
941 ASSERT_TRUE(info.UpdateProfileKeys(dex_files)); in TEST_F()
947 GetMethod(info, dex.get(), /* method_idx= */ 0); in TEST_F()
953 GetMethod(info, dex2, /* method_idx= */ 0); in TEST_F()
966 ProfileCompilationInfo info; in TEST_F() local
967 AddMethod(&info, dex1, /* method_idx= */ 0); in TEST_F()
971 AddMethod(&info, dex1_renamed, /* method_idx= */ 0); in TEST_F()
973 ASSERT_FALSE(info.UpdateProfileKeys(dex_files)); in TEST_F()
1186 ProfileCompilationInfo info; in TEST_F() local
1188 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ i)); in TEST_F()
1190 ASSERT_FALSE(IsEmpty(info)); in TEST_F()
1191 info.ClearData(); in TEST_F()
1192 ASSERT_TRUE(IsEmpty(info)); in TEST_F()
1196 ProfileCompilationInfo info; in TEST_F() local
1198 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ i)); in TEST_F()
1200 info.ClearData(); in TEST_F()
1203 ASSERT_TRUE(info.Save(GetFd(profile))); in TEST_F()
1210 ASSERT_TRUE(loaded_info.Equals(info)); in TEST_F()
1214 ProfileCompilationInfo info; in TEST_F() local
1216 memcmp(info.GetVersion(), in TEST_F()
1220 ASSERT_FALSE(info.IsForBootImage()); in TEST_F()
1233 ProfileCompilationInfo info(/*for_boot_image=*/ false); in TEST_F() local
1235 ASSERT_FALSE(info.Equals(info1)); in TEST_F()
1239 ProfileCompilationInfo info(/*for_boot_image*/ true); in TEST_F() local
1242 AddMethod(&info, dex1, index, static_cast<Hotness::Flag>(1 << index)); in TEST_F()
1245 auto run_test = [&dex1 = dex1](const ProfileCompilationInfo& info) { in TEST_F() argument
1247 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, index)).IsInProfile()); in TEST_F()
1248 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, index)) in TEST_F()
1250 << info.GetMethodHotness(MethodReference(dex1, index)).GetFlags(); in TEST_F()
1253 run_test(info); in TEST_F()
1257 ASSERT_TRUE(info.Save(GetFd(profile))); in TEST_F()
1268 ProfileCompilationInfo info(/*for_boot_image*/ true); in TEST_F() local
1272 AddMethod(&info, dex1, 0, static_cast<Hotness::Flag>(1 << index)); in TEST_F()
1275 auto run_test = [&dex1 = dex1](const ProfileCompilationInfo& info) { in TEST_F() argument
1277 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 0)).IsInProfile()); in TEST_F()
1278 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 0)) in TEST_F()
1282 run_test(info); in TEST_F()
1286 ASSERT_TRUE(info.Save(GetFd(profile))); in TEST_F()
1316 auto run_test = [&dex1 = dex1](const ProfileCompilationInfo& info) { in TEST_F() argument
1319 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 0)).IsInProfile()); in TEST_F()
1320 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 0)) in TEST_F()
1323 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 1)).IsInProfile()); in TEST_F()
1324 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 1)) in TEST_F()
1332 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 0)).IsInProfile()); in TEST_F()
1333 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, 0)) in TEST_F()
1336 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 1)).IsInProfile()); in TEST_F()
1337 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, 1)) in TEST_F()
1345 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, 0)) in TEST_F()
1347 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, 1)) in TEST_F()
1378 ProfileCompilationInfo info; in TEST_F() local
1385 ASSERT_TRUE(info.AddMethod(ProfileMethodInfo(hot), Hotness::kFlagHot)); in TEST_F()
1386 ASSERT_TRUE(info.AddMethod( in TEST_F()
1389 ASSERT_TRUE(info.AddMethod(ProfileMethodInfo(startup), Hotness::kFlagStartup)); in TEST_F()
1392 EXPECT_TRUE(info.GetMethodHotness(hot).IsInProfile()); in TEST_F()
1393 EXPECT_EQ(info.GetMethodHotness(hot).GetFlags(), Hotness::kFlagHot); in TEST_F()
1395 EXPECT_TRUE(info.GetMethodHotness(hot_startup).IsInProfile()); in TEST_F()
1396 EXPECT_EQ(info.GetMethodHotness(hot_startup).GetFlags(), in TEST_F()
1399 EXPECT_TRUE(info.GetMethodHotness(startup).IsInProfile()); in TEST_F()
1400 EXPECT_EQ(info.GetMethodHotness(startup).GetFlags(), Hotness::kFlagStartup); in TEST_F()
1405 ProfileCompilationInfo info; in TEST_F() local
1413 info.AddMethod(ProfileMethodInfo(hot, inline_caches), Hotness::kFlagHot); in TEST_F()
1414 info.AddMethod(ProfileMethodInfo(startup, inline_caches), Hotness::kFlagStartup); in TEST_F()
1418 GetMethod(info, dex1, hot.index); in TEST_F()
1424 ASSERT_TRUE(GetMethod(info, dex1, startup.index) == nullptr); in TEST_F()
1429 ProfileCompilationInfo info; in TEST_F() local
1435 ASSERT_FALSE(info.AddMethods(pmis, Hotness::kFlagHot)); in TEST_F()
1440 ProfileCompilationInfo info; in TEST_F() local
1446 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ i, Hotness::kFlagHot, psa1)); in TEST_F()
1449 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ i, Hotness::kFlagHot, psa2)); in TEST_F()
1452 auto run_test = [&dex1 = dex1, &psa1 = psa1, &psa2 = psa2](const ProfileCompilationInfo& info) { in TEST_F() argument
1455 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, i), psa1).IsInProfile()); in TEST_F()
1456 EXPECT_TRUE(info.GetHotMethodInfo(MethodReference(dex1, i), psa1) != nullptr); in TEST_F()
1459 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, i), psa2).IsInProfile()); in TEST_F()
1460 EXPECT_TRUE(info.GetHotMethodInfo(MethodReference(dex1, i), psa2) != nullptr); in TEST_F()
1464 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, i), psa1).IsInProfile()); in TEST_F()
1465 EXPECT_FALSE(info.GetHotMethodInfo(MethodReference(dex1, i), psa1) != nullptr); in TEST_F()
1468 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, i), psa2).IsInProfile()); in TEST_F()
1469 EXPECT_FALSE(info.GetHotMethodInfo(MethodReference(dex1, i), psa2) != nullptr); in TEST_F()
1473 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, i)).IsInProfile()); in TEST_F()
1474 EXPECT_TRUE(info.GetHotMethodInfo(MethodReference(dex1, i)) != nullptr); in TEST_F()
1478 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, i)).IsInProfile()); in TEST_F()
1479 EXPECT_FALSE(info.GetHotMethodInfo(MethodReference(dex1, i)) != nullptr); in TEST_F()
1485 EXPECT_FALSE(info.GetMethodHotness(ref, not_exisiting).IsInProfile()); in TEST_F()
1486 EXPECT_FALSE(info.GetHotMethodInfo(ref, not_exisiting) != nullptr); in TEST_F()
1490 run_test(info); in TEST_F()
1493 ASSERT_TRUE(info.Save(GetFd(profile))); in TEST_F()
1500 ASSERT_TRUE(loaded_info.Equals(info)); in TEST_F()
1508 ProfileCompilationInfo info; in TEST_F() local
1514 ASSERT_TRUE(AddClass(&info, dex1, dex::TypeIndex(i), psa1)); in TEST_F()
1517 ASSERT_TRUE(AddClass(&info, dex1, dex::TypeIndex(i), psa2)); in TEST_F()
1520 auto run_test = [&dex1 = dex1, &psa1 = psa1, &psa2 = psa2](const ProfileCompilationInfo& info) { in TEST_F() argument
1523 EXPECT_TRUE(info.ContainsClass(*dex1, dex::TypeIndex(i), psa1)); in TEST_F()
1526 EXPECT_TRUE(info.ContainsClass(*dex1, dex::TypeIndex(i), psa2)); in TEST_F()
1530 EXPECT_FALSE(info.ContainsClass(*dex1, dex::TypeIndex(i), psa1)); in TEST_F()
1533 EXPECT_FALSE(info.ContainsClass(*dex1, dex::TypeIndex(i), psa2)); in TEST_F()
1537 EXPECT_TRUE(info.ContainsClass(*dex1, dex::TypeIndex(i))); in TEST_F()
1541 EXPECT_FALSE(info.ContainsClass(*dex1, dex::TypeIndex(i))); in TEST_F()
1545 EXPECT_FALSE(info.ContainsClass(*dex1, dex::TypeIndex(0), ProfileSampleAnnotation("new_test"))); in TEST_F()
1549 run_test(info); in TEST_F()
1552 ASSERT_TRUE(info.Save(GetFd(profile))); in TEST_F()
1559 ASSERT_TRUE(loaded_info.Equals(info)); in TEST_F()
1585 ProfileCompilationInfo info; in TEST_F() local
1586 ASSERT_TRUE(info.MergeWith(info1)); in TEST_F()
1587 ASSERT_TRUE(info.MergeWith(info2)); in TEST_F()
1591 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, i), psa1).IsInProfile()); in TEST_F()
1592 EXPECT_TRUE(info.ContainsClass(*dex1, dex::TypeIndex(i), psa1)); in TEST_F()
1595 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex1, i), psa2).IsInProfile()); in TEST_F()
1596 EXPECT_TRUE(info.GetMethodHotness(MethodReference(dex2, i), psa2).IsInProfile()); in TEST_F()
1597 EXPECT_TRUE(info.ContainsClass(*dex1, dex::TypeIndex(i), psa2)); in TEST_F()
1602 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex1, i), psa2).IsInProfile()); in TEST_F()
1603 EXPECT_FALSE(info.GetMethodHotness(MethodReference(dex2, i), psa2).IsInProfile()); in TEST_F()
1604 EXPECT_FALSE(info.ContainsClass(*dex1, dex::TypeIndex(i), psa2)); in TEST_F()
1610 ProfileCompilationInfo info; in TEST_F() local
1621 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ i, Hotness::kFlagHot, psa1)); in TEST_F()
1622 ASSERT_TRUE(AddClass(&info, dex1, dex::TypeIndex(i), psa1)); in TEST_F()
1627 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ i, Hotness::kFlagHot, psa2)); in TEST_F()
1628 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ i, Hotness::kFlagStartup, psa1)); in TEST_F()
1637 EXPECT_TRUE(info.GetClassesAndMethods( in TEST_F()
1644 EXPECT_FALSE(info.GetClassesAndMethods( in TEST_F()
1655 ProfileCompilationInfo info; in TEST_F() local
1663 ASSERT_TRUE(info.AddMethod(ProfileMethodInfo(ref), Hotness::kFlagHot, psa1)); in TEST_F()
1665 ASSERT_FALSE(info.AddMethod(ProfileMethodInfo(ref_checksum_missmatch), Hotness::kFlagHot, psa1)); in TEST_F()
1667 ASSERT_TRUE(info.AddMethod(ProfileMethodInfo(ref_checksum_missmatch), Hotness::kFlagHot, psa2)); in TEST_F()
1672 ProfileCompilationInfo info; in TEST_F() local
1679 ASSERT_TRUE(info.AddMethod(ProfileMethodInfo(ref), Hotness::kFlagHot, psa1)); in TEST_F()
1682 EXPECT_TRUE(info.GetMethodHotness(ref, psa1).IsInProfile()); in TEST_F()
1684 EXPECT_FALSE(info.GetMethodHotness(ref_checksum_missmatch, psa1).IsInProfile()); in TEST_F()
1687 EXPECT_TRUE(info.GetMethodHotness(ref).IsInProfile()); in TEST_F()
1688 EXPECT_FALSE(info.GetMethodHotness(ref_checksum_missmatch).IsInProfile()); in TEST_F()
1692 ProfileCompilationInfo info; in TEST_F() local
1694 AddMethod(&info, dex1, /* method_idx= */ 0, Hotness::kFlagHot); in TEST_F()
1696 info.ClearDataAndAdjustVersion(/*for_boot_image=*/true); in TEST_F()
1697 ASSERT_TRUE(info.IsEmpty()); in TEST_F()
1698 ASSERT_TRUE(info.IsForBootImage()); in TEST_F()
1702 ProfileCompilationInfo info(/*for_boot_image=*/true); in TEST_F() local
1704 AddMethod(&info, dex1, /* method_idx= */ 0, Hotness::kFlagHot); in TEST_F()
1706 info.ClearDataAndAdjustVersion(/*for_boot_image=*/false); in TEST_F()
1707 ASSERT_TRUE(info.IsEmpty()); in TEST_F()
1708 ASSERT_FALSE(info.IsForBootImage()); in TEST_F()
1721 ProfileCompilationInfo info; in TEST_F() local
1728 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ i, Hotness::kFlagHot, psa1)); in TEST_F()
1729 ASSERT_TRUE(AddClass(&info, dex1, dex::TypeIndex(i), psa1)); in TEST_F()
1730 ASSERT_TRUE(AddMethod(&info, dex1, /* method_idx= */ i, Hotness::kFlagStartup, psa2)); in TEST_F()
1731 ASSERT_TRUE(AddClass(&info, dex1, dex::TypeIndex(i), psa2)); in TEST_F()
1732 ASSERT_TRUE(AddMethod(&info, dex2, /* method_idx= */ i, Hotness::kFlagHot, psa2)); in TEST_F()
1734 ASSERT_TRUE(AddMethod(&info, dex3, /* method_idx= */ i, Hotness::kFlagHot, psa2)); in TEST_F()
1742 std::unique_ptr<FlattenProfileData> flattenProfileData = info.ExtractProfileData(dex_files); in TEST_F()