Update JIT Zygote image option.

Bug: 203492478
Test: manual -
  1. Build a system image and flash it to a device.
  2. adb shell setprop dalvik.vm.extra-opts '-verbose:image'
  3. adb shell setprop dalvik.vm.profilebootclasspath true
  4. adb shell setprop ctl.restart zygote
  5. See the boot image extension being compiled in memory
     (http://gpaste/4688561208033280).
Change-Id: I69c11e3e41b9ab142b427ee054c2a6275ff089de
This commit is contained in:
Jiakai Zhang 2021-12-22 15:28:36 +00:00
parent ad9f190680
commit 5e6fa85a96

View File

@ -228,8 +228,7 @@ static const char* PROFILE_BOOT_CLASS_PATH = "profilebootclasspath";
// TODO: Rename the server-level flag or remove.
static const char* ENABLE_JITZYGOTE_IMAGE = "enable_apex_image";
// Flag to pass to the runtime when using the JIT Zygote image.
static const char* kJitZygoteImageOption =
"-Ximage:boot.art:/nonx/boot-framework.art!/system/etc/boot-image.prof";
static const char* kJitZygoteImageOption = "-Xforcejitzygote";
// Feature flag name for disabling lock profiling.
static const char* DISABLE_LOCK_PROFILING = "disable_lock_profiling";
@ -983,9 +982,9 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool p
"--instruction-set-features=", "-Xcompiler-option");
/*
* When running with debug.generate-debug-info, add --generate-debug-info to
* the compiler options so that both JITted code and the boot image extension,
* if it is compiled on device, will include native debugging information.
* When running with debug.generate-debug-info, add --generate-debug-info to the compiler
* options so that both JITted code and the boot image, if it is compiled on device, will
* include native debugging information.
*/
property_get("debug.generate-debug-info", propBuf, "");
bool generate_debug_info = (strcmp(propBuf, "true") == 0);
@ -1008,7 +1007,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool p
property_get("dalvik.vm.extra-opts", extraOptsBuf, "");
parseExtraOpts(extraOptsBuf, NULL);
// Extra options for boot image extension generation.
// Extra options for boot image generation.
if (skip_compilation) {
addOption("-Xnoimage-dex2oat");
} else {
@ -1031,8 +1030,8 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool p
parseCompilerOption("dalvik.vm.image-dex2oat-cpu-set", dex2oatCpuSetImageBuf, "--cpu-set=",
"-Ximage-compiler-option");
// The runtime may compile a boot image extension, when necessary, not using installd.
// Thus, we need to pass the instruction-set-features/variant as an image-compiler-option.
// The runtime may compile a boot image, when necessary, not using installd. Thus, we need
// to pass the instruction-set-features/variant as an image-compiler-option.
// Note: it is OK to reuse the buffer, as the values are exactly the same between
// * compiler-option, used for runtime compilation (DexClassLoader)
// * image-compiler-option, used for boot-image compilation on device