History log of /dalvik/vm/DvmDex.h
Revision Date Author Comments
375fb116bcb817b37509ab579dbd55cdbb765cbf 15-Jun-2011 Carl Shapiro <cshapiro@google.com> Normalize the include guard style.

An leading underscore followed by a capital letter is a reserved
name space in C and C++.

This change also moves any #include directives within the include
guard in some of the compiler/codegen/arm header files.

Change-Id: I9715e2c5301699d31886e61d0fe6e29483555a2a
d862faa2ceae186da5518607505eb942d634ced9 28-Apr-2011 Carl Shapiro <cshapiro@google.com> Get rid of uneeded extern, enum, typedef and struct qualifiers.

Change-Id: I236c5a1553a51f82c9bc3eaaab042046c854d3b4
ae188c676c681e47a93ade7fdf0144099b470e03 08-Apr-2011 Carl Shapiro <cshapiro@google.com> Compile the garbage collector and heap profiler as C++.

Change-Id: I25d8fa821987a3dd6d7109d07fd42dbf2fe0e589
57fd399d1265ec627d28a15b3d4b98e5f239ac88 04-Mar-2011 Andy McFadden <fadden@android.com> Low-level support for in-memory DEX

We want to be able to load classes from a DEX file in memory,
rather than insisting that they always be loaded from disk. This
provides the underpinnings.

The code was previously using the "are we in dexopt" flag to
decide if it needed to mprotect(RW) DEX data before altering it.
We now have an explicit flag.

Also, scraped off some "opt header flags" checks that never did much.

Bug 1338213

Change-Id: If7128bf246992156662e089a2a87cebf475a6f2a
d394371bd84bacc51e96e2d2eacb8549d9110b1e 09-Sep-2010 Dan Bornstein <danfuzz@android.com> Remove the functionality in ReduceConstants.[ch].

It was a good experiment to try, but it was never made production-ready,
and it doesn't look like it would be a net win at this point. We
metaphorically pour out a beer in its honor.

Change-Id: I7f6ac95f5b7c963df0a3015ed33595fa1a928636
fb119e6cf8b47d53f024cae889487a17eacbf19f 29-Jun-2010 Andy McFadden <fadden@android.com> Emit volatile field access instructions.

Easier said than done. The trick is that we need to ensure that the
instruction replacement happens even if the verifier and optimizer
are not enabled in dexopt.

We're currently doing the -wide-volatile replacement during
verification, but that's not so great, since we collapse things like
iget-byte and iget-char into a single iget-volatile, losing the field
width. We could recover it from the field declaration, but doing it
during verification is really just sort of wrong to begin with.

The substitution isn't technically an "optimization", but it's easiest
to do it during the opt pass, and we already have a convenient "is
optimized" flag that helps ensure that we do the replacement pass
exactly once.

Optimizing at run time means making a private copy of shared pages,
because the pages are mapped shared/read-only out of the DEX file.
We could use up a lot of physical memory if we applied all possible
optimizations, so we need a notion of "essential" and "non-essential"
optimizations. If we're not running in dexopt, we only do the
essential ones, which should leave most methods untouched.

Replacement of 32-bit instructions is only strictly necessary when
we're building for SMP. On a uniprocessor, the 32-bit operations
are inherently atomic, and memory barriers aren't required. However,
the JIT may benefit from having volatile accesses identified by opcode.
Since the current branch doesn't support any SMP products, I'm enabling
the instruction generation for all platforms so that we can give it
some exercise.

While making this change I noticed that the exclusion mechanism for
breakpoints and optimization/verification was only serving to avoid
a data race (e.g. breakpoint being overwritten by an instruction
rewrite). It wasn't guaranteed to prevent races when two threads
toggled pages between read-write and read-only while making an update,
since a 4K page can hold code for more than one class. This has been
corrected by adding a mutex.

This change:
- Introduces the notion of essential vs. non-essential optimizations.
- Adds generation of 32-bit *-volatile instructions for all platforms.
- Moves generation of *-wide-volatile from the verifier to the optimizer.
- Allows the optimizer to modify code at run time.
- Tweaks optimizeMethod() for "best effort" rather than "fail early".
- Adds a DEX-granularity mutex to the bytecode update functions.

This also begins the removal of PROFILE_FIELD_ACCESS, which hasn't been
used for much and is mostly just in the way.

Change-Id: I4ac9fa5e1ac5f9a1d106c662c3deee90d62895aa
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.
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
2ad60cfc28e14ee8f0bb038720836a4696c478ad 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution