summaryrefslogtreecommitdiffstats
path: root/core/jni/AndroidRuntime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/jni/AndroidRuntime.cpp')
-rw-r--r--core/jni/AndroidRuntime.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 0bfc0c9..0d83e93 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -536,6 +536,7 @@ bool AndroidRuntime::parseCompilerRuntimeOption(const char* property,
*/
int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
{
+ int result = -1;
JavaVMInitArgs initArgs;
char propBuf[PROPERTY_VALUE_MAX];
char stackTraceFileBuf[sizeof("-Xstacktracefile:")-1 + PROPERTY_VALUE_MAX];
@@ -586,7 +587,6 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
char localeOption[sizeof("-Duser.locale=") + PROPERTY_VALUE_MAX];
char lockProfThresholdBuf[sizeof("-Xlockprofthreshold:")-1 + PROPERTY_VALUE_MAX];
char nativeBridgeLibrary[sizeof("-XX:NativeBridge=") + PROPERTY_VALUE_MAX];
- char cpuAbiListBuf[sizeof("--cpu-abilist=") + PROPERTY_VALUE_MAX];
bool checkJni = false;
property_get("dalvik.vm.checkjni", propBuf, "");
@@ -705,7 +705,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
if (!hasFile("/system/etc/preloaded-classes")) {
ALOGE("Missing preloaded-classes file, /system/etc/preloaded-classes not found: %s\n",
strerror(errno));
- return -1;
+ goto bail;
}
addOption("-Ximage-compiler-option");
addOption("--image-classes=/system/etc/preloaded-classes");
@@ -860,18 +860,6 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
// Dalvik-cache pruning counter.
parseRuntimeOption("dalvik.vm.zygote.max-boot-retry", cachePruneBuf,
"-Xzygote-max-boot-retry=");
-#if defined(__LP64__)
- const char* cpu_abilist_property_name = "ro.product.cpu.abilist64";
-#else
- const char* cpu_abilist_property_name = "ro.product.cpu.abilist32";
-#endif // defined(__LP64__)
- property_get(cpu_abilist_property_name, propBuf, "");
- if (propBuf[0] == '\0') {
- ALOGE("%s is not expected to be empty", cpu_abilist_property_name);
- return -1;
- }
- snprintf(cpuAbiListBuf, sizeof(cpuAbiListBuf), "--cpu-abilist=%s", propBuf);
- addOption(cpuAbiListBuf);
initArgs.version = JNI_VERSION_1_4;
initArgs.options = mOptions.editArray();
@@ -887,10 +875,13 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
*/
if (JNI_CreateJavaVM(pJavaVM, pEnv, &initArgs) < 0) {
ALOGE("JNI_CreateJavaVM failed\n");
- return -1;
+ goto bail;
}
- return 0;
+ result = 0;
+
+bail:
+ return result;
}
char* AndroidRuntime::toSlashClassName(const char* className)