Use cleared JNI weak sentinel from boot image.
We were already adding the sentinel to the boot image,
so we may as well reuse the boot image copy.
Also move pre-allocated objects from class roots to the
boot image live objects.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: aosp_taimen-userdebug boots.
Change-Id: I635dcdd146ca2c6b55d187e9a545a9990b0b35ca
diff --git a/runtime/image.h b/runtime/image.h
index 88bba13..4626055 100644
--- a/runtime/image.h
+++ b/runtime/image.h
@@ -222,10 +222,6 @@
enum ImageRoot {
kDexCaches,
kClassRoots,
- kOomeWhenThrowingException, // Pre-allocated OOME when throwing exception.
- kOomeWhenThrowingOome, // Pre-allocated OOME when throwing OOME.
- kOomeWhenHandlingStackOverflow, // Pre-allocated OOME when handling StackOverflowError.
- kNoClassDefFoundError, // Pre-allocated NoClassDefFoundError.
kSpecialRoots, // Different for boot image and app image, see aliases below.
kImageRootsMax,
@@ -234,6 +230,15 @@
kBootImageLiveObjects = kSpecialRoots, // Array of boot image objects that must be kept live.
};
+ enum BootImageLiveObjects {
+ kOomeWhenThrowingException, // Pre-allocated OOME when throwing exception.
+ kOomeWhenThrowingOome, // Pre-allocated OOME when throwing OOME.
+ kOomeWhenHandlingStackOverflow, // Pre-allocated OOME when handling StackOverflowError.
+ kNoClassDefFoundError, // Pre-allocated NoClassDefFoundError.
+ kClearedJniWeakSentinel, // Pre-allocated sentinel for cleared weak JNI references.
+ kIntrinsicObjectsStart
+ };
+
/*
* This describes the number and ordering of sections inside of Boot
* and App Images. It is very important that changes to this struct