Merge "Update AndroidRuntime with dalvik-dev changes" into gingerbread

This commit is contained in:
Brian Carlstrom
2010-08-25 10:53:10 -07:00
committed by Android (Google) Code Review

View File

@@ -506,7 +506,7 @@ static void blockSigpipe()
static void readLocale(char* language, char* region) static void readLocale(char* language, char* region)
{ {
char propLang[PROPERTY_VALUE_MAX], propRegn[PROPERTY_VALUE_MAX]; char propLang[PROPERTY_VALUE_MAX], propRegn[PROPERTY_VALUE_MAX];
property_get("persist.sys.language", propLang, ""); property_get("persist.sys.language", propLang, "");
property_get("persist.sys.country", propRegn, ""); property_get("persist.sys.country", propRegn, "");
if (*propLang == 0 && *propRegn == 0) { if (*propLang == 0 && *propRegn == 0) {
@@ -710,6 +710,33 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
LOGW("dalvik.vm.gc.overwritefree should be 'true' or 'false'"); LOGW("dalvik.vm.gc.overwritefree should be 'true' or 'false'");
} }
/* enable heap verification before each gc */
property_get("dalvik.vm.gc.preverify", propBuf, "false");
if (strcmp(propBuf, "true") == 0) {
opt.optionString = "-Xgc:preverify";
mOptions.add(opt);
} else if (strcmp(propBuf, "false") != 0) {
LOGW("dalvik.vm.gc.preverify should be 'true' or 'false'");
}
/* enable heap verification after each gc */
property_get("dalvik.vm.gc.postverify", propBuf, "false");
if (strcmp(propBuf, "true") == 0) {
opt.optionString = "-Xgc:postverify";
mOptions.add(opt);
} else if (strcmp(propBuf, "false") != 0) {
LOGW("dalvik.vm.gc.postverify should be 'true' or 'false'");
}
/* enable card table verification for partial gc */
property_get("dalvik.vm.gc.verifycardtable", propBuf, "false");
if (strcmp(propBuf, "true") == 0) {
opt.optionString = "-Xgc:verifycardtable";
mOptions.add(opt);
} else if (strcmp(propBuf, "false") != 0) {
LOGW("dalvik.vm.gc.verifycardtable should be 'true' or 'false'");
}
/* enable debugging; set suspend=y to pause during VM init */ /* enable debugging; set suspend=y to pause during VM init */
#ifdef HAVE_ANDROID_OS #ifdef HAVE_ANDROID_OS
/* use android ADB transport */ /* use android ADB transport */
@@ -757,16 +784,6 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
} }
#if defined(WITH_JIT) #if defined(WITH_JIT)
/* Minimal profile threshold to trigger JIT compilation */
char jitThresholdBuf[sizeof("-Xjitthreshold:") + PROPERTY_VALUE_MAX];
property_get("dalvik.vm.jit.threshold", propBuf, "");
if (strlen(propBuf) > 0) {
strcpy(jitThresholdBuf, "-Xjitthreshold:");
strcat(jitThresholdBuf, propBuf);
opt.optionString = jitThresholdBuf;
mOptions.add(opt);
}
/* Force interpreter-only mode for selected opcodes. Eg "1-0a,3c,f1-ff" */ /* Force interpreter-only mode for selected opcodes. Eg "1-0a,3c,f1-ff" */
char jitOpBuf[sizeof("-Xjitop:") + PROPERTY_VALUE_MAX]; char jitOpBuf[sizeof("-Xjitop:") + PROPERTY_VALUE_MAX];
property_get("dalvik.vm.jit.op", propBuf, ""); property_get("dalvik.vm.jit.op", propBuf, "");
@@ -777,16 +794,6 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
mOptions.add(opt); mOptions.add(opt);
} }
/*
* Reverse the polarity of dalvik.vm.jit.op and force interpreter-only
* for non-selected opcodes.
*/
property_get("dalvik.vm.jit.includeop", propBuf, "");
if (strlen(propBuf) > 0) {
opt.optionString = "-Xincludeselectedop";
mOptions.add(opt);
}
/* Force interpreter-only mode for selected methods */ /* Force interpreter-only mode for selected methods */
char jitMethodBuf[sizeof("-Xjitmethod:") + PROPERTY_VALUE_MAX]; char jitMethodBuf[sizeof("-Xjitmethod:") + PROPERTY_VALUE_MAX];
property_get("dalvik.vm.jit.method", propBuf, ""); property_get("dalvik.vm.jit.method", propBuf, "");
@@ -796,37 +803,6 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
opt.optionString = jitMethodBuf; opt.optionString = jitMethodBuf;
mOptions.add(opt); mOptions.add(opt);
} }
/*
* Reverse the polarity of dalvik.vm.jit.method and force interpreter-only
* for non-selected methods.
*/
property_get("dalvik.vm.jit.includemethod", propBuf, "");
if (strlen(propBuf) > 0) {
opt.optionString = "-Xincludeselectedmethod";
mOptions.add(opt);
}
/*
* Enable profile collection on JIT'ed code.
*/
property_get("dalvik.vm.jit.profile", propBuf, "");
if (strlen(propBuf) > 0) {
opt.optionString = "-Xjitprofile";
mOptions.add(opt);
}
/*
* Disable optimizations by setting the corresponding bit to 1.
*/
char jitOptBuf[sizeof("-Xjitdisableopt:") + PROPERTY_VALUE_MAX];
property_get("dalvik.vm.jit.disableopt", propBuf, "");
if (strlen(propBuf) > 0) {
strcpy(jitOptBuf, "-Xjitdisableopt:");
strcat(jitOptBuf, propBuf);
opt.optionString = jitOptBuf;
mOptions.add(opt);
}
#endif #endif
if (executionMode == kEMIntPortable) { if (executionMode == kEMIntPortable) {