From e0ac1151b360be7147fa20320c0b427688b1424f Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Mon, 13 Feb 2017 19:03:47 -0800 Subject: Extend profman to generate profiles with inline caches Extend profman logic to generate profiles based on a simple textual respresentation. This will help writing tests for profile guided compilation. Before this CL, profman was able to generate profiles based on a list of classes like: java.lang.Comparable java.lang.Math java.lang.Object This CL, enables profman to understand methods and classes alike. The new format is: # Classes Ljava/lang/Comparable; Ljava/lang/Math; # Methods with inline caches LTestInline;->inlinePolymorhic(LSuper;)I+LSubA;,LSubB;,LSubC; LTestInline;->noInlineCache(LSuper;)I "LTestInline;->inlinePolymorhic(LSuper;)I+LSubA;,LSubB;,LSubC;" means that method `int inlineMonomorphicSubA(Super)` from class Main will be added to the profile with the inline cache (SubA,SubB) for its one and only invoke virtual. @Main#noInlineCache:(LSuper;)I+; meaning that method `int noInlineCache' from class Main will be added to the profile with no inline cache. Note that the methods are allowed to have a single invoke virtual in their dex bytecode. That is to keep the parsing the file format simple and easy to use. Also, add a few more tests for profiles and fix an issue caused by writing the dex files in a possibly wrong order. Test: m run-test-host-gtest-profile_assistant_test Bug: 32434870 Change-Id: I6b7340cf613007117d9818be206ccb3a27b815bf --- compiler/driver/compiler_driver_test.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'compiler/driver/compiler_driver_test.cc') diff --git a/compiler/driver/compiler_driver_test.cc b/compiler/driver/compiler_driver_test.cc index 97954f3c29..562f97b3ae 100644 --- a/compiler/driver/compiler_driver_test.cc +++ b/compiler/driver/compiler_driver_test.cc @@ -240,9 +240,8 @@ class CompilerDriverProfileTest : public CompilerDriverTest { ProfileCompilationInfo info; for (const std::unique_ptr& dex_file : dex_files) { - std::string key = ProfileCompilationInfo::GetProfileDexFileKey(dex_file->GetLocation()); - profile_info_.AddMethodIndex(key, dex_file->GetLocationChecksum(), 1); - profile_info_.AddMethodIndex(key, dex_file->GetLocationChecksum(), 2); + profile_info_.AddMethodIndex(dex_file->GetLocation(), dex_file->GetLocationChecksum(), 1); + profile_info_.AddMethodIndex(dex_file->GetLocation(), dex_file->GetLocationChecksum(), 2); } return &profile_info_; } -- cgit v1.2.3-59-g8ed1b