Add profile support for dex2oat. (#6382)

dex2oat supports profile-guided compilation. In addition to taking dex
code as an input, it can take a profile as another input, to guide the
compilation. The profile determines which methods need to be compiled,
how calls can be inlined, and so on.

Because Compiler Explorer doesn't support multiple input files, the
profile is added as a comment block in the Java/Kotlin source code. A
post-processor extracts the profile from the comment block into a
separate file, in order to input it to dex2oat.
This commit is contained in:
kevinjeon-g
2024-04-29 20:17:24 -05:00
committed by GitHub
parent 9f5906abf3
commit b94781ab48
7 changed files with 103 additions and 3 deletions
+9
View File
@@ -5,3 +5,12 @@ class Square {
}
}
// Set `enabled` to `true` to enable profile-guided compilation for dex2oat.
// For the profile format, see
// https://developer.android.com/topic/performance/baselineprofiles/manually-create-measure#define-rules-manually
// (For advanced use only!)
/* ---------- begin profile (enabled=false) ----------
HSPLSquare;-><init>()V
HSPLSquare;->square(I)I
LSquare;
---------- end profile ---------- */