OSDN Git Service

android-x86/dalvik.git
15 years agoMerge change 7442
Android (Google) Code Review [Thu, 16 Jul 2009 14:42:44 +0000 (07:42 -0700)]
Merge change 7442

* changes:
  Make verifier field/method resolution conformant.

15 years agoMerge change 7474
Android (Google) Code Review [Thu, 16 Jul 2009 14:42:32 +0000 (07:42 -0700)]
Merge change 7474

* changes:
  Throw OutOfMemoryError on oversize array allocs.

15 years agoam 6fbc4eb4: Merge change 7410 into donut
Android (Google) Code Review [Thu, 16 Jul 2009 01:14:52 +0000 (18:14 -0700)]
am 6fbc4eb4: Merge change 7410 into donut

Merge commit '6fbc4eb48bf368199f31a25fae60f8f7a378cc52'

* commit '6fbc4eb48bf368199f31a25fae60f8f7a378cc52':
  Fix bug: Arrays.deepToSting renders "[null]" as "null"; "[[]]" as "[]"; etc.

15 years agoThrow OutOfMemoryError on oversize array allocs.
Andy McFadden [Wed, 15 Jul 2009 23:56:00 +0000 (16:56 -0700)]
Throw OutOfMemoryError on oversize array allocs.

We've been throwing InternalError because of a particular statement in
the JPL that suggests we should be clearing out SoftReferences before
throwing OOM.  That seems unnecessary for an array allocation that we're
rejecting because the total size doesn't fit in a 32-bit integer.

Now we just throw OOM.

15 years agoMerge change 6983
Android (Google) Code Review [Wed, 15 Jul 2009 23:33:20 +0000 (16:33 -0700)]
Merge change 6983

* changes:
  Include the full stacktrace when a test times out.

15 years agoMake verifier field/method resolution conformant.
Andy McFadden [Wed, 15 Jul 2009 21:34:49 +0000 (14:34 -0700)]
Make verifier field/method resolution conformant.

The VM spec spells out a particular way to look for fields.  It assumes
that static and virtual fields are piled together into a single pool,
so it makes sense to scan through both kinds when resolving.  In Dalvik,
field definitions are separated by scope, so we can save a little time
by only searching through the appropriate list.

It turns out that you can create a situation where a field with the same
name is available in both static and virtual forms in the same class.
javac won't let you do this in a single class, but with separate
compilation and inheritance you can pull it off.  In these situations,
Dalvik can do the wrong thing.  For example, if you ask for a static
field, Dalvik will happily use the static field from a superclass without
realizing that there's an instance field with the same name in the current
class.  It's supposed to find the instance field, realize that it's not
static, and throw an exception.

This change updates the verifier to do an "untyped" scan like the VM
spec wants.  Problematic situations are identifed and result in an
"incompatible class change" exception.

This does not alter "direct" method lookups (constructors, private
methods).

I also altered the annotation "ambiguous" method lookup to use the new
function, since that's probably the desired behavior there as well.

15 years agoMerge change 7410 into donut
Android (Google) Code Review [Wed, 15 Jul 2009 21:18:58 +0000 (14:18 -0700)]
Merge change 7410 into donut

* changes:
  Fix bug: Arrays.deepToSting renders "[null]" as "null"; "[[]]" as "[]"; etc.

15 years agoFix bug: Arrays.deepToSting renders "[null]" as "null"; "[[]]" as "[]"; etc.
Joshua Bloch [Wed, 15 Jul 2009 18:29:28 +0000 (11:29 -0700)]
Fix bug: Arrays.deepToSting renders "[null]" as "null"; "[[]]" as "[]"; etc.

15 years agoMerge change 7162
Android (Google) Code Review [Wed, 15 Jul 2009 14:22:30 +0000 (07:22 -0700)]
Merge change 7162

* changes:
  Throw a pre-fabricated NoClassDefFoundError.

15 years agoThrow a pre-fabricated NoClassDefFoundError.
Andy McFadden [Tue, 14 Jul 2009 22:57:23 +0000 (15:57 -0700)]
Throw a pre-fabricated NoClassDefFoundError.

When a class loader tries to load a class, it first asks its parent to
look for it.  This continues up the chain until the bootstrap class loader
is reached.  If the class can't be found, the bootstrap loader throws a
NoClassDefFoundError.  As a result, we're throwing at least one exception
for every class we load that doesn't come from the bootstrap path.

This change creates a "stock" NoClassDefFoundError exception with a trivial
stack trace and throws that instead, saving the overhead of creating and
initializing the exception object.

I think the only way that anyone will see this is if they try to
load a class directly from the bootstrap loader, in which case the
ClassNotFoundException will show the canned NCDFE as the cause.  I
don't think any useful diagnostic information is being lost.

15 years agoMerge change 7171
Android (Google) Code Review [Tue, 14 Jul 2009 23:29:09 +0000 (16:29 -0700)]
Merge change 7171

* changes:
  Add real info.

15 years agoAdd real info.
Andy McFadden [Tue, 14 Jul 2009 23:28:48 +0000 (16:28 -0700)]
Add real info.

15 years agoam 798e7434: (-s ours) Don\'t init class during reflection signature scan.
Andy McFadden [Tue, 14 Jul 2009 18:10:18 +0000 (11:10 -0700)]
am 798e7434: (-s ours) Don\'t init class during reflection signature scan.

Merge commit '798e74341e03edf2c30728a141dc6af7a89f9e1f'

* commit '798e74341e03edf2c30728a141dc6af7a89f9e1f':
  Don't init class during reflection signature scan.

15 years agoDon't init class during reflection signature scan.
Andy McFadden [Tue, 16 Jun 2009 19:10:04 +0000 (12:10 -0700)]
Don't init class during reflection signature scan.

Do not merge to master -- this is 57ea16e8 from there.

When processing Class.getDeclaredMethods() we create Method objects.
These have arrays of classes that indicate the method parameter types.
While generating the array we were initializing the classes we found,
which isn't necessary and led to some unpleasantness described in
external bug 3005.

15 years agoMerge change 7034
Android (Google) Code Review [Tue, 14 Jul 2009 03:57:42 +0000 (20:57 -0700)]
Merge change 7034

* changes:
  Added note about unaligned doubles.

15 years agoAdded note about unaligned doubles.
Andy McFadden [Tue, 14 Jul 2009 00:30:21 +0000 (17:30 -0700)]
Added note about unaligned doubles.

15 years agoam 2b828991: (-s ours) Remove races from JNI_OnLoad invocation.
Andy McFadden [Mon, 13 Jul 2009 23:59:27 +0000 (16:59 -0700)]
am 2b828991: (-s ours) Remove races from JNI_OnLoad invocation.

Merge commit '2b82899181108c4ed290f8c6b6be13759b59768f'

* commit '2b82899181108c4ed290f8c6b6be13759b59768f':
  Remove races from JNI_OnLoad invocation.

15 years agoInclude the full stacktrace when a test times out.
Jesse Wilson [Mon, 13 Jul 2009 22:48:58 +0000 (15:48 -0700)]
Include the full stacktrace when a test times out.

15 years agoRemove races from JNI_OnLoad invocation.
Andy McFadden [Fri, 10 Jul 2009 00:01:04 +0000 (17:01 -0700)]
Remove races from JNI_OnLoad invocation.

Do not merge to master.  (This was copied from there to donut.)

The current implementation just calls JNI_OnLoad and returns a failure
result if that goes badly.  If a second load attempt is made after
dlopen() finishes but before JNI_OnLoad completes, it will succeed
immediately.

This is bad because (a) we might not have finished the initialization
steps in JNI_OnLoad, and (b) it's possible JNI_OnLoad will fail.  We now
wait for an in-progress JNI_OnLoad to complete before returning.  (This
also requires recognizing and handling recursive invocation.)

15 years agoAdd note about -to-long conversions.
Andy McFadden [Mon, 13 Jul 2009 20:47:28 +0000 (13:47 -0700)]
Add note about -to-long conversions.

Library behavior may not be what Java spec requires.  Added sample code
and pointer to dalvik test.

15 years agoMerge change 6848
Android (Google) Code Review [Mon, 13 Jul 2009 14:32:43 +0000 (07:32 -0700)]
Merge change 6848

* changes:
  Minor class loading optimization.

15 years agoMerge change 6800
Android (Google) Code Review [Mon, 13 Jul 2009 14:30:38 +0000 (07:30 -0700)]
Merge change 6800

* changes:
  Remove races from JNI_OnLoad invocation.

15 years agoMinor class loading optimization.
Andy McFadden [Fri, 10 Jul 2009 23:15:23 +0000 (16:15 -0700)]
Minor class loading optimization.

In internal bug 1836311, the String.replace() in PathLoader.findClass
was identifed by traceview as 6.6% of startup time for an app.  This
adds a (hidden) alternative that takes a "binary name" like the
functions in ClassLoader, and we do the slash-to-dot conversion inside
the VM as we convert it to a descriptor.  (This is really how it should
have been done in the first place, but now it's part of the visible API
and engraved in stone.)

The original function now does a slash-to-dot conversion and calls the
new one.

(We may want to un-hide the method for the benefit of people writing
custom class loaders.  If so, we can do that in a separate API-update
commit.)

15 years agoRemove races from JNI_OnLoad invocation.
Andy McFadden [Fri, 10 Jul 2009 00:01:04 +0000 (17:01 -0700)]
Remove races from JNI_OnLoad invocation.

The current implementation just calls JNI_OnLoad and returns a failure
result if that goes badly.  If a second load attempt is made after
dlopen() finishes but before JNI_OnLoad completes, it will succeed
immediately.

This is bad because (a) we might not have finished the initialization
steps in JNI_OnLoad, and (b) it's possible JNI_OnLoad will fail.  We now
wait for an in-progress JNI_OnLoad to complete before returning.  (This
also requires recognizing and handling recursive invocation.)

15 years agoInline-execute for Java.Lang.Math routines, jit codegen restructure, various bug...
Bill Buzbee [Wed, 8 Jul 2009 20:08:04 +0000 (13:08 -0700)]
Inline-execute for Java.Lang.Math routines, jit codegen restructure, various bug fixes.

15 years agoMerge change 4613
Android (Google) Code Review [Fri, 10 Jul 2009 12:00:30 +0000 (05:00 -0700)]
Merge change 4613

* changes:
  Performance improvement for OpenSSLSocketImpl in read and write

15 years agoam 3bef2909: Merge change 4595 into donut
Android (Google) Code Review [Fri, 10 Jul 2009 10:38:42 +0000 (03:38 -0700)]
am 3bef2909: Merge change 4595 into donut

Merge commit '3bef2909f1f0e8ea57e9934494b0ff8b7ecd8656'

* commit '3bef2909f1f0e8ea57e9934494b0ff8b7ecd8656':
  Reactivating test that failed with a extensive gref count increase

15 years agoMerge change 4595 into donut
Android (Google) Code Review [Fri, 10 Jul 2009 10:36:41 +0000 (03:36 -0700)]
Merge change 4595 into donut

* changes:
  Reactivating test that failed with a extensive gref count increase

15 years agoImproved method invocation performance: 1.5x for virtual and 2.8x for interface.
Ben Cheng [Tue, 7 Jul 2009 21:19:20 +0000 (14:19 -0700)]
Improved method invocation performance: 1.5x for virtual and 2.8x for interface.

- Implemented predicted chaining for invoke virtual and interface.
- Eliminated a little bit of fat for invoke native.
- Added 078-polymorphic-virtual for stress tests.

15 years agoMerge commit '3102d523c787402faf4590c7e25cef8c3e20afa4' into merge_korg_master
Jean-Baptiste Queru [Mon, 6 Jul 2009 23:44:44 +0000 (16:44 -0700)]
Merge commit '3102d523c787402faf4590c7e25cef8c3e20afa4' into merge_korg_master

Conflicts:
vm/Android.mk

15 years agoMerge commit 'c1b54205471ea7824c87e53e0d9e6d4c30518007' into merge_korg_master
Jean-Baptiste Queru [Mon, 6 Jul 2009 23:12:31 +0000 (16:12 -0700)]
Merge commit 'c1b54205471ea7824c87e53e0d9e6d4c30518007' into merge_korg_master

15 years agoMerge branch 'master' of ssh://android-git:29418/platform/dalvik into merge_korg_master
Jean-Baptiste Queru [Mon, 6 Jul 2009 23:03:27 +0000 (16:03 -0700)]
Merge branch 'master' of ssh://android-git:29418/platform/dalvik into merge_korg_master

15 years agoMerge commit 'ca807d6e5d828787e06588af109941cfbbbffef7' into merge_korg_master
Jean-Baptiste Queru [Mon, 6 Jul 2009 22:29:04 +0000 (15:29 -0700)]
Merge commit 'ca807d6e5d828787e06588af109941cfbbbffef7' into merge_korg_master

Conflicts:
docs/porting-guide.html

15 years agoMerge commit 'eab2645a76fa91a73d77dc25c3df2be4108ca843' into merge_korg_master
Jean-Baptiste Queru [Mon, 6 Jul 2009 22:28:37 +0000 (15:28 -0700)]
Merge commit 'eab2645a76fa91a73d77dc25c3df2be4108ca843' into merge_korg_master

15 years agoMerge commit '7501cdb16d99ee9f1340d0e5e81c21e22084a8f3' into merge_korg_master
Jean-Baptiste Queru [Mon, 6 Jul 2009 22:28:18 +0000 (15:28 -0700)]
Merge commit '7501cdb16d99ee9f1340d0e5e81c21e22084a8f3' into merge_korg_master

15 years agoMerge commit '748191eb80feda199a8fb2990221e3140a97005f' into merge_korg_master
Jean-Baptiste Queru [Mon, 6 Jul 2009 22:27:51 +0000 (15:27 -0700)]
Merge commit '748191eb80feda199a8fb2990221e3140a97005f' into merge_korg_master

15 years agoMerge commit '9b0e83401b0ade80e1943c2cc16ef5ec9b46eef5' into merge_korg_master
Jean-Baptiste Queru [Mon, 6 Jul 2009 22:27:37 +0000 (15:27 -0700)]
Merge commit '9b0e83401b0ade80e1943c2cc16ef5ec9b46eef5' into merge_korg_master

Conflicts:
vm/oo/Class.c
vm/oo/Object.h

15 years agoMerge commit '9974ec51bb9db86c370b2fbcd251f20865a4cd1d' into merge_korg_master
Jean-Baptiste Queru [Mon, 6 Jul 2009 22:26:10 +0000 (15:26 -0700)]
Merge commit '9974ec51bb9db86c370b2fbcd251f20865a4cd1d' into merge_korg_master

15 years agoMerge change 6268
Android (Google) Code Review [Mon, 6 Jul 2009 21:00:32 +0000 (14:00 -0700)]
Merge change 6268

* changes:
  Update notes on JDWP debugger support.

15 years agoUpdate notes on JDWP debugger support.
Andy McFadden [Mon, 6 Jul 2009 20:56:24 +0000 (13:56 -0700)]
Update notes on JDWP debugger support.

In particular:

 - The app framework uses ro.debuggable, not ro.secure, to decide
   whether or not debuggers are globally allowed.
 - If you have a debugger attached, Thread objects may not be collected.

15 years agoMerge change 6122
Android (Google) Code Review [Mon, 6 Jul 2009 20:42:35 +0000 (13:42 -0700)]
Merge change 6122

* changes:
  Add mterp stub collection to aid porting.

15 years agoAdd mterp stub collection to aid porting.
Andy McFadden [Thu, 2 Jul 2009 20:53:09 +0000 (13:53 -0700)]
Add mterp stub collection to aid porting.

For some of the more complex Dalvik operations it can be handy to see
what gcc outputs in similar circumstances.  This adds a file filled with
"trivial" operations to the Dalvik porting documentation.

15 years agoam ec537042: Merge change 6098 into donut
Android (Google) Code Review [Mon, 6 Jul 2009 18:02:44 +0000 (11:02 -0700)]
am ec537042: Merge change 6098 into donut

Merge commit 'ec537042338c000af4526099599e128be63bee68'

* commit 'ec537042338c000af4526099599e128be63bee68':
  Commented out invalid test.

15 years agoam ab4b7f70: Merge change 5967 into donut
Android (Google) Code Review [Mon, 6 Jul 2009 16:12:44 +0000 (09:12 -0700)]
am ab4b7f70: Merge change 5967 into donut

Merge commit 'ab4b7f704313075838517ffec400dc5b6250c67c'

* commit 'ab4b7f704313075838517ffec400dc5b6250c67c':
  Modifies OpenSSLSocketImpl to use a different lock for the instance count. It was using the same lock when use around native methods meaning that the finalizer could be blocked unnecessarily

15 years agoMerge commit 'a8e9edde' into manualmerge
Andy McFadden [Mon, 6 Jul 2009 16:09:47 +0000 (09:09 -0700)]
Merge commit 'a8e9edde' into manualmerge

15 years agoMerge commit 'e260e580' into manualmerge
Andy McFadden [Mon, 6 Jul 2009 14:34:06 +0000 (07:34 -0700)]
Merge commit 'e260e580' into manualmerge

15 years agoam 4ce12e65: Fixes deadlock in Runtime.exec(). We can\'t malloc() or free() after...
crazybob [Thu, 2 Jul 2009 22:23:24 +0000 (15:23 -0700)]
am 4ce12e65: Fixes deadlock in Runtime.exec(). We can\'t malloc() or free() after fork() because the heap lock may be held by a thread that is no longer running.

Merge commit '4ce12e65bb5fb7cb0eaa131e8b5c0b740e8e359e'

* commit '4ce12e65bb5fb7cb0eaa131e8b5c0b740e8e359e':
  Fixes deadlock in Runtime.exec(). We can't malloc() or free() after fork() because the heap lock may be held by a thread that is no longer running.

15 years agoMerge change 6098 into donut
Android (Google) Code Review [Thu, 2 Jul 2009 18:42:32 +0000 (11:42 -0700)]
Merge change 6098 into donut

* changes:
  Commented out invalid test.

15 years agoCommented out invalid test.
crazybob [Thu, 2 Jul 2009 18:35:18 +0000 (13:35 -0500)]
Commented out invalid test.

15 years agoFix fill-array-data on big-endian systems.
Andy McFadden [Tue, 30 Jun 2009 23:14:30 +0000 (16:14 -0700)]
Fix fill-array-data on big-endian systems.

The array data comes out of the instruction stream, which is swapped as
if it were a stream of 16-bit code units.  This is great for char/short
array data, but comes out wrong for everything else.

This was verified by an external developer with big-endian MIPS hardware.
Should be no change for ARM.

15 years agoMerge change 5967 into donut
Android (Google) Code Review [Thu, 2 Jul 2009 17:17:51 +0000 (10:17 -0700)]
Merge change 5967 into donut

* changes:
  Modifies OpenSSLSocketImpl to use a different lock for the instance count. It was using the same lock when use around native methods meaning that the finalizer could be blocked unnecessarily resulting in a VM crash.

15 years agoMerge change 5991 into donut
Android (Google) Code Review [Thu, 2 Jul 2009 16:41:19 +0000 (09:41 -0700)]
Merge change 5991 into donut

* changes:
  Reduce VM aborts during high CPU stress.

15 years agoMerge change 5990 into donut
Android (Google) Code Review [Thu, 2 Jul 2009 16:41:09 +0000 (09:41 -0700)]
Merge change 5990 into donut

* changes:
  Pull 138592-p9 from master to donut.

15 years agoReduce VM aborts during high CPU stress.
Andy McFadden [Wed, 17 Jun 2009 23:29:30 +0000 (16:29 -0700)]
Reduce VM aborts during high CPU stress.

(This was cherry-picked from master 2aa43610 for internal bug 1952616.)

The VM has some timeouts that are meant to kill the current process if
something gets stuck (e.g. a thread grabs a lock and then manages to die
while the rest of the process continues on).  These were tripping a
little too easily during some high-load situations.

This changes the order of operations so that we now unlock the "thread
suspend" lock before sending a wakeup broadcast to the condition variable
that threads sleep on.  This should make it less likely for a thread to
be running for an extended period while the lock is held.  (Relates to
internal bug 1664687.)

This also wraps a couple of things (pthread_create, dlopen) with a state
change to VMWAIT.  During high load situations these can take a while to
complete, and we would (with the K-Means Visualizer load generator
running) very occasionally time out.

Augmented the debug output in a couple of minor ways.  Updated comments.

15 years agoPull 138592-p9 from master to donut.
Andy McFadden [Wed, 1 Jul 2009 21:52:13 +0000 (14:52 -0700)]
Pull 138592-p9 from master to donut.

Switch from VMWAIT to RUNNING when executing code on behalf of the
debugger.  Reset the thread-suspend lock timeout if we have to suspend
while trying to acquire it.

Also, clear any pending exception before calling interpreted code.

Reworked some log messages to make them easier to decipher.

(For internal bug 1952616.)

15 years agoModifies OpenSSLSocketImpl to use a different lock for the instance count. It was...
crazybob [Wed, 1 Jul 2009 20:30:58 +0000 (15:30 -0500)]
Modifies OpenSSLSocketImpl to use a different lock for the instance count. It was using the same lock when use around native methods meaning that the finalizer could be blocked unnecessarily
resulting in a VM crash.

15 years agoFixes deadlock in Runtime.exec(). We can't malloc() or free() after fork() because...
crazybob [Thu, 18 Jun 2009 22:19:04 +0000 (17:19 -0500)]
Fixes deadlock in Runtime.exec(). We can't malloc() or free() after fork() because the heap lock may be held by a thread that is no longer running.

15 years agoInline some java.lang.Math functions.
Andy McFadden [Tue, 30 Jun 2009 00:04:04 +0000 (17:04 -0700)]
Inline some java.lang.Math functions.

For a first pass, I inlined the various flavors of abs(), min()/max() on
integers, sqrt(), cos(), and sin().  These were selected based on a
static analysis of a few of our jar files.

A test of repeated sin/cos/sqrt calls on a G1-class device showed an
improvement of 28%.  This would improve more on devices with VFP
support if the VM is compiled with -mfpu=vfp.

Also: clarified a warning and removed some "#if 0" stuff.

15 years agoam 3e371e2e: dalvik: thread: Set the control group of a thread to the background...
San Mehat [Mon, 29 Jun 2009 23:36:32 +0000 (16:36 -0700)]
am 3e371e2e: dalvik: thread: Set the control group of a thread to the background group if the priority is logically-lower than ANDROID_PRIORITY_BACKGROUND

Merge commit '3e371e2ebbeeefe176ba1357e6ff241bd13a711e'

* commit '3e371e2ebbeeefe176ba1357e6ff241bd13a711e':
  dalvik: thread: Set the control group of a thread to the background group

15 years agodalvik: thread: Set the control group of a thread to the background group
San Mehat [Fri, 26 Jun 2009 15:36:16 +0000 (08:36 -0700)]
dalvik: thread: Set the control group of a thread to the background group
if the priority is logically-lower than ANDROID_PRIORITY_BACKGROUND

Signed-off-by: San Mehat <san@google.com>
15 years agoMerge change 5440
Android (Google) Code Review [Fri, 26 Jun 2009 14:24:45 +0000 (07:24 -0700)]
Merge change 5440

* changes:
  "External allocation" tracking for direct buffers.

15 years ago"External allocation" tracking for direct buffers.
Andy McFadden [Thu, 4 Jun 2009 21:34:14 +0000 (14:34 -0700)]
"External allocation" tracking for direct buffers.

The native memory allocated for ByteBuffer.allocateDirect was not being
tracked by the VM's "external allocation" mechanism.  This adds the
necessary calls to the Harmony OSMemory allocator, which is what
actually calls malloc().

The external alloc stuff just takes size values, so we tuck a copy of
the allocation size into the allocated block, and pull it out when it's
time to free the memory.

(Includes in a couple of other changes that I had to commit somewhere so
I could sync.)

15 years agoMerge change 5292
Android (Google) Code Review [Thu, 25 Jun 2009 19:36:11 +0000 (12:36 -0700)]
Merge change 5292

* changes:
  Collect per-method code size statistics to show compiled vs overall Dalvik portion and total native code size.

15 years agoam 7d8220a4: Merge change 5286 into donut
Android (Google) Code Review [Thu, 25 Jun 2009 14:25:59 +0000 (07:25 -0700)]
am 7d8220a4: Merge change 5286 into donut

Merge commit '7d8220a4d0193b85efd7d289cbff3617f56ef0a9'

* commit '7d8220a4d0193b85efd7d289cbff3617f56ef0a9':
  Check for failure in GetDirectBufferAddress.

15 years agoMerge change 5286 into donut
Android (Google) Code Review [Thu, 25 Jun 2009 14:23:43 +0000 (07:23 -0700)]
Merge change 5286 into donut

* changes:
  Check for failure in GetDirectBufferAddress.

15 years agoCollect per-method code size statistics to show compiled vs overall Dalvik portion...
Ben Cheng [Thu, 25 Jun 2009 00:27:07 +0000 (17:27 -0700)]
Collect per-method code size statistics to show compiled vs overall Dalvik portion and total native code size.

15 years agoCheck for failure in GetDirectBufferAddress.
Andy McFadden [Wed, 24 Jun 2009 23:56:06 +0000 (16:56 -0700)]
Check for failure in GetDirectBufferAddress.

We now check for a null result or a pending exception in the JNI
GetDirectBufferAddress function.  This prevents a VM crash when somebody
tries to get the address of a non-direct buffer.

For internal bug 1926596.

15 years agoam 0f0ae023: Add FileDescriptor variation of startMethodTracing().
Dianne Hackborn [Wed, 24 Jun 2009 23:19:10 +0000 (16:19 -0700)]
am 0f0ae023: Add FileDescriptor variation of startMethodTracing().

Merge commit '0f0ae023a3a53f7c9e254283b50a0099781acb79'

* commit '0f0ae023a3a53f7c9e254283b50a0099781acb79':
  Add FileDescriptor variation of startMethodTracing().

15 years agoAdd FileDescriptor variation of startMethodTracing().
Dianne Hackborn [Wed, 24 Jun 2009 02:21:10 +0000 (19:21 -0700)]
Add FileDescriptor variation of startMethodTracing().

This is for bug #1829561 ("am profile" with bad filename kills process), which
will allow the am command to take care of opening the file and handing the
resulting fd over to the process to be profiled.

15 years agoam cda8f8ab: Merge 137552-p9 to donut.
Andy McFadden [Wed, 24 Jun 2009 20:53:34 +0000 (13:53 -0700)]
am cda8f8ab: Merge 137552-p9 to donut.

Merge commit 'cda8f8abd1d02f5ab58add1ebb23f20fdab6341c'

* commit 'cda8f8abd1d02f5ab58add1ebb23f20fdab6341c':
  Merge 137552-p9 to donut.

15 years agoMerge 137552-p9 to donut.
Andy McFadden [Tue, 23 Jun 2009 23:27:45 +0000 (16:27 -0700)]
Merge 137552-p9 to donut.

Since we're apparently using these calls now, we probably ought to pull
the bug fix over.  It's been in master for more than 3 months so it
should be safe.  It'll also make future merges easier.

Prequel to fix for internal bug #1926596.

15 years agoShutdown the compiler thread before the dvmSlayDaemons call is made.
Ben Cheng [Tue, 23 Jun 2009 05:53:35 +0000 (22:53 -0700)]
Shutdown the compiler thread before the dvmSlayDaemons call is made.

15 years agoadded/modified to support SuperH architecture
Shin-ichiro KAWASAKI [Tue, 23 Jun 2009 05:00:12 +0000 (14:00 +0900)]
added/modified to support SuperH architecture

modified:   README.txt
modified:   vm/Android.mk
new file:   vm/arch/sh/CallSH4ABI.S

15 years agoThe address of dvmMterpCommonExceptionThrown should be loaded in a position-independe...
Ben Cheng [Mon, 22 Jun 2009 21:45:16 +0000 (14:45 -0700)]
The address of dvmMterpCommonExceptionThrown should be loaded in a position-independent way since these handlers are copied into the code cache.

BTW fixed a couple recently introduced compiler warnings in Codegen.c.

15 years agoNew threshold mechanism for trace selections. Intended to reduce number of junk...
Bill Buzbee [Fri, 19 Jun 2009 23:02:27 +0000 (16:02 -0700)]
New threshold mechanism for trace selections.  Intended to reduce number of junk traces.

15 years agoMerge change 4935
Android (Google) Code Review [Mon, 22 Jun 2009 18:21:12 +0000 (11:21 -0700)]
Merge change 4935

* changes:
  Instance_of should return false if reference is NULL.

15 years agoInstance_of should return false if reference is NULL.
Ben Cheng [Mon, 22 Jun 2009 17:50:07 +0000 (10:50 -0700)]
Instance_of should return false if reference is NULL.

15 years agoUse paired immediates for large constants.
Andy McFadden [Fri, 19 Jun 2009 23:52:19 +0000 (16:52 -0700)]
Use paired immediates for large constants.

The double-to-int and double-to-long instructions were loading constants
from .word directives, which wastes space in the CPU data cache.  This
replaces a single LDR with a pair of data operations.

We don't actually use the double-to-long handler (the ARM EABI lib
does the right thing), and double-to-int is handled by VFP on newer
devices, but on older devices this may help a smidgeon.  Mostly it just
looks nicer when you don't have .words lying around.

Also picks up a change that should be in the armv7-a generated file but
got lost in all of today's various mergings (float compare tweak).

15 years agoAdded ARMv6T2 experiment.
Andy McFadden [Fri, 19 Jun 2009 22:20:12 +0000 (15:20 -0700)]
Added ARMv6T2 experiment.

These adds replacements for handlers that benefit from the use of new
instructions introduced in ARMv6T2 (notably UBFX, unsigned bit-field
extraction).  This also adds an "armv7-a" mterp config file.

The benchmark improvement was tiny, so there's no real motivation to
convince the build system to use them.

This also includes an interleave fix for binop2addr.

15 years agoMerge change 4809
Android (Google) Code Review [Fri, 19 Jun 2009 21:18:35 +0000 (14:18 -0700)]
Merge change 4809

* changes:
  Warn when one handler replaces another.

15 years agoMerge change 4798
Android (Google) Code Review [Fri, 19 Jun 2009 21:06:54 +0000 (14:06 -0700)]
Merge change 4798

* changes:
  Replace an iterator with a traditional for loop, to reduce object allocations and memory usage.

15 years agoWarn when one handler replaces another.
Andy McFadden [Fri, 19 Jun 2009 20:19:01 +0000 (13:19 -0700)]
Warn when one handler replaces another.

The mterp generation script silently allows you to specify handlers for
the same opcode more than once.  This can cause some confusion.  We now
issue a warning when that happens.

This also reduces the overall verbosity level, so the warnings are
visible.

15 years agoReplace an iterator with a traditional for loop, to reduce object allocations and...
Marco Nelissen [Fri, 19 Jun 2009 19:44:08 +0000 (12:44 -0700)]
Replace an iterator with a traditional for loop, to reduce object allocations and memory usage.

15 years agoImprove interleave on VFP compare.
Andy McFadden [Fri, 19 Jun 2009 17:00:14 +0000 (10:00 -0700)]
Improve interleave on VFP compare.

Improves FloatOps/FloatOpsD from 229/230ns to 228/229ns, an exciting
half-percentage-point gain.

15 years agoMerge change 4695
Android (Google) Code Review [Fri, 19 Jun 2009 14:25:04 +0000 (07:25 -0700)]
Merge change 4695

* changes:
  Quick experiment with ARMv6 instructions.

15 years agoQuick experiment with ARMv6 instructions.
Andy McFadden [Thu, 18 Jun 2009 23:37:34 +0000 (16:37 -0700)]
Quick experiment with ARMv6 instructions.

This is a commented-out experiment with ARMv6 instructions, which our
existing products support.  (We can't use these unless we want to define
an ARMv6 target.  For what we gain with these, it's not worthwhile.)

15 years agoNeglected to rebuild template/out/* and mterp/out* in #4536
Bill Buzbee [Thu, 18 Jun 2009 23:01:22 +0000 (16:01 -0700)]
Neglected to rebuild template/out/* and mterp/out* in #4536

15 years agoMerge change 4658
Android (Google) Code Review [Thu, 18 Jun 2009 21:50:18 +0000 (14:50 -0700)]
Merge change 4658

* changes:
  Bump the VM version.

15 years agoMerge change 4657
Android (Google) Code Review [Thu, 18 Jun 2009 21:36:37 +0000 (14:36 -0700)]
Merge change 4657

* changes:
  Method override tests.

15 years agoBump the VM version.
Andy McFadden [Thu, 18 Jun 2009 21:22:22 +0000 (14:22 -0700)]
Bump the VM version.

This should have been incremented when OP_THROW_VERIFICATION_ERROR was
added, since older VMs won't be able to handle the odex we generate.

Dropped the log level on the warning.

15 years agoMethod override tests.
Andy McFadden [Thu, 18 Jun 2009 21:15:23 +0000 (14:15 -0700)]
Method override tests.

Test various method overrides, especially those that the compiler
doesn't allow (public vs. private, static vs. virtual).  This doesn't
succeed right now because of the way the verifier deals with static and
virtual methods (internal bug 1752800).

15 years agoTrace profiling support for the jit
Bill Buzbee [Wed, 17 Jun 2009 23:56:19 +0000 (16:56 -0700)]
Trace profiling support for the jit

15 years agoModularize architecture selection.
Andy McFadden [Thu, 18 Jun 2009 18:03:12 +0000 (11:03 -0700)]
Modularize architecture selection.

"make" syntax lacks an "elif", so when you have an N-way choice the
indentation starts to get nasty.  This splits the arch/variant handling
into smaller pieces, and uses the "generic" arch if none of the pieces
matched.

15 years agoMerge change 4534
Android (Google) Code Review [Thu, 18 Jun 2009 17:31:48 +0000 (10:31 -0700)]
Merge change 4534

* changes:
  Reduce VM aborts during high CPU stress.

15 years agoPerformance improvement for OpenSSLSocketImpl in read and write
Urs Grob [Thu, 18 Jun 2009 16:15:51 +0000 (18:15 +0200)]
Performance improvement for OpenSSLSocketImpl in read and write

This change only calls SSL_get_error only in case of an error and not in any case as it does before the change.

BUG=1322058

15 years agoReactivating test that failed with a extensive gref count increase
Urs Grob [Thu, 18 Jun 2009 12:09:08 +0000 (14:09 +0200)]
Reactivating test that failed with a extensive gref count increase

The cause for this failure was fixed. So this test can be reactivated.
BUG=1814539

15 years agoMerge change 4495
Android (Google) Code Review [Thu, 18 Jun 2009 00:24:39 +0000 (17:24 -0700)]
Merge change 4495

* changes:
  Implemented peephole optimizations including null-check elimination, redundant ld/st elimination, ad-hoc register renaming and store sinking.

15 years agoReduce VM aborts during high CPU stress.
Andy McFadden [Wed, 17 Jun 2009 23:29:30 +0000 (16:29 -0700)]
Reduce VM aborts during high CPU stress.

The VM has some timeouts that are meant to kill the current process if
something gets stuck (e.g. a thread grabs a lock and then manages to die
while the rest of the process continues on).  These were tripping a
little too easily during some high-load situations.

This changes the order of operations so that we now unlock the "thread
suspend" lock before sending a wakeup broadcast to the condition variable
that threads sleep on.  This should make it less likely for a thread to
be running for an extended period while the lock is held.  (Relates to
internal bug 1664687.)

This also wraps a couple of things (pthread_create, dlopen) with a state
change to VMWAIT.  During high load situations these can take a while to
complete, and we would (with the K-Means Visualizer load generator
running) very occasionally time out.

Augmented the debug output in a couple of minor ways.  Updated comments.

15 years agoUse RFC3493-conformant IPv6 headers.
Lorenzo Colitti [Fri, 12 Jun 2009 02:35:46 +0000 (19:35 -0700)]
Use RFC3493-conformant IPv6 headers.

15 years agoImplemented peephole optimizations including null-check elimination, redundant ld...
Ben Cheng [Tue, 16 Jun 2009 23:11:47 +0000 (16:11 -0700)]
Implemented peephole optimizations including null-check elimination, redundant ld/st elimination, ad-hoc register renaming and store sinking.