OSDN Git Service

android-x86/dalvik.git
13 years agoam af5aa1f4: Don\'t treat dvmJitToPatchPredictedChain as a Jit-to-Interp entry point.
Ben Cheng [Wed, 5 Jan 2011 00:03:46 +0000 (16:03 -0800)]
am af5aa1f4: Don\'t treat dvmJitToPatchPredictedChain as a Jit-to-Interp entry point.

* commit 'af5aa1f4ce7eecc1b47a4c038cebb67d33f08f18':
  Don't treat dvmJitToPatchPredictedChain as a Jit-to-Interp entry point.

13 years agoDon't treat dvmJitToPatchPredictedChain as a Jit-to-Interp entry point.
Ben Cheng [Tue, 4 Jan 2011 23:37:04 +0000 (15:37 -0800)]
Don't treat dvmJitToPatchPredictedChain as a Jit-to-Interp entry point.

It is just a native callout helper function.

Change-Id: I6398b6876f5ba579b76e732107157a4c99337796

13 years agoam a8589335: [Jit] Fix for 3311468 Maps crashed at handleFmt...
Bill Buzbee [Mon, 27 Dec 2010 18:19:26 +0000 (10:19 -0800)]
am a8589335: [Jit] Fix for 3311468 Maps crashed at handleFmt...

* commit 'a85893356ac4d86ef7d7dd18807d7bef95d7dddb':
  [Jit] Fix for 3311468 Maps crashed at handleFmt...

13 years ago[Jit] Fix for 3311468 Maps crashed at handleFmt...
Bill Buzbee [Mon, 27 Dec 2010 17:31:21 +0000 (09:31 -0800)]
[Jit] Fix for 3311468 Maps crashed at handleFmt...

Change https://android-git.corp.google.com/g/#change,86452 eliminated unused
chaining cells for direct JNI calls.   However, a code path in CodegenDriver.c
assumed all similar invokes would have such cells.  Slightly re-arranged the
to avoid relying on the existance of the cell in cases in which it isn't
needed.

Change-Id: Ifc28acf559455a292b4b915ef1302085557e1d81

13 years agoam 9679fddf: Merge "Restore a few external allocation constants for compatibility."
Carl Shapiro [Thu, 23 Dec 2010 02:23:53 +0000 (18:23 -0800)]
am 9679fddf: Merge "Restore a few external allocation constants for compatibility."

* commit '9679fddfac3aad7f4f7407ae4f285d71140f6168':
  Restore a few external allocation constants for compatibility.

13 years agoam d255a545: (-s ours) Eliminate the chaining cells for direct JNI calls.
Ben Cheng [Thu, 23 Dec 2010 02:23:50 +0000 (18:23 -0800)]
am d255a545: (-s ours) Eliminate the chaining cells for direct JNI calls.

* commit 'd255a545ce8f7ab1848e6932e7136465e3852b39':
  Eliminate the chaining cells for direct JNI calls.

13 years agoresolved conflicts for merge of d255a545 to dalvik-dev
Ben Cheng [Thu, 23 Dec 2010 00:40:46 +0000 (16:40 -0800)]
resolved conflicts for merge of d255a545 to dalvik-dev

Change-Id: Ic8caa4cac0b442d5fe6c9fa6d37568c8f8e17c33

13 years agoMerge "Restore a few external allocation constants for compatibility."
Carl Shapiro [Thu, 23 Dec 2010 00:22:11 +0000 (16:22 -0800)]
Merge "Restore a few external allocation constants for compatibility."

13 years agoEliminate the chaining cells for direct JNI calls.
Ben Cheng [Wed, 22 Dec 2010 20:27:41 +0000 (12:27 -0800)]
Eliminate the chaining cells for direct JNI calls.

The JNI code is dispatched through TEMPLATE_INVOKE_METHOD_NATIVE, so
having a chaining cell for a non-virtual native call simply wastes
space.

Change-Id: Iaf944f745a0723a7772ea168fb35f79e79b21fae

13 years agoRestore a few external allocation constants for compatibility.
Carl Shapiro [Wed, 22 Dec 2010 20:21:01 +0000 (12:21 -0800)]
Restore a few external allocation constants for compatibility.

Aspects of the external allocation facility were exposed through the
VMDebug getAllocCount method.  In a previous change I removed all of
the references to external allocation from getAllocCount.  This had
the unfortunate side effect of breaking some CTS tests and causing the
VM to abort if the old constants were provided to getAllocCount on an
asserts enabled dalvik build.

The straight forward workaround seems to be to restore the special
treatment of these values in getAllocCount for as long as we support
the public interfaces of the external allocation facility.  An easier
way out may have been to make the failure case of getAllocCount return
0 instead of -1 and aborting on an asserts build.  Without some
analysis of API usage in market I would prefer to not change the -1
return value to 0 as it seems the thread counts currently return -1.

This change also eliminates the conditional export of the enum values
related to external allocation.  Those values are published API so it
makes no sense to maintain a way to guard their inclusion.

Change-Id: I49c173e0ec305536760c7aec15eebdc29213fc56

13 years agoam 0d1aac38: Revert "Remove inline natives for an unused performance test."
Jesse Wilson [Wed, 22 Dec 2010 20:08:30 +0000 (12:08 -0800)]
am 0d1aac38: Revert "Remove inline natives for an unused performance test."

* commit '0d1aac383a4bdce9feaad2f614df42234c2dcced':
  Revert "Remove inline natives for an unused performance test."

13 years agoRevert "Remove inline natives for an unused performance test."
Jesse Wilson [Wed, 22 Dec 2010 20:01:23 +0000 (12:01 -0800)]
Revert "Remove inline natives for an unused performance test."

This reverts commit 7ecd89dc02ce00c425788bd4989bdb6cde9a618a.

Change-Id: I427635b7e3f7be45cfde78b8046dab3b23b64562

13 years agoam a7a2d108: Update DalvikVersion due to removed NativeTestTarget
Jesse Wilson [Wed, 22 Dec 2010 18:11:26 +0000 (10:11 -0800)]
am a7a2d108: Update DalvikVersion due to removed NativeTestTarget

* commit 'a7a2d108b10803e2b96a56ffb3957561f5534e79':
  Update DalvikVersion due to removed NativeTestTarget

13 years agoUpdate DalvikVersion due to removed NativeTestTarget
Jesse Wilson [Wed, 22 Dec 2010 18:06:58 +0000 (10:06 -0800)]
Update DalvikVersion due to removed NativeTestTarget

Change-Id: I891b63a676b6c3f12fdbc5858ef12f235bc1b9c1

13 years agoam 7ecd89dc: Remove inline natives for an unused performance test.
Jesse Wilson [Wed, 22 Dec 2010 18:02:04 +0000 (10:02 -0800)]
am 7ecd89dc: Remove inline natives for an unused performance test.

* commit '7ecd89dc02ce00c425788bd4989bdb6cde9a618a':
  Remove inline natives for an unused performance test.

13 years agoRemove inline natives for an unused performance test.
Jesse Wilson [Wed, 22 Dec 2010 13:20:31 +0000 (05:20 -0800)]
Remove inline natives for an unused performance test.

Change-Id: I80cfb918bdf174aeb6de83909c840563f6b945dd

13 years agoam 039167e7: Simplify the interface for waiting for a concurrent GC to complete.
Carl Shapiro [Tue, 21 Dec 2010 03:21:40 +0000 (19:21 -0800)]
am 039167e7: Simplify the interface for waiting for a concurrent GC to complete.

* commit '039167e7894ae16880f51fa0b4d44316318aae1e':
  Simplify the interface for waiting for a concurrent GC to complete.

13 years agoSimplify the interface for waiting for a concurrent GC to complete.
Carl Shapiro [Tue, 21 Dec 2010 02:33:24 +0000 (18:33 -0800)]
Simplify the interface for waiting for a concurrent GC to complete.

Previously, there was no guarantee that a GC would have completed when
the waiting routine returned.  This was an oversight, and the workaround
became to wait in a loop that tested the condition that the GC running
flag was not set.  The right fix was always to push the loop into the
waiting routine itself to keep the interface simple.  This change backs
out the hack, moving the waiting loop to where it belongs.

Change-Id: Idc6ab6e5d4379a5da27e9e115d23d4123c7cacc4

13 years agoam e7bdd8b8: Remove the external allocation facility.
Carl Shapiro [Mon, 20 Dec 2010 01:31:39 +0000 (17:31 -0800)]
am e7bdd8b8: Remove the external allocation facility.

* commit 'e7bdd8b8c6f3aae552b333d0bd9664ef5e63f0a0':
  Remove the external allocation facility.

13 years agoFactor debug locals into liveness.
Andy McFadden [Fri, 17 Dec 2010 23:46:22 +0000 (15:46 -0800)]
Factor debug locals into liveness.

If the debugger asks for a reference held in a local variable, we know
that the reference is valid because the stack is part of the root set.
With liveness analysis, it's possible for a local to be considered dead
and get GCed.  Since we don't currently have a way to deal with that
in the debugging code, we just mark debugger-visible locals as live.

Bug 2534655

Change-Id: I5b217f20a76364f1f6a89499058de6ec4eb07b7d

13 years agoRemove the external allocation facility.
Carl Shapiro [Fri, 17 Dec 2010 23:34:52 +0000 (15:34 -0800)]
Remove the external allocation facility.

Change-Id: Iff508a9173382f29c67ca9e6eb6f65855dce0be4

13 years agoRename BackwardFlow --> Liveness
Andy McFadden [Fri, 17 Dec 2010 23:07:09 +0000 (15:07 -0800)]
Rename BackwardFlow --> Liveness

Changed my mind.

Change-Id: I16cdba8ba20a4dc60db5fbd70e591fb375c48008

13 years agoMerge "Fix dmtracedump." into dalvik-dev
Andy McFadden [Fri, 17 Dec 2010 20:34:21 +0000 (12:34 -0800)]
Merge "Fix dmtracedump." into dalvik-dev

13 years agoFix dmtracedump.
Andy McFadden [Fri, 17 Dec 2010 19:04:18 +0000 (11:04 -0800)]
Fix dmtracedump.

This rolls back a couple of checkins that were made some time ago.  The
dmtracedump tool has largely been broken ever since (only the "-o" mode
worked reliably).

The key feature this removes is "filters".  I don't know what they do.

Bug 2643529

Change-Id: I602c96da7a704286715d81d3fb227f490e933fcc

13 years ago[JIT] Trace profiling support
buzbee [Thu, 16 Dec 2010 00:32:35 +0000 (16:32 -0800)]
[JIT] Trace profiling support

In preparation for method compilation, this CL causes all traces to
include two entry points: profiling and non-profiling.  For now, the
profiling entry will only be used if dalvik is run with -Xjitprofile,
and largely works like it did before.  The difference is that profiling
support no longer requires the "assert" build - it's always there now.

This will enable us to do a form of sampling profiling of
traces in order to identify hot methods or hot trace groups,
while keeping the overhead low by only switching profiling on periodically.

To turn the periodic profiling on and off, we simply unchain all existing
translations and set the appropriate global profile state.  The underlying
translation lookup and chaining utilties will examine the profile state to
determine which entry point to use (i.e. - profiling or non-profiling) while
the traces naturally rechain during further execution.

Change-Id: I9ee33e69e33869b9fab3a57e88f9bc524175172b

13 years agoMerge "Progress on live-precise GC." into dalvik-dev
Andy McFadden [Fri, 17 Dec 2010 15:42:48 +0000 (07:42 -0800)]
Merge "Progress on live-precise GC." into dalvik-dev

13 years agoam 650177ee: Expose sysCopyFileToFile() and use it.
Dan Bornstein [Thu, 16 Dec 2010 23:34:56 +0000 (15:34 -0800)]
am 650177ee: Expose sysCopyFileToFile() and use it.

* commit '650177ee24fbe07cdd9ad9d8913fbf44cf44be13':
  Expose sysCopyFileToFile() and use it.

13 years agoProgress on live-precise GC.
Andy McFadden [Fri, 10 Dec 2010 23:34:00 +0000 (15:34 -0800)]
Progress on live-precise GC.

This implements computation of register liveness.  This is still a work
in progress.  The computation is disabled by default, and when enabled
it's not yet used during the generation of register maps.  The code
has not been thoughly tested.

While working on this I fiddled around with the verifier's verbose
debugging stuff a bit.

This also changes some stuff in BitVector.  Unsigned ints are now
prevalent, and functions like dvmSetBit abort rather than returning a
boolean value when an illegal operation is attempted.  (Some parallel
functions in the compiler were also updated.)

Bug 2534655

Change-Id: Iea161c6d63a310e1dbdac2aeeb7b7aeadda8807c

13 years agoExpose sysCopyFileToFile() and use it.
Dan Bornstein [Thu, 16 Dec 2010 21:17:30 +0000 (13:17 -0800)]
Expose sysCopyFileToFile() and use it.

Moved from ZipArchive.c, with tweaks to for argument order and name. Also
tweaked a related function in ZipArchive to match.

Change-Id: I4d2e3c8b44386d87c5aa1c4565f72da87357fce8

13 years agoam eab7355f: Hook up the preexisting RawDexFile opener.
Dan Bornstein [Thu, 16 Dec 2010 20:59:56 +0000 (12:59 -0800)]
am eab7355f: Hook up the preexisting RawDexFile opener.

* commit 'eab7355f9280dabcfe62fa2f21ca4e5511a59a24':
  Hook up the preexisting RawDexFile opener.

13 years agoHook up the preexisting RawDexFile opener.
Dan Bornstein [Thu, 16 Dec 2010 00:58:48 +0000 (16:58 -0800)]
Hook up the preexisting RawDexFile opener.

This one is similar in functionality to what's in JarFile.

I also made a couple minor (whitespace/comment/logging) changes to
JarFile where I spotted the opportunities.

This change makes it so that, if you happen to put a plain dex file on
your classpath (e.g., "dalvikvm -classpath /data/local/blort.dex
Blort"), it will actually be able to be used. This was documented as
working, but it was a lie...until now.

Change-Id: I2c93a8fdb40afa2d920904ab1235b7909e5837f8

13 years agoam 734ff82f: Merge "Initialize my field."
Dan Bornstein [Thu, 16 Dec 2010 00:37:48 +0000 (16:37 -0800)]
am 734ff82f: Merge "Initialize my field."

* commit '734ff82ff55be8083fe78f96ac950e2252b1ea28':
  Initialize my field.

13 years agoresolved conflicts for merge of 5c398996 to dalvik-dev
Carl Shapiro [Thu, 16 Dec 2010 00:28:14 +0000 (16:28 -0800)]
resolved conflicts for merge of 5c398996 to dalvik-dev

Change-Id: I2abd02d2840cbb74b93516bb83c604753acafd4a

13 years agoMerge "Initialize my field."
Dan Bornstein [Thu, 16 Dec 2010 00:06:33 +0000 (16:06 -0800)]
Merge "Initialize my field."

13 years agoInitialize my field.
Dan Bornstein [Wed, 15 Dec 2010 23:59:19 +0000 (15:59 -0800)]
Initialize my field.

<self-flagellation/>We can't count on malloc() to hand us zeroed
memory. I should know better by now.</self-flagellation>

Change-Id: If63c9d213982236e6e0362d03a4dd772b15bc73c

13 years agoMerge "Never write an hprof record for a null root."
Carl Shapiro [Wed, 15 Dec 2010 23:58:13 +0000 (15:58 -0800)]
Merge "Never write an hprof record for a null root."

13 years agoStore the key value with switch and catch blocks.
Ben Cheng [Wed, 15 Dec 2010 22:18:31 +0000 (14:18 -0800)]
Store the key value with switch and catch blocks.

For switch blocks, the key is the enum value with the case.
For catch blocks, the key is the type id of the exception.

Change-Id: I66a7e31c917aba63a0b455ce1796e3d5e277ca5a

13 years agoNever write an hprof record for a null root.
Carl Shapiro [Wed, 15 Dec 2010 21:36:59 +0000 (13:36 -0800)]
Never write an hprof record for a null root.

The old hprof implementation was never presented with null references
but with the new visitor based implementation null references are a
possibility.  With this change, the root visitor short circuits after
encountering a null reference and does write to the hprof file.

Change-Id: I38e8808a6ea43cb4361582ada4714f20ace7bea6

13 years agoam c5ba2b6a: Plumbing for loading byte[]-based dex files.
Dan Bornstein [Wed, 15 Dec 2010 20:46:58 +0000 (12:46 -0800)]
am c5ba2b6a: Plumbing for loading byte[]-based dex files.

* commit 'c5ba2b6a98636c841f6cb17094503c3c8199e852':
  Plumbing for loading byte[]-based dex files.

13 years agoPlumbing for loading byte[]-based dex files.
Dan Bornstein [Wed, 15 Dec 2010 00:57:00 +0000 (16:57 -0800)]
Plumbing for loading byte[]-based dex files.

This is obviously incomplete, but it's at least similarly incomplete
to the related code path it's right next to.

Change-Id: I06af6df3a4c2d648bf5b61b30a1ed5bbab4d170e

13 years agoPeriodically reset the thin lock polling interval.
Carl Shapiro [Tue, 14 Dec 2010 02:34:16 +0000 (18:34 -0800)]
Periodically reset the thin lock polling interval.

In a worst case scenario it was possible for a thread waiting to
inflate a lock to get stuck polling once a second.  With this change
the waiting thread will reset its delay back to the minimum delay
after reaching a 1 second delay.

This change also replaces a call to the obsolete usleep function with
a call to nanosleep.

Change-Id: I25bc3e3907ec070250e1d7821b7770a8d1ba9627

13 years agoMerge "[JIT] Regalloc cleanup" into dalvik-dev
buzbee [Wed, 15 Dec 2010 00:22:13 +0000 (16:22 -0800)]
Merge "[JIT] Regalloc cleanup" into dalvik-dev

13 years agoGet rid of the HeapRefTable type.
Carl Shapiro [Tue, 14 Dec 2010 22:19:12 +0000 (14:19 -0800)]
Get rid of the HeapRefTable type.

This was a needless alias for a ReferenceTable.

Change-Id: I3450c4a731d06da0954e6d8b441e731a06ded321

13 years agoSwapped order of registers for jumbo format 5rc to match documentation.
jeffhao [Tue, 14 Dec 2010 22:03:56 +0000 (14:03 -0800)]
Swapped order of registers for jumbo format 5rc to match documentation.

Change-Id: I3da544e9d71c2f4460847928cfa1df54d6c8d42e

13 years ago[JIT] Regalloc cleanup
buzbee [Tue, 14 Dec 2010 21:16:43 +0000 (13:16 -0800)]
[JIT] Regalloc cleanup

Remove vestiges of code intended for linear scan register allocation
in the trace compiler.  New plan is to stick with local allocation for
traces and build a new linear scan allocator for the method compiler.

Change-Id: Ic265ab5a7936b144cbe7fa4dc667fa7aba579045

13 years agoMerge "Stamp out some x86/host mode warnings" into dalvik-dev
buzbee [Tue, 14 Dec 2010 19:18:49 +0000 (11:18 -0800)]
Merge "Stamp out some x86/host mode warnings" into dalvik-dev

13 years agoStamp out some x86/host mode warnings
buzbee [Tue, 14 Dec 2010 19:06:25 +0000 (11:06 -0800)]
Stamp out some x86/host mode warnings

Nuked a void* cast warnings and moved cacheflush into a target-specific
utility wrapper.

Change-Id: I36c841288b9ec7e03c0cb29b2e89db344f36fad1

13 years ago_Bool to bool
Brad Fitzpatrick [Tue, 14 Dec 2010 18:58:06 +0000 (10:58 -0800)]
_Bool to bool

Change-Id: Ib89ffca7b296dd18d06a72b65fbdea6571ed95b4

13 years agoMerge "resolved conflicts for merge of 3b55675a to dalvik-dev" into dalvik-dev
Brad Fitzpatrick [Tue, 14 Dec 2010 18:44:03 +0000 (10:44 -0800)]
Merge "resolved conflicts for merge of 3b55675a to dalvik-dev" into dalvik-dev

13 years agoresolved conflicts for merge of 3b55675a to dalvik-dev
Brad Fitzpatrick [Tue, 14 Dec 2010 18:42:39 +0000 (10:42 -0800)]
resolved conflicts for merge of 3b55675a to dalvik-dev

Change-Id: Ibcce985e9a0130ec738b6729b17eb72acccc2285

13 years agoAdd explicit casts from "void *" to destination types.
Ben Cheng [Tue, 14 Dec 2010 18:25:52 +0000 (10:25 -0800)]
Add explicit casts from "void *" to destination types.

Change-Id: I8828bc628f110aaade578a197bf1f51b30bf1be7

13 years agoAdd a new, optional "is sensitive thread?" hook.
Brad Fitzpatrick [Tue, 14 Dec 2010 00:53:28 +0000 (16:53 -0800)]
Add a new, optional "is sensitive thread?" hook.

The Android framework implements this hook in Ie6f58d130a29.

Bug: 3226270
Change-Id: I7342248e5699a22b71647e7cfeec52ec871cefaf

13 years agoImplement method parser and SSA transformation.
Ben Cheng [Thu, 28 Oct 2010 18:13:58 +0000 (11:13 -0700)]
Implement method parser and SSA transformation.

Change-Id: If3fb3a36f33aaee8e5fdded4e9fa607be54f0bfb

13 years agoMerge "Experimental x86 Jit trace selection" into dalvik-dev
buzbee [Mon, 13 Dec 2010 23:33:46 +0000 (15:33 -0800)]
Merge "Experimental x86 Jit trace selection" into dalvik-dev

13 years agoExperimental x86 Jit trace selection
buzbee [Wed, 22 Sep 2010 23:19:28 +0000 (16:19 -0700)]
Experimental x86 Jit trace selection

Experimental support for trace selection for x86 host mode operation.
Not enabled by default.  Turned on by setting WITH_HOST_DALVIK true
and WITH_JIT true.  When enabled, profiles during x86 fast interpreter
operation, selects hot traces and "compiles" traces consisting of jumps
back to the interpreter.

First in a series of experimental x86 support checkins.

Change-Id: I0e423ec58a7bf01f226cb486f55de2841fab1002

13 years agoMerge "Adding javax.sip to the dx blacklist." into dalvik-dev
jeffhao [Mon, 13 Dec 2010 23:17:23 +0000 (15:17 -0800)]
Merge "Adding javax.sip to the dx blacklist." into dalvik-dev

13 years agoDo not commingle application and zygote references when sweeping.
Carl Shapiro [Mon, 13 Dec 2010 01:09:04 +0000 (17:09 -0800)]
Do not commingle application and zygote references when sweeping.

When garbage objects are identified references to these objects are
passed to a function which, in the case of an application heap,
releases their storage to the mspace or, in the case of a zygote heap,
counts their freed memory without touching the underlying heap.

This freeing process is performed in bulk.  To attenuate the cost of
calling and to allow for more efficient merging of adjacent unused
blocks of memory, a buffer is filled with adjacent references to free.
The freeing mechanism is chosen based on the first reference in the
buffer.  If the first reference is an application heap object all
objects in the buffer have their storage released to the underlying
mspace.  If the first object is a zygote object, only the free space
counting is performed.  Assertions check if this assumption is sound.

The previous change to the sweep did not treat the various regions of
the heap specially and therefore allowed the freeing buffer to have
its contained pointers span both heaps.  This change restores some of
the functionality which kept references from either heap separate.

Change-Id: Ibc563dcf46ff1681596664f04a2a85a4d29eb5e1

13 years agoresolved conflicts for merge of 8a69168b to dalvik-dev
Carl Shapiro [Mon, 13 Dec 2010 21:47:37 +0000 (13:47 -0800)]
resolved conflicts for merge of 8a69168b to dalvik-dev

Change-Id: I8f17c650f6528fddec6198097fb1abeb978b3c05

13 years agoAdding javax.sip to the dx blacklist.
jeffhao [Mon, 13 Dec 2010 18:51:15 +0000 (10:51 -0800)]
Adding javax.sip to the dx blacklist.

Change-Id: I5be068821862ccf073cb758e60b686f46a3c97c1

13 years agoFix a bug in hprof that corrupted the root set output.
Carl Shapiro [Mon, 13 Dec 2010 20:13:47 +0000 (12:13 -0800)]
Fix a bug in hprof that corrupted the root set output.

The root visitor takes an Object ** but the hprof output assumed an
Object *.  As such, bad root set object ids were written to the hprof
dump and, by extension, objects reachable only from the roots either
looked like floating garbage or were wholly omitted from the output.

Change-Id: I58b31b6ad145fa9843ecbda630ed8b6ab951d931

13 years agoFix a comment that misrepresents the root marking algorithm.
Carl Shapiro [Mon, 13 Dec 2010 00:00:59 +0000 (16:00 -0800)]
Fix a comment that misrepresents the root marking algorithm.

During the initial root marking nothing is pushed on the mark stack.
Marked roots are pushed during the scanning phase following root
marking.  Unfortunately, the comment above the root marking callback
incorrectly claimed that it pushed objects on the mark stack.

In addition, this change renames the marking callback for the re-mark
phase to more accurately reflect its limited usage.

Change-Id: I38161fa723e00e14bd8d047a2e25cdbfd215a2c6

13 years agoNew jumbo verification error opcode.
Dan Bornstein [Sat, 11 Dec 2010 01:03:06 +0000 (17:03 -0800)]
New jumbo verification error opcode.

I'll regenerate the vm code for this in a follow-up change.

Change-Id: I59a0a91d39fd539f1b3a25f1f2889618fa484b96

13 years agoNew instruction format for verification errors.
Dan Bornstein [Sat, 11 Dec 2010 00:57:38 +0000 (16:57 -0800)]
New instruction format for verification errors.

Change-Id: I99e6828487dcc7f6277bb710e4279ce0aa8c7563

13 years agoMinor tweaks.
Andy McFadden [Fri, 10 Dec 2010 23:23:47 +0000 (15:23 -0800)]
Minor tweaks.

Clean up replaceFailingInstruction() a little.  In particular, use
the appropriate method for extracting the opcode, and assert that
the instruction we're replacing was marked "can throw" (if it wasn't,
the list of predecessors in the catch handler will be wrong).  Also
remove a declaration that became redundant when we started replacing
instructions in place (as opposed to making a copy of the method body).

Strip out a bit of stale #if 0 code.

Change-Id: Iccf80647237672e2da4b1b46ca9627ae3344704d

13 years agoSplit BitVector into its own file.
Andy McFadden [Fri, 10 Dec 2010 19:08:22 +0000 (11:08 -0800)]
Split BitVector into its own file.

This just pulls the BitVector stuff out into separate files.

IIRC the motivation for building Misc.c for ARM rather than Thumb was
the bit-manipulation going on in BitVector (e.g. the use of ffs()),
so I switched that around in the makefile.

The only change of any substance was relocation of the kBitVectorGrowth
define from the .h to the .c.

Change-Id: Ib35fda81809081bd629b4f344e41f21966e1441c

13 years agoProgress on liveness analysis.
Andy McFadden [Thu, 2 Dec 2010 00:18:19 +0000 (16:18 -0800)]
Progress on liveness analysis.

Compute basic blocks and their predecessors, necessary for backward flow
analysis.  This is a work in progress and isn't yet enabled.

(When enabled, verification takes 20% longer, so there's some room for
improvement on performance.)

Also, this changes the "generate register maps" setting to be enabled
by default, and allows a "no" prefix on -Xgenregmap to disable it.

Bug 2534655

Change-Id: Id2e8512f53fc454ce2184879ab663ed7121274b6

13 years agoKill dvmHeapSourceGetObjectBitmaps and aliasBitmaps.
Carl Shapiro [Thu, 9 Dec 2010 23:24:11 +0000 (15:24 -0800)]
Kill dvmHeapSourceGetObjectBitmaps and aliasBitmaps.

In the beginning separate mark bitmaps and live bitmaps were kept for
each of the three heaps.  Later, all heaps were allocated adjacent to
one another from a single contiguous tract of virtual memory.  As
such, summary data structures such as the card table, mark bitmap, and
live bitmap, were similarly allocated from individual blocks of memory
instead of sparsely for each heap.

While the summary structures were changed, the sweeping routine was
left to assume separate bitmaps.  In fact, the aliasBitmap hack was
added to continue the fiction of small bitmaps for each of the heaps.
It would have been preferable to change the sweeping routine, but that
routine was greatly entangled with generalities.  Fortunately, those
entanglements have since been eliminated.

This change updates the sweeping routine to operate on memory address
ranges instead of whole bitmaps, obsoleting aliasBitmaps and its sole
caller.  The bitmap sweep routine now receives a range of addresses
for sweeping.  This range may span the entire bitmap or any contiguous
range within the span of the bitmap.

Change-Id: Iae206032738d6cad77e0625d27ae7b7d6551890d

13 years agoCompare the buffer pointers to avoid signedness mismatches.
Carl Shapiro [Thu, 9 Dec 2010 01:17:45 +0000 (17:17 -0800)]
Compare the buffer pointers to avoid signedness mismatches.

Previously, this code tried to traffick in buffer sizes.  It seems
that the results of the pointer arithmetic resulted in a signed value
while the buffer size constant was interpreted as an unsigned.

Change-Id: I1816fee9eae36f225d0480642ecc91ea7a2d0ad1

13 years agoMerge "Compute the pointer buffer size from familiar constants." into dalvik-dev
Carl Shapiro [Thu, 9 Dec 2010 00:49:17 +0000 (16:49 -0800)]
Merge "Compute the pointer buffer size from familiar constants." into dalvik-dev

13 years agoam 06d02069: Various improvements to dexdeps.
Dan Bornstein [Thu, 9 Dec 2010 00:16:19 +0000 (16:16 -0800)]
am 06d02069: Various improvements to dexdeps.

* commit '06d020698f7182ae17b933fa688ab9302a8674e2':
  Various improvements to dexdeps.

13 years agoCompute the pointer buffer size from familiar constants.
Carl Shapiro [Wed, 8 Dec 2010 23:40:24 +0000 (15:40 -0800)]
Compute the pointer buffer size from familiar constants.

Change-Id: Ibe4260c508417b015537fbee4f0dc78329450cbf

13 years agoVarious improvements to dexdeps.
Dan Bornstein [Wed, 8 Dec 2010 22:47:11 +0000 (14:47 -0800)]
Various improvements to dexdeps.

This includes:
* Adding an option to only produce lists of dependent classes (and not
  also fields and methods).
* Adding the ability to process multiple files on a single invocation.
* Adding a label at the head of the section for each file.
* Neatening up Output a bit by factoring "System.out" into a static field.

Change-Id: Id9a691d23afd18f82ab3790cb760cfd12e14bc86

13 years agoam 07946cfd: Throw useful detail messages when Method.invoke fails.
Elliott Hughes [Wed, 8 Dec 2010 00:39:16 +0000 (16:39 -0800)]
am 07946cfd: Throw useful detail messages when Method.invoke fails.

* commit '07946cfdee82ba5ef235be61d067f56aa56e3b02':
  Throw useful detail messages when Method.invoke fails.

13 years agoThrow useful detail messages when Method.invoke fails.
Elliott Hughes [Sat, 4 Dec 2010 01:59:32 +0000 (17:59 -0800)]
Throw useful detail messages when Method.invoke fails.

Part of my general push for better exceptions.

(Cherry-pick from dalvik-dev of https://android-git.corp.google.com/g/83287.)

Change-Id: I0cd47b492fbdc52db2eef8e2a02f31bda2a086eb

13 years agoThrow useful detail messages when Method.invoke fails.
Elliott Hughes [Sat, 4 Dec 2010 01:59:32 +0000 (17:59 -0800)]
Throw useful detail messages when Method.invoke fails.

Part of my general push for better exceptions.

Change-Id: I9677c946744caa4c1c9e8b834edcd38e656a888b

13 years agoFix implicit conversions, rename reserved works, enable -Wc++-compat.
Carl Shapiro [Tue, 7 Dec 2010 19:43:38 +0000 (11:43 -0800)]
Fix implicit conversions, rename reserved works, enable -Wc++-compat.

Change-Id: I06292964a6882ea2d0c17c5c962db95e46b01543

13 years agoMerge remote branch 'goog/dalvik-dev' into dalvik-dev-to-master
Brian Carlstrom [Mon, 6 Dec 2010 22:23:09 +0000 (14:23 -0800)]
Merge remote branch 'goog/dalvik-dev' into dalvik-dev-to-master

13 years agoam 91b93ea4: Fix monitor verification.
Andy McFadden [Sun, 5 Dec 2010 07:42:21 +0000 (23:42 -0800)]
am 91b93ea4: Fix monitor verification.

* commit '91b93ea496e8c86f410f302a94c2adf0fc9d8189':
  Fix monitor verification.

13 years agoMinor simplification.
Dan Bornstein [Sat, 4 Dec 2010 01:58:01 +0000 (17:58 -0800)]
Minor simplification.

Change-Id: Ie17ba83ead45028a8b7b32c1cc5763f9dd6d684c

13 years agoMerge "Fix stupid copy-paste error." into dalvik-dev
Dan Bornstein [Sat, 4 Dec 2010 01:49:46 +0000 (17:49 -0800)]
Merge "Fix stupid copy-paste error." into dalvik-dev

13 years agoFix stupid copy-paste error.
Dan Bornstein [Sat, 4 Dec 2010 01:48:27 +0000 (17:48 -0800)]
Fix stupid copy-paste error.

Change-Id: I1ad1e8c26ec47b9b148fc6a4292afa2ee25e58e2

13 years agoMerge "These asserts are no longer pointless." into dalvik-dev
Dan Bornstein [Sat, 4 Dec 2010 01:32:04 +0000 (17:32 -0800)]
Merge "These asserts are no longer pointless." into dalvik-dev

13 years agoThese asserts are no longer pointless.
Dan Bornstein [Sat, 4 Dec 2010 01:24:34 +0000 (17:24 -0800)]
These asserts are no longer pointless.

Change-Id: I32cfd2334de344156a41d1c2d7c10a8d96e970c4

13 years agoMake the inlined String.charAt throw detailed exceptions.
Elliott Hughes [Sat, 4 Dec 2010 00:37:54 +0000 (16:37 -0800)]
Make the inlined String.charAt throw detailed exceptions.

Part of my general push for better exceptions. I'll add a unit test to libcore,
but until we lose the dexopt brain damage, we won't be able to see it (dexopt
can't optimize JUnit tests, so we get no coverage of inline natives on our
continuous builds; http://b/3003994).

Change-Id: I3af757751534747fa4b3cc725b0914a8f7b3d45d

13 years agoMerge "Another clarifying rename and a bit more automation." into dalvik-dev
Dan Bornstein [Sat, 4 Dec 2010 00:07:33 +0000 (16:07 -0800)]
Merge "Another clarifying rename and a bit more automation." into dalvik-dev

13 years agoAnother clarifying rename and a bit more automation.
Dan Bornstein [Fri, 3 Dec 2010 23:32:40 +0000 (15:32 -0800)]
Another clarifying rename and a bit more automation.

kNumDalvikInstructions is now kNumPackedOpcodes, there is a new
kMaxOpcodeValue, and both are generated by opcode-gen.

Change-Id: Ic46f1f52d2d21382452c8e777024f4a985ad31d3
Bonus: Reworded the switch and array data comment for clarity.

13 years agoMerge "Use dvmHumanReadableDescriptor in -Xjnitrace." into dalvik-dev
Elliott Hughes [Fri, 3 Dec 2010 23:40:14 +0000 (15:40 -0800)]
Merge "Use dvmHumanReadableDescriptor in -Xjnitrace." into dalvik-dev

13 years agoRegular-expression compatibility.
Dan Bornstein [Fri, 3 Dec 2010 23:11:55 +0000 (15:11 -0800)]
Regular-expression compatibility.

The most compatible way of indicating that a dash is part of a
character range is to put a single dash at the end of the range
expression.

Change-Id: I1e118038dfacffbc004c97be0ae1c3dfe97e861d

13 years agoSmall fixes.
Dan Bornstein [Fri, 3 Dec 2010 21:16:08 +0000 (13:16 -0800)]
Small fixes.

I had unpackOpcode() slightly wrong, and I made the libcore opcode
numbers always be four hex digits.

Change-Id: I4f988b8794b4b6c48ef91698a8e567fa46b96dac

13 years agoClean up the opcode-gen script.
Dan Bornstein [Fri, 3 Dec 2010 21:01:06 +0000 (13:01 -0800)]
Clean up the opcode-gen script.

There was way too much string duplication, and it needed at least
a bit more commenting.

Change-Id: Id31ee1fd260db6f4afe301764c60de7c63b3f729

13 years agoUse dvmHumanReadableDescriptor in -Xjnitrace.
Elliott Hughes [Fri, 3 Dec 2010 18:57:15 +0000 (10:57 -0800)]
Use dvmHumanReadableDescriptor in -Xjnitrace.

This made the output more readable while debugging a zlib issue.

Bug: 3220923
Change-Id: Ie360516a8a7a92b5b75fe70feb5c9722289bed78

13 years agoMerge "Eliminate the GC.h header file." into dalvik-dev
Carl Shapiro [Fri, 3 Dec 2010 01:37:48 +0000 (17:37 -0800)]
Merge "Eliminate the GC.h header file." into dalvik-dev

13 years agoEliminate the GC.h header file.
Carl Shapiro [Fri, 3 Dec 2010 01:27:01 +0000 (17:27 -0800)]
Eliminate the GC.h header file.

Change-Id: Ieda8b819032fc6aac80b390960d9c6f4864795ab

13 years agoMerge "Add a note." into dalvik-dev
Dan Bornstein [Fri, 3 Dec 2010 01:09:33 +0000 (17:09 -0800)]
Merge "Add a note." into dalvik-dev

13 years agoAdd a note.
Dan Bornstein [Fri, 3 Dec 2010 01:08:56 +0000 (17:08 -0800)]
Add a note.

Change-Id: I55362cbc8bfbb22ebcd493db7cdeb34fc3394e3a

13 years agoMerge "Get rid of the ugly macros inside the bitmap sweep routine." into dalvik-dev
Carl Shapiro [Fri, 3 Dec 2010 01:07:52 +0000 (17:07 -0800)]
Merge "Get rid of the ugly macros inside the bitmap sweep routine." into dalvik-dev

13 years agoMerge "Make opcode 00ff be called "dispatch-ff"." into dalvik-dev
Dan Bornstein [Fri, 3 Dec 2010 01:07:38 +0000 (17:07 -0800)]
Merge "Make opcode 00ff be called "dispatch-ff"." into dalvik-dev

13 years agoMerge "Inching closer to having extended opcodes in the vm." into dalvik-dev
Dan Bornstein [Fri, 3 Dec 2010 01:07:04 +0000 (17:07 -0800)]
Merge "Inching closer to having extended opcodes in the vm." into dalvik-dev

13 years agoGet rid of the ugly macros inside the bitmap sweep routine.
Carl Shapiro [Fri, 3 Dec 2010 00:41:28 +0000 (16:41 -0800)]
Get rid of the ugly macros inside the bitmap sweep routine.

Thanks to recent simplifications the implementation macrology can be
expanded out.  While we are here, fix the comments about the treatment
of max.  This edit should have happened in the previous change to the
sweeper.

Change-Id: Ia18ee580f5955dca8c27b96f7badbfb067a0a1cb

13 years agoMerge "Drive all root scanning by the root visitor." into dalvik-dev
Carl Shapiro [Fri, 3 Dec 2010 00:59:54 +0000 (16:59 -0800)]
Merge "Drive all root scanning by the root visitor." into dalvik-dev