From 3c43b3863328e339dff90b216aed15194d129e4a Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 11 Dec 2015 15:01:04 +0000 Subject: Special case system_server to not create the JIT code cache. Change-Id: I7d2622f560435b2b6d133b0acd2659f3410acd2e --- core/java/com/android/internal/os/Zygote.java | 5 +++-- core/jni/com_android_internal_os_Zygote.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java index 8186378bfb6f..d23f26d675c4 100644 --- a/core/java/com/android/internal/os/Zygote.java +++ b/core/java/com/android/internal/os/Zygote.java @@ -145,8 +145,9 @@ public final class Zygote { native private static int nativeForkSystemServer(int uid, int gid, int[] gids, int debugFlags, int[][] rlimits, long permittedCapabilities, long effectiveCapabilities); - private static void callPostForkChildHooks(int debugFlags, String instructionSet) { - VM_HOOKS.postForkChild(debugFlags, instructionSet); + private static void callPostForkChildHooks(int debugFlags, boolean isSystemServer, + String instructionSet) { + VM_HOOKS.postForkChild(debugFlags, isSystemServer, instructionSet); } diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 73c74876c292..96d150be0234 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -581,7 +581,7 @@ static pid_t ForkAndSpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArra UnsetSigChldHandler(); env->CallStaticVoidMethod(gZygoteClass, gCallPostForkChildHooks, debug_flags, - is_system_server ? NULL : instructionSet); + is_system_server, instructionSet); if (env->ExceptionCheck()) { RuntimeAbort(env, __LINE__, "Error calling post fork hooks."); } @@ -652,7 +652,7 @@ static const JNINativeMethod gMethods[] = { int register_com_android_internal_os_Zygote(JNIEnv* env) { gZygoteClass = MakeGlobalRefOrDie(env, FindClassOrDie(env, kZygoteClassName)); gCallPostForkChildHooks = GetStaticMethodIDOrDie(env, gZygoteClass, "callPostForkChildHooks", - "(ILjava/lang/String;)V"); + "(IZLjava/lang/String;)V"); return RegisterMethodsOrDie(env, "com/android/internal/os/Zygote", gMethods, NELEM(gMethods)); } -- cgit v1.2.3-59-g8ed1b