OSDN Git Service

android-x86/dalvik.git
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 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 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.

14 years agoFix windows SDK build.
Andy McFadden [Tue, 24 Nov 2009 00:12:39 +0000 (16:12 -0800)]
Fix windows SDK build.

Broken by 96516932f1557d8f48a8b2dbbb885af01a11ef6e.

14 years agoMerge change I4bd6f817
Android (Google) Code Review [Mon, 23 Nov 2009 23:25:50 +0000 (15:25 -0800)]
Merge change I4bd6f817

* changes:
  Replaced primitive sorts with Iaroslavski, Bentley, and Bloch's Dual Pivot Quicksort. The originals were based on Bentley and McIlroy's "Engineering a Sort Function." The original floating point sorts suffered from poor performance due to the use of a naive comparison function.  In round numbers, the new version is 1.5x as fast as the old one on integers and twice as fast on floating point numbers (on the latest Android build running on Sholes).  On some data sets (e.g., nearly sorted data, the new version is substantially faster.

14 years agoReplaced primitive sorts with Iaroslavski, Bentley, and Bloch's Dual Pivot Quicksort.
Joshua Bloch [Wed, 11 Nov 2009 23:31:19 +0000 (15:31 -0800)]
Replaced primitive sorts with Iaroslavski, Bentley, and Bloch's Dual Pivot Quicksort.
The originals were based on Bentley and McIlroy's "Engineering a Sort Function."
The original floating point sorts suffered from poor performance due to the use
of a naive comparison function.  In round numbers, the new version is 1.5x as fast
as the old one on integers and twice as fast on floating point numbers (on the
latest Android build running on Sholes).  On some data sets (e.g., nearly sorted data,
the new version is substantially faster.

Now, with added performance tweaks from Jesse and Bob!! With these tweaks, the sort
is 70% faster than the original sort on integers and over twice as fast on doubles.
None of the optimizations are Dalvik-specific, and we may be able to make it even
faster by adding Dalvik-specific optimizations.

Also added beefier tests.

14 years agoAdd a comment.
Elliott Hughes [Mon, 23 Nov 2009 18:54:47 +0000 (10:54 -0800)]
Add a comment.

14 years agoExplicitly ignore non-IPv4/IPv6 addresses from IFA_ADDRESS.
Elliott Hughes [Mon, 23 Nov 2009 18:46:02 +0000 (10:46 -0800)]
Explicitly ignore non-IPv4/IPv6 addresses from IFA_ADDRESS.

I don't think this can happen (some other calls return hardware addresses too,
but I've never seen a hardware address in an IFA_ADDRESS message), but netlink
is badly documented, and it's better to be safe than sorry.

14 years agoJit: Support for inline-execute/range [issue 2268232]
Bill Buzbee [Fri, 20 Nov 2009 23:41:34 +0000 (15:41 -0800)]
Jit: Support for inline-execute/range [issue 2268232]

14 years agoJit: Misc fixes, move_exception, blocking mode, self-cosim
Bill Buzbee [Sun, 22 Nov 2009 20:45:30 +0000 (12:45 -0800)]
Jit: Misc fixes, move_exception, blocking mode, self-cosim

OP_MOVE_EXCEPTION handler was neglecting to reset.
Blocking mode was failing to signal empty queue in some cases
Self-cosim was including operations in traces that can't be done twice
Added OP_MOVE_EXCEPTION to self cosim's no-replay ops (it has side effects)
Restored threshold of 1 to self-cosim (now able to boot device with self-cosim)
When threshold < 6, disable 2nd-level translation filter

14 years agoRestructure the codegen to make architectural depedency explicit.
Ben Cheng [Mon, 23 Nov 2009 07:31:11 +0000 (23:31 -0800)]
Restructure the codegen to make architectural depedency explicit.

The original Codegen.c is broken into three components:

- CodegenCommon.c (arch-independend)
- CodegenFactory.c (Thumb1/2 dependent)
- CodegenDriver.c (Dalvik dependent)

For the Thumb/Thumb2 directories, each contain the followin three files:

- Factory.c (low-level routines for instruction selections)
- Gen.c     (invoke the ISA-specific instruction selection routines)
- Ralloc.c  (arch-dependent register pools)

The FP directory contains FP-specific codegen routines depending on
Thumb/Thumb2/VFP/PortableFP:

- Thumb2VFP.c
- ThumbVFP.c
- ThumbPortableFP.c

Then the hierarchy is formed by stacking these files in the following top-down
order:

1 CodegenCommon.c
2 Thumb[2]/Factory.c
3 CodegenFactory.c
4 Thumb[2]/Gen.c
5 FP stuff
6 Thumb[2]/Ralloc.c
7 CodegenDriver.c

14 years agoMerge change I9fa3ef2c
Android (Google) Code Review [Sat, 21 Nov 2009 03:13:58 +0000 (19:13 -0800)]
Merge change I9fa3ef2c

* changes:
  Rewrite NetworkInterface's JNI for IPv6.

14 years agoMerge change I2807742e
Android (Google) Code Review [Sat, 21 Nov 2009 01:26:04 +0000 (17:26 -0800)]
Merge change I2807742e

* changes:
  Switch java_io_File.c over to C++.

14 years agoSwitch java_io_File.c over to C++.
Elliott Hughes [Sat, 21 Nov 2009 00:57:50 +0000 (16:57 -0800)]
Switch java_io_File.c over to C++.

14 years agoam 070dbac8: am 0dfef7bc: Fix bugs created by caching NumberFormat & DecimalFormatSym...
Dan Egnor [Sat, 21 Nov 2009 00:25:09 +0000 (16:25 -0800)]
am 070dbac8: am 0dfef7bc: Fix bugs created by caching NumberFormat & DecimalFormatSymbols objects

Merge commit '070dbac882856834111bc0e766224ee53c8d5471'

* commit '070dbac882856834111bc0e766224ee53c8d5471':
  Fix bugs created by caching NumberFormat & DecimalFormatSymbols objects

14 years agoam 0dfef7bc: Fix bugs created by caching NumberFormat & DecimalFormatSymbols objects
Dan Egnor [Sat, 21 Nov 2009 00:20:17 +0000 (16:20 -0800)]
am 0dfef7bc: Fix bugs created by caching NumberFormat & DecimalFormatSymbols objects

Merge commit '0dfef7bc223f18a1372b4c44c822b9cdc5d5f741' into eclair-mr2-plus-aosp

* commit '0dfef7bc223f18a1372b4c44c822b9cdc5d5f741':
  Fix bugs created by caching NumberFormat & DecimalFormatSymbols objects

14 years agoFix bugs created by caching NumberFormat & DecimalFormatSymbols objects
Dan Egnor [Sat, 21 Nov 2009 00:10:56 +0000 (16:10 -0800)]
Fix bugs created by caching NumberFormat & DecimalFormatSymbols objects

14 years agoRewrite NetworkInterface's JNI for IPv6.
Elliott Hughes [Fri, 20 Nov 2009 02:32:43 +0000 (18:32 -0800)]
Rewrite NetworkInterface's JNI for IPv6.

The old ioctl SIOCGIFCONF implementation of getNetworkInterfaces only returns
IPv4 addresses. Now we've switched everything over to IPv6, that's not good
enough. This change (a) implements glibc/BSD-like getifaddrs(3)/freeifaddrs(3)
for Android, and (b) rewrites our getNetworkInterfaces to use that method. Of
particular note is that we now do more of the work in Java. The JNI hands back
a Java equivalent of getifaddrs(3)'s linked list of ifaddrs structs. The new
package-private java.net.InterfaceAddress class serves as Java's "struct
ifaddrs".

The old implementation was also broken: SIOCGIFCONF doesn't actually return
interface indexes from the kernel as the old code believed, so we were
pulling the address family out of the IPv4 address it returned, leading
us to assign the index 2 to all network interfaces. This caused all kinds of
weird behavior later.

I also had to fix GenericIPMreq so that its interface index field is actually
set. The native code gets passed one of these objects when setNetworkInterface
is called, so it's kind of important that the object identify which interface
it's supposed to correspond to.

I've also added missing copyright headers.

This fixes all of the harmony tests on the simulator and on the device. It
fixes several but not all of the jtreg MulticastSocket and IPv6 tests.

14 years agoMerge change I952e8040
Android (Google) Code Review [Fri, 20 Nov 2009 23:07:35 +0000 (15:07 -0800)]
Merge change I952e8040

* changes:
  Implement ZoneInfo.toString for debugging convenience.

14 years agoImplement ZoneInfo.toString for debugging convenience.
Elliott Hughes [Fri, 20 Nov 2009 22:19:42 +0000 (14:19 -0800)]
Implement ZoneInfo.toString for debugging convenience.

Bug: 2276903

14 years agoFix heap profiling doc.
Andy McFadden [Fri, 20 Nov 2009 21:42:29 +0000 (13:42 -0800)]
Fix heap profiling doc.

The DDMS "get hprof dump" button doesn't show up until 2.0.

14 years agoAdd execute-inline/range instruction.
Andy McFadden [Thu, 19 Nov 2009 18:23:41 +0000 (10:23 -0800)]
Add execute-inline/range instruction.

Like "execute-inline", this is an instruction generated by dexopt that
replaces a method invoke instruction.  It's useful for small, frequently
called methods in the core libs.

As with execute-inline, we allow at most 4 arguments, but with /range
we're no longer limited to the low 16 registers.

Also: marked execute-inline as being able to throw an exception.

Needed: native x86 implementation; support in JIT.

For bug 2268232.

14 years agoJit: fix for string/indexOf handler.
Bill Buzbee [Thu, 19 Nov 2009 19:37:21 +0000 (11:37 -0800)]
Jit: fix for string/indexOf handler.

14 years agoMerge change I8cd9a083
Android (Google) Code Review [Wed, 18 Nov 2009 22:04:37 +0000 (14:04 -0800)]
Merge change I8cd9a083

* changes:
  Fix KXmlSerializer so it won't generate invalid XML.

14 years agoFix KXmlSerializer so it won't generate invalid XML.
Elliott Hughes [Wed, 18 Nov 2009 02:05:40 +0000 (18:05 -0800)]
Fix KXmlSerializer so it won't generate invalid XML.

We were allowing arbitrary characters to be output (which, surprisingly,
XML does not), and we weren't correctly escaping CDATA sections that
contained "]]>".

Pull out some of my test helpers from DocumentBuilderTest into Support_Xml,
because they're more generally useful when writing tests involving XML.

Also correct a bunch of spelling mistakes in XmlSerializer's javadoc, since
I happened to be reading through.

14 years agoDon't ignore errors on expected result, compile, or install in jtreg runner.
Jesse Wilson [Wed, 18 Nov 2009 21:33:48 +0000 (13:33 -0800)]
Don't ignore errors on expected result, compile, or install in jtreg runner.

14 years agoMerge change Id856eca6
Android (Google) Code Review [Wed, 18 Nov 2009 01:52:35 +0000 (17:52 -0800)]
Merge change Id856eca6

* changes:
  protect use of SMALL_BUFFERS and HANDSHAKE_CUTTHROUGH

14 years agoam 50f82ad4: am 08e0023c: Merge change I42d17725 into eclair-mr2
Dan Egnor [Wed, 18 Nov 2009 01:01:37 +0000 (17:01 -0800)]
am 50f82ad4: am 08e0023c: Merge change I42d17725 into eclair-mr2

Merge commit '50f82ad4f2c4047382029560fd09d1907518adc8'

* commit '50f82ad4f2c4047382029560fd09d1907518adc8':
  Cache NumberFormat and DecimalFormatSymbols objects in a ThreadLocal,

14 years agoam 239e94f6: am 28ac5b8c: Merge change I77af8135 into eclair-mr2
Elliott Hughes [Wed, 18 Nov 2009 01:01:32 +0000 (17:01 -0800)]
am 239e94f6: am 28ac5b8c: Merge change I77af8135 into eclair-mr2

Merge commit '239e94f6a7d54bf13c78171d841582557b5fdd38'

* commit '239e94f6a7d54bf13c78171d841582557b5fdd38':
  Fix Formatter.format's handling of Formattable.

14 years agoam 08e0023c: Merge change I42d17725 into eclair-mr2
Dan Egnor [Wed, 18 Nov 2009 00:58:01 +0000 (16:58 -0800)]
am 08e0023c: Merge change I42d17725 into eclair-mr2

Merge commit '08e0023c59828a443d993c7e6cb43bf9d197506a' into eclair-mr2-plus-aosp

* commit '08e0023c59828a443d993c7e6cb43bf9d197506a':
  Cache NumberFormat and DecimalFormatSymbols objects in a ThreadLocal,

14 years agoam 28ac5b8c: Merge change I77af8135 into eclair-mr2
Elliott Hughes [Wed, 18 Nov 2009 00:57:57 +0000 (16:57 -0800)]
am 28ac5b8c: Merge change I77af8135 into eclair-mr2

Merge commit '28ac5b8cfd52d1902a132a5faf8f102a8b33d6c2' into eclair-mr2-plus-aosp

* commit '28ac5b8cfd52d1902a132a5faf8f102a8b33d6c2':
  Fix Formatter.format's handling of Formattable.

14 years agoMerge change I42d17725 into eclair-mr2
Android (Google) Code Review [Wed, 18 Nov 2009 00:55:29 +0000 (16:55 -0800)]
Merge change I42d17725 into eclair-mr2

* changes:
  Cache NumberFormat and DecimalFormatSymbols objects in a ThreadLocal, so they can be reused between multiple instances of Formatter on the same thread.  This speeds up my unscientific benchmark (a number of printouts involved in a debugging diagnostics output) by 3x, and should have a similar impact on anyone who uses String.format(), PrintWriter.format(), and the like.

14 years agoMerge change I77af8135 into eclair-mr2
Android (Google) Code Review [Wed, 18 Nov 2009 00:54:48 +0000 (16:54 -0800)]
Merge change I77af8135 into eclair-mr2

* changes:
  Fix Formatter.format's handling of Formattable.

14 years agoam 52d2e5f4: am 08c24984: Merge change I0ee370b9 into eclair-mr2
Elliott Hughes [Wed, 18 Nov 2009 00:46:57 +0000 (16:46 -0800)]
am 52d2e5f4: am 08c24984: Merge change I0ee370b9 into eclair-mr2

Merge commit '52d2e5f4e7f75e3a2b38b0373158b7dff13e72cf'

* commit '52d2e5f4e7f75e3a2b38b0373158b7dff13e72cf':
  Consistently use Formatter's cached NumberFormat.

14 years agoam 08c24984: Merge change I0ee370b9 into eclair-mr2
Elliott Hughes [Wed, 18 Nov 2009 00:42:52 +0000 (16:42 -0800)]
am 08c24984: Merge change I0ee370b9 into eclair-mr2

Merge commit '08c24984fd3cb3e927c9a97b8413843b4b215dc5' into eclair-mr2-plus-aosp

* commit '08c24984fd3cb3e927c9a97b8413843b4b215dc5':
  Consistently use Formatter's cached NumberFormat.

14 years agoMerge change I0ee370b9 into eclair-mr2
Android (Google) Code Review [Wed, 18 Nov 2009 00:40:01 +0000 (16:40 -0800)]
Merge change I0ee370b9 into eclair-mr2

* changes:
  Consistently use Formatter's cached NumberFormat.

14 years agoprotect use of SMALL_BUFFERS and HANDSHAKE_CUTTHROUGH
Jean-Baptiste Queru [Tue, 17 Nov 2009 23:33:33 +0000 (15:33 -0800)]
protect use of SMALL_BUFFERS and HANDSHAKE_CUTTHROUGH

14 years agoCache NumberFormat and DecimalFormatSymbols objects in a ThreadLocal,
Dan Egnor [Tue, 17 Nov 2009 23:56:11 +0000 (15:56 -0800)]
Cache NumberFormat and DecimalFormatSymbols objects in a ThreadLocal,
so they can be reused between multiple instances of Formatter on the
same thread.  This speeds up my unscientific benchmark (a number of
printouts involved in a debugging diagnostics output) by 3x, and
should have a similar impact on anyone who uses String.format(),
PrintWriter.format(), and the like.

14 years agoam d3864b20: am dced7947: Reduce logging.
Andy McFadden [Tue, 17 Nov 2009 23:10:55 +0000 (15:10 -0800)]
am d3864b20: am dced7947: Reduce logging.

Merge commit 'd3864b207e6f6b090accd41a977ad23e18bdcf01'

* commit 'd3864b207e6f6b090accd41a977ad23e18bdcf01':
  Reduce logging.

14 years agoFix Formatter.format's handling of Formattable.
Elliott Hughes [Tue, 22 Sep 2009 21:38:18 +0000 (14:38 -0700)]
Fix Formatter.format's handling of Formattable.

This doesn't make much difference to performance, but it is
slightly faster and I think it reads better too. Proof of the
latter is the fact that the rewritten form accidentally fixed
bug 1767: the old code was storing up literal text until after
handling the next format specifier, which is wrong if the
format specifier has side effects caused by the use of
Formattable.

(I don't plan on doing any more on the performance bug for now,
though I note that %g allocates and manipulates BigDecimal
instances, which would be worth looking at when we get round to
the bug that causes it to fail a harmony test.)

Bug: 1476, 1767

14 years agoConsistently use Formatter's cached NumberFormat.
Elliott Hughes [Mon, 21 Sep 2009 21:08:38 +0000 (14:08 -0700)]
Consistently use Formatter's cached NumberFormat.

%f is a lot more expensive than it should be because we're not using the cached
NumberFormat (as we are for %d). Running the microbenchmark I added to the
bug (times in ms, on a Cortex A8):

                                old       new
      new Formatter %f         1732       811
      String.format %d          635       651
      String.format %f         1752       900
      reuse Formatter %f       1521       188
      Double.toString +         149       148
      Double.toString append     33        33
      StringBuilder.append      143       139

Bug: 1476

14 years agoam dced7947: Reduce logging.
Andy McFadden [Tue, 17 Nov 2009 22:05:42 +0000 (14:05 -0800)]
am dced7947: Reduce logging.

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

* commit 'dced79474902ffa57fbd48121eb794aad7d24ddc':
  Reduce logging.

14 years agoMerge change I49b05da2
Android (Google) Code Review [Tue, 17 Nov 2009 21:47:34 +0000 (13:47 -0800)]
Merge change I49b05da2

* changes:
  Various XML fixes.

14 years agoReduce logging.
Andy McFadden [Tue, 17 Nov 2009 21:13:34 +0000 (13:13 -0800)]
Reduce logging.

This cuts out some unnecessarily verbose dalvikvm chatter, notably:

  Trying to load lib /system/lib/librs_jni.so 0x0
  Added shared lib /system/lib/librs_jni.so 0x0

These messages can be useful for people trying to get their apps to
work with the NDK, so I'm only suppressing them when the path starts
with "/system".  The result is that you can boot the system and run all
standard apps without seeing them, but we'll still see app-private libs
being loaded.

Also LOGI->LOGV for "Debugger thread not active, ignoring DDM send",
which seemed to be firing on startup for APp NaMe events.  Ditto for
"Splitting out new zygote heap", which only happens once, but doesn't
strike me as a particularly useful thing to log.

14 years agoVarious XML fixes.
Elliott Hughes [Tue, 17 Nov 2009 05:23:11 +0000 (21:23 -0800)]
Various XML fixes.

Add tests for bug 2487, exploring the situations where "]]>" is and isn't
allowed. Fix the bug by changing KXmlParser so it pays attention to
whether it's dealing with normal text or text in an attribute value and
reports errors appropriately.

In order to pass the new tests, we also need to fix DocumentBuilder to
pay attention to its DocumentBuilderFactory's "coalescing" setting: whether
or not adjacent text/CDATA nodes should be coalesced.

This in turn fixes a @KnownFailure in DocumentBuilderFactoryTest: previously
we didn't allow the caller to turn "coalescing" off (though until my
previous patch, we didn't actually coalesce anyway). Now we support both,
and I've made coalescing the default, because bug reports tell us that's
what users want. It's how the RI behaves, too.

Bug: 2487

14 years agoMerge change I117408b2
Android (Google) Code Review [Tue, 17 Nov 2009 15:19:49 +0000 (07:19 -0800)]
Merge change I117408b2

* changes:
  Restore support for DEX on FAT.

14 years agoMerge change Id8a539c6
Android (Google) Code Review [Tue, 17 Nov 2009 05:41:20 +0000 (21:41 -0800)]
Merge change Id8a539c6

* changes:
  Suppressing an invalid test that's checking implementation details.

14 years agoSuppressing an invalid test that's checking implementation details.
Jesse Wilson [Tue, 17 Nov 2009 02:31:15 +0000 (18:31 -0800)]
Suppressing an invalid test that's checking implementation details.

14 years agoRestore support for DEX on FAT.
Andy McFadden [Tue, 17 Nov 2009 00:14:54 +0000 (16:14 -0800)]
Restore support for DEX on FAT.

The recent change to mmap(read-write)+mprotect(read-only) doesn't seem
to work on FAT filesystems like /sdcard.  This caused problems for the
code that opens Zip files and the code that opens DEX files.

This change splits the "map file" function into "read only" and
"writable read only" versions, using the former for Zip and the latter
for DEX.  Further, failure to mprotect(read-only) is now considered a
soft failure and only causes a warning.

The only apps that will be affected by this are those using /sdcard to
hold optimized DEX data for "plugin" APKs.

Also: moved the non-HAVE_POSIX_FILEMAP implementation of file mapping
into a shared function.  (Could probably go away entirely.)

Also: fixed the expected output for test 071.

14 years agoMerge change I4c0dedfd
Android (Google) Code Review [Mon, 16 Nov 2009 23:10:01 +0000 (15:10 -0800)]
Merge change I4c0dedfd

* changes:
  Jit: string's compareTo performance improvement.