summaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorJeff Hao <jeffhao@google.com>2014-01-27 17:47:31 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-01-27 17:47:31 +0000
commitc963835479ce76e1355305522b392771918a2f58 (patch)
tree16eb8e351593bfe008a8c996266d56165f0ee6a8 /vm
parent9289bc489513ef0aecad17e79f11fd6ed73028ec (diff)
parent8349871b2596e5231c1cbac1f28f32cdb9d4ee99 (diff)
downloadandroid_dalvik-c963835479ce76e1355305522b392771918a2f58.tar.gz
android_dalvik-c963835479ce76e1355305522b392771918a2f58.tar.bz2
android_dalvik-c963835479ce76e1355305522b392771918a2f58.zip
Merge "Revert "Protect JIT Code cache modifications with version check""
Diffstat (limited to 'vm')
-rw-r--r--vm/compiler/Frontend.cpp50
1 files changed, 18 insertions, 32 deletions
diff --git a/vm/compiler/Frontend.cpp b/vm/compiler/Frontend.cpp
index 916915d01..47c1898a0 100644
--- a/vm/compiler/Frontend.cpp
+++ b/vm/compiler/Frontend.cpp
@@ -1579,23 +1579,16 @@ static bool compileLoop(CompilationUnit *cUnit, unsigned int startOffset,
dvmCompilerCodegenDump(cUnit);
}
- dvmLockMutex(&gDvmJit.compilerLock);
- if (info->cacheVersion == gDvmJit.cacheVersion) {
- /*
- * If this trace uses class objects as constants,
- * dvmJitInstallClassObjectPointers will switch the thread state
- * to running and look up the class pointers using the descriptor/loader
- * tuple stored in the callsite info structure. We need to make this window
- * as short as possible since it is blocking GC.
- */
- if (cUnit->hasClassLiterals && info->codeAddress) {
- dvmJitInstallClassObjectPointers(cUnit, (char *) info->codeAddress);
- }
- } else {
- ALOGD("JIT CC reset. New version: %d / trace version: %d",
- gDvmJit.cacheVersion, info->cacheVersion);
+ /*
+ * If this trace uses class objects as constants,
+ * dvmJitInstallClassObjectPointers will switch the thread state
+ * to running and look up the class pointers using the descriptor/loader
+ * tuple stored in the callsite info structure. We need to make this window
+ * as short as possible since it is blocking GC.
+ */
+ if (cUnit->hasClassLiterals && info->codeAddress) {
+ dvmJitInstallClassObjectPointers(cUnit, (char *) info->codeAddress);
}
- dvmUnlockMutex(&gDvmJit.compilerLock);
/*
* Since callsiteinfo is allocated from the arena, delay the reset until
@@ -2158,23 +2151,16 @@ bool dvmCompileTrace(JitTraceDescription *desc, int numMaxInsts,
optHints);
}
- dvmLockMutex(&gDvmJit.compilerLock);
- if (info->cacheVersion == gDvmJit.cacheVersion) {
- /*
- * If this trace uses class objects as constants,
- * dvmJitInstallClassObjectPointers will switch the thread state
- * to running and look up the class pointers using the descriptor/loader
- * tuple stored in the callsite info structure. We need to make this window
- * as short as possible since it is blocking GC.
- */
- if (cUnit.hasClassLiterals && info->codeAddress) {
- dvmJitInstallClassObjectPointers(&cUnit, (char *) info->codeAddress);
- }
- } else {
- ALOGD("JIT CC reset. New version: %d / trace version: %d",
- gDvmJit.cacheVersion, info->cacheVersion);
+ /*
+ * If this trace uses class objects as constants,
+ * dvmJitInstallClassObjectPointers will switch the thread state
+ * to running and look up the class pointers using the descriptor/loader
+ * tuple stored in the callsite info structure. We need to make this window
+ * as short as possible since it is blocking GC.
+ */
+ if (cUnit.hasClassLiterals && info->codeAddress) {
+ dvmJitInstallClassObjectPointers(&cUnit, (char *) info->codeAddress);
}
- dvmUnlockMutex(&gDvmJit.compilerLock);
/*
* Since callsiteinfo is allocated from the arena, delay the reset until