Fix profile merges in profman
profman used ProfileCompilationInfo::Load() which was not preserving the
correct order of the dex files (in a multidex profile).
The CL fixes profman to use ProfileCompilationInfo::MergeWith which
guarantees the right dex order and redesigns profile storage to avoid
such mistakes in the future. Instead of keeping data in a map indexed by
the profile key, store it in a vector whose index match profile_index.
This way, any iteration over profile info becomes deterministic with
respect to the profile index of the dex files.
Test: m test-art-host-gtest-profile_assistant_test
m test-art-host-gtest-profile_compilation_info_test
profile YouTube.apk and compile it based on the reference profile
(failing before)
Bug: 36371709
(cherry picked from commit cea9e9d26c32372ec8c75e6c89b1bfc08c5e1911)
Change-Id: Id2026339737bbf922c6066ed7ff6003861244713
5 files changed