Do not preload dex caches for assume-verified.

And completely clear dex caches when in the pruning phase.
The preloading, if requested, will fill it later.

This reduces the time it takes to compile the boot image
extension in memory by over 120ms on aosp_taimen-userdebug
with --compiler-filter=assume-verified. Measured with
  adb root && \
  adb shell stop && \
  adb shell setprop dalvik.vm.boot-image \
      'boot.art:/nonx/boot-framework.art!/system/etc/boot-image.prof' && \
  adb shell setprop dalvik.vm.image-dex2oat-filter \
      assume-verified && \
  adb shell 'setprop dalvik.vm.extra-opts \
      "-Ximage-compiler-option --dump-timings"' && \
  adb shell start
  # Collect dex2oat lines from logcat.
(To avoid dex2oat crashes, we have to revert
  https://android-review.googlesource.com/1240047 and
  https://android-review.googlesource.com/1246288 .
TODO: Investigate and fix those crashes.)

(cherry picked from commit 4b90b86153819c84f672eeb25f88247f4ce56931)

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: aosp_taimen-userdebug boots.
Test: boot-framework.art checksums are unchanged with the
      default filter, i.e. "verify" (and therefore all the
      boot images should be unchanged).
Bug: 119800099
Bug: 150193586
Change-Id: I1b3b5320aea1113c7fa983b29e2c606f58da5d2b
4 files changed