OSDN Git Service

resolved conflicts for merge of a2d19318 to lmp-mr1-ub-dev
authorSebastien Hertz <shertz@google.com>
Fri, 21 Aug 2015 07:53:41 +0000 (09:53 +0200)
committerSebastien Hertz <shertz@google.com>
Fri, 21 Aug 2015 07:53:41 +0000 (09:53 +0200)
Change-Id: I4cb38241b5efab1eb7af161e1589fa477a473a39

1  2 
cmds/app_process/app_main.cpp
core/jni/AndroidRuntime.cpp

Simple merge
@@@ -534,8 -528,9 +534,8 @@@ bool AndroidRuntime::parseCompilerRunti
   *
   * Returns 0 on success.
   */
- int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
+ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote)
  {
 -    int result = -1;
      JavaVMInitArgs initArgs;
      char propBuf[PROPERTY_VALUE_MAX];
      char stackTraceFileBuf[sizeof("-Xstacktracefile:")-1 + PROPERTY_VALUE_MAX];
      parseRuntimeOption("dalvik.vm.gctype", gctypeOptsBuf, "-Xgc:");
      parseRuntimeOption("dalvik.vm.backgroundgctype", backgroundgcOptsBuf, "-XX:BackgroundGC=");
  
-     /* enable debugging; set suspend=y to pause during VM init */
-     /* use android ADB transport */
-     addOption("-agentlib:jdwp=transport=dt_android_adb,suspend=n,server=y");
+     /*
 -     * Enable or disable dexopt features, such as bytecode verification and
 -     * calculation of register maps for precise GC.
 -     */
 -    property_get("dalvik.vm.dexopt-flags", dexoptFlagsBuf, "");
 -    if (dexoptFlagsBuf[0] != '\0') {
 -        const char* opc;
 -        const char* val;
 -
 -        opc = strstr(dexoptFlagsBuf, "v=");     /* verification */
 -        if (opc != NULL) {
 -            switch (*(opc+2)) {
 -            case 'n':   val = "-Xverify:none";      break;
 -            case 'r':   val = "-Xverify:remote";    break;
 -            case 'a':   val = "-Xverify:all";       break;
 -            default:    val = NULL;                 break;
 -            }
 -
 -            if (val != NULL) {
 -                addOption(val);
 -            }
 -        }
 -
 -        opc = strstr(dexoptFlagsBuf, "o=");     /* optimization */
 -        if (opc != NULL) {
 -            switch (*(opc+2)) {
 -            case 'n':   val = "-Xdexopt:none";      break;
 -            case 'v':   val = "-Xdexopt:verified";  break;
 -            case 'a':   val = "-Xdexopt:all";       break;
 -            case 'f':   val = "-Xdexopt:full";      break;
 -            default:    val = NULL;                 break;
 -            }
 -
 -            if (val != NULL) {
 -                addOption(val);
 -            }
 -        }
 -
 -        opc = strstr(dexoptFlagsBuf, "m=y");    /* register map */
 -        if (opc != NULL) {
 -            addOption("-Xgenregmap");
 -
 -            /* turn on precise GC while we're at it */
 -            addOption("-Xgc:precise");
 -        }
 -    }
 -
 -    /*
+      * Enable debugging only for apps forked from zygote.
+      * Set suspend=y to pause during VM init and use android ADB transport.
+      */
+     if (zygote) {
+       addOption("-agentlib:jdwp=transport=dt_android_adb,suspend=n,server=y");
+     }
  
      parseRuntimeOption("dalvik.vm.lockprof.threshold",
                         lockProfThresholdBuf,