diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2019-02-26 01:31:05 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-02-26 01:31:05 -0800 |
commit | 32498c5c0c19b96dedd948c001f1633699083daf (patch) | |
tree | 0e44a19c159822964c1768275e43e226580a4ada /core/jni/AndroidRuntime.cpp | |
parent | 2c2a2774d5bd0f39024dec6c8f6ac1b5fed4e8fd (diff) | |
parent | ed74814369fbba79c61f7cd15a64825171887628 (diff) |
Merge "Query the enable_apex_image flag from native experiment."
am: ed74814369
Change-Id: I3a3a363a6f1d80368585294413219b4349309468
Diffstat (limited to 'core/jni/AndroidRuntime.cpp')
-rw-r--r-- | core/jni/AndroidRuntime.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 7c69c3374c87..388285a5687f 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -232,6 +232,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; /* @@ -666,8 +671,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; |