OSDN Git Service

android-x86/dalvik.git
14 years agoRepurpose bits 1 and 2 of the lockword for encoding the hash state of
Carl Shapiro [Mon, 21 Dec 2009 19:42:59 +0000 (11:42 -0800)]
Repurpose bits 1 and 2 of the lockword for encoding the hash state of
an object.  Invert the meaning of the shape bit to match the encoding
scheme described in Bacon's paper.  Consequently, monitor pointers
must have the lower 3 bits stripped before they may be dereferenced.

14 years agoam 2859440d: am c51439a5: Fix a bug where, in static synchronized methods that had...
Dan Bornstein [Thu, 10 Dec 2009 23:14:59 +0000 (15:14 -0800)]
am 2859440d: am c51439a5: Fix a bug where, in static synchronized methods that had no other uses of registers (no locals, no parameters, no method calls with arguments), v0 would be used both to hold the object being synchronized on and to hold a caught exception.

Merge commit '2859440d31dcb5de958d32a6012c1f8b3c509344'

* commit '2859440d31dcb5de958d32a6012c1f8b3c509344':
  Fix a bug where, in static synchronized methods that had no other uses

14 years agoam c51439a5: Fix a bug where, in static synchronized methods that had no other uses...
Dan Bornstein [Thu, 10 Dec 2009 23:09:50 +0000 (15:09 -0800)]
am c51439a5: Fix a bug where, in static synchronized methods that had no other uses of registers (no locals, no parameters, no method calls with arguments), v0 would be used both to hold the object being synchronized on and to hold a caught exception.

Merge commit 'c51439a513d4cc3c2be4a7cce7b3e9ae480fd5c2' into eclair-mr2-plus-aosp

* commit 'c51439a513d4cc3c2be4a7cce7b3e9ae480fd5c2':
  Fix a bug where, in static synchronized methods that had no other uses

14 years agoMerge change I9388fbfd
Android (Google) Code Review [Thu, 10 Dec 2009 23:07:49 +0000 (15:07 -0800)]
Merge change I9388fbfd

* changes:
  More java.io.File cleanup.

14 years agoMore java.io.File cleanup.
Elliott Hughes [Thu, 10 Dec 2009 21:18:35 +0000 (13:18 -0800)]
More java.io.File cleanup.

Make File.list (and friends) cost one JNI call instead of four,
and move the conversion of UTF-8 byte sequences into the JNI, so
it returns String[] instead of byte[][].

Switch to readdir_r(3) so we don't need the JNI to be "static
synchronized".

Remove fixed-length buffers from the native code.

Fix leaks by introducing a "proper" native container (similar to
std::forward_list). We should still investigate either using
std::vector or passing in an ArrayList<String> and using JNI to
call ArrayList.add, but this is a step forward from the old
code anyway.

Bug: 2281992

14 years agoam 78199efa: am 39c5899d: Preflight cleanup of Ropper.java for style, whitespace...
Dan Bornstein [Thu, 10 Dec 2009 22:43:23 +0000 (14:43 -0800)]
am 78199efa: am 39c5899d: Preflight cleanup of Ropper.java for style, whitespace, etc., before doing some more drastic modifications. Also, bumped up the version number, rather than making changes first and then forgetting that important detail.

Merge commit '78199efa7615ac896c9a116737bb87f3724ead0b'

* commit '78199efa7615ac896c9a116737bb87f3724ead0b':
  Preflight cleanup of Ropper.java for style, whitespace, etc., before doing

14 years agoFix a bug where, in static synchronized methods that had no other uses
Dan Bornstein [Thu, 10 Dec 2009 22:37:32 +0000 (14:37 -0800)]
Fix a bug where, in static synchronized methods that had no other uses
of registers (no locals, no parameters, no method calls with arguments),
v0 would be used both to hold the object being synchronized on and to hold
a caught exception.

The result was code that, if an exception was thrown through it, would
in turn throw an IllegalMonitorStateException, as the vm would be
asked to monitor-exit the exception object and not the monitor-entered
class.

Dx test 062 has a couple new cases to cover this case as well as the
parallel instance method case (not that the latter was problematic,
but I like the symmetry).

14 years agoam 39c5899d: Preflight cleanup of Ropper.java for style, whitespace, etc., before...
Dan Bornstein [Thu, 10 Dec 2009 22:24:02 +0000 (14:24 -0800)]
am 39c5899d: Preflight cleanup of Ropper.java for style, whitespace, etc., before doing some more drastic modifications. Also, bumped up the version number, rather than making changes first and then forgetting that important detail.

Merge commit '39c5899d0359c386815f5f72991a3a2573135dbd' into eclair-mr2-plus-aosp

* commit '39c5899d0359c386815f5f72991a3a2573135dbd':
  Preflight cleanup of Ropper.java for style, whitespace, etc., before doing

14 years agoPreflight cleanup of Ropper.java for style, whitespace, etc., before doing
Dan Bornstein [Thu, 10 Dec 2009 21:32:09 +0000 (13:32 -0800)]
Preflight cleanup of Ropper.java for style, whitespace, etc., before doing
some more drastic modifications. Also, bumped up the version number, rather
than making changes first and then forgetting that important detail.

14 years agoThe disabled code was too late to make eclair, and there were some
Barry Hayes [Wed, 28 Oct 2009 22:32:19 +0000 (15:32 -0700)]
The disabled code was too late to make eclair, and there were some
bugs on x86, now fixed.

Let's get this into master for some burn-in.

14 years agoRemove arrayClass from ClassObject. It seems to get only dozens of hits in
Barry Hayes [Fri, 30 Oct 2009 16:36:08 +0000 (09:36 -0700)]
Remove arrayClass from ClassObject. It seems to get only dozens of hits in
all of Zygote start-up.

There doesn't seem to be a measurable difference in the time printed in:
I/Zygote  ( 2247): ...preloaded 1147 classes in NNNNms.

14 years agoMerge change I5f6d073a
Android (Google) Code Review [Thu, 10 Dec 2009 20:51:37 +0000 (12:51 -0800)]
Merge change I5f6d073a

* changes:
  Jit: Save/restore callee-save floating point registers at interpreter entry/exit

14 years agoJit: Save/restore callee-save floating point registers at interpreter entry/exit
Bill Buzbee [Tue, 8 Dec 2009 20:37:13 +0000 (12:37 -0800)]
Jit: Save/restore callee-save floating point registers at interpreter entry/exit

14 years agoam b2c70f2c: (-s ours) am 4d9f9384: DO NOT MERGE - Reduce spin-on-suspend complaints.
Andy McFadden [Thu, 10 Dec 2009 02:40:18 +0000 (18:40 -0800)]
am b2c70f2c: (-s ours) am 4d9f9384: DO NOT MERGE - Reduce spin-on-suspend complaints.

Merge commit 'b2c70f2cb70cd3dbdd12b2581447ed1e70a30992'

* commit 'b2c70f2cb70cd3dbdd12b2581447ed1e70a30992':
  DO NOT MERGE - Reduce spin-on-suspend complaints.

14 years agoam 0f6512c7: am 3f77d012: Merge change I2ca00c90 into eclair-mr2
Elliott Hughes [Thu, 10 Dec 2009 02:40:13 +0000 (18:40 -0800)]
am 0f6512c7: am 3f77d012: Merge change I2ca00c90 into eclair-mr2

Merge commit '0f6512c7b4dd17177a7fdb521ca440d87b4230ad'

* commit '0f6512c7b4dd17177a7fdb521ca440d87b4230ad':
  Fix dalvik test 063.

14 years agoImplement DTDHandler support for ExpatParser.
Elliott Hughes [Thu, 10 Dec 2009 00:05:29 +0000 (16:05 -0800)]
Implement DTDHandler support for ExpatParser.

Every time a third-party developer gets their DefaultHandler method signatures
wrong (making it impossible for us to call them), they see this in the log and
complain that SAX parsing is broken on Android:

  WARN/ExpatReader(704): DTD handlers aren't supported.

This patch adds that support -- even though no-one wants it -- so we can get
rid of the irrelevant log message.

14 years agoam 4d9f9384: DO NOT MERGE - Reduce spin-on-suspend complaints.
Andy McFadden [Wed, 9 Dec 2009 23:59:48 +0000 (15:59 -0800)]
am 4d9f9384: DO NOT MERGE - Reduce spin-on-suspend complaints.

Merge commit '4d9f9384999b14acc996ed621e1205b389845f13' into eclair-mr2-plus-aosp

* commit '4d9f9384999b14acc996ed621e1205b389845f13':
  DO NOT MERGE - Reduce spin-on-suspend complaints.

14 years agoam 3f77d012: Merge change I2ca00c90 into eclair-mr2
Elliott Hughes [Wed, 9 Dec 2009 23:40:55 +0000 (15:40 -0800)]
am 3f77d012: Merge change I2ca00c90 into eclair-mr2

Merge commit '3f77d0127a34798cfede935331c10c1e57ec0ff7' into eclair-mr2-plus-aosp

* commit '3f77d0127a34798cfede935331c10c1e57ec0ff7':
  Fix dalvik test 063.

14 years agoFix java.util.Formatter formatting of -0.0.
Elliott Hughes [Wed, 9 Dec 2009 08:44:31 +0000 (00:44 -0800)]
Fix java.util.Formatter formatting of -0.0.

The active ingredient here is the two changes to stop comparing longValue
with doubleValue and formatting the long if the two compare equal. This
causes us to lose the sign of 0 (because there's no long -0, but -0.0d == 0).
Instead, we explicitly test for boxed Double and Float arguments (because
the number of integral types is larger, they get the "else" clause).

The other changes are just minor cosmetic changes made as I followed the code.

Bug found by jtreg, so no new test.

14 years agoDO NOT MERGE - Reduce spin-on-suspend complaints.
Andy McFadden [Thu, 3 Dec 2009 01:03:41 +0000 (17:03 -0800)]
DO NOT MERGE - Reduce spin-on-suspend complaints.

The first complaint is popping up too quickly, and the pile of log
messages it emits aren't helping the process do real work.  This
skips the complaining if we just finished the first (0.25 sec) sleep.

(merged back from master)

14 years agoMerge change I7bdddfb1
Android (Google) Code Review [Wed, 9 Dec 2009 00:34:19 +0000 (16:34 -0800)]
Merge change I7bdddfb1

* changes:
  Improve the FileNotFoundExceptions thrown by OSFileSystem.open.

14 years agoImprove the FileNotFoundExceptions thrown by OSFileSystem.open.
Elliott Hughes [Tue, 8 Dec 2009 23:41:35 +0000 (15:41 -0800)]
Improve the FileNotFoundExceptions thrown by OSFileSystem.open.

When I improved the internals of java.io.File, I failed to keep
OSFileSystem.open (which uses the internals of java.io.File) in
sync, leading to misleading error reporting. java.io.File's
internals now include a trailing NUL, which is useful for the
native code but confuses Java if it tries to decode the byte[]
as a UTF-8 sequence.

This patch fixes the bug and also improves OSFileSystem.open's
error reporting to include the reason for the failure.

Bug: 2313271

14 years agoam 66cbe5b1: am bf1bb914: am 4a888b09: Two exception-related tweaks: (1) Make the...
Dan Bornstein [Tue, 8 Dec 2009 22:51:58 +0000 (14:51 -0800)]
am 66cbe5b1: am bf1bb914: am 4a888b09: Two exception-related tweaks: (1) Make the dynamic exception construction mechanism be able to handle exception constructors that take Object instead of String. (2) Add a convenience in JNIHelp to throw RuntimeExceptions.

Merge commit '66cbe5b10e3bd9f7b3c262a2ec8a3c11087baa80'

* commit '66cbe5b10e3bd9f7b3c262a2ec8a3c11087baa80':
  Two exception-related tweaks: (1) Make the dynamic exception construction

14 years agoFix build.
Elliott Hughes [Tue, 8 Dec 2009 21:20:29 +0000 (13:20 -0800)]
Fix build.

14 years agoMerge change I8cdf9790
Android (Google) Code Review [Tue, 8 Dec 2009 21:04:55 +0000 (13:04 -0800)]
Merge change I8cdf9790

* changes:
  Take Locale into account in java.util.Formatter uppercase conversions.

14 years agoTake Locale into account in java.util.Formatter uppercase conversions.
Elliott Hughes [Tue, 8 Dec 2009 19:52:21 +0000 (11:52 -0800)]
Take Locale into account in java.util.Formatter uppercase conversions.

(This is an RI incompatibility, but Sun accepts that the RI's behavior is a
bug.)

Bug: 2301938

14 years agoMerge change Id40223ec
Android (Google) Code Review [Tue, 8 Dec 2009 15:21:26 +0000 (07:21 -0800)]
Merge change Id40223ec

* changes:
  Convert an assert() into a real test.

14 years agoMerge change I2ca00c90 into eclair-mr2
Android (Google) Code Review [Tue, 8 Dec 2009 01:32:14 +0000 (17:32 -0800)]
Merge change I2ca00c90 into eclair-mr2

* changes:
  Fix dalvik test 063.

14 years agoFix dalvik test 063.
Elliott Hughes [Tue, 8 Dec 2009 01:20:53 +0000 (17:20 -0800)]
Fix dalvik test 063.

Avoid a race by sleeping so the code we're examining gets to run before we
query its state.

Bug: 2310700

14 years agoam bf1bb914: am 4a888b09: Two exception-related tweaks: (1) Make the dynamic exceptio...
Dan Bornstein [Tue, 8 Dec 2009 01:02:10 +0000 (17:02 -0800)]
am bf1bb914: am 4a888b09: Two exception-related tweaks: (1) Make the dynamic exception construction mechanism be able to handle exception constructors that take Object instead of String. (2) Add a convenience in JNIHelp to throw RuntimeExceptions.

Merge commit 'bf1bb914a62c65eb8304ce1d86e8ff2dd4f5c79b' into eclair-mr2-plus-aosp

* commit 'bf1bb914a62c65eb8304ce1d86e8ff2dd4f5c79b':
  Two exception-related tweaks: (1) Make the dynamic exception construction

14 years agoam 4a888b09: Two exception-related tweaks: (1) Make the dynamic exception constructio...
Dan Bornstein [Tue, 8 Dec 2009 00:57:31 +0000 (16:57 -0800)]
am 4a888b09: Two exception-related tweaks: (1) Make the dynamic exception construction mechanism be able to handle exception constructors that take Object instead of String. (2) Add a convenience in JNIHelp to throw RuntimeExceptions.

Merge commit '4a888b09be2ade9fc5bb0137f702b3be889679a9' into eclair-mr2

* commit '4a888b09be2ade9fc5bb0137f702b3be889679a9':
  Two exception-related tweaks: (1) Make the dynamic exception construction

14 years agoTwo exception-related tweaks: (1) Make the dynamic exception construction
Dan Bornstein [Mon, 7 Dec 2009 23:46:23 +0000 (15:46 -0800)]
Two exception-related tweaks: (1) Make the dynamic exception construction
mechanism be able to handle exception constructors that take Object instead
of String. (2) Add a convenience in JNIHelp to throw RuntimeExceptions.

Change-Id: Ie5ce680c30043a4b186e59d7c8883666648b2c87

14 years agoConvert an assert() into a real test.
Andy McFadden [Mon, 7 Dec 2009 23:35:51 +0000 (15:35 -0800)]
Convert an assert() into a real test.

We occasionally see an assertion failure on some debug builds that
indicates a thread is being examined by the GC while still running.
This turns the assertion into an always-enabled test with verbose
logging and a VM abort.

14 years agoMerge change I78b1acb6
Android (Google) Code Review [Mon, 7 Dec 2009 21:26:09 +0000 (13:26 -0800)]
Merge change I78b1acb6

* changes:
  More java.io.File cleanup.

14 years agoMore java.io.File cleanup.
Elliott Hughes [Sun, 6 Dec 2009 04:27:37 +0000 (20:27 -0800)]
More java.io.File cleanup.

Remove the duplication between the various list and listFiles methods.
This also makes the variants that take a filter no less efficient than
those that don't, for the special case of the null filter.

The upstream code sometimes assumed returned filenames were UTF-8, and
at other times assumed returned filenames were in the platform encoding.
The new code always uses UTF-8, to match filenames sent to the operating
system, which were and are always sent as UTF-8 byte sequences.

This patch does not alter the native listImpl method. That's for the
next patch.

A couple of unrelated cosmetic changes have been made in this patch:
declarations of native methods have been moved next to the methods
they implement, and a minor simplification has been made to the
documentation of isAbsolute.

Bug: 2281992

14 years agoMerge change I01c5bfe3
Android (Google) Code Review [Mon, 7 Dec 2009 18:21:42 +0000 (10:21 -0800)]
Merge change I01c5bfe3

* changes:
  Jit: 2nd attempt at fix for [Issue 2302318] Crash during spin-on-suspend

14 years agoJit: 2nd attempt at fix for [Issue 2302318] Crash during spin-on-suspend
Bill Buzbee [Fri, 4 Dec 2009 21:17:36 +0000 (13:17 -0800)]
Jit: 2nd attempt at fix for [Issue 2302318] Crash during spin-on-suspend

Logic on the 1st attempt was a little off, preventing some invokes from
getting chaining cells.

14 years agoMerge change I76f1dbe7
Android (Google) Code Review [Sun, 6 Dec 2009 03:47:49 +0000 (19:47 -0800)]
Merge change I76f1dbe7

* changes:
  More java.io.File cleanup.

14 years agoMore java.io.File cleanup.
Elliott Hughes [Sat, 5 Dec 2009 18:49:20 +0000 (10:49 -0800)]
More java.io.File cleanup.

Mostly cosmetic: improve documentation, factor out the code to join two
strings into a path, put fields in canonical order, defer to String (which
might be able to perform optimizations we can't), simplify the path
cleaning code.

Also remove more unused Windows support (since our File is already totally
broken on Windows anyway).

Bug: 2281992

14 years agoImprove TimeZone documentation.
Elliott Hughes [Sat, 5 Dec 2009 17:47:23 +0000 (09:47 -0800)]
Improve TimeZone documentation.

We can't do anything about the RI's unfortunate choice of method names,
but improving our documentation might help reduce the confusion they
cause.

Bug: 2244560

14 years agoMerge change I97af6ec8
Android (Google) Code Review [Sat, 5 Dec 2009 17:15:50 +0000 (09:15 -0800)]
Merge change I97af6ec8

* changes:
  More java.io.File cleanup.

14 years agoMore java.io.File cleanup.
Elliott Hughes [Fri, 4 Dec 2009 23:06:58 +0000 (15:06 -0800)]
More java.io.File cleanup.

Two changes:

1. Change the createNewFile JNI to match the Java interface, so we can lose the
glue. (Also make the Java/JNI names match, and sort the table of native method
names alphabetically.)

2. Fix the caching of the path byte sequence so we're caching the exact byte
sequence we want to hand to JNI. Also switch to caching the byte[] at
construction time, rather than hiding it behind an accessor.

There's a deliberate functional change here too: previously we were inconsistent
about which encoding was in use. Sometimes it was explicitly UTF-8, other times
the default platform encoding (which happens to be UTF-8 on Android). Now we
always use UTF-8. (But note that the File.list methods, which I haven't got to
yet, still return a mix of UTF-8 and platform-encoded strings.)

Bug: 2281992

14 years agoMerge change Ia8ff1644
Android (Google) Code Review [Sat, 5 Dec 2009 00:32:24 +0000 (16:32 -0800)]
Merge change Ia8ff1644

* changes:
  Fix two trivial Formatter bugs (found by jtreg).

14 years agoFix two trivial Formatter bugs (found by jtreg).
Elliott Hughes [Fri, 4 Dec 2009 01:24:54 +0000 (17:24 -0800)]
Fix two trivial Formatter bugs (found by jtreg).

jtreg complains that we allow "%<%" and "%<n". This patch disallows
the special "last argument" case to conversions that don't take
arguments.

We also reject explicitly-numbered arguments such as "%123$n" or
"%123$%" (whether or not a corresponding argument was provided) though
the RI ignores such errors. I've modified the harmony tests to stop
passing unused argument indexes to %n and %%.

This fixes about 80 jtreg complaints (the java/util/Formatter/Basic test is
generated by shell script and seems to accidentally repeat many of the same
tests over and over).

This patch also includes a little more tidying for readability, but
no other functional changes.

14 years agoMerge change I9bb3f193
Android (Google) Code Review [Fri, 4 Dec 2009 22:43:30 +0000 (14:43 -0800)]
Merge change I9bb3f193

* changes:
  Add new(-ish) Dalvik opcodes to Opcodes.java.

14 years agoAdd new(-ish) Dalvik opcodes to Opcodes.java.
Andy McFadden [Fri, 4 Dec 2009 21:43:01 +0000 (13:43 -0800)]
Add new(-ish) Dalvik opcodes to Opcodes.java.

This is a public API change.

14 years agoMerge change I85442b60
Android (Google) Code Review [Fri, 4 Dec 2009 21:04:35 +0000 (13:04 -0800)]
Merge change I85442b60

* changes:
    Android ICU4.2.1 upgrade.   For detail of dalvik changes, please see:   https://docs.google.com/a/google.com/View?docid=0AfZlO7RuiBh5Y2NmMjdndmJfNDVmNWM2cGY0NQ&hl=en

14 years agoReverting [master] Change I85dd4a66: (platform/dalvik)
Bill Buzbee [Fri, 4 Dec 2009 20:39:42 +0000 (12:39 -0800)]
Reverting [master] Change I85dd4a66: (platform/dalvik)

14 years agoam ca77c603: am a7745f97: Remove "unused" opcodes from API.
Andy McFadden [Fri, 4 Dec 2009 19:30:04 +0000 (11:30 -0800)]
am ca77c603: am a7745f97: Remove "unused" opcodes from API.

Merge commit 'ca77c6035fcce6ed9653ee1bed1753bff99e3d89'

* commit 'ca77c6035fcce6ed9653ee1bed1753bff99e3d89':
  Remove "unused" opcodes from API.

14 years agoam b90871f4: (-s ours) am 5d26339a: DO NOT MERGE: backport the IPv6 NetworkInterface...
Elliott Hughes [Fri, 4 Dec 2009 19:30:00 +0000 (11:30 -0800)]
am b90871f4: (-s ours) am 5d26339a: DO NOT MERGE: backport the IPv6 NetworkInterface/multicast fixes.

Merge commit 'b90871f4c638ce83137adea74b66dd3eca907cfe'

* commit 'b90871f4c638ce83137adea74b66dd3eca907cfe':
  DO NOT MERGE: backport the IPv6 NetworkInterface/multicast fixes.

14 years agoam a7745f97: Remove "unused" opcodes from API.
Andy McFadden [Fri, 4 Dec 2009 19:24:26 +0000 (11:24 -0800)]
am a7745f97: Remove "unused" opcodes from API.

Merge commit 'a7745f9734870e8750d8488b6563f80e0ecdcdcf' into eclair-mr2-plus-aosp

* commit 'a7745f9734870e8750d8488b6563f80e0ecdcdcf':
  Remove "unused" opcodes from API.

14 years agoMerge change I85dd4a66
Android (Google) Code Review [Fri, 4 Dec 2009 19:00:33 +0000 (11:00 -0800)]
Merge change I85dd4a66

* changes:
  Jit: Fix for [Issue 2302318] Crash during spin-on-suspend testing

14 years agoRemove "unused" opcodes from API.
Andy McFadden [Fri, 4 Dec 2009 15:31:13 +0000 (07:31 -0800)]
Remove "unused" opcodes from API.

There's no need to have constants like OP_UNUSED_FF in the API.  They
serve no purpose, and it makes life confusing when an opcode is defined
(does the "unused" one go away, breaking the API?  do we have the real
definition and the "unused" definition simultaneously?).

Discussed / approved by API council.

14 years agoMerge change I7d18e38e
Android (Google) Code Review [Fri, 4 Dec 2009 15:21:41 +0000 (07:21 -0800)]
Merge change I7d18e38e

* changes:
  Added additional DEX checksum.

14 years agoJit: Fix for [Issue 2302318] Crash during spin-on-suspend testing
Bill Buzbee [Thu, 3 Dec 2009 23:09:32 +0000 (15:09 -0800)]
Jit: Fix for [Issue 2302318] Crash during spin-on-suspend testing

This was an amusing bug: the test case simulated a daemon by falling
into an empty loop-forever.  The trace selector treats unconditional
branches as NOPs, and proceeded to repeatedly add the same "branch to self"
instruction to the trace until it reached max trace size.  The compiler
got confused, and died.

14 years agoMerge change I6d8a640c
Android (Google) Code Review [Fri, 4 Dec 2009 00:32:56 +0000 (16:32 -0800)]
Merge change I6d8a640c

* changes:
  Make java.util.Formatter perform acceptably (and fix two jtreg failures).

14 years agoAdded additional DEX checksum.
Andy McFadden [Fri, 4 Dec 2009 00:08:36 +0000 (16:08 -0800)]
Added additional DEX checksum.

We have a checksum on the base DEX data, but not on the stuff that
dexopt appends.  If a flash block goes "funny" we might not be able to
detect the problem.  This change adds a checksum field to the
"optimized" header.

The new checksum is verified under the same circumstances as the base
DEX checksum: when you use "dexdump", and when you enable additional
checking with -Xcheckdexsum (or the property dalvik.vm.check-dex-sum
is set to "true").

For bug 2255640.

14 years agoMerge change I1ede83b7
Android (Google) Code Review [Thu, 3 Dec 2009 21:44:04 +0000 (13:44 -0800)]
Merge change I1ede83b7

* changes:
  Reduce spin-on-suspend complaints.

14 years agoMake java.util.Formatter perform acceptably (and fix two jtreg failures).
Elliott Hughes [Wed, 2 Dec 2009 21:35:29 +0000 (13:35 -0800)]
Make java.util.Formatter perform acceptably (and fix two jtreg failures).

Here are the slowdowns compared to hand-written StringBuilder.append code,
for three cases: a long format string with no format specifiers, a long
format string with a single %d, and a long format string with a
single %s (in that order):

 passion-old:  54x   40x   10x
 sim-new:       1.7x  3.4x  5.3x
 passion-new:   9.2x  2.2x  1.8x

Formatter has been changed to use a less expensive mechanism for parsing
the format string, to not create expensive temporary objects unless they're
actually needed (particularly strings used only in error messages), to not
create a temporary StringBuilder in every transform* method, and to not
charge for padding (or truncation) unless actually required.

As Stroustrup would say, "you don't pay for what you don't use".

Other changes:

AbstractStringBuilder adds a special case for appending one StringBuilder to
another, similar to its existing special case for String (because we do a
much better job of copying a char[] with System.arraycopy than iterating over
a CharSequence).

Character reinstates the ASCII-range optimizations for isDigit and
isUpperCase, both of which are used by Formatter. Bug 2295801 covers
reinstating the rest of Character's special cases.

String loses the unused inner class ConsolePrintStream, which isn't actually
relevant to this change, but offended me greatly.

CharBuffer gets a rewritten toString that's less inefficient. (This doesn't
matter to us because the new Formatter doesn't use CharBuffer, but one
shouldn't leave broken glass on the lawn.)

The change to Formatter.close fixes a jtreg failure (and brings our
implementation in line with our documentation, which already stated that
multiple calls to Formatter.close only close the underlying Closeable
once).

The change to Formatter.format(Locale, ...) fixes a jtreg failure: any
Formattable we call out to needs to be able to use Formatter.locale to
find out the locale it's formatting for. I've reworded the documentation
so that it's clearer (it was already correct, but ambiguous).

Bug: 2272346

14 years agoReduce spin-on-suspend complaints.
Andy McFadden [Thu, 3 Dec 2009 01:03:41 +0000 (17:03 -0800)]
Reduce spin-on-suspend complaints.

The first complaint is popping up too quickly, and the pile of log
messages it emits aren't helping the process do real work.  This
skips the complaining if we just finished the first (0.25 sec) sleep.

14 years agoMerge change I909b4182
Android (Google) Code Review [Thu, 3 Dec 2009 18:09:30 +0000 (10:09 -0800)]
Merge change I909b4182

* changes:
  Jit: Fix for 2187020, bad exception recovery from native invoke static

14 years agoJit: Fix for 2187020, bad exception recovery from native invoke static
Bill Buzbee [Thu, 3 Dec 2009 17:56:50 +0000 (09:56 -0800)]
Jit: Fix for 2187020, bad exception recovery from native invoke static

14 years agoMerge change I352c5d87
Android (Google) Code Review [Thu, 3 Dec 2009 15:26:10 +0000 (07:26 -0800)]
Merge change I352c5d87

* changes:
  Rudimentary JNI method arg checking.

14 years agoMore jtreg+JUnit love. Getting JUnit to work off-device.
Jesse Wilson [Thu, 3 Dec 2009 01:58:26 +0000 (17:58 -0800)]
More jtreg+JUnit love. Getting JUnit to work off-device.

Also fixing the number of threads used by the driver.

14 years agoMerge change I147cfdcf
Android (Google) Code Review [Thu, 3 Dec 2009 00:58:33 +0000 (16:58 -0800)]
Merge change I147cfdcf

* changes:
  JUnit support for jtreg runner. This makes it so that a single command will compile a focused set of tests, install them on the device, and run them.

14 years agoJUnit support for jtreg runner. This makes it so that a single command
Jesse Wilson [Wed, 2 Dec 2009 01:33:27 +0000 (17:33 -0800)]
JUnit support for jtreg runner. This makes it so that a single command
will compile a focused set of tests, install them on the device, and
run them.

There are still some features missing in the current test runner:
 - it requires JUnit to be compiled manually "mmm external/junit". I'm
   trying to figure out why our build system cannot find it.
 - it requires the full test suite already be on the device. This is
   necessary for the support test files and annotations. I intend to
   create a follow up change to move those into a smaller target.
   For now "mmm dalvik snod" will build these.
 - JUnit test expectations are at the class level, not the method level.
   I don't yet have a mechanism to introspect the .java file from JUnit
   to get its method-level detail.
 - jtreg tests can only be run as a directory, not as a single test.

14 years agoMerge change I310502fa
Android (Google) Code Review [Thu, 3 Dec 2009 00:03:32 +0000 (16:03 -0800)]
Merge change I310502fa

* changes:
  Enable CheckJNI on core tests.

14 years agoEnable CheckJNI on core tests.
Andy McFadden [Wed, 2 Dec 2009 23:50:09 +0000 (15:50 -0800)]
Enable CheckJNI on core tests.

This adds -Xcheck:jni to the core test command line.  The tests will run
a bit more slowly when native code is involved, but I don't think we're
doing any performance testing in here, and the extra JNI testing is
useful.

14 years agoRudimentary JNI method arg checking.
Andy McFadden [Wed, 2 Dec 2009 20:52:52 +0000 (12:52 -0800)]
Rudimentary JNI method arg checking.

This adds basic checking of reference arguments passed to interpreted
methods from native code when CheckJNI is enabled.  The various
method calls and NewObject variants are checked.

Currently only tests to see if objects are valid references; does not
attempt to verify that the objects are of the correct type.

Also: renamed checkCallCommon for clarity.

14 years agoMerge change I45d6e22b
Android (Google) Code Review [Wed, 2 Dec 2009 20:13:28 +0000 (12:13 -0800)]
Merge change I45d6e22b

* changes:
  Jit: shift bug fix - 2296099

14 years agoJit: shift bug fix - 2296099
Bill Buzbee [Tue, 1 Dec 2009 22:28:05 +0000 (14:28 -0800)]
Jit: shift bug fix - 2296099

14 years ago Android ICU4.2.1 upgrade.
Claire Ho [Wed, 2 Dec 2009 00:16:40 +0000 (16:16 -0800)]
  Android ICU4.2.1 upgrade.
  For detail of dalvik changes, please see:
  https://docs.google.com/a/google.com/View?docid=0AfZlO7RuiBh5Y2NmMjdndmJfNDVmNWM2cGY0NQ&hl=en

  Bug: 1823720
Reviewed-by: jessewilson@google.com,enh@google.com
  CC:
  Signed-off-by:

14 years agoUpdate makefile comments.
Andy McFadden [Tue, 1 Dec 2009 23:53:41 +0000 (15:53 -0800)]
Update makefile comments.

The "make clean" note was out of date -- it only cleaned one of our four
targets.

14 years agoam 5d26339a: DO NOT MERGE: backport the IPv6 NetworkInterface/multicast fixes.
Elliott Hughes [Tue, 1 Dec 2009 19:31:45 +0000 (11:31 -0800)]
am 5d26339a: DO NOT MERGE: backport the IPv6 NetworkInterface/multicast fixes.

Merge commit '5d26339aed33942ba82bfdb79e1b7e9a832c96a7' into eclair-mr2-plus-aosp

* commit '5d26339aed33942ba82bfdb79e1b7e9a832c96a7':
  DO NOT MERGE: backport the IPv6 NetworkInterface/multicast fixes.

14 years agoMerge change I47b9b7f9
Android (Google) Code Review [Tue, 1 Dec 2009 01:35:12 +0000 (17:35 -0800)]
Merge change I47b9b7f9

* changes:
  DPQ Comment cleanup (and a few very minor code changes)

14 years agoReplaced all versions of binarySearch with better versions.
Joshua Bloch [Tue, 1 Dec 2009 00:18:20 +0000 (16:18 -0800)]
Replaced all versions of binarySearch with better versions.
For float[] and double[], the new versions should run significantly faster than the old.
Removed some obsolete helper methods.

14 years agoDPQ Comment cleanup (and a few very minor code changes)
Joshua Bloch [Tue, 1 Dec 2009 01:08:39 +0000 (17:08 -0800)]
DPQ Comment cleanup (and a few very minor code changes)

14 years agoMerge change I9d0bdb0b
Android (Google) Code Review [Mon, 30 Nov 2009 22:26:14 +0000 (14:26 -0800)]
Merge change I9d0bdb0b

* changes:
  Update docs for debugger change.

14 years agoUpdate docs for debugger change.
Andy McFadden [Mon, 30 Nov 2009 22:20:37 +0000 (14:20 -0800)]
Update docs for debugger change.

Update notes re: breakpoint implementation (changed Oct 28, 96516932).

14 years agoMore java.io.File improvements.
Elliott Hughes [Mon, 30 Nov 2009 06:11:38 +0000 (22:11 -0800)]
More java.io.File improvements.

Three themes to this change: not making unnecessary native calls (like the
pointless "exists" check in canWrite), being consistent in our
treatment of the empty path, and removing unnecessary cruft from the native
code.

I'm sure there must be a better implementation for handling the empty
path (the few methods for which it *isn't* invalid should be the special
cases, not every single method), but in this patch I'm just interested
in correctness.

With this patch, we pass the jtreg empty path test (which we previously
failed) and we pass my more complete test (added to FileTest.java in this
patch).

Bug: 2281992

14 years agoDO NOT MERGE: backport the IPv6 NetworkInterface/multicast fixes.
Elliott Hughes [Thu, 26 Nov 2009 20:44:42 +0000 (12:44 -0800)]
DO NOT MERGE: backport the IPv6 NetworkInterface/multicast fixes.

This is a backport of the minimal changes from master (flan) to fix IPv6
multicasting. Specifically, it fixes NetworkInterface to report IPv6 addresses,
it fixes GenericIPMreq so we pass the interface indexes down to native code,
it replaces our old copy of harmony's MulticastSocketTest with the current
upstream version (to avoid bogus failures), and it brings back one small
"unrelated" fix to OSNetworkSystem.cpp that's necessary to prevent failures
in later parts of tests we used to fail too early to notice secondary
problems.

This passes all the (fixed) MulticastSocketTest tests, causes no regressions
in the whole net.AllTests suite, and fixes the user-submitted application
that started the investigation.

Bug: 1750581

14 years agoFix File.isHidden and File.listRoots.
Elliott Hughes [Thu, 26 Nov 2009 00:16:37 +0000 (16:16 -0800)]
Fix File.isHidden and File.listRoots.

Not only were the old implementations of these methods over-complicated, they
were both incorrect. We now pass all our existing tests plus the jtreg tests.

Bug: 2281992

14 years agoMerge change I5ec3a381
Android (Google) Code Review [Wed, 25 Nov 2009 17:55:11 +0000 (09:55 -0800)]
Merge change I5ec3a381

* changes:
  Changing JtregRunner to support running tests off device.

14 years agoChanging JtregRunner to support running tests off device.
Jesse Wilson [Wed, 25 Nov 2009 01:40:39 +0000 (17:40 -0800)]
Changing JtregRunner to support running tests off device.

14 years agoMerge change I869898f1
Android (Google) Code Review [Tue, 24 Nov 2009 23:08:30 +0000 (15:08 -0800)]
Merge change I869898f1

* changes:
  Fix an assertion.

14 years agoFix an assertion.
Andy McFadden [Tue, 24 Nov 2009 22:00:50 +0000 (14:00 -0800)]
Fix an assertion.

The assertion probably dated from before the binary-search path existed.

14 years agoam e732bb04: am 1c7705b6: Merge change I96996494 into eclair-mr2
Elliott Hughes [Tue, 24 Nov 2009 21:31:39 +0000 (13:31 -0800)]
am e732bb04: am 1c7705b6: Merge change I96996494 into eclair-mr2

Merge commit 'e732bb040be84bd2ac652ca53330b80367a65725'

* commit 'e732bb040be84bd2ac652ca53330b80367a65725':
  Fix browser crashes if server certificates have > 32 subjectAltNames.

14 years agoam 1c7705b6: Merge change I96996494 into eclair-mr2
Elliott Hughes [Tue, 24 Nov 2009 21:28:07 +0000 (13:28 -0800)]
am 1c7705b6: Merge change I96996494 into eclair-mr2

Merge commit '1c7705b6066ea57109557fc1cb0609991ac0af24' into eclair-mr2-plus-aosp

* commit '1c7705b6066ea57109557fc1cb0609991ac0af24':
  Fix browser crashes if server certificates have > 32 subjectAltNames.

14 years agoMerge change I96996494 into eclair-mr2
Android (Google) Code Review [Tue, 24 Nov 2009 21:24:18 +0000 (13:24 -0800)]
Merge change I96996494 into eclair-mr2

* changes:
  Fix browser crashes if server certificates have > 32 subjectAltNames.

14 years agoFix browser crashes if server certificates have > 32 subjectAltNames.
Elliott Hughes [Tue, 24 Nov 2009 19:47:14 +0000 (11:47 -0800)]
Fix browser crashes if server certificates have > 32 subjectAltNames.

Android-only changes added an arbitrary limit that upstream doesn't have.
This limit-free implementation is still more efficient than upstream (which
always allocates three Vectors).

Dr No: danfuzz
Bug: 2281869

14 years agoA few notes on why we don't cache canonical paths.
Jesse Wilson [Tue, 24 Nov 2009 18:24:37 +0000 (10:24 -0800)]
A few notes on why we don't cache canonical paths.

14 years agoMerge change I518925b0
Android (Google) Code Review [Tue, 24 Nov 2009 18:35:44 +0000 (10:35 -0800)]
Merge change I518925b0

* changes:
  Fix windows SDK build.

14 years agoam 683daacf: (-s ours) am d1aead76: Merge change Ie21b2327 into eclair-mr2
Jesse Wilson [Tue, 24 Nov 2009 17:56:59 +0000 (09:56 -0800)]
am 683daacf: (-s ours) am d1aead76: Merge change Ie21b2327 into eclair-mr2

Merge commit '683daacf21830a0b0510320c735485c75749c4f1'

* commit '683daacf21830a0b0510320c735485c75749c4f1':
  DO NOT MERGE: Removing the use of FileCanonPathCache.

14 years agoam d1aead76: Merge change Ie21b2327 into eclair-mr2
Jesse Wilson [Tue, 24 Nov 2009 17:51:34 +0000 (09:51 -0800)]
am d1aead76: Merge change Ie21b2327 into eclair-mr2

Merge commit 'd1aead768d5c6e4aa18c4f43e6be97f8a40fbf84' into eclair-mr2-plus-aosp

* commit 'd1aead768d5c6e4aa18c4f43e6be97f8a40fbf84':
  DO NOT MERGE: Removing the use of FileCanonPathCache.

14 years agoMerge change Ie21b2327 into eclair-mr2
Android (Google) Code Review [Tue, 24 Nov 2009 17:47:04 +0000 (09:47 -0800)]
Merge change Ie21b2327 into eclair-mr2

* changes:
  DO NOT MERGE: Removing the use of FileCanonPathCache.

14 years agoDO NOT MERGE: Removing the use of FileCanonPathCache.
Jesse Wilson [Tue, 24 Nov 2009 01:58:43 +0000 (17:58 -0800)]
DO NOT MERGE: Removing the use of FileCanonPathCache.

Aside from being an unjustified optimization, users have reported
problems with this in the wild. This cache has already been removed
in master.

14 years agoMerge change I9189bd9d
Android (Google) Code Review [Tue, 24 Nov 2009 01:44:32 +0000 (17:44 -0800)]
Merge change I9189bd9d

* changes:
  Fix java.io.File's JNI's fixed-length buffers.

14 years agoFix java.io.File's JNI's fixed-length buffers.
Elliott Hughes [Sat, 21 Nov 2009 07:02:07 +0000 (23:02 -0800)]
Fix java.io.File's JNI's fixed-length buffers.

I've also removed most of the duplication, simplified a lot of the
implementation, and added loads of TODOs now it's possible to see
what's going on under all the obfuscation. (The native code is
roughly half its previous size, but more functional.)

I want to stop here rather than start fixing any of the TODOs
because this change is already large enough and the history will
be clearer if unrelated changes are kept separate (easy though many
of them are).

Strictly speaking, I haven't removed all the fixed-length buffers:
the File.list implementation still uses fixed-length buffers, but
as the new TODOs point out, I think we want to rewrite that code
to better match its callers, and doing so will make the fixed-length
buffers go away. There's no point polishing code that's already
scheduled for deletion.

Add a couple of basic tests, one that assumes that if Path copes
with long paths in a couple of File's methods, it works in all of
them; another that singles out our readlink(2) wrapper because
that's the only place so far where we cope with arbitrary-length
paths moving in the opposite direction (from kernel to JNI to Java).

14 years agoMerge change Iff90b1aa
Android (Google) Code Review [Tue, 24 Nov 2009 00:35:47 +0000 (16:35 -0800)]
Merge change Iff90b1aa

* changes:
  Explicitly ignore non-IPv4/IPv6 addresses from IFA_ADDRESS.

14 years agoMerge change I72b1f303
Android (Google) Code Review [Tue, 24 Nov 2009 00:33:44 +0000 (16:33 -0800)]
Merge change I72b1f303

* changes:
  Add a comment.