OSDN Git Service

android-x86/dalvik.git
13 years agoMerge "Free the slot data when freeing an indirect reference table." into dalvik-dev
Carl Shapiro [Sat, 12 Mar 2011 02:14:11 +0000 (18:14 -0800)]
Merge "Free the slot data when freeing an indirect reference table." into dalvik-dev

13 years agoMerge "Add a predicate that returns true for addresses contained by the heap." into...
Carl Shapiro [Sat, 12 Mar 2011 02:13:46 +0000 (18:13 -0800)]
Merge "Add a predicate that returns true for addresses contained by the heap." into dalvik-dev

13 years agoMerge "Do not allocate native objects on the managed heap." into dalvik-dev
Carl Shapiro [Sat, 12 Mar 2011 02:12:41 +0000 (18:12 -0800)]
Merge "Do not allocate native objects on the managed heap." into dalvik-dev

13 years agoClarify a comment.
Dan Bornstein [Sat, 12 Mar 2011 01:57:13 +0000 (17:57 -0800)]
Clarify a comment.

Per suggestion during code review of previous patch.

Change-Id: I9bf88d3127f32036c1668ad03ffc491947a4f696

13 years agoAdd a predicate that returns true for addresses contained by the heap.
Carl Shapiro [Sat, 12 Mar 2011 01:54:58 +0000 (17:54 -0800)]
Add a predicate that returns true for addresses contained by the heap.

Change-Id: Iaa2978c59fc314563555b14f53bdc28be6b71cc4

13 years agoFree the slot data when freeing an indirect reference table.
Carl Shapiro [Sat, 12 Mar 2011 01:40:40 +0000 (17:40 -0800)]
Free the slot data when freeing an indirect reference table.

Change-Id: I96e342a57c77f53c212535d4ed563c22718d4bd0

13 years agoDo not allocate native objects on the managed heap.
Carl Shapiro [Wed, 9 Mar 2011 01:09:25 +0000 (17:09 -0800)]
Do not allocate native objects on the managed heap.

Descriptors for the managed heap were being allocated in the managed
heap using mspace-malloc.  With this change we use an ordinary malloc
to allocate those objects instead.

13 years agoMerge "Fix bugs in incremental dx." into dalvik-dev
Jesse Wilson [Sat, 12 Mar 2011 00:55:51 +0000 (16:55 -0800)]
Merge "Fix bugs in incremental dx." into dalvik-dev

13 years agoFix bugs in incremental dx.
Jesse Wilson [Fri, 11 Mar 2011 22:27:41 +0000 (14:27 -0800)]
Fix bugs in incremental dx.

The compaction code used to merge a dex with itself. This caused
problems because annotations would be duplicated. Now the dex is
merged with an empty dex. I've changed the section default from
-1 to 0 to make the empty dex trivial to construct.

It also had a correctness problem where we were using the wrong
offsets when merging indexed values. Move the offsets out of the
loop so they aren't reset.

Change-Id: Ibcf24de8f96c2c525ca2e2ac44550239e3cf689e
http://b/3447216

13 years agoMerge "Verifier allows certain errors so they can fail at runtime." into dalvik-dev
jeffhao [Sat, 12 Mar 2011 00:53:31 +0000 (16:53 -0800)]
Merge "Verifier allows certain errors so they can fail at runtime." into dalvik-dev

13 years agoMerge "Clean up how primitive types are handled." into dalvik-dev
Dan Bornstein [Sat, 12 Mar 2011 00:49:32 +0000 (16:49 -0800)]
Merge "Clean up how primitive types are handled." into dalvik-dev

13 years agoam ce52ba38: Build libdexdump_static.
Ying Wang [Sat, 12 Mar 2011 00:47:01 +0000 (16:47 -0800)]
am ce52ba38: Build libdexdump_static.

* commit 'ce52ba385f7f84cd47fdf004640de8f53181114d':
  Build libdexdump_static.

13 years agoClean up how primitive types are handled.
Dan Bornstein [Fri, 11 Mar 2011 20:58:05 +0000 (12:58 -0800)]
Clean up how primitive types are handled.

The PrimitiveType enum got "promoted" to libdex, and I added a
few helper functions there. I also quashed the idea that there
is some sort of canonical ordering of the enumerated values.

In the vm (per se), I made PrimitiveType uses where it had assumed
an ordering instead switch(). This mostly made things much simpler.

I also split out the array of type classes in Globals.h into
individual ClassObject*s. This mostly made things simpler, but the gc
got a tiny bit of extra cruft because of it.

Finally, I made it so that the type classes get created explicitly
during vm startup, instead of happening implicitly the first time
they're accessed. This both simplified the code and, in particular,
made it so that the type classes didn't have to be declared volatile.

There are still a couple of related items that could stand to be
cleaned up, but I think what's here is enough for one patch.

Change-Id: Id14a6dfdb200abce9f30911c330ba32d9c2a4c3f

13 years agoVerifier allows certain errors so they can fail at runtime.
jeffhao [Sat, 12 Mar 2011 00:07:48 +0000 (16:07 -0800)]
Verifier allows certain errors so they can fail at runtime.

Specifically, this relaxes array typing in the absense of local variable
info.

Change-Id: I1b1aeb64a0842be3cffe70c02418444457abe972

13 years agoBuild libdexdump_static.
Ying Wang [Fri, 11 Mar 2011 23:49:56 +0000 (15:49 -0800)]
Build libdexdump_static.

Which will be used in libdexdumpjni.

Change-Id: I7431fdcd006b4c4cf92e3565265830a39ccf3084

13 years agoMerge "Clean up stale cases" into dalvik-dev
Andy McFadden [Fri, 11 Mar 2011 21:15:08 +0000 (13:15 -0800)]
Merge "Clean up stale cases" into dalvik-dev

13 years agoClean up stale cases
Andy McFadden [Fri, 11 Mar 2011 20:37:24 +0000 (12:37 -0800)]
Clean up stale cases

Substitution of "volatile" ops was once done by the verifier, which
meant the verifier could see them.  This is no longer the case, so we
don't need to be handling them.

Change-Id: I6e4cd24dd65a1c28d4e5ee781be6e3499562a05b

13 years agoMerge "Extract more reference inits." into dalvik-dev
Dan Bornstein [Fri, 11 Mar 2011 17:42:02 +0000 (09:42 -0800)]
Merge "Extract more reference inits." into dalvik-dev

13 years agoMerge "Add volatile/jumbo opcodes" into dalvik-dev
Andy McFadden [Fri, 11 Mar 2011 15:40:53 +0000 (07:40 -0800)]
Merge "Add volatile/jumbo opcodes" into dalvik-dev

13 years agoExtract more reference inits.
Dan Bornstein [Fri, 11 Mar 2011 01:22:22 +0000 (17:22 -0800)]
Extract more reference inits.

In this case, the primitive array reference initialization got made
un-lazy and now happens consistently and early during vm
initialization.

Change-Id: I7477e31554bbde02dd5fc96bd7aff4af5cdac513

13 years agoRemove the stopAtPrivileged argument.
Dan Bornstein [Fri, 11 Mar 2011 00:16:11 +0000 (16:16 -0800)]
Remove the stopAtPrivileged argument.

It's superfluous now.

Change-Id: I23a3319285eab4858c9dd649aebe22df4139fe28

13 years agoAdd volatile/jumbo opcodes
Andy McFadden [Thu, 10 Mar 2011 22:12:48 +0000 (14:12 -0800)]
Add volatile/jumbo opcodes

This adds 12 dexopt-generated "volatile/jumbo" instructions, to
be used for replacing appropriate get/put ops, plus a jumbo
replacement for invoke-object-init/range.

The new instructions are defined but not yet used.  For x86 and
x86-atom, C stubs are selected.

Also, guarded macro args used in arithmetic expressions in header.S.

Bug 3403118

Change-Id: I283cea053d1cee1d70c3715df3e71177e8b8d3b2

13 years agoKill off the doPrivileged() special case code.
Dan Bornstein [Thu, 10 Mar 2011 23:57:40 +0000 (15:57 -0800)]
Kill off the doPrivileged() special case code.

We've already deprecated / disabled much of the rest of the intra-VM
security manager code, and so this code serves no real purpose anymore.

Change-Id: Ic75abc20c446d12022d19ad8807abd34f918a14b

13 years agoPull the Reference setup code into InitRefs.c.
Dan Bornstein [Thu, 10 Mar 2011 21:02:43 +0000 (13:02 -0800)]
Pull the Reference setup code into InitRefs.c.

The idea here is to make it obvious in the setup code that Reference
has to be set up specially, to make it less likely that it will get
erroneously combined with the other setup code in the future.

Since the class Reference itself isn't used, I took the opportunity
to just remove it from Globals.h.

Change-Id: I301c0ac2032e78e1e57cc3065eb0baa77f0d346f

13 years agoMerge "Clean up UtfString.c, two ways." into dalvik-dev
Dan Bornstein [Thu, 10 Mar 2011 20:46:33 +0000 (12:46 -0800)]
Merge "Clean up UtfString.c, two ways." into dalvik-dev

13 years agoClean up UtfString.c, two ways.
Dan Bornstein [Thu, 10 Mar 2011 19:32:05 +0000 (11:32 -0800)]
Clean up UtfString.c, two ways.

The class and member init code got pulled out, and put it into
InitRefs.c (for further cleansing in a future change).

The instance creation code got refactored a bit, to keep things
simpler and tidier.

Change-Id: I22d8abff141ea889b3455a1cebcf51e333cd8c92

13 years agoMerge "Handle relocatable class objects in JIT'ed code." into dalvik-dev
Ben Cheng [Thu, 10 Mar 2011 19:17:04 +0000 (11:17 -0800)]
Merge "Handle relocatable class objects in JIT'ed code." into dalvik-dev

13 years agoHandle relocatable class objects in JIT'ed code.
Ben Cheng [Sat, 5 Mar 2011 00:48:33 +0000 (16:48 -0800)]
Handle relocatable class objects in JIT'ed code.

1) Split the original literal pool into class object literals and
constants. Elements in the class object pool have to match the specicial
values perfectly (ie no +delta space optimizations) since they might be
relocated.

2) Implement dvmJitScanAllClassPointers(void (*callback)(void *))
which is the entry routine to report all memory locations in the code cache
that contain class objects (ie class object pool and predicted chaining
cells for virtual calls).

3) Major codegen changes on how/when the class object pool are populated
and how predicted chains are patched. Before this change the compiler
thread is always in the VM_WAIT state, which won't prevent GC from
running. Since the class object pointers captured by a worker thread
are no longer guaranteed to be stable at JIT time, change various
internal data structures to capture the class descriptor/loader
tuple instead. The conversion from descriptor/loader tuple to actual
class object pointers are only performed when the thread state is
RUNNING or at GC safe point.

4) Separate the class object installation phase out of the main
dvmCompilerAssembleLIR routine so that the impact to blocking GC
requests is minimal. Add new stats to report the potential block time.
For example:
Potential GC blocked by compiler: max 46 us / avg 25 us

5) Various cleanup in the trace structure walkup code. Modified the
verbose print routine to show the class descriptor in the class literal
pool. For example:

D/dalvikvm( 1450): -------- end of chaining cells (0x007c)
D/dalvikvm( 1450): 0x44020628 (00b4): .class
(Lcom/android/unit_tests/PerformanceTests$EmptyClass;)
D/dalvikvm( 1450): 0x4402062c (00b8): .word (0xaca8d1a5)
D/dalvikvm( 1450): 0x44020630 (00bc): .word (0x401abc02)
D/dalvikvm( 1450): End

Bug: 3482956

Change-Id: I2e736b00d63adc255c33067544606b8b96b72ffc

13 years agoA bit of libdex spring cleaning.
Dan Bornstein [Thu, 10 Mar 2011 01:40:41 +0000 (17:40 -0800)]
A bit of libdex spring cleaning.

Give the UTF-8 parsing/validation code and the debug info decoder
their own files in libdex. Also, moved the random utility
dexRoundUpPower2() so it wasn't in the middle of unrelated stuff
(though maybe it doesn't want to stay in DexFile.c at all).

Change-Id: I115447e49904e2440dd538b1df90616ea95707a9

13 years agoMerge "Better class name validation." into dalvik-dev
Dan Bornstein [Thu, 10 Mar 2011 01:07:10 +0000 (17:07 -0800)]
Merge "Better class name validation." into dalvik-dev

13 years agoBetter class name validation.
Dan Bornstein [Thu, 10 Mar 2011 00:42:16 +0000 (16:42 -0800)]
Better class name validation.

I made a combined class name / type descriptor validator in
libdex extracted from the original type descriptor validator,
made the original validator use that, and added another public
function to do class name validation.

The two not-quite-validators in CheckJNI.c and InternalNative.c
now do proper checking.

Change-Id: I0f25e3efb439da065d92596197d219792d5a46b1

13 years agoMerge "Improve class name checking." into dalvik-dev
Dan Bornstein [Wed, 9 Mar 2011 23:35:22 +0000 (15:35 -0800)]
Merge "Improve class name checking." into dalvik-dev

13 years agoImprove class name checking.
Dan Bornstein [Wed, 9 Mar 2011 22:09:16 +0000 (14:09 -0800)]
Improve class name checking.

Class.forName() will now do a better job of checking the validity of
the names passed to it.

Also, cleared out the TODO on dvmThrowClassNotFoundException(),
having determined that it would have been a bad idea.

Change-Id: Ia5b8c613ef8f49a313ad825dc4c72cc5ff428e69

13 years agoFix handling of short types in FFI bridge
Andy McFadden [Wed, 9 Mar 2011 23:06:23 +0000 (15:06 -0800)]
Fix handling of short types in FFI bridge

As reported in external bug 15349, we were being a bit sloppy in
our handling of sub-32-bit types, assuming they could be treated
as 32 bit values.

Bug 4080070

Change-Id: I3d2e014342d7ff4e1544e37666680eb05aba37e6

13 years agoUse indirect references in JNI by default.
Carl Shapiro [Wed, 9 Mar 2011 00:19:08 +0000 (16:19 -0800)]
Use indirect references in JNI by default.

This change removes support for direct references.

Change-Id: I2af043ecfc5811c16a7d02a5bbb6c071ec6f0a82

13 years agoMerge "Also clear the JNI weak global reference table on shutdown." into dalvik-dev
Carl Shapiro [Wed, 9 Mar 2011 00:49:12 +0000 (16:49 -0800)]
Merge "Also clear the JNI weak global reference table on shutdown." into dalvik-dev

13 years agoAlso clear the JNI weak global reference table on shutdown.
Carl Shapiro [Wed, 9 Mar 2011 00:00:36 +0000 (16:00 -0800)]
Also clear the JNI weak global reference table on shutdown.

Change-Id: I6644bd3cbd60024db60a46f9ead4d50a3112f751

13 years agoMerge "Use an explicit fp in dvmPlatformInvoke" into dalvik-dev
Andy McFadden [Tue, 8 Mar 2011 23:51:07 +0000 (15:51 -0800)]
Merge "Use an explicit fp in dvmPlatformInvoke" into dalvik-dev

13 years agoUse an explicit fp in dvmPlatformInvoke
Andy McFadden [Fri, 18 Feb 2011 21:25:40 +0000 (13:25 -0800)]
Use an explicit fp in dvmPlatformInvoke

When calling a JNI method we have to push a variable number of
arguments onto the stack.  This confuses the stack unwinders in
gdb and debuggerd.

It turns out that the unroll tables consulted by debuggerd let
you specify a frame pointer register.  If we set that up, we can
get a full debuggerd trace.  gdb is still confused though.

We now need to preserve fp on entry, but we no longer need to save
off sp, and as a result of some additional register shuffling we
also no longer need to save r4 and r5.

Bug 3466808

Change-Id: I5fda1deae330e698553657dc233bd06476b25ce2

13 years agoFix method profiling
Andy McFadden [Tue, 8 Mar 2011 23:22:14 +0000 (15:22 -0800)]
Fix method profiling

Moved a couple of things out of MethodTraceState so they don't get
zeroed after being initialized.

Also, rearranged the native method invocation path slightly so the
common case runs uninterrupted.

Change-Id: I0dad007a7f344d93f30444156e67f20bed6606a4

13 years agoMerge "Compute a length based on heap size instead of card table size." into dalvik-dev
Carl Shapiro [Tue, 8 Mar 2011 22:44:47 +0000 (14:44 -0800)]
Merge "Compute a length based on heap size instead of card table size." into dalvik-dev

13 years agoMerge "Finish the indirect reference implementation." into dalvik-dev
Carl Shapiro [Tue, 8 Mar 2011 22:44:26 +0000 (14:44 -0800)]
Merge "Finish the indirect reference implementation." into dalvik-dev

13 years agoCompute a length based on heap size instead of card table size.
Carl Shapiro [Tue, 8 Mar 2011 21:46:10 +0000 (13:46 -0800)]
Compute a length based on heap size instead of card table size.

The card from address computation checks that the argument is a valid
card.  However, the limit points just past the end of the last card so
it is often invalid.  This fixes a crash in asserts-enabled builds.

Change-Id: I5d7f0a4753703f82b2e1be520e6108d1b61b22d3

13 years agoFinish the indirect reference implementation.
Carl Shapiro [Tue, 8 Mar 2011 21:44:51 +0000 (13:44 -0800)]
Finish the indirect reference implementation.

This change eliminates all compilation errors and warnings when the
indirect reference feature is enabled, adds support for the indirect
reference table to the root visitor, and adds a new implementation of
jni weak global references integrated with the garbage collector.

Change-Id: Ieb4a0eb6c352b1a7dc095b0be1b5df2ad133fb64

13 years agoresolved conflicts for merge of 10185db0 to dalvik-dev
buzbee [Tue, 8 Mar 2011 20:09:24 +0000 (12:09 -0800)]
resolved conflicts for merge of 10185db0 to dalvik-dev

Change-Id: I29ffeacb0f4bfb740011c449a3693edd61ade4db

13 years agoresolved conflicts for merge of d063e255 to honeycomb-plus-aosp
buzbee [Tue, 8 Mar 2011 15:17:52 +0000 (07:17 -0800)]
resolved conflicts for merge of d063e255 to honeycomb-plus-aosp

Change-Id: I3c4d6895209ccba61ec3a14c24274939a7fc65e8

13 years agoMerge "Permit dx to build resource-only dex files." into dalvik-dev
Jesse Wilson [Tue, 8 Mar 2011 07:42:34 +0000 (23:42 -0800)]
Merge "Permit dx to build resource-only dex files." into dalvik-dev

13 years agoPermit dx to build resource-only dex files.
Jesse Wilson [Tue, 8 Mar 2011 02:02:50 +0000 (18:02 -0800)]
Permit dx to build resource-only dex files.

Previously it would build a .jar file containing a classes.dex
that itself contained no classes.

Change-Id: I9c36a5dcdd17d2821be15f87656d72ef0048c113

13 years agoMerge "Add a tool to grep the strings in a dex file." into dalvik-dev
Jesse Wilson [Tue, 8 Mar 2011 00:12:07 +0000 (16:12 -0800)]
Merge "Add a tool to grep the strings in a dex file." into dalvik-dev

13 years agoAdd a tool to grep the strings in a dex file.
Jesse Wilson [Tue, 8 Mar 2011 00:08:20 +0000 (16:08 -0800)]
Add a tool to grep the strings in a dex file.

Change-Id: I21b8537518718350def2f847e9c76ae4154bd4d6
http://b/4026001

13 years agoConsistency in exception throws.
Dan Bornstein [Mon, 7 Mar 2011 22:54:14 +0000 (14:54 -0800)]
Consistency in exception throws.

Make the messages that consist of a series of values consistently use
semicolons between the values, and make the call order for exception
throws that take both "info about a thing" as well as "info about a
use of that thing" take the "info about a thing" argument first.

Practical upshot: Adding a second semicolon in the message for
StringIndexOutOfBoundsException being thrown for a region, and
switching the order of arguments of
dvmThrowArrayIndexOutOfBoundsException().

Bug: 3500987
Change-Id: I97eb0046ab8997a68e2d6dfde5dbf3d02290c1f7

13 years agoCollate more of the low-level class lookups.
Dan Bornstein [Mon, 7 Mar 2011 18:30:41 +0000 (10:30 -0800)]
Collate more of the low-level class lookups.

I pulled out all the initialization code that I could find that was
merely looking up class and member names during early VM initialization,
putting them all in a new file, InitRefs.c. I didn't do any real restructuring
of the code, though. That will come in a follow-up.

This was instigated by discussion surrounding bug #3500987, but it's not
directly related to it.

Change-Id: I59e93e552d29a5518f2cc4e1e30c4a8d51750d7b

13 years agoFix JUMBO failures
buzbee [Sun, 6 Mar 2011 21:14:46 +0000 (13:14 -0800)]
Fix JUMBO failures

Fix some failures w/ the new Dalvik JUMBO opcodes on the x86 and portable
interpreters.  These showed up on dalvik/test/089-jumbo-opcodes when
running with:

    run-test --host 089              # x86 host-mode
    run-test --portable --host 089   # portable host-mode
    run-test --portable 089          # on device, portable

Change-Id: I520c8d2e001db95aa7525e4ffde7a81e2e786d38

13 years agoMerge "Update to allow x86-atom build for FI on Gingerbread"
David Turner [Sat, 5 Mar 2011 09:08:13 +0000 (01:08 -0800)]
Merge "Update to allow x86-atom build for FI on Gingerbread"

13 years agoRename some of the exception functions.
Dan Bornstein [Fri, 4 Mar 2011 19:53:40 +0000 (11:53 -0800)]
Rename some of the exception functions.

Since the there is no longer a "ByClass" vs. not distinction, remove
all the "ByClass"es.

Bug: 3500987
Change-Id: I6bdaf5a31e8166b47c333dbbb394dc811f321c5d

13 years agoClean out now-unused exception code.
Dan Bornstein [Fri, 4 Mar 2011 18:27:32 +0000 (10:27 -0800)]
Clean out now-unused exception code.

We hereby wish a fond farewell to the throw functions that took
a string name for the exception.

Bug: 3500987
Change-Id: I869ddc2b4e45d3122859249d4010e452d790fa1f

13 years agoMerge "More exception rework." into dalvik-dev
Dan Bornstein [Fri, 4 Mar 2011 17:48:58 +0000 (09:48 -0800)]
Merge "More exception rework." into dalvik-dev

13 years agoMerge "Low-level support for in-memory DEX" into dalvik-dev
Andy McFadden [Fri, 4 Mar 2011 15:51:13 +0000 (07:51 -0800)]
Merge "Low-level support for in-memory DEX" into dalvik-dev

13 years agoMore exception rework.
Dan Bornstein [Fri, 4 Mar 2011 01:51:05 +0000 (17:51 -0800)]
More exception rework.

I believe this change gets rid of the remaining throw calls that
used quoted strings for the excpetion type argument.

Bug: 3500987
Change-Id: Id4f905883c1a4e4e5608a2c59986cbd602d416cc

13 years agoLow-level support for in-memory DEX
Andy McFadden [Fri, 4 Mar 2011 00:27:40 +0000 (16:27 -0800)]
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

13 years agoMore exception rework.
Dan Bornstein [Fri, 4 Mar 2011 00:17:37 +0000 (16:17 -0800)]
More exception rework.

This includes banishing dvmThrowExceptionWithClassMessage(), in favor
of the "ByClass" version, as well as making the verification error
throwing code use class objects.

Bug: 3500987
Change-Id: I1d63cec0ffaf3a0ad17e9304ba6a21fe51072fc7

13 years agoMerge "Set up a few more exceptions." into dalvik-dev
Dan Bornstein [Thu, 3 Mar 2011 22:29:50 +0000 (14:29 -0800)]
Merge "Set up a few more exceptions." into dalvik-dev

13 years agoSet up a few more exceptions.
Dan Bornstein [Thu, 3 Mar 2011 21:10:04 +0000 (13:10 -0800)]
Set up a few more exceptions.

I'm starting to scrape the bottom of the barrel.

Bug: 3500987
Change-Id: If9c0f922506a94e78c504ea8c58176effe5fe00c

13 years agoMerge "Fix for test case now that jumbo opcodes are on." into dalvik-dev
jeffhao [Thu, 3 Mar 2011 21:08:00 +0000 (13:08 -0800)]
Merge "Fix for test case now that jumbo opcodes are on." into dalvik-dev

13 years agoFix for test case now that jumbo opcodes are on.
jeffhao [Thu, 3 Mar 2011 19:49:58 +0000 (11:49 -0800)]
Fix for test case now that jumbo opcodes are on.

Change-Id: Iad2bde29a3e0898b564b8e2c695dd45d3a6e927f

13 years agoLet dx generate the new extended instructions.
Dan Bornstein [Thu, 3 Mar 2011 17:58:06 +0000 (09:58 -0800)]
Let dx generate the new extended instructions.

Bug: 2557227
Change-Id: I8ca2479cbc76de6bf3bd746bad8ceb99b732d8c5

13 years agoMerge "Set up a few more exceptions." into dalvik-dev
Dan Bornstein [Thu, 3 Mar 2011 01:39:03 +0000 (17:39 -0800)]
Merge "Set up a few more exceptions." into dalvik-dev

13 years agoSet up a few more exceptions.
Dan Bornstein [Thu, 3 Mar 2011 00:28:04 +0000 (16:28 -0800)]
Set up a few more exceptions.

This time I *didn't* modify all the call sites, as they're not all
straightforward. However, I will do so in a separate follow-up.

Bug: 3500987
Change-Id: I7c8b4fe960704dc37e192d645be9da9d97159627

13 years agoMerge "Clarify the ordering requirement." into dalvik-dev
Dan Bornstein [Thu, 3 Mar 2011 00:27:33 +0000 (16:27 -0800)]
Merge "Clarify the ordering requirement." into dalvik-dev

13 years agoMerge "Use the card table to scan the immune region of the heap." into dalvik-dev
Carl Shapiro [Wed, 2 Mar 2011 23:45:23 +0000 (15:45 -0800)]
Merge "Use the card table to scan the immune region of the heap." into dalvik-dev

13 years agoUse the card table to scan the immune region of the heap.
Carl Shapiro [Wed, 2 Mar 2011 23:43:39 +0000 (15:43 -0800)]
Use the card table to scan the immune region of the heap.

Using the card table results in a dramatic cost reduction in scanning
time.  During a reboot, scanning each object in the zygote for
pointers to the application heap costs an average of 20ms of thread
time on a stingray with 8 megabyte zygote.  In comparison, scanning
dirty cards in the zygote costs 300us on average.

Change-Id: I1dba35646d509e6b1b4535e291a1eb6f66d7b218

13 years agoam bf0cce6d: Fix build.
Raphael [Wed, 2 Mar 2011 23:11:14 +0000 (15:11 -0800)]
am bf0cce6d: Fix build.

* commit 'bf0cce6d471ffcd65161eca6e027e1b66f02f054':
  Fix build.

13 years agoam 021b2229: am 7027ab61: am 88041260: am dd19f5b9: Merge "Fix for a crash when GC...
Romain Guy [Wed, 2 Mar 2011 23:11:11 +0000 (15:11 -0800)]
am 021b2229: am 7027ab61: am 88041260: am dd19f5b9: Merge "Fix for a crash when GC weak references."

* commit '021b222995fb625cc6f90855446a18ce911f2133':
  Fix for a crash when GC weak references.

13 years agoam b3086d3b: am 0c91e9d5: am 98e0347a: am 2b3d7e8e: Merge "Open dexdump files in...
Raphael Moll [Wed, 2 Mar 2011 23:11:00 +0000 (15:11 -0800)]
am b3086d3b: am 0c91e9d5: am 98e0347a: am 2b3d7e8e: Merge "Open dexdump files in binary mode."

* commit 'b3086d3b933b6942c32a3c9ef4d0ed8f6850afac':
  Open dexdump files in binary mode.

13 years agoClarify the ordering requirement.
Dan Bornstein [Wed, 2 Mar 2011 23:08:54 +0000 (15:08 -0800)]
Clarify the ordering requirement.

Hopefully, future maintainers won't also have to spend a day or so
sorting out what's going on.

Bug: 3500987
Change-Id: I0a1041df9ed4992563bc9d882fa134e82829cf18

13 years agoFix build.
Raphael [Wed, 2 Mar 2011 22:37:37 +0000 (14:37 -0800)]
Fix build.

The build server is stuck waiting for the O_BINARY change
from system/core. This will unblock it.

Change-Id: Iedd5f7a6cb140ac07b5084948a69eb5d94e2070f

13 years agoMerge "Yak-shaving in support of the exception cleanup." into dalvik-dev
Dan Bornstein [Wed, 2 Mar 2011 22:14:22 +0000 (14:14 -0800)]
Merge "Yak-shaving in support of the exception cleanup." into dalvik-dev

13 years agoMerge "Change invoke-object-init to /range form" into dalvik-dev
Andy McFadden [Wed, 2 Mar 2011 22:01:59 +0000 (14:01 -0800)]
Merge "Change invoke-object-init to /range form" into dalvik-dev

13 years agoHandle OP_THROW in the method JIT.
Ben Cheng [Sat, 19 Feb 2011 01:12:42 +0000 (17:12 -0800)]
Handle OP_THROW in the method JIT.

The current implementation is to reconstruct the leaf Dalvik frame and
punt to the interpreter, since the amount of work involed to match
each catch block and walk through the stack frames is just not worth
JIT'ing.

Additional changes:
- Fixed a control-flow bug where a block that ends with a throw shouldn't
  have a fall-through block.
- Fixed a code cache lookup bug so that method-based compilation is
  guaranteed a slot in the profiling table.
- Created separate handler routines based on opcode format for the
  method-based JIT.
- Renamed a few core registers that also have special meanings to the
  VM or ARM architecture.

Change-Id: I429b3633f281a0e04d352ae17a1c4f4a41bab156

13 years agoYak-shaving in support of the exception cleanup.
Dan Bornstein [Wed, 2 Mar 2011 00:16:12 +0000 (16:16 -0800)]
Yak-shaving in support of the exception cleanup.

This change restructures where early class initialization happens in
the VM, moving a few chunks of it together into Init.c. The exception
classes get moved here as well as the super-core classes needed
particularly for dex optimization. This is all done to support a follow-up
change that will put more of the verifier's required exceptions into
the list. (Before this change, it would have been unsafe to do that.)

This change also paves the way for further consolidation of class and
member initialization, which I hope will make it easier to transition
the whole mess into the new copying-gc world, when that arrives on the
scene.

Bug: 3500987
Change-Id: I0caae09432a05287af53aa36a6663997ab310985

13 years agoChange invoke-object-init to /range form
Andy McFadden [Tue, 1 Mar 2011 23:47:46 +0000 (15:47 -0800)]
Change invoke-object-init to /range form

The invoke-object-init instruction pretends to be a regular invoke
that only knows how to call Object.<init>.  As such it always takes
one argument, and if we use the /range version we can specify the
"this" register with 16 bits instead of only 4.

Bug 3486699

Change-Id: I9ee4700c6935beee1dcbaa583b57befd33641414

13 years agoam 7027ab61: am 88041260: am dd19f5b9: Merge "Fix for a crash when GC weak references."
Romain Guy [Wed, 2 Mar 2011 20:53:48 +0000 (12:53 -0800)]
am 7027ab61: am 88041260: am dd19f5b9: Merge "Fix for a crash when GC weak references."

* commit '7027ab6198f9d27b376e467971d55f14b160e40f':
  Fix for a crash when GC weak references.

13 years agoam 0c91e9d5: am 98e0347a: am 2b3d7e8e: Merge "Open dexdump files in binary mode."
Raphael Moll [Wed, 2 Mar 2011 20:53:46 +0000 (12:53 -0800)]
am 0c91e9d5: am 98e0347a: am 2b3d7e8e: Merge "Open dexdump files in binary mode."

* commit '0c91e9d5a4078bc1c6da2c225bde5fb703fd9d58':
  Open dexdump files in binary mode.

13 years agoMerge "mterp generation cleanup" into dalvik-dev
buzbee [Wed, 2 Mar 2011 17:55:18 +0000 (09:55 -0800)]
Merge "mterp generation cleanup" into dalvik-dev

13 years agomterp generation cleanup
buzbee [Tue, 1 Mar 2011 23:42:31 +0000 (15:42 -0800)]
mterp generation cleanup

Change I3a22048a introduced a new interpreter breakout mechanism, and
with it a bit of hackish ugliness in the mechanism to automatically
generate interpreter source files.

This CL applies some Lipo and Botox:
   o New alt-op-start, alt-op-end commands removed - will just use
     existing op-start & op-end.
   o New command "handler-style" to explicitly declare interpreter
     style (computed-goto, jump-table or all-c).  Previous trigger
     on "handler-size==0" removed.
   o Alternate handler stub no longer using fixed file name, but
     intead is named by command asm-alt-stub (which is modelled on
     existing alt-stub command).
   o Previous CL stated requirement for explicitly called-out handler
     for the Dalvik dispatch opcode.  Turns out this was not necessary.
     Requirement removed.

Change-Id: I20f7411820715476533c2073d28f357e28c1ae52

13 years agoMerge "Fix PopLocalFrame" into dalvik-dev
Andy McFadden [Tue, 1 Mar 2011 23:14:20 +0000 (15:14 -0800)]
Merge "Fix PopLocalFrame" into dalvik-dev

13 years agoFix PopLocalFrame
Andy McFadden [Tue, 1 Mar 2011 22:28:30 +0000 (14:28 -0800)]
Fix PopLocalFrame

In an indirect-ref world we would return the wrong thing.

From http://b.android.com/15119

Change-Id: Iec02aaff1d0bdf6036ba6d5676d4ae15688c1622

13 years agoClean up a few more exceptions.
Dan Bornstein [Tue, 1 Mar 2011 21:22:13 +0000 (13:22 -0800)]
Clean up a few more exceptions.

Bug: 3500987
Change-Id: I9d6dcf429ca67a64a81e4489b1087948f9673e07

13 years agoam 88041260: am dd19f5b9: Merge "Fix for a crash when GC weak references."
Romain Guy [Tue, 1 Mar 2011 21:50:40 +0000 (13:50 -0800)]
am 88041260: am dd19f5b9: Merge "Fix for a crash when GC weak references."

* commit '88041260251335cc497db4708f0057d5367da8b4':
  Fix for a crash when GC weak references.

13 years agoam 98e0347a: am 2b3d7e8e: Merge "Open dexdump files in binary mode."
Raphael Moll [Tue, 1 Mar 2011 21:50:37 +0000 (13:50 -0800)]
am 98e0347a: am 2b3d7e8e: Merge "Open dexdump files in binary mode."

* commit '98e0347a7f016764403384567267db6e9dcf8edf':
  Open dexdump files in binary mode.

13 years agoam dd19f5b9: Merge "Fix for a crash when GC weak references."
Romain Guy [Tue, 1 Mar 2011 20:39:47 +0000 (12:39 -0800)]
am dd19f5b9: Merge "Fix for a crash when GC weak references."

* commit 'dd19f5b91a1032e60871febb143850fd81000c5a':
  Fix for a crash when GC weak references.

13 years agoam 2b3d7e8e: Merge "Open dexdump files in binary mode."
Raphael Moll [Tue, 1 Mar 2011 20:39:44 +0000 (12:39 -0800)]
am 2b3d7e8e: Merge "Open dexdump files in binary mode."

* commit '2b3d7e8eccd7cbf64b2ac41c05073a9191d0d3b3':
  Open dexdump files in binary mode.

13 years agoMerge "Clean up a few more exceptions." into dalvik-dev
Dan Bornstein [Tue, 1 Mar 2011 19:20:27 +0000 (11:20 -0800)]
Merge "Clean up a few more exceptions." into dalvik-dev

13 years agoam 46413c1b: Add notice file for dx.jar and dexdump
Xavier Ducrohet [Tue, 1 Mar 2011 19:17:08 +0000 (11:17 -0800)]
am 46413c1b: Add notice file for dx.jar and dexdump

* commit '46413c1b857d2d25af800ffbb11b6eaefac0136a':
  Add notice file for dx.jar and dexdump

13 years agoClean up a few more exceptions.
Dan Bornstein [Tue, 1 Mar 2011 18:28:42 +0000 (10:28 -0800)]
Clean up a few more exceptions.

This includes a fix for ExceptionInInitializerError, which previously
could have gotten thrown before itself being initialized.

Change-Id: I3f27091f79b1a7e965c6261d3ff78109e0e4a23f

13 years agoMerge "Improved register allocation for check-cast instructions." into dalvik-dev
jeffhao [Tue, 1 Mar 2011 19:04:03 +0000 (11:04 -0800)]
Merge "Improved register allocation for check-cast instructions." into dalvik-dev

13 years agoException cleanup in the assembly interpreters
buzbee [Tue, 1 Mar 2011 00:38:50 +0000 (16:38 -0800)]
Exception cleanup in the assembly interpreters

Removed the last of the "exception as strings" calls from the
assembly interpreters, replacing them with the helper functions.

Change-Id: I4c44cde348ed7d2ea99f908bc22166afeb5e3d37

13 years agoMerge "New interpreter breakout mechanism" into dalvik-dev
buzbee [Tue, 1 Mar 2011 17:25:57 +0000 (09:25 -0800)]
Merge "New interpreter breakout mechanism" into dalvik-dev

13 years agoAdd notice file for dx.jar and dexdump
Xavier Ducrohet [Tue, 1 Mar 2011 02:16:32 +0000 (18:16 -0800)]
Add notice file for dx.jar and dexdump

Change-Id: I0094d382e866b8767383516abd367c98712da594

13 years agoMerge "Add comments describing the dump references visitor." into dalvik-dev
Carl Shapiro [Tue, 1 Mar 2011 02:27:32 +0000 (18:27 -0800)]
Merge "Add comments describing the dump references visitor." into dalvik-dev