History log of /dalvik/vm/compiler/Dataflow.c
Revision Date Author Comments
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
35ff69be47f3f2bd33f2a2d8562eaa2ac3dc9f1d 29-Jul-2010 buzbee <buzbee@google.com> JIT: temporarily disable the JIT and concurrent GC on SMP systems

Change-Id: If2d489b2aca39cd0297453f311a5c3ce80f577d9
c6b25c79a4ec5cc83e2bc14af24e8eabad931743 22-Jun-2010 Andy McFadden <fadden@android.com> Relocate OpCodeNames.[ch].

The JIT was pulling it out of the dexdump directory, which is Just
Plain Wrong[tm]. Now it's part of libdex, for all to enjoy.

Change-Id: Ic1e4c981eb2d70ccc3c841ceb5a54f4f77af2008
c35a2ef53d0cccd6f924eeba36633220ec67c32e 17-Jun-2010 Andy McFadden <fadden@android.com> Add opcodes for volatile field accesses

This adds instructions for {i,s}{get,put}{,-object}-volatile, for a
total of eight new instructions.

On SMP systems, these instructions will be substituted in for existing
field access instructions, either by dexopt or during just-in-time
verification. Unlike the wide-volatile instructions, these will not be
used at all when the VM is not built for SMP.

(Ideally we'd omit the volatile instruction implementations entirely on
non-SMP builds, but that requires a little work in gen-mterp.py.)

The change defines and implements the opcodes and support methods, but
does not cause them to be used.

Also, changed dvmQuasiAtomicRead64's argument to be const.

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

Change-Id: I0c0edb3ebf0d5e040d6bbbf60269fab0deb70ef9
e3c01dac83e6eea7f82fe81ed89cfbdd9791dbc9 21-May-2010 Carl Shapiro <cshapiro@google.com> Remove unused labels, variables, and functions. Enable warnings.

Change-Id: Icbe24eaf1ad499f28b68b6a5f05368271a0a7e86
5387824f19033ed51a945fbc8c2b574998404b3d 05-Mar-2010 Andy McFadden <fadden@android.com> Add instructions for volatile wide fields.

This adds four new instructions for accessing volatile wide fields (long
and double). The JLS requires that such accesses are atomic, but the
VM doesn't otherwise make guarantees about the atomicity of reads and
writes on 64-bit fields.

There are no behavioral changes. This just adds definitions for the new
instructions and a couple of tests. The current implementation is just
the non-volatile form of the instructions or a C stub, but since we're
not generating them it doesn't really matter yet.

Also:
- bumped Dalvik version to 1.3.0
- added a note to the x86-atom TODO list

For bug 1633591.
ce46c9456590968db896b5f6e63509a70232044c 21-Nov-2009 Bill Buzbee <buzbee@google.com> Jit: Support for inline-execute/range [issue 2268232]
b0a0541b59d1126ff77c88de742b4a74579fe296 19-Nov-2009 Andy McFadden <fadden@android.com> Add execute-inline/range instruction.

Like "execute-inline", this is an instruction generated by dexopt that
replaces a method invoke instruction. It's useful for small, frequently
called methods in the core libs.

As with execute-inline, we allow at most 4 arguments, but with /range
we're no longer limited to the low 16 registers.

Also: marked execute-inline as being able to throw an exception.

Needed: native x86 implementation; support in JIT.

For bug 2268232.
96516932f1557d8f48a8b2dbbb885af01a11ef6e 29-Oct-2009 Andy McFadden <fadden@android.com> Change the way breakpoints work.

This replaces the breakpoint mechanism with a more efficient approach.
We now insert breakpoint instructions into the bytecode stream instead of
maintaining a table. This requires mapping DEX files as private instead
of shared, which allows copy-on-write to work. mprotect() is used to
guard the pages against inadvertent writes.

Unused opcode EC is now OP_BREAKPOINT. It's not recognized by dexdump or
any interpreter except portdbg, but it can be encountered by the bytecode
verifier (the debugger can request breakpoints in unverified code).
Breakpoint changes are blocked while the verifier runs to avoid races.

This eliminates method->debugBreakpointCount, which is no longer needed.
(Also, it clashed with LinearAlloc's read-only mode.)

The deferred verification error mechanism was using a code-copying
approach to modify the bytecode stream. That has been changed to use
the same copy-on-write modification mechanism.

Also, normalized all PAGE_SIZE/PAGESIZE references to a single
SYSTEM_PAGE_SIZE define.

Simple Fibonacci computation test times (opal-eng):
JIT, no debugger: 10.6ms
Fast interp, no debugger: 36ms
Portable interp, no debugger: 43.8ms

ORIG debug interp, no breakpoints set: 458ms
ORIG debug interp, breakpoint set nearby: 697ms

NEW debug interp, no breakpoints set: 341ms
NEW debug interp, breakpoints set nearby: 341ms

Where "nearby" means there's a breakpoint in the method doing the
computation that isn't actually hit -- the VM had an optimization where
it flagged methods with breakpoints and skipped some of the processing
when possible.

The bottom line is that code should run noticeably faster while a
debugger is attached.
1465db5ee2d3c4c4dcc8e017a294172e858765cb 24-Sep-2009 Bill Buzbee <buzbee@google.com> Major registor allocation rework - stage 1.

Direct usage of registers abstracted out.
Live values tracked locally. Redundant loads and stores suppressed.
Address of registers and register pairs unified w/ single "location" mechanism
Register types inferred using existing dataflow analysis pass.
Interim (i.e. Hack) mechanism for storing register liveness info. Rewrite TBD.
Stubbed-out code for linear scan allocation (for loop and long traces)
Moved optimistic lock check for monitor-enter/exit inline for Thumb2
Minor restructuring, renaming and general cleanup of codegen
Renaming of enums to follow coding convention
Formatting fixes introduced by the enum renaming

Rewrite of RallocUtil.c and addition of linear scan to come in stage 2.
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.
4238ec2ad1ace5103b2206a483f5f03d2e96c476 25-Aug-2009 Ben Cheng <bccheng@android.com> Implement SSA-based loop optimizations.

For traces of simple natural loops (ie no invokes/side exits) null and range
checks will be hoisted in to entry block.

For acyclic traces SSA representation will be formed but no optimizations are
applied (for now).

SSA representation will be printed with the normal verbose output. For example:

D/dalvikvm( 1248): Dumping LIR insns
D/dalvikvm( 1248): installed code is at 0x428559d4
D/dalvikvm( 1248): total size is 324 bytes
D/dalvikvm( 1248): 0x428559d4 (0000): data 0x012c(300)
D/dalvikvm( 1248): -------- entry offset: 0x002b
D/dalvikvm( 1248): -------- MIR_OP_NULL_N_RANGE_UP_CHECK
D/dalvikvm( 1248): 0x428559d6 (0002): ldr r0, [r5, #36]
D/dalvikvm( 1248): 0x428559d8 (0004): ldr r1, [r5, #12]
D/dalvikvm( 1248): 0x428559da (0006): cbz r0,0x42855a06
D/dalvikvm( 1248): 0x428559dc (0008): ldr r0, [r0, #8]
D/dalvikvm( 1248): 0x428559de (000a): subs r1, #1
D/dalvikvm( 1248): 0x428559e0 (000c): cmp r1, r0
D/dalvikvm( 1248): 0x428559e2 (000e): bge 0x42855a06
D/dalvikvm( 1248): -------- MIR_OP_NULL_N_RANGE_UP_CHECK
D/dalvikvm( 1248): 0x428559e4 (0010): ldr r0, [r5, #40]
D/dalvikvm( 1248): 0x428559e6 (0012): ldr r1, [r5, #12]
D/dalvikvm( 1248): 0x428559e8 (0014): cbz r0,0x42855a06
D/dalvikvm( 1248): 0x428559ea (0016): ldr r0, [r0, #8]
D/dalvikvm( 1248): 0x428559ec (0018): subs r1, #1
D/dalvikvm( 1248): 0x428559ee (001a): cmp r1, r0
D/dalvikvm( 1248): 0x428559f0 (001c): bge 0x42855a06
D/dalvikvm( 1248): -------- MIR_OP_NULL_N_RANGE_UP_CHECK
D/dalvikvm( 1248): 0x428559f2 (001e): ldr r0, [r5, #32]
D/dalvikvm( 1248): 0x428559f4 (0020): ldr r1, [r5, #12]
D/dalvikvm( 1248): 0x428559f6 (0022): cbz r0,0x42855a06
D/dalvikvm( 1248): 0x428559f8 (0024): ldr r0, [r0, #8]
D/dalvikvm( 1248): 0x428559fa (0026): cmp r1, r0
D/dalvikvm( 1248): 0x428559fc (0028): bge 0x42855a06
D/dalvikvm( 1248): -------- MIR_OP_LOWER_BOUND_CHECK
D/dalvikvm( 1248): 0x428559fe (002a): ldr r0, [r5, #44]
D/dalvikvm( 1248): 0x42855a00 (002c): cmp r0, #1
D/dalvikvm( 1248): 0x42855a02 (002e): blt 0x42855a06
D/dalvikvm( 1248): 0x42855a04 (0030): b 0x42855a08
D/dalvikvm( 1248): 0x42855a06 (0032): b 0x42855af0
D/dalvikvm( 1248): L0x002b:
D/dalvikvm( 1248): -------- MIR_OP_PHI
D/dalvikvm( 1248): -------- s20(v11_1) <- s11(v11_0) s46(v11_2)
D/dalvikvm( 1248): -------- dalvik offset: 0x002b @ aget-wide
D/dalvikvm( 1248): -------- s21(v12_1) s22(v13_1) <- s9(v9_0) s20(v11_1)
D/dalvikvm( 1248): 0x42855a08 (0034): ldr r2, [r5, #36]
D/dalvikvm( 1248): 0x42855a0a (0036): ldr r3, [r5, #44]
D/dalvikvm( 1248): 0x42855a0c (0038): adds r2, r2, #16
D/dalvikvm( 1248): 0x42855a0e (003a): lsls r3, r3, #3
D/dalvikvm( 1248): 0x42855a10 (003c): ldr r0, [r2, r3]
D/dalvikvm( 1248): 0x42855a12 (003e): adds r2, r2, #4
D/dalvikvm( 1248): 0x42855a14 (0040): ldr r1, [r2, r3]
D/dalvikvm( 1248): -------- dalvik offset: 0x002d @ aget-wide
D/dalvikvm( 1248): -------- s23(v14_1) s24(v15_1) <- s10(v10_0) s20(v11_1)
D/dalvikvm( 1248): 0x42855a16 (0042): ldr r3, [r5, #40]
D/dalvikvm( 1248): 0x42855a18 (0044): str r0, [r5, #48]
D/dalvikvm( 1248): 0x42855a1a (0046): ldr r0, [r5, #44]
D/dalvikvm( 1248): 0x42855a1c (0048): adds r3, r3, #16
D/dalvikvm( 1248): 0x42855a1e (004a): lsls r0, r0, #3
D/dalvikvm( 1248): 0x42855a20 (004c): str r1, [r5, #52]
D/dalvikvm( 1248): 0x42855a22 (004e): ldr r1, [r3, r0]
D/dalvikvm( 1248): 0x42855a24 (0050): adds r3, r3, #4
D/dalvikvm( 1248): 0x42855a26 (0052): ldr r2, [r3, r0]
D/dalvikvm( 1248): -------- dalvik offset: 0x002f @ add-double/2addr
D/dalvikvm( 1248): -------- s25(v12_2) s26(v13_2) <- s21(v12_1) s22(v13_1) s23(v14_1) s24(v15_1)
D/dalvikvm( 1248): 0x42855a28 (0054): str r1, [r5, #56]
D/dalvikvm( 1248): 0x42855a2a (0056): str r2, [r5, #60]
D/dalvikvm( 1248): 0x42855a2c (0058): vldr d1, [r5, #48]
D/dalvikvm( 1248): 0x42855a30 (005c): vldr d2, [r5, #56]
D/dalvikvm( 1248): 0x42855a34 (0060): vadd d0, d1, d2
D/dalvikvm( 1248): -------- dalvik offset: 0x0030 @ const/4
D/dalvikvm( 1248): -------- s27(v14_2) <-
D/dalvikvm( 1248): 0x42855a38 (0064): movs r2, #1
D/dalvikvm( 1248): -------- dalvik offset: 0x0031 @ sub-int
D/dalvikvm( 1248): -------- s28(v14_3) <- s20(v11_1) s27(v14_2)
D/dalvikvm( 1248): 0x42855a3a (0066): ldr r3, [r5, #44]
D/dalvikvm( 1248): 0x42855a3c (0068): subs r0, r3, r2
D/dalvikvm( 1248): -------- dalvik offset: 0x0033 @ aget-wide
D/dalvikvm( 1248): -------- s29(v14_4) s30(v15_2) <- s8(v8_0) s28(v14_3)
D/dalvikvm( 1248): 0x42855a3e (006a): ldr r3, [r5, #32]
D/dalvikvm( 1248): 0x42855a40 (006c): adds r3, r3, #16
D/dalvikvm( 1248): 0x42855a42 (006e): str r0, [r5, #56]
D/dalvikvm( 1248): 0x42855a44 (0070): lsls r0, r0, #3
D/dalvikvm( 1248): 0x42855a46 (0072): vstr d0, [r5, #48]
D/dalvikvm( 1248): 0x42855a4a (0076): ldr r1, [r3, r0]
D/dalvikvm( 1248): 0x42855a4c (0078): adds r3, r3, #4
D/dalvikvm( 1248): 0x42855a4e (007a): ldr r2, [r3, r0]
D/dalvikvm( 1248): -------- dalvik offset: 0x0035 @ add-double/2addr
D/dalvikvm( 1248): -------- s31(v12_3) s32(v13_3) <- s25(v12_2) s26(v13_2) s29(v14_4) s30(v15_2)
D/dalvikvm( 1248): 0x42855a50 (007c): str r1, [r5, #56]
D/dalvikvm( 1248): 0x42855a52 (007e): str r2, [r5, #60]
D/dalvikvm( 1248): 0x42855a54 (0080): vldr d1, [r5, #48]
D/dalvikvm( 1248): 0x42855a58 (0084): vldr d2, [r5, #56]
D/dalvikvm( 1248): 0x42855a5c (0088): vadd d0, d1, d2
D/dalvikvm( 1248): -------- dalvik offset: 0x0036 @ add-int/lit8
D/dalvikvm( 1248): -------- s33(v14_5) <- s20(v11_1)
D/dalvikvm( 1248): 0x42855a60 (008c): ldr r2, [r5, #44]
D/dalvikvm( 1248): 0x42855a62 (008e): adds r2, r2, #1
D/dalvikvm( 1248): -------- dalvik offset: 0x0038 @ aget-wide
D/dalvikvm( 1248): -------- s34(v14_6) s35(v15_3) <- s8(v8_0) s33(v14_5)
D/dalvikvm( 1248): 0x42855a64 (0090): ldr r1, [r5, #32]
D/dalvikvm( 1248): 0x42855a66 (0092): adds r1, r1, #16
D/dalvikvm( 1248): 0x42855a68 (0094): str r2, [r5, #56]
D/dalvikvm( 1248): 0x42855a6a (0096): lsls r2, r2, #3
D/dalvikvm( 1248): 0x42855a6c (0098): vstr d0, [r5, #48]
D/dalvikvm( 1248): 0x42855a70 (009c): ldr r3, [r1, r2]
D/dalvikvm( 1248): 0x42855a72 (009e): adds r1, r1, #4
D/dalvikvm( 1248): 0x42855a74 (00a0): ldr r0, [r1, r2]
D/dalvikvm( 1248): -------- dalvik offset: 0x003a @ add-double/2addr
D/dalvikvm( 1248): -------- s36(v12_4) s37(v13_4) <- s31(v12_3) s32(v13_3) s34(v14_6) s35(v15_3)
D/dalvikvm( 1248): 0x42855a76 (00a2): str r3, [r5, #56]
D/dalvikvm( 1248): 0x42855a78 (00a4): str r0, [r5, #60]
D/dalvikvm( 1248): 0x42855a7a (00a6): vldr d1, [r5, #48]
D/dalvikvm( 1248): 0x42855a7e (00aa): vldr d2, [r5, #56]
D/dalvikvm( 1248): 0x42855a82 (00ae): vadd d0, d1, d2
D/dalvikvm( 1248): 0x42855a86 (00b2): vstr d0, [r5, #48]
D/dalvikvm( 1248): -------- dalvik offset: 0x003b @ mul-double/2addr
D/dalvikvm( 1248): -------- s38(v12_5) s39(v13_5) <- s36(v12_4) s37(v13_4) s4(v4_0) s5(v5_0)
D/dalvikvm( 1248): 0x42855a8a (00b6): vmov.f64 s2, s0
D/dalvikvm( 1248): 0x42855a8e (00ba): vldr d2, [r5, #16]
D/dalvikvm( 1248): 0x42855a92 (00be): vmuld d0, d1, d2
D/dalvikvm( 1248): -------- dalvik offset: 0x003c @ aget-wide
D/dalvikvm( 1248): -------- s40(v14_7) s41(v15_4) <- s8(v8_0) s20(v11_1)
D/dalvikvm( 1248): 0x42855a96 (00c2): ldr r2, [r5, #32]
D/dalvikvm( 1248): 0x42855a98 (00c4): ldr r3, [r5, #44]
D/dalvikvm( 1248): 0x42855a9a (00c6): adds r2, r2, #16
D/dalvikvm( 1248): 0x42855a9c (00c8): lsls r3, r3, #3
D/dalvikvm( 1248): 0x42855a9e (00ca): vstr d0, [r5, #48]
D/dalvikvm( 1248): 0x42855aa2 (00ce): ldr r0, [r2, r3]
D/dalvikvm( 1248): 0x42855aa4 (00d0): adds r2, r2, #4
D/dalvikvm( 1248): 0x42855aa6 (00d2): ldr r1, [r2, r3]
D/dalvikvm( 1248): 0x42855aa8 (00d4): str r0, [r5, #56]
D/dalvikvm( 1248): 0x42855aaa (00d6): str r1, [r5, #60]
D/dalvikvm( 1248): -------- dalvik offset: 0x003e @ mul-double
D/dalvikvm( 1248): -------- s42(v14_8) s43(v15_5) <- s40(v14_7) s41(v15_4) s16(v16_0) s17(v17_0)
D/dalvikvm( 1248): 0x42855aac (00d8): vldr d1, [r5, #56]
D/dalvikvm( 1248): 0x42855ab0 (00dc): vldr d2, [r5, #64]
D/dalvikvm( 1248): 0x42855ab4 (00e0): vmuld d0, d1, d2
D/dalvikvm( 1248): 0x42855ab8 (00e4): vstr d0, [r5, #56]
D/dalvikvm( 1248): -------- dalvik offset: 0x0040 @ add-double/2addr
D/dalvikvm( 1248): -------- s44(v12_6) s45(v13_6) <- s38(v12_5) s39(v13_5) s42(v14_8) s43(v15_5)
D/dalvikvm( 1248): 0x42855abc (00e8): vldr d1, [r5, #48]
D/dalvikvm( 1248): 0x42855ac0 (00ec): vldr d2, [r5, #56]
D/dalvikvm( 1248): 0x42855ac4 (00f0): vadd d0, d1, d2
D/dalvikvm( 1248): 0x42855ac8 (00f4): vstr d0, [r5, #48]
D/dalvikvm( 1248): -------- dalvik offset: 0x0041 @ aput-wide
D/dalvikvm( 1248): -------- s44(v12_6) s45(v13_6) s8(v8_0) s20(v11_1)
D/dalvikvm( 1248): 0x42855acc (00f8): ldr r3, [r5, #32]
D/dalvikvm( 1248): 0x42855ace (00fa): ldr r0, [r5, #44]
D/dalvikvm( 1248): 0x42855ad0 (00fc): adds r3, r3, #16
D/dalvikvm( 1248): 0x42855ad2 (00fe): ldr r1, [r5, #48]
D/dalvikvm( 1248): 0x42855ad4 (0100): ldr r2, [r5, #52]
D/dalvikvm( 1248): 0x42855ad6 (0102): lsls r0, r0, #3
D/dalvikvm( 1248): 0x42855ad8 (0104): str r1, [r3, r0]
D/dalvikvm( 1248): 0x42855ada (0106): adds r3, r3, #4
D/dalvikvm( 1248): 0x42855adc (0108): str r2, [r3, r0]
D/dalvikvm( 1248): -------- dalvik offset: 0x0043 @ add-int/lit8
D/dalvikvm( 1248): -------- s46(v11_2) <- s20(v11_1)
D/dalvikvm( 1248): 0x42855ade (010a): ldr r2, [r5, #44]
D/dalvikvm( 1248): 0x42855ae0 (010c): adds r2, r2, #1
D/dalvikvm( 1248): 0x42855ae2 (010e): str r2, [r5, #44]
D/dalvikvm( 1248): -------- dalvik offset: 0x0045 @ goto
D/dalvikvm( 1248): --------
D/dalvikvm( 1248): L0x0029:
D/dalvikvm( 1248): -------- dalvik offset: 0x0029 @ if-ge
D/dalvikvm( 1248): -------- s46(v11_2) s3(v3_0)
D/dalvikvm( 1248): 0x42855ae4 (0110): ldr r0, [r5, #44]
D/dalvikvm( 1248): 0x42855ae6 (0112): ldr r1, [r5, #12]
D/dalvikvm( 1248): 0x42855ae8 (0114): cmp r0, r1
D/dalvikvm( 1248): 0x42855aea (0116): bge 0x42855aee
D/dalvikvm( 1248): 0x42855aec (0118): b 0x42855a08
D/dalvikvm( 1248): -------- exit offset: 0x0046
D/dalvikvm( 1248): 0x42855aee (011a): b 0x42855af8
D/dalvikvm( 1248): -------- reconstruct dalvik PC : 0x42a644d6 @ +0x002b
D/dalvikvm( 1248): 0x42855af0 (011c): ldr r0, [pc, #32]
D/dalvikvm( 1248): Exception_Handling:
D/dalvikvm( 1248): 0x42855af2 (011e): ldr r1, [r6, #84]
D/dalvikvm( 1248): 0x42855af4 (0120): blx r1
D/dalvikvm( 1248): 0x42855af6 (0122): .align4
D/dalvikvm( 1248): -------- chaining cell (normal): 0x0046
D/dalvikvm( 1248): 0x42855af8 (0124): ldr r0, [r6, #76]
D/dalvikvm( 1248): 0x42855afa (0126): blx r0
D/dalvikvm( 1248): 0x42855afc (0128): data 0x450c(17676)
D/dalvikvm( 1248): 0x42855afe (012a): data 0x42a6(17062)
D/dalvikvm( 1248): 0x42855b14 (0140): .word (0x42a644d6)
D/dalvikvm( 1248): End Ljnt/scimark2/SOR;execute, 18 Dalvik instructions