Only pass -Xprofile-* options to ART

Bug: 13391896
Change-Id: I5d6a3b900c9b20f02e1d4ccb73f712e9260c7dfd
This commit is contained in:
Brian Carlstrom
2014-03-10 10:20:01 -07:00
parent 6e2fb587d7
commit 98ba7bd5d1

View File

@@ -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];