diff options
| author | 2014-03-10 17:44:30 +0000 | |
|---|---|---|
| committer | 2014-03-10 17:44:31 +0000 | |
| commit | ab97d617e8043f7396dc6031c4ddeb2ae632230f (patch) | |
| tree | 695348c975b943a645b8da24f0553a65647191be | |
| parent | 6e2fb587d71631bd29fdb844a6451d68e2144337 (diff) | |
| parent | 98ba7bd5d1942edd7c2881cc6fd0e777ae8baa2e (diff) | |
Merge "Only pass -Xprofile-* options to ART"
| -rw-r--r-- | core/jni/AndroidRuntime.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index e623d5dced2d..98f7716138cb 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -749,10 +749,11 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) mOptions.add(opt); } - // libart tolerates libdvm flags, but not vice versa, so only pass these if libart. + // libart tolerates libdvm flags, but not vice versa, so only pass some options if libart. property_get("persist.sys.dalvik.vm.lib.1", dalvikVmLibBuf, "libdvm.so"); - if (strncmp(dalvikVmLibBuf, "libart", 6) == 0) { + bool libart = (strncmp(dalvikVmLibBuf, "libart", 6) == 0); + if (libart) { // Extra options for DexClassLoader. property_get("dalvik.vm.dex2oat-flags", dex2oatFlagsBuf, ""); parseExtraOpts(dex2oatFlagsBuf, "-Xcompiler-option"); @@ -783,7 +784,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) /* * Set profiler options */ - { + if (libart) { char period[sizeof("-Xprofile-period:") + PROPERTY_VALUE_MAX]; char duration[sizeof("-Xprofile-duration:") + PROPERTY_VALUE_MAX]; char interval[sizeof("-Xprofile-interval:") + PROPERTY_VALUE_MAX]; |