summaryrefslogtreecommitdiffstats
path: root/vm/compiler/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'vm/compiler/codegen')
-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
7 files changed, 40 insertions, 6 deletions
diff --git a/vm/compiler/codegen/arm/Assemble.cpp b/vm/compiler/codegen/arm/Assemble.cpp
index a729dc589..10572eb5f 100644
--- a/vm/compiler/codegen/arm/Assemble.cpp
+++ b/vm/compiler/codegen/arm/Assemble.cpp
@@ -2153,6 +2153,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 0b1e0cdeb..a81a2e735 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 c698f6267..72ae3ce9c 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 4362961ec..473b88e8b 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 3027929a1..337bd61ae 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