summaryrefslogtreecommitdiff
path: root/core/jni/AndroidRuntime.cpp
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2019-02-26 03:52:14 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-02-26 03:52:14 -0800
commit83624df78e9854c65853a91721ba2bc71c74e713 (patch)
tree802c89aacf5e3338220158cf2a90f213686ff05c /core/jni/AndroidRuntime.cpp
parent5412ada56a6ed66fafe5a177c5beeb6007814e39 (diff)
parentd63481be772b0b8b6d66130bc006d832fd9d090c (diff)
Merge "Query the enable_apex_image flag from native experiment." am: ed74814369 am: 32498c5c0c
am: d63481be77 Change-Id: Ib41e65bd247e2b5c620b72ca024aab868f8f6ea6
Diffstat (limited to 'core/jni/AndroidRuntime.cpp')
-rw-r--r--core/jni/AndroidRuntime.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 0938e569ad7e..16517bf87afe 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -244,6 +244,11 @@ static const char* kGenerationalCCRuntimeOption = "-Xgc:generational_cc";
// Copying (CC) garbage collector.
static const char* kNoGenerationalCCRuntimeOption = "-Xgc:nogenerational_cc";
+// Feature flag name for running the JIT in Zygote experiment, b/119800099.
+static const char* ENABLE_APEX_IMAGE = "enable_apex_image";
+// Flag to pass to the runtime when using the apex image.
+static const char* kApexImageOption = "-Ximage:/system/framework/apex.art";
+
static AndroidRuntime* gCurRuntime = NULL;
/*
@@ -678,8 +683,17 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote)
char jdwpProviderBuf[sizeof("-XjdwpProvider:") - 1 + PROPERTY_VALUE_MAX];
char bootImageBuf[sizeof("-Ximage:") - 1 + PROPERTY_VALUE_MAX];
- if (parseRuntimeOption("dalvik.vm.boot-image", bootImageBuf, "-Ximage:")) {
- ALOGI("Boot image: '%s'\n", bootImageBuf);
+ std::string use_apex_image =
+ server_configurable_flags::GetServerConfigurableFlag(RUNTIME_NATIVE_BOOT_NAMESPACE,
+ ENABLE_APEX_IMAGE,
+ /*default_value=*/ "");
+ if (use_apex_image == "true") {
+ addOption(kApexImageOption);
+ ALOGI("Using Apex boot image: '%s'\n", kApexImageOption);
+ } else if (parseRuntimeOption("dalvik.vm.boot-image", bootImageBuf, "-Ximage:")) {
+ ALOGI("Using dalvik.vm.boot-image: '%s'\n", bootImageBuf);
+ } else {
+ ALOGI("Using default boot image");
}
bool checkJni = false;