OSDN Git Service

android-x86/dalvik.git
14 years agoFixed 2 floating point bugs; improved debug output; armv7-a thumb2 inline sqrt
Bill Buzbee [Sat, 1 Aug 2009 18:32:36 +0000 (11:32 -0700)]
Fixed 2 floating point bugs; improved debug output; armv7-a thumb2 inline sqrt

14 years agoMerge change 9395
Android (Google) Code Review [Sat, 1 Aug 2009 16:04:06 +0000 (09:04 -0700)]
Merge change 9395

* changes:
  Stage 3 of Thumb2 support. armv7-a now generates vfp code inline.

14 years agoStage 3 of Thumb2 support. armv7-a now generates vfp code inline.
Bill Buzbee [Thu, 30 Jul 2009 17:52:29 +0000 (10:52 -0700)]
Stage 3 of Thumb2 support. armv7-a now generates vfp code inline.

14 years agoMerge change 9414
Android (Google) Code Review [Fri, 31 Jul 2009 23:26:37 +0000 (16:26 -0700)]
Merge change 9414

* changes:
  Fix a LOGVV.

14 years agoMerge change 9384
Android (Google) Code Review [Fri, 31 Jul 2009 23:24:13 +0000 (16:24 -0700)]
Merge change 9384

* changes:
  Added VMDebug.crash() (hidden).

14 years agoFix a LOGVV.
Andy McFadden [Fri, 31 Jul 2009 23:24:12 +0000 (16:24 -0700)]
Fix a LOGVV.

Somebody on android-porting stumbled over this.

14 years agoAdded VMDebug.crash() (hidden).
Andy McFadden [Fri, 31 Jul 2009 20:54:59 +0000 (13:54 -0700)]
Added VMDebug.crash() (hidden).

This call prints the stack trace for the current thread, and then
crashes the VM so you can see the native stack trace too.  Useful for
figuring out "how did I get here?" situations.

14 years agoIndirect reference table implementation.
Andy McFadden [Fri, 17 Jul 2009 01:11:22 +0000 (18:11 -0700)]
Indirect reference table implementation.

This change introduces the "indirect" reference table, which will be
replacing ReferenceTable for local and global JNI references.  The key
difference is that, instead of handing raw Object pointers to JNI, we
will be giving them a magic value that can be converted back to an
Object.  The goal is to avoid having to pin every object that native
code is aware of.

The code is not actually used anywhere yet.

Also bundled up here:
 - added detail to a log message
 - fixed a string format issue in the internal assert() definition
 - very minor optimization in "remove" function in ReferenceTable
 - quiet a gcc complaint
 - only include the hash table regression test in builds that invoke it

14 years agoMerge change 8953
Android (Google) Code Review [Thu, 30 Jul 2009 21:21:19 +0000 (14:21 -0700)]
Merge change 8953

* changes:
  Store all IP addresses for a hostname instead of just one.

14 years agoStore all IP addresses for a hostname instead of just one.
Lorenzo Colitti [Wed, 29 Jul 2009 00:55:00 +0000 (17:55 -0700)]
Store all IP addresses for a hostname instead of just one.

14 years agoMerge change 9190
Android (Google) Code Review [Thu, 30 Jul 2009 17:49:00 +0000 (10:49 -0700)]
Merge change 9190

* changes:
  Minor tweak (TEQS -> TEQ).

14 years agoMinor tweak (TEQS -> TEQ).
Andy McFadden [Thu, 30 Jul 2009 17:50:14 +0000 (10:50 -0700)]
Minor tweak (TEQS -> TEQ).

Avoids "Warning: s suffix on comparison instruction is deprecated".

14 years agoam bd79e449: Fix an issue where we\'re adding 4x the intended offset.
Jesse Wilson [Thu, 30 Jul 2009 16:56:34 +0000 (09:56 -0700)]
am bd79e449: Fix an issue where we\'re adding 4x the intended offset.

Merge commit 'bd79e4498465381117f2cbc6399a256061f1d144'

* commit 'bd79e4498465381117f2cbc6399a256061f1d144':
  Fix an issue where we're adding 4x the intended offset.

14 years agoam 29326482: Removing MD2
Urs Grob [Thu, 30 Jul 2009 13:56:17 +0000 (06:56 -0700)]
am 29326482: Removing MD2

Merge commit '2932648271e72bad181b293e1fa5945265c7dbed'

* commit '2932648271e72bad181b293e1fa5945265c7dbed':
  Removing MD2

14 years agoMerge change 9042
Android (Google) Code Review [Wed, 29 Jul 2009 23:16:12 +0000 (16:16 -0700)]
Merge change 9042

* changes:
  Update bytecode verifier info.

14 years agoUpdate bytecode verifier info.
Andy McFadden [Wed, 29 Jul 2009 23:07:01 +0000 (16:07 -0700)]
Update bytecode verifier info.

Rewrote last section to describe deferred verification error reporting.
Added note about structured locking checks.

14 years agoFix an issue where we're adding 4x the intended offset.
Jesse Wilson [Tue, 28 Jul 2009 23:49:40 +0000 (16:49 -0700)]
Fix an issue where we're adding 4x the intended offset.

We were doing pointer arithmetic of mixed types (jint* and jint),
and the type conversion ended up causing the offset to be converted
an extra time.

14 years agoMerge change 9014
Android (Google) Code Review [Wed, 29 Jul 2009 20:59:24 +0000 (13:59 -0700)]
Merge change 9014

* changes:
  Fixing some broken links in the concurrent Javadoc.

14 years agoFixing some broken links in the concurrent Javadoc.
Jesse Wilson [Wed, 29 Jul 2009 20:45:14 +0000 (13:45 -0700)]
Fixing some broken links in the concurrent Javadoc.

There's a bug in droiddoc where links to methods with generic parameters
don't resolve correctly. I'll open a buganizer issue for this; in the
interim I've simply dropped the parameters for the offending links.

14 years agoFixing Executors to use raw types, which is what RI v5 does.
Jesse Wilson [Wed, 29 Jul 2009 18:39:24 +0000 (11:39 -0700)]
Fixing Executors to use raw types, which is what RI v5 does.

Also fixing VMStack to hide the new API method.

14 years agoMerge change 8903
Android (Google) Code Review [Wed, 29 Jul 2009 17:00:32 +0000 (10:00 -0700)]
Merge change 8903

* changes:
  Update concurrent module to Harmony r798021.

14 years agoRemoving MD2
Urs Grob [Wed, 22 Jul 2009 18:06:03 +0000 (20:06 +0200)]
Removing MD2

14 years agoUpdate concurrent module to Harmony r798021.
Jesse Wilson [Wed, 29 Jul 2009 00:34:57 +0000 (17:34 -0700)]
Update concurrent module to Harmony r798021.

commit 56bcdc2a3b881883409267c3bd16294d80716859
Merge: 903691a f429dca
Author: Jesse Wilson <jessewilson@google.com>
Date:   Mon Jul 27 17:33:19 2009 -0700

    Merge branch 'concurrent_798021' into concurrent_dalvik

    Conflicts:
     libcore/concurrent/.classpath
     libcore/concurrent/build.xml
     libcore/concurrent/make/run-test.xml
     libcore/concurrent/src/main/java/java/util/concurrent/ArrayBlockingQueue.java
     libcore/concurrent/src/main/java/java/util/concurrent/BlockingQueue.java
     libcore/concurrent/src/main/java/java/util/concurrent/ConcurrentHashMap.java
     libcore/concurrent/src/main/java/java/util/concurrent/ConcurrentLinkedQueue.java
     libcore/concurrent/src/main/java/java/util/concurrent/ConcurrentMap.java
     libcore/concurrent/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java
     libcore/concurrent/src/main/java/java/util/concurrent/CopyOnWriteArraySet.java
     libcore/concurrent/src/main/java/java/util/concurrent/DelayQueue.java
     libcore/concurrent/src/main/java/java/util/concurrent/LinkedBlockingQueue.java
     libcore/concurrent/src/main/java/java/util/concurrent/PriorityBlockingQueue.java
     libcore/concurrent/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java
     libcore/concurrent/src/main/java/java/util/concurrent/Semaphore.java
     libcore/concurrent/src/main/java/java/util/concurrent/SynchronousQueue.java
     libcore/concurrent/src/main/java/java/util/concurrent/ThreadPoolExecutor.java
     libcore/concurrent/src/main/java/java/util/concurrent/TimeUnit.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/AtomicBoolean.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/AtomicInteger.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/AtomicIntegerArray.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLong.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLongArray.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/AtomicReference.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/AtomicReferenceArray.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
     libcore/concurrent/src/main/java/java/util/concurrent/atomic/package.html
     libcore/concurrent/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
     libcore/concurrent/src/main/java/java/util/concurrent/locks/LockSupport.java
     libcore/concurrent/src/main/java/java/util/concurrent/locks/ReentrantReadWriteLock.java
     libcore/concurrent/src/main/java/java/util/concurrent/locks/package.html
     libcore/concurrent/src/main/java/java/util/concurrent/package.html
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/AtomicLongFieldUpdaterTest.java
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/AtomicReferenceFieldUpdaterTest.java
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/AtomicReferenceTest.java
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/ConcurrentHashMapTest.java
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/DelayQueueTest.java
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/ExecutorsTest.java
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/JSR166TestCase.java
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/LinkedBlockingQueueTest.java
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/LockSupportTest.java
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/ReentrantLockTest.java
     libcore/concurrent/src/test/java/tests/api/java/util/concurrent/ReentrantReadWriteLockTest.java

commit 903691ae71cff640d5487a3d34a20e8767dbfb66
Author: Jesse Wilson <jessewilson@google.com>
Date:   Mon Jul 27 16:09:58 2009 -0700

    Dalvik Concurrent

commit f429dca21c408ee62e688f60d5e110718374e944
Author: Jesse Wilson <jessewilson@google.com>
Date:   Mon Jul 27 16:08:25 2009 -0700

    Concurrent 798021

commit b2c76fdd1056113000140bc4af57300c87469d2d
Author: Jesse Wilson <jessewilson@google.com>
Date:   Mon Jul 27 16:03:45 2009 -0700

    Concurrent 527399

14 years agoMerge change 8867
Android (Google) Code Review [Tue, 28 Jul 2009 22:14:16 +0000 (15:14 -0700)]
Merge change 8867

* changes:
  Fix for 1857865: Need x86 implementation for OP_THROW_VERIFICATION_ERROR

14 years agoFix for 1857865: Need x86 implementation for OP_THROW_VERIFICATION_ERROR
Bill Buzbee [Tue, 28 Jul 2009 22:02:22 +0000 (15:02 -0700)]
Fix for 1857865: Need x86 implementation for OP_THROW_VERIFICATION_ERROR

14 years agoPrevent OP_INVOKE_DIRECT_EMPTY from terminating a trace
Bill Buzbee [Tue, 28 Jul 2009 20:28:25 +0000 (13:28 -0700)]
Prevent OP_INVOKE_DIRECT_EMPTY from terminating a trace

14 years agoStage 2 of structural changes for support of THUMB2. No logic changes.
Bill Buzbee [Tue, 28 Jul 2009 18:22:22 +0000 (11:22 -0700)]
Stage 2 of structural changes for support of THUMB2.  No logic changes.

14 years agoFix for 3326: Incorrect return value from native library in dalvik
Bill Buzbee [Mon, 27 Jul 2009 22:51:54 +0000 (15:51 -0700)]
Fix for 3326: Incorrect return value from native library in dalvik
Really a workaround for a gcc bug in 4.3.  Don't trust the C compiler
to properly clear high bits from < 32-bit JNI return values.

14 years agoMerge change 5582
Android (Google) Code Review [Tue, 28 Jul 2009 01:08:32 +0000 (18:08 -0700)]
Merge change 5582

* changes:
  Integrate luni module (but not tests) to Harmony r772995.

14 years agoFix a JIT bug where invoke-direct-empty is the last instruction in the trace.
Ben Cheng [Mon, 27 Jul 2009 23:21:52 +0000 (16:21 -0700)]
Fix a JIT bug where invoke-direct-empty is the last instruction in the trace.

14 years agoMerge change 8665
Android (Google) Code Review [Mon, 27 Jul 2009 23:25:59 +0000 (16:25 -0700)]
Merge change 8665

* changes:
  First phase of restructuring to support THUMB2 & ARM traces Store some useful info about traces in JitTable entry; some general cleanup

14 years agoMerge change 8707
Android (Google) Code Review [Mon, 27 Jul 2009 23:08:47 +0000 (16:08 -0700)]
Merge change 8707

* changes:
  Fix mangling to translate dollar signs.

14 years agoFix mangling to translate dollar signs.
Brian McKenna [Sun, 19 Jul 2009 10:49:26 +0000 (20:49 +1000)]
Fix mangling to translate dollar signs.

(Manually pulled from external change 10724.)

14 years agoFirst phase of restructuring to support THUMB2 & ARM traces
Bill Buzbee [Thu, 23 Jul 2009 20:22:09 +0000 (13:22 -0700)]
First phase of restructuring to support THUMB2 & ARM traces
Store some useful info about traces in JitTable entry; some general cleanup

14 years agoAdded dvmLinearAllocContains().
Andy McFadden [Mon, 27 Jul 2009 21:44:22 +0000 (14:44 -0700)]
Added dvmLinearAllocContains().

14 years agoam 8e696dc0: JNI direct buffer function speedup, part 3.
Andy McFadden [Sat, 25 Jul 2009 17:11:54 +0000 (10:11 -0700)]
am 8e696dc0: JNI direct buffer function speedup, part 3.

Merge commit '8e696dc0271299433cb3297e7aafc7bd0ee1b2b7'

* commit '8e696dc0271299433cb3297e7aafc7bd0ee1b2b7':
  JNI direct buffer function speedup, part 3.

14 years agoam 8e5c7847: JNI direct buffer function speedup, part 2.
Andy McFadden [Fri, 24 Jul 2009 23:08:33 +0000 (16:08 -0700)]
am 8e5c7847: JNI direct buffer function speedup, part 2.

Merge commit '8e5c78470229fd2f5474574081eaa4a2286aafea'

* commit '8e5c78470229fd2f5474574081eaa4a2286aafea':
  JNI direct buffer function speedup, part 2.

14 years agoIntegrate luni module (but not tests) to Harmony r772995.
Jesse Wilson [Fri, 24 Jul 2009 22:17:03 +0000 (15:17 -0700)]
Integrate luni module (but not tests) to Harmony r772995.

Notable changes
     - Stripped "@since Android 1.0" from many files. Most files
       are now 100% the same in Dalvik and Harmony.
     - AbstractStringBuilder.reverse() supports surrogates
     - AbstractStringBuilder shares less to waste less memory
     - Bitset optimized
     - BufferedInputStream changed to support unsynchronized close()
     - BufferedOutputStream does flushInternal
     - BufferedReader supports EBCDIC NEL
     - Collections.synchronizedList().indexOf() does a copy for more concurrency
     - Classes in nio module changed: DatagramChannelImpl, SocketChannelImpl
       and ServerSocketChannelImpl (these depend on internal APIs changed in
       this update)
     - DataInputStream/DataOutputStream now use a small buffer to limit the
       number of times the underlying stream is accessed
     - Date now has a minutes offset, more efficient toString()
     - ExposedByteArrayInputStream: new internal class
     - DeleteOnExit moved to top-level class
     - FileDescriptor.isValid() now non-native
     - Float, Double lessThan optimized (fix for compare(-0.0F, 0.0F) still pending)
     - FileURLConnection now guesses content types from streams
     - HashMap iterator changes
     - Hashtable iterator changes
     - INetworkSystem
       - removes bind2(), createMulticastSocket, sendStream(),
       - renames createSocket to createStreamSocket
     - JarURLConnection rewritten
     - LinkedHashMap: new iterator
     - Locale, Currency, TimeZone: now use ICU in Harmony, plain Java in Dalvik
     - ObjectInputStream: Accessor objects in Harmony, direct native in Dalvik
     - ProxyClassFile - many changes
     - String - optimized ascii for toLowerCase, toUpperCase, compare
     - Timer - rewritten
     - TreeMap - rewritten
     - URLClassLoader - new
     - URLConnection - new guessContentTypeFromStream(), uses org.apache.harmony.awt.www.content
       to lookup content type handlers

14 years agoJNI direct buffer function speedup, part 3.
Andy McFadden [Fri, 24 Jul 2009 22:28:16 +0000 (15:28 -0700)]
JNI direct buffer function speedup, part 3.

This caches the effective address in a new field in the base Buffer
object.  The first time something calls through one of the various
getEffectiveAddress calls, the value is set.  (This seemed easier than
chasing down the constructors and factories, and also prevents bit rot
on the "slow path" in the VM.)

14 years agoJNI direct buffer function speedup, part 2.
Andy McFadden [Fri, 24 Jul 2009 00:47:18 +0000 (17:47 -0700)]
JNI direct buffer function speedup, part 2.

This converts the three direct buffer functions from JNI to internal VM
calls.  As a bonus, we grab PlatformAddress.osaddr directly instead of
retrieving it with PlatformAddress.toLong().

We're still calling through getEffectiveAddress(), which is where most
of the complexity lies.

Nudged a couple of comments.

14 years agoam 828311c1: Merge change 8258 into donut
Android (Google) Code Review [Wed, 22 Jul 2009 23:09:07 +0000 (16:09 -0700)]
am 828311c1: Merge change 8258 into donut

Merge commit '828311c1293ba533065895cc375abb143e14b69a'

* commit '828311c1293ba533065895cc375abb143e14b69a':
  Minor fixes to CheckJNI.

14 years agoMerge change 8258 into donut
Android (Google) Code Review [Wed, 22 Jul 2009 22:34:57 +0000 (15:34 -0700)]
Merge change 8258 into donut

* changes:
  Minor fixes to CheckJNI.

14 years agoam 5f612b82: JNI direct buffer function speedup, part 1.
Andy McFadden [Wed, 22 Jul 2009 22:30:18 +0000 (15:30 -0700)]
am 5f612b82: JNI direct buffer function speedup, part 1.

Merge commit '5f612b82bbc2fcfb13865acd3c3835febab23466'

* commit '5f612b82bbc2fcfb13865acd3c3835febab23466':
  JNI direct buffer function speedup, part 1.

14 years agoMinor fixes to CheckJNI.
Andy McFadden [Wed, 22 Jul 2009 22:20:08 +0000 (15:20 -0700)]
Minor fixes to CheckJNI.

We weren't always switching to "running" mode before playing with
objects.  Now checkObject() always changes modes, and things that called
checkObject while in "running" mode now do so after switching back to
"native" (which shouldn't matter now, but I don't want to require nested
switching to work if I don't have to).

Vaguely related to internal bug 1943379, since I think we want to do
some updates to CheckJNI there.

14 years agoJNI direct buffer function speedup, part 1.
Andy McFadden [Wed, 22 Jul 2009 22:07:27 +0000 (15:07 -0700)]
JNI direct buffer function speedup, part 1.

This is a fairly straightforward improvement to GetDirectBufferAddress,
caching classes and methodIDs instead of looking them up on every call.
This is the best we can do without making the function more vulnerable
to internal changes to Harmony's NIO implementation.

It looks like we need to take this farther, but this way we have a
relatively fast and relatively safe version to fall back on.

For internal bug 1943379.

14 years agoAdd armv7-a target to jit. Mostly a placeholder, another restructuring to come
Bill Buzbee [Wed, 22 Jul 2009 20:58:23 +0000 (13:58 -0700)]
Add armv7-a target to jit.  Mostly a placeholder, another restructuring to come

14 years agoRemove unused label.
Ben Cheng [Tue, 21 Jul 2009 19:45:34 +0000 (12:45 -0700)]
Remove unused label.

14 years agoAssociate Java source code line number with JIT traces.
Ben Cheng [Tue, 21 Jul 2009 17:22:22 +0000 (10:22 -0700)]
Associate Java source code line number with JIT traces.

Sample output:

D/dalvikvm(  400): TRACEPROFILE 0x426d945c    5192426 [0x4(+32), 810] Lcom/android/unit_tests/PerformanceTests$AddMemberVariableTest;testRun;()V
D/dalvikvm(  400): TRACEPROFILE 0x426d955c        263 [0x2(+1), 809] (omitted)
D/dalvikvm(  400): TRACEPROFILE 0x426d9640          0 [0x53(+1), 344] (omitted)
D/dalvikvm(  400): TRACEPROFILE 0x426d960c          0 [0x72(+1), 271] (omitted)
D/dalvikvm(  400): TRACEPROFILE 0x426d9590          0 [0x74(+5), 272] (omitted)

For the first line:

5192426: execution count of this trace
0x4: starting bytecode offset
+32: number of instructions included in the trace
810: line number corresponding to 0x4 in the file containing the method

Also add WITH_JIT_TUNING for now whenever JIT is enabled.

14 years agoMerge change 7773
Android (Google) Code Review [Mon, 20 Jul 2009 16:43:02 +0000 (09:43 -0700)]
Merge change 7773

* changes:
  Polish JIT trace profiling and fix a unchaining bug when profiling is enabled.

14 years agoPolish JIT trace profiling and fix a unchaining bug when profiling is enabled.
Ben Cheng [Fri, 17 Jul 2009 22:54:23 +0000 (15:54 -0700)]
Polish JIT trace profiling and fix a unchaining bug when profiling is enabled.

14 years agoMerge change 7487
Android (Google) Code Review [Fri, 17 Jul 2009 03:04:34 +0000 (20:04 -0700)]
Merge change 7487

* changes:
  Fixed a tiny bug in TimSort that slightly affects performance on small arrays Martin Buchholz discovered this bug by running all tests with assertions enabled.  That's the only way he could have discovered it, as it doesn't affect correctness:) The assertion that failed was the one at the head of countRunAndMakeAscending.  The cause was that I called the method with (a, start, length) instead of (a, start, end).

14 years agoMerge change 7550
Android (Google) Code Review [Thu, 16 Jul 2009 22:46:12 +0000 (15:46 -0700)]
Merge change 7550

* changes:
  Fixing wakeups caused by Thread.join() interacting with LockSupport.unpark.

14 years agoFixing wakeups caused by Thread.join() interacting with LockSupport.unpark.
Jesse Wilson [Thu, 16 Jul 2009 18:56:27 +0000 (11:56 -0700)]
Fixing wakeups caused by Thread.join() interacting with LockSupport.unpark.

This caused several concurrency tests to fail when run with timeouts, since
the tests cause park and unpark to happen frequently.

Also fixing a tiny issue with CoreTestRunnable to use the proper tmp directory
and to include the program of a failed external execution.

14 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.

14 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.

14 years agoFixed a tiny bug in TimSort that slightly affects performance on small arrays
Joshua Bloch [Thu, 16 Jul 2009 01:26:05 +0000 (18:26 -0700)]
Fixed a tiny bug in TimSort that slightly affects performance on small arrays
Martin Buchholz discovered this bug by running all tests with assertions
enabled.  That's the only way he could have discovered it, as it doesn't
affect correctness:) The assertion that failed was the one at the head of
countRunAndMakeAscending.  The cause was that I called the method with
(a, start, length) instead of (a, start, end).

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

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

14 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.

14 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.

14 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.

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

14 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.

14 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.

14 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.)

14 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.

14 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.

14 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.

14 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.)

14 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.)

14 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.

14 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

14 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

14 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

14 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.

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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.

14 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.

14 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.

14 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.

14 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.

14 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

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

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