summaryrefslogtreecommitdiffstats
path: root/vm/DvmDex.h
Commit message (Collapse)AuthorAgeFilesLines
* Implement the dalvik side of libcore.reflect.Elliott Hughes2013-07-251-0/+3
| | | | Change-Id: I9ef0da6f715e2727d8530aa7a8edee97b5bfa48d
* Normalize the include guard style.Carl Shapiro2011-06-141-3/+3
| | | | | | | | | | 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
* Get rid of uneeded extern, enum, typedef and struct qualifiers.Carl Shapiro2011-04-271-10/+2
| | | | Change-Id: I236c5a1553a51f82c9bc3eaaab042046c854d3b4
* Compile the garbage collector and heap profiler as C++.Carl Shapiro2011-04-081-0/+8
| | | | Change-Id: I25d8fa821987a3dd6d7109d07fd42dbf2fe0e589
* Low-level support for in-memory DEXAndy McFadden2011-03-031-0/+1
| | | | | | | | | | | | | | | | 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
* Remove the functionality in ReduceConstants.[ch].Dan Bornstein2010-09-091-178/+0
| | | | | | | | 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
* Emit volatile field access instructions.Andy McFadden2010-06-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Change the way breakpoints work.Andy McFadden2009-11-161-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+319
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-319/+0
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-8/+176
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+151