Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8772351 authored by Nicolas Geoffray's avatar Nicolas Geoffray Committed by Narayan Kamath
Browse files

Special case system_server to not create the JIT code cache.

(cherry picked from commit 3c43b386)

Change-Id: Ic7b0887f9edcb950fad98ccbe66cab6949fbdc52
parent 2eae6027
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);
    }


+2 −2
Original line number Diff line number Diff line
@@ -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.");
    }
@@ -674,7 +674,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));
}