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

Commit 27c39f1a authored by Andreas Gampe's avatar Andreas Gampe
Browse files

am b6d14a00: resolved conflicts for merge of c29791d5 to mnc-dev-plus-aosp

* commit 'b6d14a00':
  Frameworks/base: Add debug.gencfi property

(cherry picked from commit a5b55a01)
parent 6b3e0587
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -634,6 +634,9 @@ public class Process {
            if ((debugFlags & Zygote.DEBUG_ENABLE_JIT) != 0) {
            if ((debugFlags & Zygote.DEBUG_ENABLE_JIT) != 0) {
                argsForZygote.add("--enable-jit");
                argsForZygote.add("--enable-jit");
            }
            }
            if ((debugFlags & Zygote.DEBUG_GENERATE_CFI) != 0) {
                argsForZygote.add("--generate-cfi");
            }
            if ((debugFlags & Zygote.DEBUG_ENABLE_ASSERT) != 0) {
            if ((debugFlags & Zygote.DEBUG_ENABLE_ASSERT) != 0) {
                argsForZygote.add("--enable-assert");
                argsForZygote.add("--enable-assert");
            }
            }
+2 −0
Original line number Original line Diff line number Diff line
@@ -40,6 +40,8 @@ public final class Zygote {
    public static final int DEBUG_ENABLE_JNI_LOGGING = 1 << 4;
    public static final int DEBUG_ENABLE_JNI_LOGGING = 1 << 4;
    /** enable the JIT compiler */
    /** enable the JIT compiler */
    public static final int DEBUG_ENABLE_JIT         = 1 << 5;
    public static final int DEBUG_ENABLE_JIT         = 1 << 5;
    /** Force generation of CFI code */
    public static final int DEBUG_GENERATE_CFI       = 1 << 6;


    /** No external storage should be mounted. */
    /** No external storage should be mounted. */
    public static final int MOUNT_EXTERNAL_NONE = 0;
    public static final int MOUNT_EXTERNAL_NONE = 0;
+3 −1
Original line number Original line Diff line number Diff line
@@ -321,7 +321,7 @@ class ZygoteConnection {


        /**
        /**
         * From --enable-debugger, --enable-checkjni, --enable-assert,
         * From --enable-debugger, --enable-checkjni, --enable-assert,
         * --enable-safemode, --enable-jit, and --enable-jni-logging.
         * --enable-safemode, --enable-jit, --generate-cfi and --enable-jni-logging.
         */
         */
        int debugFlags;
        int debugFlags;


@@ -433,6 +433,8 @@ class ZygoteConnection {
                    debugFlags |= Zygote.DEBUG_ENABLE_CHECKJNI;
                    debugFlags |= Zygote.DEBUG_ENABLE_CHECKJNI;
                } else if (arg.equals("--enable-jit")) {
                } else if (arg.equals("--enable-jit")) {
                    debugFlags |= Zygote.DEBUG_ENABLE_JIT;
                    debugFlags |= Zygote.DEBUG_ENABLE_JIT;
                } else if (arg.equals("--generate-cfi")) {
                    debugFlags |= Zygote.DEBUG_GENERATE_CFI;
                } else if (arg.equals("--enable-jni-logging")) {
                } else if (arg.equals("--enable-jni-logging")) {
                    debugFlags |= Zygote.DEBUG_ENABLE_JNI_LOGGING;
                    debugFlags |= Zygote.DEBUG_ENABLE_JNI_LOGGING;
                } else if (arg.equals("--enable-assert")) {
                } else if (arg.equals("--enable-assert")) {
+13 −0
Original line number Original line Diff line number Diff line
@@ -875,6 +875,19 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
    parseRuntimeOption("dalvik.vm.zygote.max-boot-retry", cachePruneBuf,
    parseRuntimeOption("dalvik.vm.zygote.max-boot-retry", cachePruneBuf,
                       "-Xzygote-max-boot-retry=");
                       "-Xzygote-max-boot-retry=");


    /*
     * When running with debug.gencfi, add --include-cfi to the compiler options so that the boot
     * image, if it is compiled on device, will include CFI info, as well as other compilations
     * started by the runtime.
     */
    property_get("debug.gencfi", propBuf, "");
    if (strcmp(propBuf, "true") == 0) {
        addOption("-Xcompiler-option");
        addOption("--include-cfi");
        addOption("-Ximage-compiler-option");
        addOption("--include-cfi");
    }

    initArgs.version = JNI_VERSION_1_4;
    initArgs.version = JNI_VERSION_1_4;
    initArgs.options = mOptions.editArray();
    initArgs.options = mOptions.editArray();
    initArgs.nOptions = mOptions.size();
    initArgs.nOptions = mOptions.size();
+4 −0
Original line number Original line Diff line number Diff line
@@ -3179,6 +3179,10 @@ public final class ActivityManagerService extends ActivityManagerNative
                    debugFlags |= Zygote.DEBUG_ENABLE_JIT;
                    debugFlags |= Zygote.DEBUG_ENABLE_JIT;
                }
                }
            }
            }
            String genCFIDebugProperty = SystemProperties.get("debug.gencfi");
            if ("true".equals(genCFIDebugProperty)) {
                debugFlags |= Zygote.DEBUG_GENERATE_CFI;
            }
            if ("1".equals(SystemProperties.get("debug.jni.logging"))) {
            if ("1".equals(SystemProperties.get("debug.jni.logging"))) {
                debugFlags |= Zygote.DEBUG_ENABLE_JNI_LOGGING;
                debugFlags |= Zygote.DEBUG_ENABLE_JNI_LOGGING;
            }
            }