History log of /dalvik/vm/mterp/armv5te/footer.S
Revision Date Author Comments
4934b377d9cf5df6f80da7caab4f2178c6cec307 21-Sep-2010 Ben Cheng <bccheng@android.com> Several fixes for JIT and self-verification under corner cases.

1) Fix the self-verification mode to handle backward chaining cell
properly when a single-step instruction is in the middle of the cyclic
portion of the trace. Then found issue 2 when changing the JIT
threshold to 1.
2) When the code cache is full, the VM may stop making forward progress
and bounces back and forth between the debug and fast intepreters as the
translation request is constantly rejected. The fix is to stay in the
debug interpreter until the corner case condition is cleared. Then found
issue 3.
3) Under self-verification mode, the code cache reset request may get
delayed indefinitely due to spurious indication that a thread is
running JIT'ed code. Trivial fix - make sure the inJitCodeCache flag is
cleared.

(cherry-picked from dalvik-dev)

Change-Id: Ic0b9952c0ae545f68f7eb2ae06a82a634ab62e9e
0d615c3ce5bf97ae65b9347ee77968f38620d5e8 18-Aug-2010 Andy McFadden <fadden@android.com> Always support debugging and profiling.

This eliminates the use of the WITH_DEBUGGER and WITH_PROFILER
conditional compilation flags. We've never shipped a device without
these features, and it's unlikely we ever will. They're not worth
the code clutter they cause.

As usual, since I can't test the x86-atom code I left that alone and
added an item to the TODO list.

Bug 2923442.

Change-Id: I335ebd5193bc86f7641513b1b41c0378839be1fe
7a2697d327936e20ef5484f7819e2e4bf91c891f 07-Jun-2010 Ben Cheng <bccheng@android.com> Implement method inlining for getters/setters

Changes include:
1) Force the trace that ends with an invoke instruction to include
the next instruction if it is a move-result (because both need
to be turned into no-ops if callee is inlined).
2) Interpreter entry point/trace builder changes so that return
target won't automatically be considered as trace starting points
(to avoid duplicate traces that include the move result
instructions).
3) Codegen changes to handle getters/setters invoked from both
monomorphic and polymorphic callsites.
4) Extend/fix self-verification to form identical trace regions and
handle traces with inlined callees.
5) Apply touchups to the method based parsing - still not in use.

Change-Id: I116b934df01bf9ada6d5a25187510e352bccd13c
7365493ad8d360c1dcf9cd8b6eee62747af01cae 09-Jun-2010 Carl Shapiro <cshapiro@google.com> Remove repeated newlines at the end of files.

Change-Id: I1e3d103a7b932ef21acedb6438c0f26b315df28f
fbdcfb9ea9e2a78f295834424c3f24986ea45dac 29-May-2010 Brian Carlstrom <bdc@google.com> Merge remote branch 'goog/dalvik-dev' into dalvik-dev-to-master

Change-Id: I0c0edb3ebf0d5e040d6bbbf60269fab0deb70ef9
bd0472480c6e876198fe19c4ffa22350c0ce57da 13-May-2010 Bill Buzbee <buzbee@google.com> 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
978738d2cbf9d08fa78c65762eaac3351ab76b9a 13-May-2010 Ben Cheng <bccheng@android.com> Add counters to track JIT inline cache hit rate and code cache patch counts.

Also did some WITH_JIT_TUNING cleanup.

Change-Id: I8bb2d681a06b0f2af1f976a007326825a88cea38
c95e0fbce4f77b2b08eb48205e405793de0d4248 29-Apr-2010 Andy McFadden <fadden@android.com> Rework common_periodicChecks.

The function was rewritten to optimize the common path. The control flow
now matches the C version, which tests for debugger/profiler even if the
previous test for suspension came up true.

This also adds a minor optimization on the test for debugger attachment,
allowing us to skip a load from memory if the process is simply not
debuggable. (The optimization isn't yet enabled because a similar change
must be made to the x86 asm code.)

The VM apparently hadn't been built without debugging/profiling support
for a while, so this fixes those places (necessary to be able to test
all forms of the new code).

Bug 2634642.

Change-Id: I096b58c961bb73ee0d128ba776d68dbf29bba924
7a44e4ee0782d24b4c6090be1f0a3c66f971f2c1 29-Apr-2010 Andy McFadden <fadden@android.com> Use unsigned compare for stack overflow.

When checking for stack overflow we're using a comparison that is treating
the pointers as signed values. If we manage to get a stack straddling
0x80000000, this will not work correctly.

Bug 2613607.

Change-Id: I5d178db86e93a3bb1e6a417e88d7cb1770d285bb
d5adae17d71e86a1a5f3ae7825054e3249fb7879 27-Mar-2010 Ben Cheng <bccheng@android.com> Improve JIT self verifier test coverage to follow single-step instructions.

Bug: 2549326
Change-Id: I01412d4aac1379b61c90fe6e59c534b33be93f66
51ae442fa9ed49e081e58e5127d1805789dbb196 13-Mar-2010 Bill Buzbee <buzbee@google.com> Jit: Minor cleanup - enum size fix, remove useless code, control consistency.

Change-Id: Id8c16303efd25683ad4b04a85e0d2a059b5ec3be
86717f79d9b018f4d69cc991075fa36611f234e5 06-Mar-2010 Ben Cheng <bccheng@android.com> Collect more JIT stats in the assert build.

New stuff includes breakdown of callsite types (ie monomorphic vs polymorphic
vs monoporphic resolved to native), total time spent in JIT'ing, and average
JIT time per compilation.

Example output:
D/dalvikvm( 840): 4042 compilations using 1976 + 329108 bytes
D/dalvikvm( 840): Compiler arena uses 10 blocks (8100 bytes each)
D/dalvikvm( 840): Compiler work queue length is 0/36
D/dalvikvm( 840): size if 8192, entries used is 4137
D/dalvikvm( 840): JIT: 4137 traces, 8192 slots, 1099 chains, 40 thresh, Non-blocking
D/dalvikvm( 840): JIT: Lookups: 1128780 hits, 168564 misses; 179520 normal, 6 punt
D/dalvikvm( 840): JIT: noChainExit: 528464 IC miss, 194708 interp callsite, 0 switch overflow
D/dalvikvm( 840): JIT: Invoke: 507 mono, 988 poly, 72 native, 1038 return
D/dalvikvm( 840): JIT: Total compilation time: 2342 ms
D/dalvikvm( 840): JIT: Avg unit compilation time: 579 us
D/dalvikvm( 840): JIT: 3357 Translation chains, 97 interp stubs
D/dalvikvm( 840): dalvik.vm.jit.op = 0-2,4-5,7-8,a-c,e-16,19-1a,1c-23,26,28-29,2b-2f,31-3d,44-4b,4d-51,60,62-63,68-69,70-72,76-78,7b,81-82,84,87,89,8d-93,95-98,a1,a3,a6,a8-a9,b0-b3,b5-b6,bb-bf,c6-c8,d0,d2-d6,d8,da-e2,ee-f0,f2-fb,
D/dalvikvm( 840): Code size stats: 50666/105126 (compiled/total Dalvik), 329108 (native)
40094c16d9727cc1e047a7d4bddffe04dd566211 25-Feb-2010 Ben Cheng <bccheng@android.com> Tweak the interpreter entries and 2nd level trace filter to capture more traces.

Real changes:
1) Add a new entry point from JIT to the interpreter to request hot traces w/o
doing chaining.
2) Increase the granularity of the secondary profile filter to match 64-byte
chunks using 64 entries.

The remaining are just cosmetic changes.
94e79ebaa340e8ba3bb4d13f5e908fef6d9d5eed 05-Feb-2010 Ben Cheng <bccheng@android.com> Enable JIT parameters to be initialized in an architecture dependent way.

The search for optimial value is still ongoing. The current settings are:

v5 v7
JIT profile table 512 2048
JIT code cache 512K 1M
JIT threshold 200 40
7b133ef7c84e68c3c4042176d830ea5b52e84139 05-Feb-2010 Ben Cheng <bccheng@android.com> Enable JIT parameters to be initialized in an architecture dependent way.

The search for optimial value is still ongoing. The current settings are:

v5 v7
JIT profile table 512 2048
JIT code cache 512K 1M
JIT threshold 200 40
c3b92b26df6416d3179e865adccb283ee4170ab1 27-Jan-2010 Ben Cheng <bccheng@android.com> Fix performance issues related to chaining and unchaining.

1) Patching requests for predicted chaining cells (used by virtual/interface
methods) are now batched in a queue and processed when the VM is paused for GC.

2) When the code cache is full the reset operation is also conducted at the
end of GC pauses so this totally eliminates the need for the compiler thread
to issue suspend-all requests. This is a very rare event and when happening it
takes less than 5ms to finish.

3) Change the initial value of the branch in a predicted chaining cell from 0
(ie lsl r0, r0, #0) to 0xe7fe (ie branch to self) so that initializing a
predicted chaining cell doesn't need to suspend all threads. Together with 1)
seeing 20% speedup on some benchmarks.

4) Add TestCompability.c where defining "TEST_VM_IN_ECLAIR := true" in
buildspec.mk will activate dummy symbols needed to run libdvm.so in older
releases.

Bug: 2397689
Bug: 2396513
Bug: 2331313
4fbba1f95b3e27bdc5f5572bb0420b5f928aa54e 03-Feb-2010 Andy McFadden <fadden@android.com> Fix stack overflow edge case.

When a stack overflows, Dalvik allows the stack to expand into a
"reserved" area, so that it has enough room to create and initialize the
StackOverflowError object. While the stack is expanded we also do the
search for an appropriate "catch" block, which may require resolving
some exception classes.

As it happens, things go badly when the "catch" resolution throws an
exception. The VM tries to shrink the stack back down after the second
exception is finished, rather than waiting for the initial SOE to
finish. Since we still have some additional frames on the stack, we're
still occupying the "reserved" area, and the VM aborts when it detects
the situation.

This changes the stack cleanup to wait until the SOE is being dealt
with.

For bug 2398031.
6999d84e2c55dc4a46a6c311b55bd5811336d9c4 27-Jan-2010 Ben Cheng <bccheng@android.com> Fix performance issues related to chaining and unchaining.

1) Patching requests for predicted chaining cells (used by virtual/interface
methods) are now batched in a queue and processed when the VM is paused for GC.

2) When the code cache is full the reset operation is also conducted at the
end of GC pauses so this totally eliminates the need for the compiler thread
to issue suspend-all requests. This is a very rare event and when happening it
takes less than 5ms to finish.

3) Change the initial value of the branch in a predicted chaining cell from 0
(ie lsl r0, r0, #0) to 0xe7fe (ie branch to self) so that initializing a
predicted chaining cell doesn't need to suspend all threads. Together with 1)
seeing 20% speedup on some benchmarks.

4) Add TestCompability.c where defining "TEST_VM_IN_ECLAIR := true" in
buildspec.mk will activate dummy symbols needed to run libdvm.so in older
releases.

Bug: 2397689
Bug: 2396513
Bug: 2331313
964a7b06a9134947b5985c7f712d18d57ed665d2 28-Jan-2010 Bill Buzbee <buzbee@google.com> Jit: Rework delayed start plus misc. cleanup

Defer initialization of jit to support upcoming feature to wait until
first screen is painted to start in order to avoid wasting effort on
jit'ng initialization code. Timed delay in place for the moment.
To change the on/off state, call dvmSuspendAllThreads(), update the
value of gDvmJit.pJitTable and then dvmResumeAllThreads().
Each time a thread goes through the heavyweight check suspend path, returns
from a monitor lock/unlock or returns from a JNI call, it will refresh
its on/off state.

Also:
Recognize and handle failure to increase size of JitTable.
Avoid repeated lock/unlock of JitTable modification mutex during resize
Make all work order enqueue actions non-blocking, which includes adding
a non-blocking mutex lock: dvmTryLockMutex().
Fix bug Jeff noticed where we were using a half-word form of a Thumb2
instruction rather than the byte form.
Minor comment changes.
7a0bcd0de6c4da6499a088a18d1750e51204c2a6 23-Jan-2010 Ben Cheng <bccheng@android.com> Tighten the safe points for code cache resets to happen.

Add a new flag in the Thread struct to track the whereabout of the top frame
in each Java thread. It is not safe to blow away the code cache if any thread
is in the JIT'ed land.
9797a237b48e880c33e2a2f497f48fb6f67c7a16 12-Jan-2010 Bill Buzbee <buzbee@google.com> Performance tweak for Jit lookup & adjust table sizes for better performance

Also, move setting of Jit table parameters to architecture-specific init
funciton.
72e93344b4d1ffc71e9c832ec23de0657e5b04a5 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
d726991ba52466cde88e37aba4de2395b62477fa 10-Nov-2009 Bill Buzbee <buzbee@google.com> Jit stress mode: translate everything we can and self verify.

This represents a general clean-up of some existing command-line
options: -Xjitthreshold:num and -Xjitblocking. The jit threshold
controls how quickly we treat a Dalvik address as a potential trace
head. Normally this is set around 200 (and the range is 0..255, where
0 is in effect 256 and 1 means begin trace selection on first visit).

-Xjitblocking forces the system to pause execution whenever a translation
request is made and resume when that translation is complete. Normally
the system make a request but continues execution (to avoid jitter).

Additionally, if WITH_SELF_VERIFICATION is defined, we force blocking
to be true, and set the threshold to 1. And finally, we treat
threshold==1 as a special case and disable the 2nd-level trace-building
filter - which causes the system to immediately start trace selection.
9a8c75adb2abf551d06dbf757bff558c1feded08 08-Nov-2009 Bill Buzbee <buzbee@google.com> Introduce "just interpret" chainable pseudo-translation.

This is the first step towards enabling translation & self-cosim stress modes.
When trace selection begins, the trace head address is pinned and
remains in a limbo state until the translation is complete. Previously,
if the trace selected aborted for any reason, the trace head would remain
forever in limbo. This was not a correctness problem, but caused some
small performance anomolies and made life more difficult for self-cosimulation
mode.

This CL introduces a pseudo-translation that simply routes control to
the interpreter. When we detect that a trace selection attempt has
failed, the trace head is associated with this fully-chainable
pseudo-translation. This also has the benefit for self-cosimulation that
we are guaranteed forward progress.
ccd6c0102d1f898aaea1c94761167fdd083b5275 15-Oct-2009 Ben Cheng <bccheng@google.com> Make the traige process for self-verification found divergence easier.

1. Automatically replay the code compilation with verbose mode turned on for
the offending compilation.
3. Mark the registers with divergence explicitly.
2. Print accurate operand names using the dataflow attributes. Constant values
are still printed for reference only.
3. Fixed a few correctness/style issues in self-verification code.
30f1f463b132c7b6daf2de825c5fa44ce356ca13 12-Oct-2009 Ben Cheng <bccheng@google.com> Set the debug interpreter entry point properly on the self-verification path.

Also fix the encoding for SFP/DFP register names to make self-verification
happy on FP benchmarks.
9c147b84ff7fe2c39228742b06a9ef180d39b48f 08-Oct-2009 Ben Cheng <bccheng@google.com> Fix various bugs found when debugger is attached to the VM.

See b/2161257 for details.
6ed1a0f396a1857c31b486d3e93ee2dbeb49a6cd 11-Sep-2009 Andy McFadden <fadden@android.com> Display additional information on stack overflow.

This required passing an additional argument into dvmHandleStackOverflow,
which is called directly from mterp. Fortunately the method being
called is sitting in a register for both ARM and x86, so this is a
fairly simple change.

For internal bug 2110533.
d5ab726b65d7271be261864c7e224fb90bfe06e0 25-Aug-2009 Andy McFadden <fadden@android.com> Another round of scary indirect ref changes.

This change adds a not-really-working implementation to Jni.c, with
various changes #ifdefed throughout the code. The ifdef is currently
disabled, so the old behavior should continue. Eventually the old
version will be stripped out and the ifdefs removed.

This renames the stack's "localRefTop" field, which nudged a bunch of
code. The name wasn't really right before (it's the *bottom* of the
local references), and it's even less right now. This and one other
mterp-visible constant were changed, which caused some ripples through
mterp and the JIT, but the ifdeffing was limited to one in
asm-constants.h (and the constant is the same both ways, so toggling the
ifdef won't require rebuilding asm sources).

Some comments and arg names in ReferenceTable were updated for the
correct orientation of bottom vs. top.

Some adjustments were made to the JNI code, e.g. dvmCallMethod now needs
to understand if it needs to convert reference arguments from
local/global refs to pointers (it's called from various places
throughout the VM).
97319a8a234e9fe1cf90ca39aa6eca37d729afd5 13-Aug-2009 Jeff Hao <jeffhao@google.com> New changes to enable self verification mode.
48f1824fd36241067e7bed2302cc00b2d880be7f 20-Jun-2009 Bill Buzbee <buzbee@google.com> New threshold mechanism for trace selections. Intended to reduce number of junk traces.
6e963e1cfbaeac377fed3ba8d5715c1dccfc1a57 18-Jun-2009 Bill Buzbee <buzbee@google.com> Trace profiling support for the jit
d8125c62642bd71df7485a85f787a1c6e2124c48 13-Jun-2009 Andy McFadden <fadden@android.com> Added a VFP utility function for future use.
2717622484eb0f7ad537275f7260b2f93324eda2 09-Jun-2009 Bill Buzbee <buzbee@google.com> Makes the primary Jit table growable. Also includes a change suggested earlier by Dan to use a pre-defined mask in the hash function. Reduce the default JitTable size from 2048 entries to 512 entries.
Update per Ben's comments.
46cd5b63c29d3284a9ff3e0d0711fb136f409313 06-Jun-2009 Bill Buzbee <buzbee@google.com> Support for stopping all threads in a Jit environment.
1da12167d913efde56ec3b40491524b051679f2c 06-Jun-2009 Andy McFadden <fadden@android.com> Swap the meaning of r7 and r8.

This swaps rIBASE and rINST, so that we can access rINST with 16-bit
THUMB instructions.
ba4fc8bfc1bccae048403bd1cea3b869dca61dd7 01-Jun-2009 Ben Cheng <bccheng@android.com> Initial port of the Dalvik JIT enging to the internal repository.
Fixed files with trailing spaces.
Addressed review comments from Dan.
Addressed review comments from fadden.
Addressed review comments from Dan x 2.
Addressed review comments from Dan x 3.
642d9646f0399648e377ed8e1b36eba9b12f84b2 26-Mar-2009 Ben Cheng <> Automated import from //branches/master/...@142811,142811
99409883d9c4c0ffb49b070ce307bb33a9dfe9f1 19-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import //branches/master/...@140412
f6c387128427e121477c1b32ad35cdcaa5101ba3 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
f72d5de56a522ac3be03873bdde26f23a5eeeb3c 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
31e30105703263782efd450d356cd67ea01af3b7 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@132589
6dcac3deb3c19dc634470eb30b2daedf2b201bd4 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@137055
5d709784bbf5001012d7f25172927d46f6c1abe1 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
89c1feb0a69a7707b271086e749975b3f7acacf7 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589