From 826d056e1444a9cbdac05c917de0fb7cf6edd29e Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Thu, 24 Jun 2021 17:10:22 -0700 Subject: Rename nativeZygoteJitEnabled ... to nativeZygoteLongSuspendOk to reflect its changed semantics. Bug: 192020504 Test: Boot and look at log with both options Change-Id: Id8cf5f5b9924c34ff578bf19f53fee1561f7dda6 Merged-In: Id8cf5f5b9924c34ff578bf19f53fee1561f7dda6 (cherry picked from commit cc0e208549a7ac0ad814bca37e9995ede9c06141) --- dalvik/src/main/java/dalvik/system/ZygoteHooks.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/dalvik/src/main/java/dalvik/system/ZygoteHooks.java b/dalvik/src/main/java/dalvik/system/ZygoteHooks.java index 5e0c14010ad..a17a2574f7b 100644 --- a/dalvik/src/main/java/dalvik/system/ZygoteHooks.java +++ b/dalvik/src/main/java/dalvik/system/ZygoteHooks.java @@ -206,7 +206,7 @@ public final class ZygoteHooks { /** * Is it safe to keep all ART daemon threads stopped indefinitely in the zygote? * The answer may change from false to true dynamically, but not in the other - * direction. + * direction. Only called in Zygote. * * @return {@code true} if it's safe to keep all ART daemon threads stopped * indefinitely in the zygote; and {@code false} otherwise @@ -216,12 +216,7 @@ public final class ZygoteHooks { @SystemApi(client = MODULE_LIBRARIES) @libcore.api.CorePlatformApi(status = libcore.api.CorePlatformApi.Status.STABLE) public static boolean isIndefiniteThreadSuspensionSafe() { - // TODO: Make this return true if we're done with JIT compilation. - // - // We only care about JIT compilation that affects other processes. - // The zygote itself doesn't run appreciable amounts of Java code when - // running single-threaded. - return !nativeZygoteJitEnabled(); + return nativeZygoteLongSuspendOk(); } // Hook for SystemServer specific early initialization post-forking. @@ -235,7 +230,7 @@ public final class ZygoteHooks { boolean isSystemServer, boolean isZygote, String instructionSet); - private static native boolean nativeZygoteJitEnabled(); + private static native boolean nativeZygoteLongSuspendOk(); /** * We must not fork until we're single-threaded again. Wait until /proc shows we're -- cgit v1.2.3