OSDN Git Service

android-x86/dalvik.git
14 years agoReplace the scanObject routines with one derived from Verify.
Barry Hayes [Tue, 18 May 2010 16:48:37 +0000 (09:48 -0700)]
Replace the scanObject routines with one derived from Verify.
It seems to be slightly faster this way, as well as more readable.

Change-Id: I92b9c54289c484cb4606f054f258da4a4bef8658

14 years agoMerge "Check the number of slots in the Class.java definition against the number...
Barry Hayes [Tue, 25 May 2010 20:28:35 +0000 (13:28 -0700)]
Merge "Check the number of slots in the Class.java definition against the number assumed by the VM, and abort if the Class has too many." into dalvik-dev

14 years agoMerge "Fix dalvik/tests/062-character-encodings." into dalvik-dev
Elliott Hughes [Tue, 25 May 2010 00:30:41 +0000 (17:30 -0700)]
Merge "Fix dalvik/tests/062-character-encodings." into dalvik-dev

14 years agoCheck the number of slots in the Class.java definition against the number assumed...
Barry Hayes [Mon, 24 May 2010 19:13:30 +0000 (12:13 -0700)]
Check the number of slots in the Class.java definition against the number assumed by the VM, and abort if the Class has too many.

Change-Id: Ibcf4539ab98639c1c92e5d910c38ee1feb9c8c43

14 years agoTimeout the finalizer throw test if no finalization occurs.
Carl Shapiro [Mon, 24 May 2010 18:21:12 +0000 (11:21 -0700)]
Timeout the finalizer throw test if no finalization occurs.

This test will never complete if the objects intended for finalization
are not ready to be collected.  This condition occurs with the copying
collector.  Adding the timeout forces the test to fail and allows the
test suite to make forward progress.

Change-Id: I2abb0a2530755dd32a14ecf94b24a546fd1327a9

14 years agoFix dalvik/tests/062-character-encodings.
Elliott Hughes [Mon, 24 May 2010 17:59:11 +0000 (10:59 -0700)]
Fix dalvik/tests/062-character-encodings.

The dalvik charset test should just check that the standard charsets are
available, as guaranteed by the java.nio.charset.Charset documentation.

Bug: 2709552
Change-Id: I7d2b6210936f01736034222ce26cdf81c47ef984

14 years agoRemove unused labels, variables, and functions. Enable warnings.
Carl Shapiro [Fri, 21 May 2010 05:54:18 +0000 (22:54 -0700)]
Remove unused labels, variables, and functions.  Enable warnings.

Change-Id: Icbe24eaf1ad499f28b68b6a5f05368271a0a7e86

14 years agoMerge commit '720d1e962e248a30f81c1493081ff4c01e35c839' into mm
Brian Carlstrom [Fri, 21 May 2010 22:10:31 +0000 (15:10 -0700)]
Merge commit '720d1e962e248a30f81c1493081ff4c01e35c839' into mm

Conflicts:
libcore/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp

Change-Id: I765343d83fe9bd6610f630790fbbf034467834d1

14 years agoresolved conflicts for merge of fc0dcfa2 to dalvik-dev
Andy McFadden [Fri, 21 May 2010 19:22:30 +0000 (12:22 -0700)]
resolved conflicts for merge of fc0dcfa2 to dalvik-dev

Change-Id: I54a5b9996252a22e8dd0214f4a4ccc8914f876ea

14 years agoam f00de1ba: am 6a877083: Atomic/SMP update.
Andy McFadden [Fri, 21 May 2010 19:08:06 +0000 (12:08 -0700)]
am f00de1ba: am 6a877083: Atomic/SMP update.

14 years agoam 6a877083: Atomic/SMP update.
Andy McFadden [Fri, 21 May 2010 19:06:30 +0000 (12:06 -0700)]
am 6a877083: Atomic/SMP update.

14 years agoMerge "Improvements to setThreadSelf use." into dalvik-dev
Barry Hayes [Fri, 21 May 2010 15:44:42 +0000 (08:44 -0700)]
Merge "Improvements to setThreadSelf use." into dalvik-dev

14 years agoAtomic/SMP update.
Andy McFadden [Thu, 20 May 2010 05:36:33 +0000 (22:36 -0700)]
Atomic/SMP update.

Moved quasiatomic 64-bit operations in here.  They still need work.

Use the new libcutils atomic-inline header for our memory barriers.
Adjust makefiles to set SMP definition appropriately.

Change-Id: Id2ab2123724bb0baeb32f862b5568392aba35a59

14 years agoVerifiy threads, stacks, and heap worker structures.
Carl Shapiro [Thu, 20 May 2010 22:43:30 +0000 (15:43 -0700)]
Verifiy threads, stacks, and heap worker structures.

Change-Id: I33caecfc53c8399b023675b5559be8a4b0696b97

14 years agoRemove unused local variables and local functions.
Carl Shapiro [Thu, 20 May 2010 21:59:44 +0000 (14:59 -0700)]
Remove unused local variables and local functions.

Change-Id: Iacb14a83f59ac20ef5e0616acbf0c6f683b947d5

14 years agoProperly implement conservative scanning.
Carl Shapiro [Thu, 20 May 2010 00:38:33 +0000 (17:38 -0700)]
Properly implement conservative scanning.

Even when precise GC is enabled the register map may be unavailable
and registers must be treated as ambiguous roots.  We now pin these
roots, along with native arguments, just prior to scavenging.

Change-Id: Ifbd799a34385a87960af28174128e2220e599c73

14 years agoImprovements to setThreadSelf use.
Barry Hayes [Tue, 20 Apr 2010 16:03:15 +0000 (09:03 -0700)]
Improvements to setThreadSelf use.

Made all calls to assignThreadId and prepareThread aquire
threadListLock, even in initialization, where it previously relied on
being single-threaded.

Change-Id: Ibffc454c4c6fd78efa6f22b955b955cd33998a4c

14 years agoInstead of aborting, just ignore tracked allocation calls.
Carl Shapiro [Tue, 18 May 2010 21:16:26 +0000 (14:16 -0700)]
Instead of aborting, just ignore tracked allocation calls.

This fixes a crash in the 070-nio-buffer dalvik test.

Change-Id: If58895498d573408ed69b6b580c16b9e75e9c291

14 years agoJIT: Fix for [Issue 2675245] FRF40 monkey crash in jit-cache
Bill Buzbee [Thu, 13 May 2010 20:02:53 +0000 (13:02 -0700)]
JIT: Fix for [Issue 2675245] FRF40 monkey crash in jit-cache

The JIT's chaining mechanism suffered from a narrow window that
could result in i-cache inconsistency.  One of the forms of chaining
cell consisted of a two 16-bit thumb instruction sequence.  If a thread were
interrupted between the execution of those two instructions *and*
another thread picked that moment to convert that cell's
chained/unchained state, then bad things happen.

This CL alters the chain/unchain model somewhat to avoid this case.
Chainable chaining cells grow by 4 bytes each, and instead of rewriting
a 32-bit cell to chain/unchain, we switch between chained and unchained
state by [re]writing the first 16-bits of the cell as either a 16-bit
Thumb unconditional branch (unchained mode) or the first half of a
32-bit Thumb branch. The 2nd 16-bits of the cell will never change once
the cell moves from its inital state - thus avoiding the possibility of it
becoming inconsistent.

This adds a trivial execution penalty on the slow path, but will add
about a kByte of memory usage to a typical process.

Change-Id: Id8b99802e11386cfbab23da6abae10e2d9fc4065

14 years agoDisable SSL Session Ticket extension for OpenSSLSocket
Brian Carlstrom [Thu, 13 May 2010 23:30:53 +0000 (16:30 -0700)]
Disable SSL Session Ticket extension for OpenSSLSocket

Due to compatability issues with some sites, disable this SSL extension which wasn't present in Eclair. See also:

    b/2682876 Some ssl sites cause "A secure connection could not be established" error

Change-Id: Ib42fb249eb0f8d645ae3f983c77cb278ca54f946

14 years agoMerge "Added a quick test." into dalvik-dev
Andy McFadden [Thu, 13 May 2010 21:26:03 +0000 (14:26 -0700)]
Merge "Added a quick test." into dalvik-dev

14 years agoAdded a quick test.
Andy McFadden [Thu, 13 May 2010 21:24:11 +0000 (14:24 -0700)]
Added a quick test.

Somebody on android-developers was having trouble with
Method.isAnnotationPresent().  This adds a pair of calls as a quick
sanity check.

Change-Id: I4907d7b1dbf9593be53c25149e1e6ec29cd4b222

14 years agoMerge "Add counters to track JIT inline cache hit rate and code cache patch counts...
Ben Cheng [Thu, 13 May 2010 21:17:07 +0000 (14:17 -0700)]
Merge "Add counters to track JIT inline cache hit rate and code cache patch counts." into dalvik-dev

14 years agoAdd counters to track JIT inline cache hit rate and code cache patch counts.
Ben Cheng [Thu, 13 May 2010 20:45:57 +0000 (13:45 -0700)]
Add counters to track JIT inline cache hit rate and code cache patch counts.

Also did some WITH_JIT_TUNING cleanup.

Change-Id: I8bb2d681a06b0f2af1f976a007326825a88cea38

14 years agoResolve a few errors with the new collector and the dalvik tests.
Carl Shapiro [Thu, 13 May 2010 06:11:37 +0000 (23:11 -0700)]
Resolve a few errors with the new collector and the dalvik tests.

* First, Scavenge class object instance fields.  This fixes a crash in
  the 067-preemptive-unpark test.

* Assert that allocations to back the transport of gray objects
  succeeds.  Fragmentation caused by pinning can cause a blow-up in
  the size of to-space.  Until we can perform emergency promotions
  this leads to more diagnosable test failures.

* Zero dvmHeapSweepUnmarkObjects's out parameters.  This silences some
  valgrind errors.

Change-Id: Iafbd915f2020418d584477b58c512b9ff4637213

14 years agoAdd a few global root verifiers to the common verification code.
Carl Shapiro [Wed, 12 May 2010 03:55:13 +0000 (20:55 -0700)]
Add a few global root verifiers to the common verification code.

Change-Id: I32427bc10b08b35e9be8851bfa9ef52408a07708

14 years agoPlug leak in class initialization.
Andy McFadden [Thu, 6 May 2010 20:39:07 +0000 (13:39 -0700)]
Plug leak in class initialization.

Don't add static fields and methods to the resolved-items table if the
defining class is still being initialized.  If we do, other threads can
then access those fields and methods without first performing an "is the
class initialized" test.

We will end up performing static field and method resolution more often
now than before.  On a Nexus One, zygote class preload time went from
2227ms to 2239ms (i.e. the performance difference is in the noise).

Bug 2655384.

(Re-applying this after the JIT fix.)

Change-Id: I14846865313730f705b819c5893456e342316e2e

14 years agoTwo fixes to referencing processing.
Carl Shapiro [Tue, 11 May 2010 20:46:29 +0000 (13:46 -0700)]
Two fixes to referencing processing.

First, ensure the transporter allocates from blocks on the scavenger
work queue.  Previously, the transporter could have objects allocated
in the free space of dequeued to-space blocks.  When this condition
occurs we unconditionally enqueue the block for re-scavenging.

Second, finish the implementation of large heap table scavenging and
add a verification routine for this root.

Change-Id: I5a9caf4b2824673a1f532c4e215c53f64a6a4627

14 years agoam 2725c3a4: am 7b30673d: am e54a4c58: am ff11012d: am f3377c64: Merge "Remove test...
Jesse Wilson [Tue, 11 May 2010 17:31:07 +0000 (10:31 -0700)]
am 2725c3a4: am 7b30673d: am e54a4c58: am ff11012d: am f3377c64: Merge "Remove test runner tool vogar from Froyo." into froyo

Merge commit '2725c3a4d7a33d2c8d9723079a7ec7522ceaf628' into dalvik-dev

* commit '2725c3a4d7a33d2c8d9723079a7ec7522ceaf628':
  Remove test runner tool vogar from Froyo.

14 years agoam 447fe997: am 9b0df189: am 46a56d05: am 677fead0: Merge commit \'264952afbf3986a2af...
android-build SharedAccount [Tue, 11 May 2010 17:29:34 +0000 (10:29 -0700)]
am 447fe997: am 9b0df189: am 46a56d05: am 677fead0: Merge commit \'264952afbf3986a2af4c2fa6b8daaed04f34fee8\' into froyo-plus-aosp

Merge commit '447fe9973744f685fdd83d14ba2103d2a3e13553' into dalvik-dev

* commit '447fe9973744f685fdd83d14ba2103d2a3e13553':
  b/2663512: "java.io.IOException: SSL shutdown failed.: Ok" shouldn't dump a stacktrace

14 years agoam 7b30673d: am e54a4c58: am ff11012d: am f3377c64: Merge "Remove test runner tool...
Jesse Wilson [Tue, 11 May 2010 17:28:00 +0000 (10:28 -0700)]
am 7b30673d: am e54a4c58: am ff11012d: am f3377c64: Merge "Remove test runner tool vogar from Froyo." into froyo

14 years agoam e54a4c58: am ff11012d: am f3377c64: Merge "Remove test runner tool vogar from...
Jesse Wilson [Tue, 11 May 2010 17:25:51 +0000 (10:25 -0700)]
am e54a4c58: am ff11012d: am f3377c64: Merge "Remove test runner tool vogar from Froyo." into froyo

14 years agoam 9b0df189: am 46a56d05: am 677fead0: Merge commit \'264952afbf3986a2af4c2fa6b8daaed...
android-build SharedAccount [Tue, 11 May 2010 17:24:17 +0000 (10:24 -0700)]
am 9b0df189: am 46a56d05: am 677fead0: Merge commit \'264952afbf3986a2af4c2fa6b8daaed04f34fee8\' into froyo-plus-aosp

14 years agoam ff11012d: am f3377c64: Merge "Remove test runner tool vogar from Froyo." into...
Jesse Wilson [Tue, 11 May 2010 17:23:30 +0000 (10:23 -0700)]
am ff11012d: am f3377c64: Merge "Remove test runner tool vogar from Froyo." into froyo

Merge commit 'ff11012d99f01ba9c0b9c66f7ae089df8d93f813' into kraken

* commit 'ff11012d99f01ba9c0b9c66f7ae089df8d93f813':
  Remove test runner tool vogar from Froyo.

14 years agoam 46a56d05: am 677fead0: Merge commit \'264952afbf3986a2af4c2fa6b8daaed04f34fee8...
android-build SharedAccount [Tue, 11 May 2010 17:23:09 +0000 (10:23 -0700)]
am 46a56d05: am 677fead0: Merge commit \'264952afbf3986a2af4c2fa6b8daaed04f34fee8\' into froyo-plus-aosp

14 years agoam 677fead0: Merge commit \'264952afbf3986a2af4c2fa6b8daaed04f34fee8\' into froyo...
android-build SharedAccount [Tue, 11 May 2010 17:22:04 +0000 (10:22 -0700)]
am 677fead0: Merge commit \'264952afbf3986a2af4c2fa6b8daaed04f34fee8\' into froyo-plus-aosp

Merge commit '677fead05d1df2457c1f9a92d193b809b91319c0' into kraken

* commit '677fead05d1df2457c1f9a92d193b809b91319c0':
  b/2663512: "java.io.IOException: SSL shutdown failed.: Ok" shouldn't dump a stacktrace

14 years agoam f3377c64: Merge "Remove test runner tool vogar from Froyo." into froyo
Jesse Wilson [Tue, 11 May 2010 17:18:31 +0000 (10:18 -0700)]
am f3377c64: Merge "Remove test runner tool vogar from Froyo." into froyo

Merge commit 'f3377c64212d5ebda0799d42659bde3e8f488b29' into froyo-plus-aosp

* commit 'f3377c64212d5ebda0799d42659bde3e8f488b29':
  Remove test runner tool vogar from Froyo.

14 years agoMerge commit '264952afbf3986a2af4c2fa6b8daaed04f34fee8' into froyo-plus-aosp
android-build SharedAccount [Tue, 11 May 2010 17:14:32 +0000 (10:14 -0700)]
Merge commit '264952afbf3986a2af4c2fa6b8daaed04f34fee8' into froyo-plus-aosp

14 years agoAdd the dummy CHECK_JIT and ABORT_JIT_TSELECT macros even when JIT is off.
Ben Cheng [Tue, 11 May 2010 06:24:02 +0000 (23:24 -0700)]
Add the dummy CHECK_JIT and ABORT_JIT_TSELECT macros even when JIT is off.

Change-Id: I5d9886dcb8359dd4336d83b2a2bddad383f5cc36

14 years agoMerge "Abandon a JIT trace if it contains static fields that are not fully initialize...
Ben Cheng [Tue, 11 May 2010 05:28:21 +0000 (22:28 -0700)]
Merge "Abandon a JIT trace if it contains static fields that are not fully initialized" into dalvik-dev

14 years agoCorrect and add additional LOGV statements.
Carl Shapiro [Tue, 11 May 2010 02:55:50 +0000 (19:55 -0700)]
Correct and add additional LOGV statements.

Change-Id: I28db8a3b4c0bb9eb25a075f46b89280c7f8f466c

14 years agoAbandon a JIT trace if it contains static fields that are not fully initialized
Ben Cheng [Fri, 7 May 2010 20:05:47 +0000 (13:05 -0700)]
Abandon a JIT trace if it contains static fields that are not fully initialized

Also turn some asserts into aborts to capture future contract changes between
the VM and the JIT.

Bug: 2655384
Change-Id: I8bb0226c7ae26fedf6b4ad25a1cd1aa7013b60d4

14 years agoMerge "Remove test runner tool vogar from Froyo." into froyo
Jesse Wilson [Mon, 10 May 2010 22:44:52 +0000 (15:44 -0700)]
Merge "Remove test runner tool vogar from Froyo." into froyo

14 years agoRemove test runner tool vogar from Froyo.
Jesse Wilson [Mon, 10 May 2010 21:39:20 +0000 (14:39 -0700)]
Remove test runner tool vogar from Froyo.

This tool has been open sourced independently and it will be quite
awkward for external contributors who attempt to use or contribute
to this dead copy. This code is test only and not used by the
production runtime.
http://code.google.com/p/vogar/

Change-Id: Ib53bdfdb600330e1a2f200b5747305fc527a78a6

14 years agoRationalize logging.
Carl Shapiro [Thu, 6 May 2010 22:35:27 +0000 (15:35 -0700)]
Rationalize logging.

Replacing stray uses of LOGI them with macros specific to functional
aspects of the collector.  Replace (void *) cast for with (void) cast
in the expansion of unused macros.  While these are both no-ops, the
latter cast does not emit a warning message.  Lastly, eliminate some
logging statements I never found useful.  More logging statements need
to be culled.

Change-Id: Id5603c3a816c016a91e00e296ff5c16dddfe7e1a

14 years agoMerge "Implement reference processing for the copying collector." into dalvik-dev
Carl Shapiro [Fri, 7 May 2010 21:13:02 +0000 (14:13 -0700)]
Merge "Implement reference processing for the copying collector." into dalvik-dev

14 years agoImplement reference processing for the copying collector.
Carl Shapiro [Thu, 6 May 2010 21:35:29 +0000 (14:35 -0700)]
Implement reference processing for the copying collector.

When scavenging a reference object the scavenging of the referent
field is now deferred until after hard-reachable objects have been
scavenged.  The reference processing routines were lifted from the
mark and sweep collector.  The interface routines are still stubbed
out and reference processing occurs in the top-level scavenging
routine.

The use of subclasses of Object has been rationalized as part of this
change.  In various places what are logically down-casts have been
eliminated.  This caused lots of uneccesary casting.  One day this
code should just be written in a more expressive language.

Change-Id: I937f494e8be42bd66357e301f7158eeaa4f69c10

14 years agoRemove the HeapBitmap List routines.
Barry Hayes [Fri, 7 May 2010 16:19:46 +0000 (09:19 -0700)]
Remove the HeapBitmap List routines.

Change-Id: Ic518798ba8574534746ada9e8757948ae2e1bab9

14 years agob/2663512: "java.io.IOException: SSL shutdown failed.: Ok" shouldn't dump a stacktrace
Brian Carlstrom [Fri, 7 May 2010 16:58:15 +0000 (09:58 -0700)]
b/2663512: "java.io.IOException: SSL shutdown failed.: Ok" shouldn't dump a stacktrace

Gutted OpenSSLSocketImpl finalizer. The comment from the code
(excepted below) explains in detail the trouble of having the
finalizer do anything more than touch its the instances own state due
to unpredictable order of finalization and the future possability of
parallel finalization.

        /*
         * Just worry about our own state. Notably we do not try and
         * close anything. The SocketImpl, either our own
         * PlainSocketImpl, or the Socket we are wrapping, will do
         * that. This might mean we do not properly SSL_shutdown, but
         * if you want to do that, properly close the socket yourself.
         *
         * The reason why we don't try to SSL_shutdown is that there
         * can be a race between finalizers where the PlainSocketImpl
         * finalizer runs first and closes the socket. However, in the
         * meanwhile, the underlying file descriptor could be reused
         * for another purpose. If we call SSL_shutdown after that, the
         * underlying socket BIOs still have the older file descriptor
         * and will write the close notify to some unsuspecting
         * reader.
         */

Tested extensively in mainline with existing tests.xnet.AllTests as
well as new javax.net.ssl tests. Sanity tested in froyo with
tests.xnet.AllTests and browser testing.

Change-Id: I85e0e086b43b2ad79304f2cf42721d09cc41a5f4

14 years agoam 030dc99b: am b463bd41: am 645689db: am 42b68d1a: am 818164b8: Revert "Plug leak...
Dan Egnor [Fri, 7 May 2010 04:21:18 +0000 (21:21 -0700)]
am 030dc99b: am b463bd41: am 645689db: am 42b68d1a: am 818164b8: Revert "Plug leak in class initialization."

Merge commit '030dc99b8ca387adb3377830d65eea76de3adacd' into dalvik-dev

* commit '030dc99b8ca387adb3377830d65eea76de3adacd':
  Revert "Plug leak in class initialization."

14 years agoam b463bd41: am 645689db: am 42b68d1a: am 818164b8: Revert "Plug leak in class initia...
Dan Egnor [Fri, 7 May 2010 04:15:59 +0000 (21:15 -0700)]
am b463bd41: am 645689db: am 42b68d1a: am 818164b8: Revert "Plug leak in class initialization."

14 years agoam 645689db: am 42b68d1a: am 818164b8: Revert "Plug leak in class initialization."
Dan Egnor [Fri, 7 May 2010 04:15:02 +0000 (21:15 -0700)]
am 645689db: am 42b68d1a: am 818164b8: Revert "Plug leak in class initialization."

14 years agoam 42b68d1a: am 818164b8: Revert "Plug leak in class initialization."
Dan Egnor [Fri, 7 May 2010 04:13:51 +0000 (21:13 -0700)]
am 42b68d1a: am 818164b8: Revert "Plug leak in class initialization."

Merge commit '42b68d1aef220145fc7c06ca469d2693e96e9801' into kraken

* commit '42b68d1aef220145fc7c06ca469d2693e96e9801':
  Revert "Plug leak in class initialization."

14 years agoam 818164b8: Revert "Plug leak in class initialization."
Dan Egnor [Fri, 7 May 2010 04:10:17 +0000 (21:10 -0700)]
am 818164b8: Revert "Plug leak in class initialization."

Merge commit '818164b87a9c08a938c371d8b47987a3af06d6f6' into froyo-plus-aosp

* commit '818164b87a9c08a938c371d8b47987a3af06d6f6':
  Revert "Plug leak in class initialization."

14 years agoRevert "Plug leak in class initialization."
Dan Egnor [Fri, 7 May 2010 03:56:14 +0000 (20:56 -0700)]
Revert "Plug leak in class initialization."

This reverts commit d07cf9d69dddeebb91386a88f7b6d2323cf125a9.
Bug: 2664424

Change-Id: I1a36469757f2f20fb29b3bcf04e2a23aa7b72dca

14 years agoam ac2a3585: am 206edb63: am 71c9526e: am 99632b11: manual merge from froyo
Jean-Baptiste Queru [Fri, 7 May 2010 00:13:06 +0000 (17:13 -0700)]
am ac2a3585: am 206edb63: am 71c9526e: am 99632b11: manual merge from froyo

Merge commit 'ac2a358546cf2b5bab43a39eb40549d31932c64d' into dalvik-dev

* commit 'ac2a358546cf2b5bab43a39eb40549d31932c64d':
  Plug leak in class initialization.

14 years agoam 551a96fb: am 0c0d3893: am 173de779: am b2520c7f: manual merge from froyo
Jean-Baptiste Queru [Fri, 7 May 2010 00:13:04 +0000 (17:13 -0700)]
am 551a96fb: am 0c0d3893: am 173de779: am b2520c7f: manual merge from froyo

Merge commit '551a96fbb09043734fe3622cdc49dc161486d79b' into dalvik-dev

* commit '551a96fbb09043734fe3622cdc49dc161486d79b':
  DO NOT MERGE: Rewrite the HTTP connection pool used by HttpURLConnection.

14 years agoam 206edb63: am 71c9526e: am 99632b11: manual merge from froyo
Jean-Baptiste Queru [Fri, 7 May 2010 00:09:49 +0000 (17:09 -0700)]
am 206edb63: am 71c9526e: am 99632b11: manual merge from froyo

14 years agoam 0c0d3893: am 173de779: am b2520c7f: manual merge from froyo
Jean-Baptiste Queru [Fri, 7 May 2010 00:09:47 +0000 (17:09 -0700)]
am 0c0d3893: am 173de779: am b2520c7f: manual merge from froyo

14 years agoam 71c9526e: am 99632b11: manual merge from froyo
Jean-Baptiste Queru [Thu, 6 May 2010 23:34:42 +0000 (16:34 -0700)]
am 71c9526e: am 99632b11: manual merge from froyo

14 years agoam 173de779: am b2520c7f: manual merge from froyo
Jean-Baptiste Queru [Thu, 6 May 2010 23:34:39 +0000 (16:34 -0700)]
am 173de779: am b2520c7f: manual merge from froyo

14 years agoam 99632b11: manual merge from froyo
Jean-Baptiste Queru [Thu, 6 May 2010 23:31:40 +0000 (16:31 -0700)]
am 99632b11: manual merge from froyo

Merge commit '99632b1107cfec56f07aa4941e770e5d449391b7' into kraken

* commit '99632b1107cfec56f07aa4941e770e5d449391b7':
  Plug leak in class initialization.

14 years agoam b2520c7f: manual merge from froyo
Jean-Baptiste Queru [Thu, 6 May 2010 23:31:38 +0000 (16:31 -0700)]
am b2520c7f: manual merge from froyo

Merge commit 'b2520c7f1348cfcb3fa9c2e039140c1addb7688a' into kraken

* commit 'b2520c7f1348cfcb3fa9c2e039140c1addb7688a':
  DO NOT MERGE: Rewrite the HTTP connection pool used by HttpURLConnection.

14 years agomanual merge from froyo
Jean-Baptiste Queru [Thu, 6 May 2010 23:20:19 +0000 (16:20 -0700)]
manual merge from froyo

Change-Id: Ied6d44cd7a54a62e4613b026b8ca9451630f63e1

14 years agomanual merge from froyo
Jean-Baptiste Queru [Thu, 6 May 2010 23:20:06 +0000 (16:20 -0700)]
manual merge from froyo

Change-Id: I0f7ff92c18a3d047047fd8aca04e0bda4a8c97b9

14 years agoam 60751517: (-s ours) am d6bec833: am 80a4e249: Dalvik Zip rewrite.
Andy McFadden [Thu, 6 May 2010 22:41:28 +0000 (15:41 -0700)]
am 60751517: (-s ours) am d6bec833: am 80a4e249: Dalvik Zip rewrite.

Merge commit '60751517acb65abf5a4f5cede844d8932dea9542' into dalvik-dev

* commit '60751517acb65abf5a4f5cede844d8932dea9542':
  Dalvik Zip rewrite.

14 years agoam d6bec833: am 80a4e249: Dalvik Zip rewrite.
Andy McFadden [Thu, 6 May 2010 22:33:01 +0000 (15:33 -0700)]
am d6bec833: am 80a4e249: Dalvik Zip rewrite.

14 years agoPlug leak in class initialization.
Andy McFadden [Thu, 6 May 2010 20:39:07 +0000 (13:39 -0700)]
Plug leak in class initialization.

Don't add static fields and methods to the resolved-items table if the
defining class is still being initialized.  If we do, other threads can
then access those fields and methods without first performing an "is the
class initialized" test.

We will end up performing static field and method resolution more often
now than before.  On a Nexus One, zygote class preload time went from
2227ms to 2239ms (i.e. the performance difference is in the noise).

Bug 2655384.

Change-Id: Ib0c285ef23d58ae709be65f09efb68e73f982084

14 years agoam 80a4e249: Dalvik Zip rewrite.
Andy McFadden [Thu, 6 May 2010 22:07:48 +0000 (15:07 -0700)]
am 80a4e249: Dalvik Zip rewrite.

14 years agoDalvik Zip rewrite.
Andy McFadden [Fri, 23 Apr 2010 23:34:52 +0000 (16:34 -0700)]
Dalvik Zip rewrite.

Change the way zip archives are handled.  This is necessary to deal with
very large (~1GB) APK files, for which our current approach of mapping
the entire file falls over.

We now do the classic scavenger hunt for the End Of Central Directory magic
on a buffer of data read from the file, instead of a memory-mapped section.
We use what we find to create a map that covers the Central Directory only.
For most uses in the VM this is all we really need, since we just want
to check file attributes vs. the optimized DEX to see if we're out of date.

If the caller is interested in unpacking the file contents, we have to
do an additional file read to discover the size of the Local File Header
section so we can skip past it.  We also now do a file-to-file extraction
using read() calls instead of a buffer-to-file extraction on mmap()ed data.
No difference in performance (as measured by first-boot dexopt).

Since this is more of a rewrite than an update, I also took the opportunity
to change buffer size variables from "long" to "size_t", and normalized
return values to int (some were using bool, which is common in the VM but
was mixed in the zip code).  Failure messages are now all LOGW with the
word "Zip" up front (didn't want to change log tag away from "dalvikvm").

Also, removed a not-quite-right check in the "map part of a file" code,
and clarified that the file offset is absolute.

For bug 2620103.

Change-Id: I745fb15abb541376f467969ffe422222676f1e5f

14 years agoAdded a class initialization test.
Andy McFadden [Thu, 6 May 2010 00:09:15 +0000 (17:09 -0700)]
Added a class initialization test.

This tests for races during init, and correctness after an exception is
thrown partway through.

For bug 2655384.

Change-Id: I837ec435d1655e49b8b39f4129bd321857172870

14 years agoDO NOT MERGE: Rewrite the HTTP connection pool used by HttpURLConnection.
Jesse Wilson [Thu, 6 May 2010 17:54:21 +0000 (10:54 -0700)]
DO NOT MERGE: Rewrite the HTTP connection pool used by HttpURLConnection.

This started off as incremental changes, but it ended up going
far enough that it earned the "rewrite" badge.

System.getProperty() is not called for every HTTP connection.
This is slightly controversial, but the old code had to bend
over backwards to support dynamic pool changes, and it didn't
even support the case when the pool shrank but not to 0.

The new code doesn't do I/O within static synchronized blocks.
This should reduce contention described here: http://b/issue?id=2606547

Also: simpify implementation, prettier names, more focused doc.

Originally submitted to dalvik-dev.
  https://android-git.corp.google.com/g/49309

Change-Id: I815c3123838b29cd2d9b39346e5c2486e1f5a2d2

14 years agoam 6854a7fc: am faaab7ba: am f6cd559a: am c2c14690: am 4751c150: Fixing bulk reads...
Jesse Wilson [Wed, 5 May 2010 21:27:24 +0000 (14:27 -0700)]
am 6854a7fc: am faaab7ba: am f6cd559a: am c2c14690: am 4751c150: Fixing bulk reads in ByteArray.MyInputStream

Merge commit '6854a7fc047633b57e1d1962fd2a9ce439051aa1' into dalvik-dev

* commit '6854a7fc047633b57e1d1962fd2a9ce439051aa1':
  Fixing bulk reads in ByteArray.MyInputStream

14 years agoam faaab7ba: am f6cd559a: am c2c14690: am 4751c150: Fixing bulk reads in ByteArray...
Jesse Wilson [Wed, 5 May 2010 21:18:53 +0000 (14:18 -0700)]
am faaab7ba: am f6cd559a: am c2c14690: am 4751c150: Fixing bulk reads in ByteArray.MyInputStream

14 years agoam f6cd559a: am c2c14690: am 4751c150: Fixing bulk reads in ByteArray.MyInputStream
Jesse Wilson [Wed, 5 May 2010 21:17:36 +0000 (14:17 -0700)]
am f6cd559a: am c2c14690: am 4751c150: Fixing bulk reads in ByteArray.MyInputStream

14 years agoam c2c14690: am 4751c150: Fixing bulk reads in ByteArray.MyInputStream
Jesse Wilson [Wed, 5 May 2010 21:16:14 +0000 (14:16 -0700)]
am c2c14690: am 4751c150: Fixing bulk reads in ByteArray.MyInputStream

Merge commit 'c2c146902f6258c16612b05d4b281c8a60b59898' into kraken

* commit 'c2c146902f6258c16612b05d4b281c8a60b59898':
  Fixing bulk reads in ByteArray.MyInputStream

14 years agoam 4751c150: Fixing bulk reads in ByteArray.MyInputStream
Jesse Wilson [Wed, 5 May 2010 21:14:22 +0000 (14:14 -0700)]
am 4751c150: Fixing bulk reads in ByteArray.MyInputStream

Merge commit '4751c150542ec282f6c6d58984974edec6c0a045' into froyo-plus-aosp

* commit '4751c150542ec282f6c6d58984974edec6c0a045':
  Fixing bulk reads in ByteArray.MyInputStream

14 years agoMerge "The "partial GC" code should not copy immune bits when doing a full GC." into...
Barry Hayes [Wed, 5 May 2010 21:11:09 +0000 (14:11 -0700)]
Merge "The "partial GC" code should not copy immune bits when doing a full GC." into dalvik-dev

14 years agoFixing bulk reads in ByteArray.MyInputStream
Jesse Wilson [Mon, 3 May 2010 22:27:11 +0000 (15:27 -0700)]
Fixing bulk reads in ByteArray.MyInputStream

This has never worked properly, but it didn't matter until recently
because neither the JDK's nor early Dalvik's DataInputStream was
exercising it. But in 2.0, Dalvik's DataInputStream prefers bulk
reads, which exercises this code when run on-device.

http://code.google.com/p/android/issues/detail?id=8115

The problem was that System.arraycopy call didn't include the start
offset in the call.

14 years agoThe "partial GC" code should not copy immune bits when doing a full GC.
Barry Hayes [Tue, 4 May 2010 20:32:12 +0000 (13:32 -0700)]
The "partial GC" code should not copy immune bits when doing a full GC.

Change-Id: I09f032e9a1dda585bd2475fc6d6f93f3ef1fc036

14 years agoMerge "Write until we fall over." into dalvik-dev
Andy McFadden [Tue, 4 May 2010 23:20:08 +0000 (16:20 -0700)]
Merge "Write until we fall over." into dalvik-dev

14 years agoWrite until we fall over.
Andy McFadden [Tue, 4 May 2010 22:41:22 +0000 (15:41 -0700)]
Write until we fall over.

Implement enh's idea about repeating write() until it fails.  Use it
in the zip expander and dexopt, which have an above-average chance of
failing due to lack of disk space.

Replace a stray DEFAULT_PAGE_SIZE with SYSTEM_PAGE_SIZE.  Apparently I
missed that during the Great Page Size Unification.

Change-Id: Id173cb7669330deebe2f24ae23ece4009a90e3bd

14 years agoMerge "Fix the identity hash code getter." into dalvik-dev
Carl Shapiro [Tue, 4 May 2010 22:20:54 +0000 (15:20 -0700)]
Merge "Fix the identity hash code getter." into dalvik-dev

14 years agoPropertly pin native method arguments.
Carl Shapiro [Tue, 4 May 2010 17:44:47 +0000 (10:44 -0700)]
Propertly pin native method arguments.

All objects that must be pinned during a collection must be discovered
before the scanning phase.  This ensures that the collector will not
relocate an object only to discover that its address cannot change.

Change-Id: I074eb02be22e62a764eb26ac85b5f66637e5015e

14 years agoFix the identity hash code getter.
Carl Shapiro [Tue, 4 May 2010 18:19:53 +0000 (11:19 -0700)]
Fix the identity hash code getter.

The address of the hash code for array objects was incorrectly rounded
up to the next double word instead of the next word as the comment
suggested.  Also, assert that we are not in receipt of a class object.
Class objects should not be in the hashed-and-moved state as they are
not yet relocatable.

Change-Id: I0d2ee147f3c144d7308e80aea32fc3dd1719402e

14 years agoMerge "Properly relocate objects with exposed identity hash codes." into dalvik-dev
Carl Shapiro [Tue, 4 May 2010 07:53:44 +0000 (00:53 -0700)]
Merge "Properly relocate objects with exposed identity hash codes." into dalvik-dev

14 years agoProperly relocate objects with exposed identity hash codes.
Carl Shapiro [Tue, 4 May 2010 03:14:14 +0000 (20:14 -0700)]
Properly relocate objects with exposed identity hash codes.

When the transporter encounters an identity hashed object it will
allocate an additional word in to-space that it fills with the
identity hash code.  The identity has code is the from-space address
for uncopied objects and a word immediately after the instance for
copied objects.  The transporter will update the hash code state when
it relocates the identity hash code.

All size computations are now performed by objectSize which now
interprets the hash code state.  Similarly, all transportation logic
has been moved to transportObject which knows how to allocate and fill
the word holding the identity hash code.

Change-Id: I4920e18299850168b41158de748c8331be541ca1

14 years agoam c0829fc9: (-s ours) am 7b04830a: am 80f7e83f: am 78115b68: am c03da3e8: Fix breakp...
Andy McFadden [Tue, 4 May 2010 00:22:27 +0000 (17:22 -0700)]
am c0829fc9: (-s ours) am 7b04830a: am 80f7e83f: am 78115b68: am c03da3e8: Fix breakpoint handling on switch statements.

Merge commit 'c0829fc9cd9dc4bc04db166df419931d40e72897' into dalvik-dev

* commit 'c0829fc9cd9dc4bc04db166df419931d40e72897':
  Fix breakpoint handling on switch statements.

14 years agoam 7b04830a: am 80f7e83f: am 78115b68: am c03da3e8: Fix breakpoint handling on switch...
Andy McFadden [Tue, 4 May 2010 00:12:25 +0000 (17:12 -0700)]
am 7b04830a: am 80f7e83f: am 78115b68: am c03da3e8: Fix breakpoint handling on switch statements.

14 years agoam 80f7e83f: am 78115b68: am c03da3e8: Fix breakpoint handling on switch statements.
Andy McFadden [Tue, 4 May 2010 00:10:48 +0000 (17:10 -0700)]
am 80f7e83f: am 78115b68: am c03da3e8: Fix breakpoint handling on switch statements.

14 years agoam 78115b68: am c03da3e8: Fix breakpoint handling on switch statements.
Andy McFadden [Tue, 4 May 2010 00:09:16 +0000 (17:09 -0700)]
am 78115b68: am c03da3e8: Fix breakpoint handling on switch statements.

Merge commit '78115b6899e6aa70a3834c3a5f7df9c53765b4ee' into kraken

* commit '78115b6899e6aa70a3834c3a5f7df9c53765b4ee':
  Fix breakpoint handling on switch statements.

14 years agoam c03da3e8: Fix breakpoint handling on switch statements.
Andy McFadden [Tue, 4 May 2010 00:08:07 +0000 (17:08 -0700)]
am c03da3e8: Fix breakpoint handling on switch statements.

Merge commit 'c03da3e87a0537b211f2300d594597d84898b8f7' into froyo-plus-aosp

* commit 'c03da3e87a0537b211f2300d594597d84898b8f7':
  Fix breakpoint handling on switch statements.

14 years agoFix breakpoint handling on switch statements.
Andy McFadden [Mon, 3 May 2010 23:11:20 +0000 (16:11 -0700)]
Fix breakpoint handling on switch statements.

Some debuggers (Eclipse and IntelliJ, but not jdb) appear to set
breakpoints at all addresses associated with a given bytecode offset.
Because dx emits line number information for the data tables used
by "switch" statements, we end up setting a breakpoint on the start
of the switch data.

In the past this wasn't a problem, but now that we're using "hard"
breakpoints it's causing the magic number at the start of the table
to be overwritten.  An explict test on the magic number is causing
the intepreter to throw an InternalError.

The quick fix is to refuse to stomp on a "magic" NOP.  Assuming the
line number table is otherwise valid and doesn't point into the middle
of a multi-word instruction, this should solve the problem.  (We can
check this during verification.)

Bug 2643148.

Change-Id: Ic96947da14ea2346a67f0eb769a1c006153da448

14 years agoMerge "Fix breakpoint handling on switch statements." into dalvik-dev
Andy McFadden [Mon, 3 May 2010 23:51:26 +0000 (16:51 -0700)]
Merge "Fix breakpoint handling on switch statements." into dalvik-dev

14 years agoMerge "Fixing bulk reads in ByteArray.MyInputStream" into dalvik-dev
Jesse Wilson [Mon, 3 May 2010 23:32:39 +0000 (16:32 -0700)]
Merge "Fixing bulk reads in ByteArray.MyInputStream" into dalvik-dev

14 years agoam 7580722d: am 860728a3: am e5ab92a2: am cf6ab741: merge from open-source master
The Android Open Source Project [Mon, 3 May 2010 23:28:45 +0000 (16:28 -0700)]
am 7580722d: am 860728a3: am e5ab92a2: am cf6ab741: merge from open-source master

Merge commit '7580722dd42463043e5192b86c1ca77b7fb6c4b5' into dalvik-dev

* commit '7580722dd42463043e5192b86c1ca77b7fb6c4b5':
  Adapt to new location of libcore
  Delete libcore, now in its own project

14 years agoFix breakpoint handling on switch statements.
Andy McFadden [Mon, 3 May 2010 23:11:20 +0000 (16:11 -0700)]
Fix breakpoint handling on switch statements.

Some debuggers (Eclipse and IntelliJ, but not jdb) appear to set
breakpoints at all addresses associated with a given bytecode offset.
Because dx emits line number information for the data tables used
by "switch" statements, we end up setting a breakpoint on the start
of the switch data.

In the past this wasn't a problem, but now that we're using "hard"
breakpoints it's causing the magic number at the start of the table
to be overwritten.  An explict test on the magic number is causing
the intepreter to throw an InternalError.

The quick fix is to refuse to stomp on a "magic" NOP.  Assuming the
line number table is otherwise valid and doesn't point into the middle
of a multi-word instruction, this should solve the problem.  (We can
check this during verification.)

Bug 2643148.

Change-Id: I8fe35539508fa4f56a3eecc375acc058cf9568e4

14 years agoam 860728a3: am e5ab92a2: am cf6ab741: merge from open-source master
The Android Open Source Project [Mon, 3 May 2010 23:20:41 +0000 (16:20 -0700)]
am 860728a3: am e5ab92a2: am cf6ab741: merge from open-source master

14 years agoam e5ab92a2: am cf6ab741: merge from open-source master
The Android Open Source Project [Mon, 3 May 2010 23:19:05 +0000 (16:19 -0700)]
am e5ab92a2: am cf6ab741: merge from open-source master

14 years agoam cf6ab741: merge from open-source master
The Android Open Source Project [Mon, 3 May 2010 23:17:51 +0000 (16:17 -0700)]
am cf6ab741: merge from open-source master

Merge commit 'cf6ab741c2a50b61d6cf1b1617e7a908caece6dd' into kraken

* commit 'cf6ab741c2a50b61d6cf1b1617e7a908caece6dd':
  Adapt to new location of libcore
  Delete libcore, now in its own project