am 7b7d111b: am 9e736723: am ec4c7752: am ab97d617: Merge "Only pass -Xprofile-* options to ART"
* commit '7b7d111ba21c7c5ad161207a75f72948c427b1b0':
Only pass -Xprofile-* options to ART
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 06e4717..e50c1d8 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -750,10 +750,11 @@
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");
@@ -784,7 +785,7 @@
/*
* 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];