summaryrefslogtreecommitdiffstats
path: root/vm/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'vm/compiler')
-rw-r--r--vm/compiler/Compiler.cpp2
-rw-r--r--vm/compiler/codegen/arm/Assemble.cpp2
-rw-r--r--vm/compiler/codegen/arm/armv5te-vfp/ArchVariant.cpp8
-rw-r--r--vm/compiler/codegen/arm/armv5te/ArchVariant.cpp8
-rw-r--r--vm/compiler/codegen/arm/armv7-a-neon/ArchVariant.cpp8
-rw-r--r--vm/compiler/codegen/arm/armv7-a/ArchVariant.cpp8
-rw-r--r--vm/compiler/codegen/mips/mips/ArchVariant.cpp6
-rw-r--r--vm/compiler/codegen/x86/CodegenInterface.cpp6
8 files changed, 41 insertions, 7 deletions
diff --git a/vm/compiler/Compiler.cpp b/vm/compiler/Compiler.cpp
index 188027f3d..fbde41f5b 100644
--- a/vm/compiler/Compiler.cpp
+++ b/vm/compiler/Compiler.cpp
@@ -182,7 +182,7 @@ bool dvmCompilerSetupCodeCache(void)
MAP_PRIVATE , fd, 0);
close(fd);
if (gDvmJit.codeCache == MAP_FAILED) {
- ALOGE("Failed to mmap the JIT code cache: %s", strerror(errno));
+ ALOGE("Failed to mmap the JIT code cache of size %d: %s", gDvmJit.codeCacheSize, strerror(errno));
return false;
}
diff --git a/vm/compiler/codegen/arm/Assemble.cpp b/vm/compiler/codegen/arm/Assemble.cpp
index 7406d3e88..ac4e64c11 100644
--- a/vm/compiler/codegen/arm/Assemble.cpp
+++ b/vm/compiler/codegen/arm/Assemble.cpp
@@ -2148,6 +2148,8 @@ void dvmCompilerSortAndPrintTraceProfiles()
}
ALOGD("JIT: Average execution count -> %d",(int)(sum / numTraces));
+ // How efficiently are we using code cache memory? Bigger is better.
+ ALOGD("JIT: CodeCache efficiency -> %.2f",(float)sum / (float)gDvmJit.codeCacheByteUsed);
/* Dump the sorted entries. The count of each trace will be reset to 0. */
for (i=0; i < gDvmJit.jitTableSize; i++) {
diff --git a/vm/compiler/codegen/arm/armv5te-vfp/ArchVariant.cpp b/vm/compiler/codegen/arm/armv5te-vfp/ArchVariant.cpp
index 713ecfa10..6c89b11e9 100644
--- a/vm/compiler/codegen/arm/armv5te-vfp/ArchVariant.cpp
+++ b/vm/compiler/codegen/arm/armv5te-vfp/ArchVariant.cpp
@@ -55,7 +55,13 @@ bool dvmCompilerArchVariantInit(void)
if (gDvmJit.threshold == 0) {
gDvmJit.threshold = 200;
}
- gDvmJit.codeCacheSize = 512*1024;
+ if (gDvmJit.codeCacheSize == DEFAULT_CODE_CACHE_SIZE) {
+ gDvmJit.codeCacheSize = 512 * 1024;
+ } else if ((gDvmJit.codeCacheSize == 0) && (gDvm.executionMode == kExecutionModeJit)) {
+ gDvm.executionMode = kExecutionModeInterpFast;
+ }
+ /* Hard limit for Arm of 2M */
+ assert(gDvmJit.codeCacheSize <= 2 * 1024 * 1024);
#if defined(WITH_SELF_VERIFICATION)
/* Force into blocking mode */
diff --git a/vm/compiler/codegen/arm/armv5te/ArchVariant.cpp b/vm/compiler/codegen/arm/armv5te/ArchVariant.cpp
index 25d650e6d..5c7fbbe41 100644
--- a/vm/compiler/codegen/arm/armv5te/ArchVariant.cpp
+++ b/vm/compiler/codegen/arm/armv5te/ArchVariant.cpp
@@ -55,7 +55,13 @@ bool dvmCompilerArchVariantInit(void)
if (gDvmJit.threshold == 0) {
gDvmJit.threshold = 200;
}
- gDvmJit.codeCacheSize = 512*1024;
+ if (gDvmJit.codeCacheSize == DEFAULT_CODE_CACHE_SIZE) {
+ gDvmJit.codeCacheSize = 512 * 1024;
+ } else if ((gDvmJit.codeCacheSize == 0) && (gDvm.executionMode == kExecutionModeJit)) {
+ gDvm.executionMode = kExecutionModeInterpFast;
+ }
+ /* Hard limit for Arm of 2M */
+ assert(gDvmJit.codeCacheSize <= 2 * 1024 * 1024);
#if defined(WITH_SELF_VERIFICATION)
/* Force into blocking mode */
diff --git a/vm/compiler/codegen/arm/armv7-a-neon/ArchVariant.cpp b/vm/compiler/codegen/arm/armv7-a-neon/ArchVariant.cpp
index 40ee04072..324c39879 100644
--- a/vm/compiler/codegen/arm/armv7-a-neon/ArchVariant.cpp
+++ b/vm/compiler/codegen/arm/armv7-a-neon/ArchVariant.cpp
@@ -50,7 +50,13 @@ bool dvmCompilerArchVariantInit(void)
if (gDvmJit.threshold == 0) {
gDvmJit.threshold = 40;
}
- gDvmJit.codeCacheSize = 1024*1024;
+ if (gDvmJit.codeCacheSize == DEFAULT_CODE_CACHE_SIZE) {
+ gDvmJit.codeCacheSize = 1500 * 1024;
+ } else if ((gDvmJit.codeCacheSize == 0) && (gDvm.executionMode == kExecutionModeJit)) {
+ gDvm.executionMode = kExecutionModeInterpFast;
+ }
+ /* Hard limit for Arm of 2M */
+ assert(gDvmJit.codeCacheSize <= 2 * 1024 * 1024);
#if defined(WITH_SELF_VERIFICATION)
/* Force into blocking */
diff --git a/vm/compiler/codegen/arm/armv7-a/ArchVariant.cpp b/vm/compiler/codegen/arm/armv7-a/ArchVariant.cpp
index 40ee04072..324c39879 100644
--- a/vm/compiler/codegen/arm/armv7-a/ArchVariant.cpp
+++ b/vm/compiler/codegen/arm/armv7-a/ArchVariant.cpp
@@ -50,7 +50,13 @@ bool dvmCompilerArchVariantInit(void)
if (gDvmJit.threshold == 0) {
gDvmJit.threshold = 40;
}
- gDvmJit.codeCacheSize = 1024*1024;
+ if (gDvmJit.codeCacheSize == DEFAULT_CODE_CACHE_SIZE) {
+ gDvmJit.codeCacheSize = 1500 * 1024;
+ } else if ((gDvmJit.codeCacheSize == 0) && (gDvm.executionMode == kExecutionModeJit)) {
+ gDvm.executionMode = kExecutionModeInterpFast;
+ }
+ /* Hard limit for Arm of 2M */
+ assert(gDvmJit.codeCacheSize <= 2 * 1024 * 1024);
#if defined(WITH_SELF_VERIFICATION)
/* Force into blocking */
diff --git a/vm/compiler/codegen/mips/mips/ArchVariant.cpp b/vm/compiler/codegen/mips/mips/ArchVariant.cpp
index d720f85af..10f5da10d 100644
--- a/vm/compiler/codegen/mips/mips/ArchVariant.cpp
+++ b/vm/compiler/codegen/mips/mips/ArchVariant.cpp
@@ -55,7 +55,11 @@ bool dvmCompilerArchVariantInit(void)
if (gDvmJit.threshold == 0) {
gDvmJit.threshold = 200;
}
- gDvmJit.codeCacheSize = 512*1024;
+ if (gDvmJit.codeCacheSize == DEFAULT_CODE_CACHE_SIZE) {
+ gDvmJit.codeCacheSize = 512 * 1024;
+ } else if ((gDvmJit.codeCacheSize == 0) && (gDvm.executionMode == kExecutionModeJit)) {
+ gDvm.executionMode = kExecutionModeInterpFast;
+ }
#if defined(WITH_SELF_VERIFICATION)
/* Force into blocking mode */
diff --git a/vm/compiler/codegen/x86/CodegenInterface.cpp b/vm/compiler/codegen/x86/CodegenInterface.cpp
index 46f097971..451c5e537 100644
--- a/vm/compiler/codegen/x86/CodegenInterface.cpp
+++ b/vm/compiler/codegen/x86/CodegenInterface.cpp
@@ -67,7 +67,11 @@ bool dvmCompilerArchInit() {
if (gDvmJit.threshold == 0) {
gDvmJit.threshold = 255;
}
- gDvmJit.codeCacheSize = 512*1024;
+ if (gDvmJit.codeCacheSize == DEFAULT_CODE_CACHE_SIZE) {
+ gDvmJit.codeCacheSize = 512 * 1024;
+ } else if ((gDvmJit.codeCacheSize == 0) && (gDvm.executionMode == kExecutionModeJit)) {
+ gDvm.executionMode = kExecutionModeInterpFast;
+ }
gDvmJit.optLevel = kJitOptLevelO1;
//Disable Method-JIT