Age | Commit message (Collapse) | Author |
|
Due to the way we implement profiles InlineCaches are only valid on
methods with implementations. Unfortunately due to the rather slow way
we update boot profile definitions code refactorings can lead to
inline-caches being lost. This change makes profman more resilient to
this error by searching up the superclass resolutions to try to find a
method the inline-caches can be attached to. This should ensure that
boot-profile definitions fall out of date more slowly.
Test: ./test.py --host
Bug: 168941430
Change-Id: I5f6096500fa6f17e285b5a7bab21ad8216221966
|
|
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
|
|
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
|
|
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
|
|
- 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
|