summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2018-10-09 10:40:25 -0700
committer Andreas Gampe <agampe@google.com> 2018-10-09 11:24:22 -0700
commit08dfdf96f7885f92821fe34e8a45f1930fcb4e82 (patch)
treee463f6a5f0a9cbbf0c8fb47edf6e86155bd3d1f9
parent1f0133bc00f96316224a7547bbe4ecc6b406c46e (diff)
ART: Add VMRuntime.hasBootImageSpaces implementation
Expose to the system whether ART is using a boot image. Test: m Test: system boots Change-Id: I087c269dd1e95eeeab5db4250133f9c61e9399c7
-rw-r--r--runtime/native/dalvik_system_VMRuntime.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc
index b18a048c60..861d1db880 100644
--- a/runtime/native/dalvik_system_VMRuntime.cc
+++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -682,6 +682,11 @@ static void VMRuntime_setProcessPackageName(JNIEnv* env,
Runtime::Current()->SetProcessPackageName(package_name.c_str());
}
+static jboolean VMRuntime_hasBootImageSpaces(JNIEnv* env ATTRIBUTE_UNUSED,
+ jclass klass ATTRIBUTE_UNUSED) {
+ return Runtime::Current()->GetHeap()->HasBootImageSpace() ? JNI_TRUE : JNI_FALSE;
+}
+
static JNINativeMethod gMethods[] = {
FAST_NATIVE_METHOD(VMRuntime, addressOf, "(Ljava/lang/Object;)J"),
NATIVE_METHOD(VMRuntime, bootClassPath, "()Ljava/lang/String;"),
@@ -690,6 +695,7 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(VMRuntime, clearGrowthLimit, "()V"),
NATIVE_METHOD(VMRuntime, concurrentGC, "()V"),
NATIVE_METHOD(VMRuntime, disableJitCompilation, "()V"),
+ FAST_NATIVE_METHOD(VMRuntime, hasBootImageSpaces, "()Z"), // Could be CRITICAL.
NATIVE_METHOD(VMRuntime, hasUsedHiddenApi, "()Z"),
NATIVE_METHOD(VMRuntime, setHiddenApiExemptions, "([Ljava/lang/String;)V"),
NATIVE_METHOD(VMRuntime, setHiddenApiAccessLogSamplingRate, "(I)V"),