summaryrefslogtreecommitdiff
path: root/test/ProfileTestMultiDex/Main.java
AgeCommit message (Collapse)Author
2021-02-19Add text-profile support for multiple ICsAlex Light
Text profile inline-cache support was limited to methods with only a single invoke. This extends support so it is instead based on the receiver type and supports an arbitrary number of invokes. It does assume that all invokes of the same receivers should have the same ICs. This enables us to create text profiles that can survive most common edits to the underlying java language files. IC lines are of the following format <<CLASS_GROUP>> := {CLASS}(,{CLASS})* <<IC_GROUP>> := \[{CLASS}{CLASS_GROUP} <<IC_LINE>> := {PROFILE_FLAGS}{CLASS}->{METHOD}\+{IC_GROUP}* This means a typical line might look like: ``` HLTestInline;->inlineTriplePolymorphic(LSuper;LSecret;LSecret;)I+[LSuper;LSubA;,LSubB;,LSubC;[LSecret;LSubB;,LSubC; ``` Note that old style single-invoke IC lines are still supported as well and their format has not changed. Updated --dump-classes-and-methods to dump ICs using this format. Note that it will combine ICs for different pcs with the same target so it is possible to construct a profile where the 'profile -> dump -> profile' operation is not idempotent. Any profile coming from a text-dump will be idempotent under this transform. Test: ./test.py --host Bug: 168941430 Change-Id: I69ba3b312caa7ca454487aaeb49862e393de3a4a
2019-09-26Clean up profile AddMethod APIsCalin Juravle
Restructure the profile assistant test to use the same APIs as profile saver and clean up all the other usages for AddMethodIndex and AddMethod. Bug: 139884006 Test: m test-art-host Change-Id: Icf76d6aa05f0f9dcc589182196ca34a0298f2cb7
2017-03-06Encode inline caches with missing types in the profileCalin Juravle
Not all runtime types can be encoded in the profile. For example if the receiver type is in a dex file which is not tracked for profiling its type cannot be encoded. Previously we would just skip over these types but that can lead to encode a polymorphic inline cache when in fact it should be megamorphic. With this CL, inline caches for which types are missing are marked in the profile with a special bit, kIsMissingTypesEncoding. Also, extend profman to understand text lines which specify an inline cache with missing types. Test: test-art-host Bug: 35927981 Bug: 32434870 Change-Id: I34528a39c227f3133771fd4454701c1ddc234f40
2017-03-03Extend profman to generate profiles with inline cachesCalin Juravle
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
2016-01-19Improve profile processingCalin Juravle
- allow file descriptors in addition to file names for profiles - fix some minor issues (wrong comparison signs, unhandled errors) - added gtests for profile_compilation_info, profile_assistant and compiler_driver Bug: 26080105 Change-Id: I136039fa1f25858399000049e48b01eafae54eb1