diff options
author | Bill Buzbee <buzbee@google.com> | 2010-05-13 13:02:53 -0700 |
---|---|---|
committer | buzbee <buzbee@google.com> | 2010-05-17 12:18:10 -0700 |
commit | bd0472480c6e876198fe19c4ffa22350c0ce57da (patch) | |
tree | 8b217d10bb8bc1349a244b93f0258cea194a0aaa /vm/compiler/Compiler.h | |
parent | 18d0e3f43f0afd38693baaf74807c37ac9ef5ebe (diff) | |
download | android_dalvik-bd0472480c6e876198fe19c4ffa22350c0ce57da.tar.gz android_dalvik-bd0472480c6e876198fe19c4ffa22350c0ce57da.tar.bz2 android_dalvik-bd0472480c6e876198fe19c4ffa22350c0ce57da.zip |
JIT: Fix for [Issue 2675245] FRF40 monkey crash in jit-cache
The JIT's chaining mechanism suffered from a narrow window that
could result in i-cache inconsistency. One of the forms of chaining
cell consisted of a two 16-bit thumb instruction sequence. If a thread were
interrupted between the execution of those two instructions *and*
another thread picked that moment to convert that cell's
chained/unchained state, then bad things happen.
This CL alters the chain/unchain model somewhat to avoid this case.
Chainable chaining cells grow by 4 bytes each, and instead of rewriting
a 32-bit cell to chain/unchain, we switch between chained and unchained
state by [re]writing the first 16-bits of the cell as either a 16-bit
Thumb unconditional branch (unchained mode) or the first half of a
32-bit Thumb branch. The 2nd 16-bits of the cell will never change once
the cell moves from its inital state - thus avoiding the possibility of it
becoming inconsistent.
This adds a trivial execution penalty on the slow path, but will add
about a kByte of memory usage to a typical process.
Change-Id: Id8b99802e11386cfbab23da6abae10e2d9fc4065
Diffstat (limited to 'vm/compiler/Compiler.h')
-rw-r--r-- | vm/compiler/Compiler.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vm/compiler/Compiler.h b/vm/compiler/Compiler.h index e42d98696..46f1799c0 100644 --- a/vm/compiler/Compiler.h +++ b/vm/compiler/Compiler.h @@ -195,4 +195,5 @@ void dvmCompilerDataFlowAnalysisDispatcher(struct CompilationUnit *cUnit, void dvmCompilerStateRefresh(void); JitTraceDescription *dvmCopyTraceDescriptor(const u2 *pc, const struct JitEntry *desc); +void *dvmCompilerGetInterpretTemplate(); #endif /* _DALVIK_VM_COMPILER */ |