OSDN Git Service

android-x86/dalvik.git
14 years agoMerge "Fix a long standing bug within dvmHeapSourceGetObjectBitmaps. All callers...
Carl Shapiro [Wed, 3 Feb 2010 02:18:13 +0000 (18:18 -0800)]
Merge "Fix a long standing bug within dvmHeapSourceGetObjectBitmaps.  All callers of this function assign the return value to an unsigned value even though this function returns -1 in the error case.  This causes the error checks to succeed in cases where it should otherwise fail. Rather than return -1 on error, I have elected to return 0 instead which just happens to be compatible with all current uses."

14 years agoFix a long standing bug within dvmHeapSourceGetObjectBitmaps. All
Carl Shapiro [Tue, 2 Feb 2010 21:47:59 +0000 (13:47 -0800)]
Fix a long standing bug within dvmHeapSourceGetObjectBitmaps.  All
callers of this function assign the return value to an unsigned value
even though this function returns -1 in the error case.  This causes
the error checks to succeed in cases where it should otherwise fail.
Rather than return -1 on error, I have elected to return 0 instead
which just happens to be compatible with all current uses.

14 years agoMerge "A new test suite for our XSLT transforms."
Jesse Wilson [Tue, 2 Feb 2010 20:48:06 +0000 (12:48 -0800)]
Merge "A new test suite for our XSLT transforms."

14 years agoA new test suite for our XSLT transforms.
Jesse Wilson [Tue, 2 Feb 2010 02:33:00 +0000 (18:33 -0800)]
A new test suite for our XSLT transforms.

Currently the test suite isn't wired-in to run automatically. Before
that can happen I need to devise a way for the device to grab the
OASIS test .zip from the Internet (or distribute it with Android).

In the interim the test can be run by hand by manually copying the
test suite to the device ("adb push") and running the test suite's
main method. This approach might be workable in our continuous
build.

Note that the RI does horribly at this test suite - in my run it
reports the following:
   FAILURES!!!
   Tests run: 3173,  Failures: 338,  Errors: 730

14 years agoRestore our ability to parse an XML Document given a File argument
Jesse Wilson [Tue, 2 Feb 2010 19:18:33 +0000 (11:18 -0800)]
Restore our ability to parse an XML Document given a File argument
directly, rather than via a stream.

When I updated DocumentBuilder but not its subclass DocumentBuilderImpl,
some of the assumptions by DocumentBuilderImpl were violated.

14 years agoMerge "Move a test I wrote under our wing."
Elliott Hughes [Tue, 2 Feb 2010 17:02:51 +0000 (09:02 -0800)]
Merge "Move a test I wrote under our wing."

14 years agoReduce VM shutdown verbosity.
Andy McFadden [Tue, 2 Feb 2010 00:56:53 +0000 (16:56 -0800)]
Reduce VM shutdown verbosity.

Adds -verbose:shutdown flag, defaulted to "false".  Cuts out most of the
log noise associated with shell commands.

14 years agoMove a test I wrote under our wing.
Elliott Hughes [Tue, 2 Feb 2010 03:45:41 +0000 (19:45 -0800)]
Move a test I wrote under our wing.

I put this in amongst the harmony tests before we started our own little
tree of tests.

14 years agoAdd a missing "static", found by FindBugs.
Elliott Hughes [Tue, 2 Feb 2010 02:19:28 +0000 (18:19 -0800)]
Add a missing "static", found by FindBugs.

14 years agoMerge "Fix BigDecimalTest.test_stripTrailingZero."
Elliott Hughes [Tue, 2 Feb 2010 01:35:21 +0000 (17:35 -0800)]
Merge "Fix BigDecimalTest.test_stripTrailingZero."

14 years agoFix BigDecimalTest.test_stripTrailingZero.
Elliott Hughes [Tue, 2 Feb 2010 00:25:40 +0000 (16:25 -0800)]
Fix BigDecimalTest.test_stripTrailingZero.

jessewilson reverted an upstream change (https://issues.apache.org/jira/browse/HARMONY-4623)
that caused an RI incompatibility. Although it seems like the RI behavior is
wrong, the poor design of BigDecimal.equals (which checks both value *and*
scale) probably means we should remain compatible.

This patch changes the test expectation to match the RI's behavior and adds
a comment in both the code and its test explaining that this is deliberate.

14 years agoMerge "Jit: MethodTrace + Jit fix"
Bill Buzbee [Tue, 2 Feb 2010 00:14:52 +0000 (16:14 -0800)]
Merge "Jit: MethodTrace + Jit fix"

14 years agoMerge "Remove @KnownFailure from tests that now pass."
Elliott Hughes [Tue, 2 Feb 2010 00:08:02 +0000 (16:08 -0800)]
Merge "Remove @KnownFailure from tests that now pass."

14 years agoMerge "FindBugs didn't like setInternalField, and neither do I."
Elliott Hughes [Tue, 2 Feb 2010 00:07:42 +0000 (16:07 -0800)]
Merge "FindBugs didn't like setInternalField, and neither do I."

14 years agoRemove @KnownFailure from tests that now pass.
Elliott Hughes [Mon, 1 Feb 2010 23:38:16 +0000 (15:38 -0800)]
Remove @KnownFailure from tests that now pass.

One of these tests still doesn't pass, but for a different reason know the
known failure is fixed, so I've removed that test's annotation too:

16) test_parseLjava_io_InputStreamLorg_xml_sax_helpers_DefaultHandlerLjava_lang_String(tests.api.javax.xml.parsers.SAXParserTest)junit.framework.AssertionFailedError
at tests.api.javax.xml.parsers.SAXParserTest.test_parseLjava_io_InputStreamLorg_xml_sax_helpers_DefaultHandlerLjava_lang_String(SAXParserTest.java:680)
at java.lang.reflect.Method.invokeNative(Native Method)
at com.google.coretests.CoreTestRunnable.runInternally(CoreTestRunnable.java:129)
at com.google.coretests.CoreTestRunnable.run(CoreTestRunnable.java:92)
at com.google.coretests.CoreTestResult.runProtected(CoreTestResult.java:148)
at com.google.coretests.CoreTestSuite.run(CoreTestSuite.java:278)
at com.google.coretests.CoreTestRunner.doRun(CoreTestRunner.java:141)
at com.google.coretests.CoreTestRunner.start(CoreTestRunner.java:317)
at com.google.coretests.CoreTestRunner.main(CoreTestRunner.java:110)
at com.google.coretests.Main.main(Main.java:45)
at dalvik.system.NativeStart.main(Native Method)

14 years agoFindBugs didn't like setInternalField, and neither do I.
Elliott Hughes [Mon, 1 Feb 2010 23:32:27 +0000 (15:32 -0800)]
FindBugs didn't like setInternalField, and neither do I.

"Exception is caught when Exception is not thrown in java.text.DecimalFormat$1.run()"

Since it will always fail anyway, because those fields don't exist, let's
just junk it.

It turns out that getInternalField is similarly useless, so junk it too.

I've tidied the whole readObject method so it's somewhat readable now.

I also fixed this FindBugs warning in passing:

"Method java.text.DecimalFormat.parse(String, ParsePosition) invokes inefficient
new Long(long) constructor; use Long.valueOf(long) instead"

14 years agoMerge "Minor clarification."
Andy McFadden [Mon, 1 Feb 2010 23:12:03 +0000 (15:12 -0800)]
Merge "Minor clarification."

14 years agoMinor clarification.
Andy McFadden [Mon, 1 Feb 2010 22:39:21 +0000 (14:39 -0800)]
Minor clarification.

People seem tempted to skip past the introductory material and jump
straight to the meaty bits, but the introduction tells you some
important things (like how you need to stop/start the framework).

14 years agoJit: MethodTrace + Jit fix
Bill Buzbee [Mon, 1 Feb 2010 02:53:15 +0000 (18:53 -0800)]
Jit: MethodTrace + Jit fix

Add checks for debug & trace mode to avoid re-entering Jit'd code.
This is the conversative solution - we'll eventually want the Jit
to integrate support for tracing and debug into Jit'd code.

14 years agoMerge "Bump up the max stack depth."
Andy McFadden [Mon, 1 Feb 2010 22:54:05 +0000 (14:54 -0800)]
Merge "Bump up the max stack depth."

14 years agoBump up the max stack depth.
Andy McFadden [Mon, 1 Feb 2010 22:32:35 +0000 (14:32 -0800)]
Bump up the max stack depth.

This increases the maximum stack depth in the DDMS "allocation tracker"
tab from 8 to 16.  Adds about 32KB to the static size, plus a variable
amount as the data is prepared for transmission to DDMS.

For bug 2345675.

14 years agoMerge "Update with froyo change."
Andy McFadden [Mon, 1 Feb 2010 20:33:39 +0000 (12:33 -0800)]
Merge "Update with froyo change."

14 years agoFix "unmappable character for ascii" warnings in libcore tests.
Elliott Hughes [Mon, 1 Feb 2010 19:40:36 +0000 (11:40 -0800)]
Fix "unmappable character for ascii" warnings in libcore tests.

The libcore "core" and "core-test" builds are now warning-free. (For Java.)

14 years agoFix varargs warnings in libcore tests.
Elliott Hughes [Mon, 1 Feb 2010 19:14:45 +0000 (11:14 -0800)]
Fix varargs warnings in libcore tests.

14 years agoMerge "Fix warnings in the new XML code."
Elliott Hughes [Mon, 1 Feb 2010 19:13:46 +0000 (11:13 -0800)]
Merge "Fix warnings in the new XML code."

14 years agoFix warnings in the new XML code.
Elliott Hughes [Mon, 1 Feb 2010 18:40:34 +0000 (10:40 -0800)]
Fix warnings in the new XML code.

14 years agoUpdate with froyo change.
Andy McFadden [Mon, 1 Feb 2010 18:24:39 +0000 (10:24 -0800)]
Update with froyo change.

This refers to Froyo as "2.x", because nobody seems to know what the
actual numbering will be.

14 years agoFix fallback in Currency.getSymbol(Locale).
Elliott Hughes [Sat, 30 Jan 2010 05:32:17 +0000 (21:32 -0800)]
Fix fallback in Currency.getSymbol(Locale).

If ICU doesn't have any localized symbol for a currency, we're supposed to
return the currency code, not null.

I introduced this bug in my recent changes. The Currency tests don't find it,
but DecimalFormatTest.test_setCurrencyLjava_util_Currency does, by accident.
I've added an explicit test.

14 years agoFix more harmony tests.
Elliott Hughes [Sat, 30 Jan 2010 02:28:23 +0000 (18:28 -0800)]
Fix more harmony tests.

"HMG" means "heure du méridien de Greenwich" to the French. ICU thinks --
and the web seems to agree -- that the French actually say UTC instead.
(And you'd hope so, after it was called UTC instead of the more sensible UCT
just to keep them happy!) The RI thinks the French say "PST" rather than
"UTC-08:00", but that's hard to believe, and means that this test was never
testing RI compatibility anyway.

Relatedly, ICU thinks that "heure normale du Pacifique" is more French than
"Heure normale du Pacifique", and who am I to argue?

Fixing these turns up a real bug in TimeZone; this patch contains a fix to
the exception thrown by the test case, but not a fix for the bug (which is
overflow in inDaylightTime for the year 292278994, so there's plenty of
time to fix that one).

14 years agoMerge "Fix all the harmony java.util.Formatter tests."
Elliott Hughes [Sat, 30 Jan 2010 01:49:30 +0000 (17:49 -0800)]
Merge "Fix all the harmony java.util.Formatter tests."

14 years agoFix all the harmony java.util.Formatter tests.
Elliott Hughes [Sat, 30 Jan 2010 01:28:06 +0000 (17:28 -0800)]
Fix all the harmony java.util.Formatter tests.

ICU thinks that German short weekday names should be "So." et seq rather than
"So". This brings us into line with frameworks/base, which I'm depressed to find
has its own copy of the CLDR data in XML form (and its own date/time
formatters).

Also fix TestEnvironment to not clobber "user.name", which we need in order to
set our expectations in cases where being root affects what we can/can't do.
(This also fixes a few other harmony tests.)

14 years agoMerge "Fixing a critical regression in our SAX parsing."
Jesse Wilson [Sat, 30 Jan 2010 01:27:24 +0000 (17:27 -0800)]
Merge "Fixing a critical regression in our SAX parsing."

14 years agoFixing a critical regression in our SAX parsing.
Jesse Wilson [Sat, 30 Jan 2010 01:06:44 +0000 (17:06 -0800)]
Fixing a critical regression in our SAX parsing.

We weren't correctly covering the case where namespaces were off, but
elements contained namespaces. See bug 2400596.

14 years agoMerge "Add support for streaming hprof dumps."
Andy McFadden [Sat, 30 Jan 2010 00:33:14 +0000 (16:33 -0800)]
Merge "Add support for streaming hprof dumps."

14 years agoMerge "Change DalvikRunner to use newly added OptionParser."
Brian Carlstrom [Fri, 29 Jan 2010 23:50:24 +0000 (15:50 -0800)]
Merge "Change DalvikRunner to use newly added OptionParser."

14 years agoChange DalvikRunner to use newly added OptionParser.
Brian Carlstrom [Fri, 29 Jan 2010 18:51:56 +0000 (10:51 -0800)]
Change DalvikRunner to use newly added OptionParser.

--skip-clean is now --no-clean
--java-home now defaults to 1.5
--mode is now used to specify to run on host's java-home

DalvikRunner page examples are updated with new --mode and --java-home

Fixes junit tests to work on host by using changing classpath to be absolute paths

Some minor scaffolding to prepare for running tests within an android.app.Activity.

(Patchset 2 adds default --java-home location to usage output)
(Patchset 3 address reviewer comments, mostly newbie style issues)
(Patchset 4 address enh OptionParser issues, adds short/byte as well)
(Patchset 5 address enh OptionParser issues, work with "java" from PATH, change deviceRunnerDir to File)

14 years agoMerge "Remove an obsolete assertion."
Carl Shapiro [Fri, 29 Jan 2010 23:33:55 +0000 (15:33 -0800)]
Merge "Remove an obsolete assertion."

14 years agoMerge "Change NumberFormatTest to match ICU's behavior."
Elliott Hughes [Fri, 29 Jan 2010 22:57:57 +0000 (14:57 -0800)]
Merge "Change NumberFormatTest to match ICU's behavior."

14 years agoMerge "Jit: Fix for [Issue 2406862] Compiler thread preventing VM from shutting down"
Bill Buzbee [Fri, 29 Jan 2010 22:52:18 +0000 (14:52 -0800)]
Merge "Jit: Fix for [Issue 2406862] Compiler thread preventing VM from shutting down"

14 years agoChange NumberFormatTest to match ICU's behavior.
Elliott Hughes [Fri, 29 Jan 2010 22:02:10 +0000 (14:02 -0800)]
Change NumberFormatTest to match ICU's behavior.

ICU uses a non-breaking space after the euro sign in its currency formats,
where the RI uses ASCII space. ICU's behavior seems more reasonable (to
the extent that any kind of space after a currency symbol is reasonable).

Also uncomment the Arabic tests --- I fixed right-to-left number formats
a few weeks ago.

14 years agoJit: Fix for [Issue 2406862] Compiler thread preventing VM from shutting down
Bill Buzbee [Fri, 29 Jan 2010 21:44:19 +0000 (13:44 -0800)]
Jit: Fix for [Issue 2406862] Compiler thread preventing VM from shutting down

Replace placeholder sleep with timed condition wait that will start
the jit either when the framework signals that the first screen has been
drawn or a fixed time has elapsed.

14 years agoAdd support for streaming hprof dumps.
Andy McFadden [Fri, 29 Jan 2010 01:01:39 +0000 (17:01 -0800)]
Add support for streaming hprof dumps.

This adds the dumpHprofDataDdms method, which generates the hprof dump
in RAM and then spits the whole thing at DDMS.  The idea is to avoid
touching /sdcard, since not all apps have permission to do that.

This rearranges hprofShutdown() a fair bit.  It used to re-use a context
struct, saving interesting bits to local variables before zapping it;
now we just create a second context struct and free both at the end.

For bug 2092855.

14 years agoFix tests.api.java.io.SerializationStressTest3.test_18_116_writeObject.
Elliott Hughes [Fri, 29 Jan 2010 21:10:43 +0000 (13:10 -0800)]
Fix tests.api.java.io.SerializationStressTest3.test_18_116_writeObject.

The dead field 'minExponentDigits' was of type 'byte', not 'int'.

Also add detail to serialization exception messages (this isn't just test code ---
ObjectInputStream calls this).

14 years agoRemove an obsolete assertion.
Carl Shapiro [Fri, 29 Jan 2010 19:24:22 +0000 (11:24 -0800)]
Remove an obsolete assertion.

14 years agoFix a Formatter test that I checked in broken.
Elliott Hughes [Fri, 29 Jan 2010 18:23:54 +0000 (10:23 -0800)]
Fix a Formatter test that I checked in broken.

There's really no excuse for this with DalvikRunner, but I copy and pasted this
from a mail, and didn't run it until after it had been committed. I mean, who
puts untested code in a mail? ;-)

14 years agoMerge "Use DecimalFormatSymbols' new default constructor for speed."
Elliott Hughes [Fri, 29 Jan 2010 18:17:44 +0000 (10:17 -0800)]
Merge "Use DecimalFormatSymbols' new default constructor for speed."

14 years agoMerge "Jit: Fix register usage bug (driveabout failure)"
Bill Buzbee [Fri, 29 Jan 2010 04:17:09 +0000 (20:17 -0800)]
Merge "Jit: Fix register usage bug (driveabout failure)"

14 years agoJit: Fix register usage bug (driveabout failure)
Bill Buzbee [Fri, 29 Jan 2010 02:36:55 +0000 (18:36 -0800)]
Jit: Fix register usage bug (driveabout failure)

Some of the execute-inline templates were using r4, which wasn't in the
save set for templates.  The failing traces expected it to be live across
the template call.

14 years agoUse DecimalFormatSymbols' new default constructor for speed.
Elliott Hughes [Fri, 29 Jan 2010 01:47:00 +0000 (17:47 -0800)]
Use DecimalFormatSymbols' new default constructor for speed.

This brings "new DecimalFormat" down to ~80us (from ~260us before this patch,
or ~600us this time last week). Also remove some dead code and tighten up some
accessibility.

Depends on https://android-git.corp.google.com/g/38877.

14 years agoFollow the coding style to rename startJITCompilation to startJitCompilation.
Ben Cheng [Fri, 29 Jan 2010 00:47:03 +0000 (16:47 -0800)]
Follow the coding style to rename startJITCompilation to startJitCompilation.

14 years agoMerge "Fix a couple minor bugs (bug 2404859) in TraceDump.c"
Jack Veenstra [Fri, 29 Jan 2010 00:34:18 +0000 (16:34 -0800)]
Merge "Fix a couple minor bugs (bug 2404859) in TraceDump.c"

14 years agoFix an off-by-one error when releasing thread ids. This is the result
Carl Shapiro [Fri, 29 Jan 2010 00:12:44 +0000 (16:12 -0800)]
Fix an off-by-one error when releasing thread ids.  This is the result
of an oversight in my change that eliminated the LSB set constraint on
assigned thread ids.

14 years agoFix a couple minor bugs (bug 2404859) in TraceDump.c
Jack Veenstra [Thu, 28 Jan 2010 23:57:02 +0000 (15:57 -0800)]
Fix a couple minor bugs (bug 2404859) in TraceDump.c

1. A switch statement was missing a "break" after option letter "f".
2. The heavily-used function "lookupMethod()" had an expression using mod (%) instead of bitwise-and (&).

14 years agoMerge "Add a callback for the framework to explicitly enable the JIT compiler."
Ben Cheng [Thu, 28 Jan 2010 22:43:36 +0000 (14:43 -0800)]
Merge "Add a callback for the framework to explicitly enable the JIT compiler."

14 years agoAdd a callback for the framework to explicitly enable the JIT compiler.
Ben Cheng [Thu, 28 Jan 2010 21:56:52 +0000 (13:56 -0800)]
Add a callback for the framework to explicitly enable the JIT compiler.

Dalvik_dalvik_system_VMRuntime_startJITCompilation ()V it is.

14 years agoMerge "Added support for filter in dmtracedump tool, along with some test cases."
Jack Veenstra [Thu, 28 Jan 2010 22:25:44 +0000 (14:25 -0800)]
Merge "Added support for filter in dmtracedump tool, along with some test cases."

14 years agoMerge "Fix jniThrowRuntimeException for C callers, add jniThrowNullPointerException."
Elliott Hughes [Thu, 28 Jan 2010 22:04:40 +0000 (14:04 -0800)]
Merge "Fix jniThrowRuntimeException for C callers, add jniThrowNullPointerException."

14 years agoMerge "Removing duplicate classes from our tests. These are obsolete with our DOMv3...
Jesse Wilson [Thu, 28 Jan 2010 22:00:35 +0000 (14:00 -0800)]
Merge "Removing duplicate classes from our tests. These are obsolete with our DOMv3 support."

14 years agoMerge "Jit: Rework delayed start plus misc. cleanup"
Bill Buzbee [Thu, 28 Jan 2010 21:48:09 +0000 (13:48 -0800)]
Merge "Jit: Rework delayed start plus misc. cleanup"

14 years agoFix jniThrowRuntimeException for C callers, add jniThrowNullPointerException.
Elliott Hughes [Thu, 28 Jan 2010 21:43:39 +0000 (13:43 -0800)]
Fix jniThrowRuntimeException for C callers, add jniThrowNullPointerException.

...and switch all NPE throwers over to the helper.

14 years agoJit: Rework delayed start plus misc. cleanup
Bill Buzbee [Thu, 28 Jan 2010 20:54:19 +0000 (12:54 -0800)]
Jit: Rework delayed start plus misc. cleanup

Defer initialization of jit to support upcoming feature to wait until
first screen is painted to start in order to avoid wasting effort on
jit'ng initialization code.  Timed delay in place for the moment.
To change the on/off state, call dvmSuspendAllThreads(), update the
value of gDvmJit.pJitTable and then dvmResumeAllThreads().
Each time a thread goes through the heavyweight check suspend path, returns
from a monitor lock/unlock or returns from a JNI call, it will refresh
its on/off state.

Also:
   Recognize and handle failure to increase size of JitTable.
   Avoid repeated lock/unlock of JitTable modification mutex during resize
   Make all work order enqueue actions non-blocking, which includes adding
      a non-blocking mutex lock: dvmTryLockMutex().
   Fix bug Jeff noticed where we were using a half-word form of a Thumb2
      instruction rather than the byte form.
   Minor comment changes.

14 years agoMerge "Double the speed of DecimalFormat creation."
Elliott Hughes [Thu, 28 Jan 2010 21:39:12 +0000 (13:39 -0800)]
Merge "Double the speed of DecimalFormat creation."

14 years agoMerge "Sneak a method-find feature into dexlist."
Andy McFadden [Thu, 28 Jan 2010 21:24:01 +0000 (13:24 -0800)]
Merge "Sneak a method-find feature into dexlist."

14 years agoFix broken build.
Ben Cheng [Thu, 28 Jan 2010 21:14:41 +0000 (13:14 -0800)]
Fix broken build.

14 years agoSneak a method-find feature into dexlist.
Andy McFadden [Thu, 28 Jan 2010 21:06:00 +0000 (13:06 -0800)]
Sneak a method-find feature into dexlist.

The "dexlist" command is used with "emulator -trace" to generate a large
list of methods.  I frequently use it to figure out which DEX file a
method is coming from (especially with the mysterious jars of google
code).  This adds an undocumented "--method" argument to make the method
search easier.

14 years agoMerge "Added note about NewStringUTF."
Andy McFadden [Thu, 28 Jan 2010 21:05:17 +0000 (13:05 -0800)]
Merge "Added note about NewStringUTF."

14 years agoAdded note about NewStringUTF.
Andy McFadden [Thu, 28 Jan 2010 20:27:06 +0000 (12:27 -0800)]
Added note about NewStringUTF.

Calling NewStringUTF with non-UTF data is a common mistake.  This adds
a note to the JNI Tips document.

14 years agoMerge "Add a poor-man's disassembler to inspect crashes in JIT'ed code."
Ben Cheng [Thu, 28 Jan 2010 20:59:05 +0000 (12:59 -0800)]
Merge "Add a poor-man's disassembler to inspect crashes in JIT'ed code."

14 years agoAdd a poor-man's disassembler to inspect crashes in JIT'ed code.
Ben Cheng [Thu, 28 Jan 2010 19:52:11 +0000 (11:52 -0800)]
Add a poor-man's disassembler to inspect crashes in JIT'ed code.

14 years agoDouble the speed of DecimalFormat creation.
Elliott Hughes [Thu, 28 Jan 2010 20:18:39 +0000 (12:18 -0800)]
Double the speed of DecimalFormat creation.

Our calls to unum_setSymbol were making us O(n^2); switching to the C++ API
and doing a bulk update is a huge win. (ICU is really a C++ library with a
C wrapper. It's always going to be slightly wasteful to go via C, but here
it's especially harmful.)

The new ScopedJavaUnicodeString provides a best-of-breed bridge between Java
strings on the Java heap and the UnicodeString type that ICU wants. I'll come
back and switch more of our ICU JNI over in a later patch.

14 years agoMerge "Removing dead code from our copy of Xalan."
Jesse Wilson [Thu, 28 Jan 2010 19:37:38 +0000 (11:37 -0800)]
Merge "Removing dead code from our copy of Xalan."

14 years agoRemoving duplicate classes from our tests. These are obsolete with our DOMv3 support.
Jesse Wilson [Thu, 28 Jan 2010 19:35:49 +0000 (11:35 -0800)]
Removing duplicate classes from our tests. These are obsolete with our DOMv3 support.

14 years agoMerge "Add streaming method profiling support."
Andy McFadden [Thu, 28 Jan 2010 15:27:08 +0000 (07:27 -0800)]
Merge "Add streaming method profiling support."

14 years agoRemoving dead code from our copy of Xalan.
Jesse Wilson [Thu, 28 Jan 2010 09:47:36 +0000 (01:47 -0800)]
Removing dead code from our copy of Xalan.

The trace package isn't accessible via our public API, so I've removed it.
Exception localization isn't worthwhile.
The Exslt code is a third-party extension that isn't necessary for the spec.
Several other classes and methods were unused; I used IntelliJ to find and remove these.

There's more that can go, but this is a fine first step.

14 years agoMerge "Bring our XML APIs up to date with Java 5."
Jesse Wilson [Thu, 28 Jan 2010 06:31:02 +0000 (22:31 -0800)]
Merge "Bring our XML APIs up to date with Java 5."

14 years agoam ffea5ceb: am 0e9d568e: Merge "Mark libcore cert tests using expired certs as known...
Brett Chabot [Thu, 28 Jan 2010 02:39:45 +0000 (18:39 -0800)]
am ffea5ceb: am 0e9d568e: Merge "Mark libcore cert tests using expired certs as known failures." into eclair

Merge commit 'ffea5cebcb45bb58d61b903f4e04c45f48442c86'

* commit 'ffea5cebcb45bb58d61b903f4e04c45f48442c86':
  Mark libcore cert tests using expired certs as known failures.

14 years agoBring our XML APIs up to date with Java 5.
Jesse Wilson [Tue, 26 Jan 2010 23:22:44 +0000 (15:22 -0800)]
Bring our XML APIs up to date with Java 5.

New packages for Java 5 compatiblity:
 - javax.xml.datatype
 - javax.xml.namespace
 - javax.xml.parsers (updated)
 - javax.xml.transform
 - javax.xml.transform.dom
 - javax.xml.transform.sax
 - javax.xml.transform.stream
 - javax.xml.validation
 - javax.xml.xpath
 - org.w3c.dom (updated)
 - org.w3c.dom.events
 - org.w3c.dom.ls (load/save)
 - org.w3c.dom.traversal
 - org.w3c.dom.views

Omitted packages (that otherwise exist in Java 5)
 - org.w3c.dom.bootstrap. This package facilitates pluggable implementations of DOM.
       I'm not including this because there's little need for it in practice; and
       because it adds an unnecessary layer of complexity. This decision is also
       reflected in TransformerFactory.newInstance(), SAXParserFactory.newInstance(),
       and DocumentBuilderFactory.newInstance().

New packages that pseudo-exist in Java 5
 - org.w3c.dom.traversal
     This package is referenced by Java 5's org.w3c.dom.ls.LSSerializerFilter, but
     isn't included in the Javadoc API. Their spec isn't self-consistent.
 - org.w3c.dom.views
     This package is referenced by Java 5's org.w3c.dom.events.MouseEvent, but
     isn't included in the Javadoc API. Another spec that isn't self-consistent.

This upgrades DOM from v2 to v3. http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/
This includes some API-incompatible changes; notably introducing new methods
into interfaces. I believe this is still safe, and Java made a similar backwards
incompatible change when they upgraded DOM from v2 to v3 between Java 1.4 and
Java 5.0.

Source for the new APIs comes from Apache XML commons.
  http://svn.apache.org/repos/asf/xml/commons/trunk rev 901014.

This code currently contains several gaps in its implementation. In particular,
the impelementations of the DOM model classes (AttrImpl, ElementImpl, NodeImpl)
have DOM v3 methods that throw UnsupportedOperationExceptions. I intend to
address this problem in an immediate follow-up CL. All gaps are marked with TODO
comments, and they all live in the org.apache.harmony.xml.dom package.

To implement these APIs, I've included Apache Xalan. In a follow-up change
I intend to remove most of the code we don't actually need. I'm using their
pristine copy from SVN so Git can track our local modifications.
  http://svn.apache.org/repos/asf/xalan/java/trunk rev 889881.

14 years agoam ff3a96c9: am c4f93305: Fix for DecimalFormatTest#test_formatToCharacterIteratorLja...
Brett Chabot [Thu, 28 Jan 2010 01:26:58 +0000 (17:26 -0800)]
am ff3a96c9: am c4f93305: Fix for DecimalFormatTest#test_formatToCharacterIteratorLjava_lang_Object

Merge commit 'ff3a96c9055888140893158fff8b33831b949e49'

* commit 'ff3a96c9055888140893158fff8b33831b949e49':
  Fix for DecimalFormatTest#test_formatToCharacterIteratorLjava_lang_Object

14 years agoRemove commented-out code.
Elliott Hughes [Thu, 28 Jan 2010 01:06:42 +0000 (17:06 -0800)]
Remove commented-out code.

Mistakenly left in my previous change when I wasn't certain it was dead.

14 years agoMerge "Fix NumberFormat's behavior with BigInteger and custom Number subclasses."
Elliott Hughes [Thu, 28 Jan 2010 00:19:37 +0000 (16:19 -0800)]
Merge "Fix NumberFormat's behavior with BigInteger and custom Number subclasses."

14 years agoFix NumberFormat's behavior with BigInteger and custom Number subclasses.
Elliott Hughes [Wed, 27 Jan 2010 23:31:17 +0000 (15:31 -0800)]
Fix NumberFormat's behavior with BigInteger and custom Number subclasses.

Also remove a few bits of cruft I ran across, and stop duplicating the
documentation between NumberFormat and DecimalFormat.

Bug: 2387934

14 years agoMerge "Spelling fixes"
Brian Carlstrom [Thu, 28 Jan 2010 00:09:57 +0000 (16:09 -0800)]
Merge "Spelling fixes"

14 years agoMerge "Jit: Fix INSTANCE_OF corner case."
Bill Buzbee [Wed, 27 Jan 2010 23:50:02 +0000 (15:50 -0800)]
Merge "Jit: Fix INSTANCE_OF corner case."

14 years agoJit: Fix INSTANCE_OF corner case.
Bill Buzbee [Wed, 27 Jan 2010 23:43:08 +0000 (15:43 -0800)]
Jit: Fix INSTANCE_OF corner case.

14 years agoAdd streaming method profiling support.
Andy McFadden [Sat, 23 Jan 2010 00:36:30 +0000 (16:36 -0800)]
Add streaming method profiling support.

The goal is to allow DDMS to start/stop method profiling in apps that
don't have permission to write to /sdcard.  Instead of writing the
profiling data to disk and then pulling it off, we just blast the whole
thing straight from memory.

This includes:

 - New method tracing start call (startMethodTracingDdms).
 - Rearrangement of existing VMDebug method tracing calls for sanity.
 - Addition of "vector" chunk send function, with corresponding
   update to the JDWP transport function.
 - Reshuffled the method trace start interlock, which seemed racy.
 - Post new method-trace-profiling-streaming feature to DDMS.

Also:

 - Added an internal exception-throw function that allows a printf
   format string, so we can put useful detail into exception messages.

For bug 2160407.

14 years agoRename icu4jni's DecimalFormat to NativeDecimalFormat, to reduce confusion.
Elliott Hughes [Wed, 27 Jan 2010 21:16:14 +0000 (13:16 -0800)]
Rename icu4jni's DecimalFormat to NativeDecimalFormat, to reduce confusion.

14 years agoGut NativeDecimalFormat in favor of icu4jni.DecimalFormat.
Elliott Hughes [Wed, 27 Jan 2010 20:00:07 +0000 (12:00 -0800)]
Gut NativeDecimalFormat in favor of icu4jni.DecimalFormat.

(I'll come back and rename icu4jni.DecimalFormat to NativeDecimalFormat and
remove all the fully-qualified names that distinguish between java.text's
DecimalFormat and icu4jni's DecimalFormat.)

14 years agoAdd a java.util.Formatter test suggested by egnor months ago.
Elliott Hughes [Wed, 27 Jan 2010 19:07:57 +0000 (11:07 -0800)]
Add a java.util.Formatter test suggested by egnor months ago.

...and add comments to existing tests.

14 years agoMerge "Add a cache to Currency.getInstance(Locale)."
Elliott Hughes [Wed, 27 Jan 2010 19:05:28 +0000 (11:05 -0800)]
Merge "Add a cache to Currency.getInstance(Locale)."

14 years agoMerge "Eliminate the constraint that thread ids must have an LSB of 1. This doubles...
Carl Shapiro [Wed, 27 Jan 2010 18:03:27 +0000 (10:03 -0800)]
Merge "Eliminate the constraint that thread ids must have an LSB of 1.  This doubles the space of thread ids and will break any code that assumes thread ids are odd numbered."

14 years agoSpelling fixes
Brian Carlstrom [Wed, 27 Jan 2010 07:34:58 +0000 (23:34 -0800)]
Spelling fixes

14 years agoAdd a cache to Currency.getInstance(Locale).
Elliott Hughes [Wed, 27 Jan 2010 01:55:25 +0000 (17:55 -0800)]
Add a cache to Currency.getInstance(Locale).

Statically there are lots of calls to Currency.getInstance(String) in the
core libraries and only one to Currency.getInstance(Locale). This might
be why the former has a cache but the latter doesn't. Dynamically, looking
up Currency by Locale is a common operation because that one caller --
DecimalFormatSymbols -- is widely used, and it sets up its currency data
eagerly. (Which might be worth coming back and also fixing later.)

14 years agoMerge "Simplify our DecimalFormat."
Elliott Hughes [Wed, 27 Jan 2010 01:46:55 +0000 (17:46 -0800)]
Merge "Simplify our DecimalFormat."

14 years agoEliminate the constraint that thread ids must have an LSB of 1. This
Carl Shapiro [Wed, 27 Jan 2010 01:12:51 +0000 (17:12 -0800)]
Eliminate the constraint that thread ids must have an LSB of 1.  This
doubles the space of thread ids and will break any code that assumes
thread ids are odd numbered.

14 years agoMerge "Fix spelling of explicitly"
Jesse Wilson [Wed, 27 Jan 2010 01:06:08 +0000 (17:06 -0800)]
Merge "Fix spelling of explicitly"

14 years agoFix spelling of explicitly
Jesse Wilson [Wed, 27 Jan 2010 01:01:57 +0000 (17:01 -0800)]
Fix spelling of explicitly

14 years agoSimplify our DecimalFormat.
Elliott Hughes [Tue, 26 Jan 2010 07:13:46 +0000 (23:13 -0800)]
Simplify our DecimalFormat.

Both the is-a and has-a hierarchies for our DecimalFormat implementation were
over-complicated. This patch starts to address that, and makes cloning twice
as fast (50us versus 100us), but not as fast as I'd like (<10us), and without
making much of a dent in the time it takes to create a new NumberFormat (550us
versus 600us).

The speed of cloning is important because Formatter has a hack that uses it,
and I want to change NumberFormat so that it always hands out clones... at
least until I have time to make "new NumberFormat" acceptably fast.

Also fixes DecimalFormat.applyLocalizedPattern (which used to behave as if
you'd called applyPattern).

14 years agoMerge "Test the lock shape before falling into the thin lock code. The original...
Carl Shapiro [Tue, 26 Jan 2010 22:37:26 +0000 (14:37 -0800)]
Merge "Test the lock shape before falling into the thin lock code.  The original formulation of this code relied on the subtly that the low bit of a thread id is always 1 and so the shape bit was punned with LSB of the thread id.  This got us two tests for the price of one. When this code was moved forward to the new lock encoding scheme, we did not crack the test in two.  This should correct the oversight."

14 years agoTest the lock shape before falling into the thin lock code. The
Carl Shapiro [Tue, 26 Jan 2010 21:22:04 +0000 (13:22 -0800)]
Test the lock shape before falling into the thin lock code.  The
original formulation of this code relied on the subtly that the low
bit of a thread id is always 1 and so the shape bit was punned with
LSB of the thread id.  This got us two tests for the price of one.
When this code was moved forward to the new lock encoding scheme, we
did not crack the test in two.  This should correct the oversight.

14 years agoMerge "Cause dex verification to fail if the class_defs section contains more than...
Dan Bornstein [Tue, 26 Jan 2010 21:24:11 +0000 (13:24 -0800)]
Merge "Cause dex verification to fail if the class_defs section contains more than one definition for any given class."