Check oat files of boot images.

Before this change, oat files of boot images were not checked when we
load boot images. We need this check to ensure that the boot images are
up-to-date, especially when we move the primary boot image out of the
ART APEX.

This check is performed at an early stage, rather than when the oat
files are actually loaded for execution, in order to determine whether
the runtime should re-compile the boot image or not.

On boot, the check itself costs ~100ms for the primary instruction set.
However, the overall boot time regression is neglectable (<10ms). This
is probably because the cost is amortized later when oat files are
loaded for execution, due to caches. The boot time impact is tested for
10 times on a high-end device.

Bug: 209963183
Test: All ART gtests and run-tests in Presubmits.
(cherry picked from commit 834295c98be7ce5112c1a2ee30c9426f04e8617a)

Merged-In: I5c6f3edd633fd980c51c00d02b813659996e85dd
Change-Id: I1e85d46f11bb4eb14214f6aa4bc0f79efacfc714
2 files changed