Fix compiling boot image extension with assume-verified.

The change https://android-review.googlesource.com/1246288
enabled AOT initialization of classes for the compiler
filter "assume-verified". However, this was untested and
broken because aborted transactions would leave created
array classes with partially rolled-back state on the heap.
Note that for other compiler filters, the verification step
creates those array classes outside of a transaction.

We fix this problem by making sure that the initialization
of an array class does not create any transaction records
for the class fields (we are keeping the defined class).

(cherry picked from commit b68bb7a02ea795fa4defb18b3f9ce31879d66271)

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: aosp_taimen-userdebug boots.
Test: 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 start  # Starts correctly.
Test: Extract the boot image extension compilation command
      from the verbose log, change compiler filter to
      "assume-verified" and execute with no crashes.
Bug: 119800099
Bug: 150193586
Change-Id: I3d9371a05c133e8c4d4092a6889dc1575a6903a6
6 files changed