Add support for selective startup dex madvise
Implement a simple heuristic for selectively madvise'ing dex files
that have layout optimizations based on startup profiles.
This does the following:
* Embeds per-dex startup class/method counts in the compiled odex,
based on the reference profile.
* Implements logic to selectively load dex files that most account
for startup behavior. For apps where the dex isn't optimized for
startup, this will effectively fall back to the current greedy logic.
* Guards the new logic behind a flag.
Follow-up work will explore use of reference profiles as the definitive
source of these hints, but that will require broader framework changes
to ensure such profiles are available at (or immediately following) the
current madvise hooks.
More details can be found in go/aperf-art-madvise-startup.
Bug: 358590127
Test: Inspect startup traces for YouTube + Google App
Test: Inspect verbose:oat logs for app startup
Flag: com.android.art.rw.flags.madvise_dex_using_profile
Change-Id: If9322fbf0801caa292d2df4c6fef0bc0aa27e916
17 files changed