History log of /dalvik/vm/mterp/x86/OP_IPUT_WIDE.S
Revision Date Author Comments
a7d59bbafea5430fe81fc21ba94ddf6f6a63b0b3 24-Feb-2011 buzbee <buzbee@google.com> New interpreter breakout mechanism

Introduce parallel handler entry points for mterp interpreters as a step
towards fully supporting debug, profile and JIT within mterp (instead of
bailing out to the portable debug interpreter).

This CL contains most of the structural changes that need to happen,
but does not yet enable the new switch mode. In short, within the
mterp assembly interpreter register rIBASE points to an array of handlers
for Dalvik opcodes. Instead of periodically checking for suspend,
debug, profiling and JIT trace selection breakouts, rIBASE may simply
be altered to point to the parallel breakout handlers when control needs
to be rerouted. This will enable us to eliminate the separate portable
debug interpreter and the entire mechanism of switching between the fast
and portable interpreters.

The x86 implementation required a large number of changes because of the
need to dedicate a register to holding the table base. It will now use %edx
(which was previously scratch).

Changes include:

o Support for two styles of mterp assembly code generation: computed goto
and jump table (ARM uses computed goto, x86 uses jump table)
o New mterp config operators to trigger generation of alternate entry points.
o Alternate entries route execution through new dvmCheckInst(). That's
where the checking code will go.
o For x86, reserved register edx as dedicated rIBASE.
o For jump-table mterps, ignore "%break" operator and allow variable-sized
handlers with no "sister" region.

Note that the x86-atom implementation will need substantial changes
to function in this new model.

Change-Id: I3a22048adb7dcfdeba4f94fbb977b26c3ab2fcb3
9f601a917c8878204482c37aec7005054b6776fa 12-Feb-2011 buzbee <buzbee@google.com> Interpreter restructuring: eliminate InterpState

The key datastructure for the interpreter is InterpState.
This change eliminates it, merging its data with the Thread structure.

Here's why:

In principio creavit Fadden Thread et InterpState. And it was good.

Thread holds thread-private state, while InterpState captures data
associated with a Dalvik interpreter activation. Because JNI calls
can result in nested interpreter invocations, we can have more than one
InterpState for each actual thread. InterpState was relatively small,
and it all worked well. It was used enough that in the Arm version
a register (rGLUE) was dedicated to it.

Then, along came the JIT guys, who saw InterpState as a convenient place
to dump all sorts of useful data that they wanted quick access to through
that dedicated register. InterpState grew and grew. In terms of
space, this wasn't a big problem - but it did mean that the initialization
cost of each interpreter activation grew as well. For applications
that do a lot of callbacks from native code into Dalvik, this is
measurable. It's also mostly useless cost because much of the JIT-related
InterpState initialization was setting up useful constants - things that
don't need to be saved and restored all the time.

The biggest problem, though, deals with thread control. When something
interesting is happening that needs all threads to be stopped (such as
GC and debugger attach), we have access to all of the Thread structures,
but we don't have access to all of the InterpState structures (which
may be buried/nested on the native stack). As a result, polling for
thread suspension is done via a one-indirection pointer chase. InterpState
itself can't hold the stop bits because we can't always find it, so
instead it holds a pointer to the global or thread-specific stop control.

Yuck.

With this change, we eliminate InterpState and merge all needed data
into Thread. Further, we replace the decidated rGLUE register with a
pointer to the Thread structure (rSELF). The small subset of state
data that needs to be saved and restored across nested interpreter
activations is collected into a record that is saved to the interpreter
frame, and restored on exit. Further, these small records are linked
together to allow tracebacks to show nested activations. Old InterpState
variables that simply contain useful constants are initialized once at
thread creation time.

This CL is large enough by itself that the new ability to streamline
suspend checks is not done here - that will happen in a future CL. Here
we just focus on consolidation.

Change-Id: Ide6b2fb85716fea454ac113f5611263a96687356
f3e177289ac078f18401cfd8eebafe584dd0d01f 12-Sep-2010 buzbee <buzbee@google.com> x86 mterp: reduce x86/x86-atom differences

To ease future x86 development, elminate unnecessary differences
between x86 and x86-atom targets.

1. Macros instead of defines (cosmetic change)
2. Register naming convention (cosmetic change)
3. Register usage convention
- Drop rIBASE, freeing %edx for general usage
- use %edi for rPC (callee-save) & eliminate spills
4. Spill & temp frame layout
5. rGLUE usage 0(%ebp) instead of -24(%ebp)
6. Jump table transition between instruction interpretations
instead of computed goto.
7. Change entry convention for instruction handlers:
Previously:
%bl contains 8-bit Dalvik opcode
%bh contains 2nd half of 16-bit Dalvik insn (usually AA or BA)
upper 16 bits of %ebx are zero
Now:
%bl contains 2nd half of 16-bit Dalvik insn (usually AA or BA)
upper 24 bits of %ebx are zero
8. Include copies of x86-atom macros and defines into x86 build. This
allows the x86 build to mix-and-match x86 and x86-atom handlers
via the normal config mechanism. [Note - only for non-control-flow
instructions. There are still some conflicts in the footer.S
main loop re-entry points].

Change-Id: Ib9d549b56f7ffd7420f9dbf97b2169f65603ee83
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
89c1feb0a69a7707b271086e749975b3f7acacf7 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589