OSDN Git Service
Andy McFadden [Thu, 28 Jan 2010 21:05:17 +0000 (13:05 -0800)]
Merge "Added 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.
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."
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.
Jesse Wilson [Thu, 28 Jan 2010 19:37:38 +0000 (11:37 -0800)]
Merge "Removing dead code from our copy of Xalan."
Andy McFadden [Thu, 28 Jan 2010 15:27:08 +0000 (07:27 -0800)]
Merge "Add streaming method profiling support."
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.
Jesse Wilson [Thu, 28 Jan 2010 06:31:02 +0000 (22:31 -0800)]
Merge "Bring our XML APIs up to date with Java 5."
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.
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.
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
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.
Elliott Hughes [Thu, 28 Jan 2010 00:19:37 +0000 (16:19 -0800)]
Merge "Fix 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
Brian Carlstrom [Thu, 28 Jan 2010 00:09:57 +0000 (16:09 -0800)]
Merge "Spelling fixes"
Bill Buzbee [Wed, 27 Jan 2010 23:50:02 +0000 (15:50 -0800)]
Merge "Jit: Fix INSTANCE_OF corner case."
Bill Buzbee [Wed, 27 Jan 2010 23:43:08 +0000 (15:43 -0800)]
Jit: Fix INSTANCE_OF corner case.
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.
Elliott Hughes [Wed, 27 Jan 2010 21:16:14 +0000 (13:16 -0800)]
Rename icu4jni's DecimalFormat to NativeDecimalFormat, to reduce confusion.
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.)
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.
Elliott Hughes [Wed, 27 Jan 2010 19:05:28 +0000 (11:05 -0800)]
Merge "Add a cache to Currency.getInstance(Locale)."
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."
Brian Carlstrom [Wed, 27 Jan 2010 07:34:58 +0000 (23:34 -0800)]
Spelling fixes
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.)
Elliott Hughes [Wed, 27 Jan 2010 01:46:55 +0000 (17:46 -0800)]
Merge "Simplify our DecimalFormat."
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.
Jesse Wilson [Wed, 27 Jan 2010 01:06:08 +0000 (17:06 -0800)]
Merge "Fix spelling of explicitly"
Jesse Wilson [Wed, 27 Jan 2010 01:01:57 +0000 (17:01 -0800)]
Fix spelling of explicitly
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).
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."
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.
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."
Dan Bornstein [Tue, 26 Jan 2010 20:58:08 +0000 (12:58 -0800)]
Cause dex verification to fail if the class_defs section contains more
than one definition for any given class.
Bonus: Killed off a bunch of trailing whitespace, to reduce the gerrit
bloodbath.
Change-Id: Idc599364f1a38887fb4b9f91dc91b9b53343ca03
Bug:
2382215
Jesse Wilson [Tue, 26 Jan 2010 20:25:25 +0000 (12:25 -0800)]
Merge "Including proper prefixes and qualified names in the Expat parser. Also changing our SAX codepath to always include values for optional parameters."
Jesse Wilson [Sat, 23 Jan 2010 08:49:53 +0000 (00:49 -0800)]
Including proper prefixes and qualified names in the Expat parser.
Also changing our SAX codepath to always include values for optional parameters.
In testing Xalan's javax.xml.transform packages with the Expat source code, the
emitted documents were malformed. The underlying problem was that Xalan was
expecting optional parameters to be populated, but Expat was not populating them.
The spec says,
"Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:
* the Namespace URI and local name are required when the namespaces property is true (the default), and are optional when the namespaces property is false (if one is specified, both must be);
* the qualified name is required when the namespace-prefixes property is true, and is optional when the namespace-prefixes property is false (the default).
Although Xalan is technically at fault here, it may take forever to find all of
the places where these optional parameters are assumed to be present. Instead,
I'll just supply them which adds little overhead anyway.
See http://code.google.com/p/android/issues/detail?id=990
Carl Shapiro [Mon, 25 Jan 2010 22:48:30 +0000 (14:48 -0800)]
Restore the lock owner ahead of calling waitSetRemove.
Carl Shapiro [Mon, 25 Jan 2010 21:38:00 +0000 (13:38 -0800)]
Merge "Move the waitSetAppend subroutine call ahead of clearing the monitor owner. We want waitSetAppend to check the invariant that the monitor must be owned by the calling thread. Clearing the owner field prior to the call breaks this invariant and causes a assertion to fail."
Carl Shapiro [Mon, 25 Jan 2010 20:51:31 +0000 (12:51 -0800)]
Move the waitSetAppend subroutine call ahead of clearing the monitor
owner. We want waitSetAppend to check the invariant that the monitor
must be owned by the calling thread. Clearing the owner field prior
to the call breaks this invariant and causes a assertion to fail.
Ben Cheng [Mon, 25 Jan 2010 19:10:25 +0000 (11:10 -0800)]
Merge "Tighten the safe points for code cache resets to happen."
Ben Cheng [Sat, 23 Jan 2010 00:45:45 +0000 (16:45 -0800)]
Tighten the safe points for code cache resets to happen.
Add a new flag in the Thread struct to track the whereabout of the top frame
in each Java thread. It is not safe to blow away the code cache if any thread
is in the JIT'ed land.
Elliott Hughes [Mon, 25 Jan 2010 19:03:54 +0000 (11:03 -0800)]
Fix @link and @see tags.
Elliott Hughes [Sat, 23 Jan 2010 03:54:51 +0000 (19:54 -0800)]
Merge "java.util.Formatter javadoc fix."
Elliott Hughes [Sat, 23 Jan 2010 03:53:40 +0000 (19:53 -0800)]
Merge "Switch our ICU JNI over to C++ and tidy up a little."
Elliott Hughes [Sat, 23 Jan 2010 03:44:51 +0000 (19:44 -0800)]
java.util.Formatter javadoc fix.
Elliott Hughes [Sat, 23 Jan 2010 02:31:10 +0000 (18:31 -0800)]
Fix java.util.Formatter "%tz".
Found by jtreg.
Elliott Hughes [Sat, 23 Jan 2010 02:29:47 +0000 (18:29 -0800)]
Merge "Rewrite java.util.Formatter documentation."
Elliott Hughes [Sat, 23 Jan 2010 02:22:53 +0000 (18:22 -0800)]
Switch our ICU JNI over to C++ and tidy up a little.
The big ugly files (implementing NativeCollation and NativeConverter), I've
just done the minimum necessary for them to compile under a C++ compiler. For
the small ones, I've been through them more thoroughly, removing duplication
and the like.
I only came across one bug; a failure path in BidiWrapper that would have
leaked.
Carl Shapiro [Sat, 23 Jan 2010 00:37:03 +0000 (16:37 -0800)]
Merge "Update the hash state bits when an identity hash code is computed."
Elliott Hughes [Fri, 22 Jan 2010 02:15:58 +0000 (18:15 -0800)]
Rewrite java.util.Formatter documentation.
Some guy on the internets pointed out that our documentation of argument
indexes was garbled. I fixed that, and then noticed that pretty much all
the documentation was close enough to be convincing but wrong enough to
not be very useful.
I've fixed everything I've found. The result isn't perfect, but it's good
enough that I could stand to use it myself now.
Jesse Wilson [Fri, 22 Jan 2010 21:47:25 +0000 (13:47 -0800)]
Merge "Adding support for arbitrary VM args in dalvik runner."
Andy McFadden [Fri, 22 Jan 2010 19:32:54 +0000 (11:32 -0800)]
Merge "Move VM feature strings (used by DDMS) into VM."
Andy McFadden [Fri, 22 Jan 2010 15:23:40 +0000 (07:23 -0800)]
Move VM feature strings (used by DDMS) into VM.
Until now, we used a place-holder in frameworks/base.
Removed cruft.
Carl Shapiro [Thu, 14 Jan 2010 06:07:50 +0000 (22:07 -0800)]
Update the hash state bits when an identity hash code is computed.
Jesse Wilson [Fri, 22 Jan 2010 18:06:15 +0000 (10:06 -0800)]
Adding support for arbitrary VM args in dalvik runner.
Jesse Wilson [Thu, 21 Jan 2010 01:24:30 +0000 (17:24 -0800)]
Teaching DalvikRunner to run arbitrary classes with main() methods.
This came up for the XML test suite, which isn't JUnit but a bunch
of main methods (that ask you to verify their output independently; ugh)
Also setting up the current working directory of the forked process.
This only works for local VMs; setting the working directory for
device VMs causes the "adb shell" call to crash.
Elliott Hughes [Fri, 22 Jan 2010 17:00:03 +0000 (09:00 -0800)]
Merge "Minor tidy-up of some of the ICU interface."
android-build SharedAccount [Fri, 22 Jan 2010 16:27:49 +0000 (08:27 -0800)]
Revert "Temporarily disable JIT for performance A/B tests."
This reverts commit
ff5363b061bea49f3fcc2afb251866c13d7c86f1.
Elliott Hughes [Fri, 22 Jan 2010 02:32:19 +0000 (18:32 -0800)]
Minor tidy-up of some of the ICU interface.
Dead code, a class that shouldn't be instantiated, work that's probably
better done all on the native side, and some slightly improved error
reporting.
Ben Cheng [Fri, 22 Jan 2010 01:09:47 +0000 (17:09 -0800)]
Merge "Temporarily disable JIT for performance A/B tests."
Ben Cheng [Fri, 22 Jan 2010 01:07:12 +0000 (17:07 -0800)]
Temporarily disable JIT for performance A/B tests.
Per jparks' request.
Nagendra Modadugu [Fri, 22 Jan 2010 00:41:12 +0000 (16:41 -0800)]
Merge "Remove StartCom MD5 root which is no longer in use: - Free SSL Certification Authority"
Nagendra Modadugu [Fri, 22 Jan 2010 00:19:47 +0000 (16:19 -0800)]
Remove StartCom MD5 root which is no longer in use:
- Free SSL Certification Authority
Brett Chabot [Fri, 22 Jan 2010 00:10:26 +0000 (16:10 -0800)]
am
0e9d568e: Merge "Mark libcore cert tests using expired certs as known failures." into eclair
Merge commit '
0e9d568ec6b946e77bc0ec1903acac1ef916e6d1' into eclair-plus-aosp
* commit '
0e9d568ec6b946e77bc0ec1903acac1ef916e6d1':
Mark libcore cert tests using expired certs as known failures.
Brett Chabot [Fri, 22 Jan 2010 00:06:15 +0000 (16:06 -0800)]
Merge "Mark libcore cert tests using expired certs as known failures." into eclair
Brett Chabot [Thu, 21 Jan 2010 23:01:34 +0000 (15:01 -0800)]
Mark libcore cert tests using expired certs as known failures.
Bug
2322662
Change-Id: If35a5a75f664535bd4eb97cf11a6afe5b0e5b4a9
Brett Chabot [Thu, 21 Jan 2010 22:25:46 +0000 (14:25 -0800)]
am
c4f93305: Fix for DecimalFormatTest#test_formatToCharacterIteratorLjava_lang_Object
Merge commit '
c4f93305d1fe3d31660af2b47a90d2ebbc6d58f9' into eclair-plus-aosp
* commit '
c4f93305d1fe3d31660af2b47a90d2ebbc6d58f9':
Fix for DecimalFormatTest#test_formatToCharacterIteratorLjava_lang_Object
Brett Chabot [Thu, 21 Jan 2010 20:10:42 +0000 (12:10 -0800)]
Fix for DecimalFormatTest#test_formatToCharacterIteratorLjava_lang_Object
Add additional logic to skip checks that require specific locales.
Bug
2386416
Change-Id: Icc30e04d393a22b272966555e617598323aefa0b
Elliott Hughes [Thu, 21 Jan 2010 18:52:50 +0000 (10:52 -0800)]
Improve the DecimalFormat JNI.
We don't need two identical copies of the code for double and long; ICU uses
overloading, and we should take advantage of that. We can also improve the code
to remove unnecessary heap allocation, remove unnecessary temporary copies, and
only make JNI calls and ask for the attribute data when necessary.
I've also switched the code from the thread-unsafe strtok(3) to strtok_r(3).
I've also removed unnecessary temporary char[]s and copying in DecimalFormat.
I've also fixed another instance of the "if (doubleValue == longValue) longPath"
anti-pattern that gets -0.0 wrong. (It's also worth noting that caliper says
the difference between the double and long paths is very small, on the order
of 2us.)
(The new code takes about 20us per call compared to 60us for the old code,
measured on passion-eng.)
Elliott Hughes [Thu, 21 Jan 2010 06:50:16 +0000 (22:50 -0800)]
Fix String.format("%d", null) and relatives.
Must have been asleep at the wheel when I mistranslated this.
We need to get the number of test failures down so we don't have to rely
on our memories of how many test failures we're expecting to see.
Elliott Hughes [Thu, 21 Jan 2010 04:40:14 +0000 (20:40 -0800)]
Merge "More java.util.Formatter performance work."
Elliott Hughes [Thu, 21 Jan 2010 00:29:46 +0000 (16:29 -0800)]
More java.util.Formatter performance work.
I got distracted into doing a bit more here, mainly speeding up the slow path
for integers. I've started to pull out some of the error checking too. We could
do a lot more along those lines, but then we'd fail even more jtreg tests which
assume a specific order in which checks are made. (I don't think we should
worry about that; I'm stopping here because this isn't what I wanted to do
today, not because I don't think we should press on. There's plenty of more
important stuff to look at first.)
Nagendra Modadugu [Wed, 20 Jan 2010 22:12:44 +0000 (14:12 -0800)]
Merge "Remove expired root CAs: - IPS SERVIDORES/emailAddress=ips@mail.ips.es - Secure Server Certification Authority"
Nagendra Modadugu [Wed, 20 Jan 2010 21:48:49 +0000 (13:48 -0800)]
Remove expired root CAs:
- IPS SERVIDORES/emailAddress=ips@mail.ips.es
- Secure Server Certification Authority
Nagendra Modadugu [Wed, 20 Jan 2010 21:29:37 +0000 (13:29 -0800)]
Merge "Add StartCom CA certificates: - StartCom Certification Authority - StartCom Extended Validation Server CA"
Nagendra Modadugu [Wed, 20 Jan 2010 20:48:55 +0000 (12:48 -0800)]
Add StartCom CA certificates:
- StartCom Certification Authority
- StartCom Extended Validation Server CA
Nagendra Modadugu [Wed, 20 Jan 2010 20:37:39 +0000 (12:37 -0800)]
Merge "Add two Verisign Root CA certificates: - VeriSign Class 3 Extended Validation SSL SGC CA - VeriSign Class 3 Public Primary Certification Authority - G5"
Nagendra Modadugu [Wed, 20 Jan 2010 20:26:54 +0000 (12:26 -0800)]
Add two Verisign Root CA certificates:
- VeriSign Class 3 Extended Validation SSL SGC CA
- VeriSign Class 3 Public Primary Certification Authority - G5
Ben Cheng [Wed, 20 Jan 2010 20:03:51 +0000 (12:03 -0800)]
Temporarily disable code cache reset.
Carl Shapiro [Wed, 20 Jan 2010 04:18:59 +0000 (20:18 -0800)]
Merge "Eliminate unused variables."
Carl Shapiro [Wed, 20 Jan 2010 04:02:22 +0000 (20:02 -0800)]
Eliminate unused variables.
Jesse Wilson [Wed, 20 Jan 2010 01:16:34 +0000 (17:16 -0800)]
Merge "Scrubbing some jtreg bugs."
Jesse Wilson [Wed, 20 Jan 2010 00:57:54 +0000 (16:57 -0800)]
Scrubbing some jtreg bugs.
Elliott Hughes [Tue, 19 Jan 2010 23:29:02 +0000 (15:29 -0800)]
One true way to query "java.net.preferIPv6Addresses".
Also stop querying and passing this boolean to code that doesn't care. (We
sort our InetAddress[]s appropriately, so most code doesn't need to worry
about this.)
Bug: http://code.google.com/p/android/issues/detail?id=5903
Elliott Hughes [Sat, 16 Jan 2010 02:25:27 +0000 (18:25 -0800)]
Rewrite InetAddress' DNS cache.
Replace harmony's two 5-element linked lists with a single 512-element
LinkedHashMap. Greatly reduce the time we spend under locks (and no network
I/O is done under a lock any more!). Take advantage of various properties
of how the cache is used to avoid having to do much explicit work to handle
expiry.
I've also optimized the usual no-SecurityManager/no custom system properties
configuring cache TTLs case (without making the slow path much slower than it
already was).
I've also updated the native method names to correspond to the C functions
they're really wrapping (rather than completely different IPv4-only ones
they probably used to wrap long ago).
I've also improved the InetAddress documentation.
Bug:
2320435
Ben Cheng [Fri, 15 Jan 2010 23:59:29 +0000 (15:59 -0800)]
Merge "Fix chaining offset mis-calculation for translations w/ large switch statements."
Ben Cheng [Fri, 15 Jan 2010 23:29:33 +0000 (15:29 -0800)]
Fix chaining offset mis-calculation for translations w/ large switch statements.
Bug:
2369821
There are 12 bytes of additional code after the 65th chaining cell. So if a
switch statement with more than that many cases is translated by the JIT, it
will run fine until the next unchaining event, which will patch the wrong code
and lead to all kinds of unexpected crashes.
Elliott Hughes [Fri, 15 Jan 2010 22:14:14 +0000 (14:14 -0800)]
Fix Formatter's behavior with %% and %n.
Yesterday's fix to the behavior with genuine null arguments didn't take into
account that we have format specifiers that don't take arguments. Fix the fix,
and add an explicit test.
Elliott Hughes [Fri, 15 Jan 2010 03:25:24 +0000 (19:25 -0800)]
Merge "Speed up Character."
Ficus Kirkpatrick [Fri, 15 Jan 2010 01:12:02 +0000 (17:12 -0800)]
Fix a NPE in java.util.Formatter.
A recent optimization to simple '%s' and '%d' formats was
failing to format null as "null". Also add a test.
Ben Cheng [Thu, 14 Jan 2010 22:33:27 +0000 (14:33 -0800)]
Merge "Fix bad long negate; bug
2373405 - EnumSetTest failure with JIT today"
Bill Buzbee [Thu, 14 Jan 2010 22:27:52 +0000 (14:27 -0800)]
Fix bad long negate; bug
2373405 - EnumSetTest failure with JIT today
Elliott Hughes [Thu, 14 Jan 2010 21:56:50 +0000 (13:56 -0800)]
Speed up Character.
Remove a useless layer of indirection in UCharacter (which is the bridge
between java.lang.Character and ICU). We're not at the stage where the
JIT can do this for us, and even if it could, why give it extra work to
do? Also fix the incorrect copyright header which was probably copied from
a file where it made sense.
Elliott Hughes [Thu, 14 Jan 2010 20:51:45 +0000 (12:51 -0800)]
Merge "Fix Date.toString."
Elliott Hughes [Thu, 14 Jan 2010 07:14:56 +0000 (23:14 -0800)]
Fix Date.toString.
Date.toString was using the TimeZone id ("America/Los_Angeles") rather than
the time zone short name ("PDT" or "PST", depending on time of year). The
naive fix made things 5x slower, so I improved Resources.getDisplayTimeZone
so the fixed Date.toString is only 2x slower. This could be improved further
with a faster getDisplayTimeZone.
I hoped to replace the body of Date.toString with a call to SimpleDateFormat,
but that turns out to be 40x slower. This patch also optimizes SimpleDateFormat
to bring the gap down to 8x by using Resources.getDisplayTimeZone instead of
asking for all the strings.
(Note that these improvements refer to the hopefully common case of localized
strings for the default locale. If you have the misfortune to need strings for
other locales, the new code will be more like 600x faster. At 0.5s a call on
the fastest current hardware, I hope no-one's actually doing that.
Dalvik Explorer -- available on the Market -- needs to do it when generating
summary reports, and it is indeed ridiculously slow. It uses two
SimpleDateFormat objects per locale, so it takes 1s per locale, for about 60
locales. I've tested Dalvik Explorer with this patch, and it does fix that
pathological behavior.)
Also fix a bug I introduced in https://android-git.corp.google.com/g/36242 that
meant that our zone names String[][] contained incorrect values (accidentally
concatenating each successive value in a row), found by existing tests now we
use more of those values.
Also replace a couple of "new Integer" calls with Integer.valueOf for a modest
speedup.
Also factor out some duplication.
Bug: http://code.google.com/p/android/issues/detail?id=6013
Bill Buzbee [Thu, 14 Jan 2010 00:13:48 +0000 (16:13 -0800)]
Merge "Restore threshold to 200 as a temporary workaround"
Elliott Hughes [Thu, 14 Jan 2010 00:04:22 +0000 (16:04 -0800)]
Merge "Remove the last bits of the ICU ResourceBundle hack."
Bill Buzbee [Thu, 14 Jan 2010 00:02:28 +0000 (16:02 -0800)]
Restore threshold to 200 as a temporary workaround
Also, fix blocking mode initialization.
Carl Shapiro [Wed, 13 Jan 2010 23:19:39 +0000 (15:19 -0800)]
Merge "Separately sweep the monitor list before sweeping the heap. Required for the copying collector so we can abandon objects without examining their headers. There is a liminal reduction in sweep time when using the non-moving collector. In addition, this change uncomments a call to free to reclaim the monitor when its owning object is unmarked."
Elliott Hughes [Wed, 13 Jan 2010 22:43:53 +0000 (14:43 -0800)]
Remove the last bits of the ICU ResourceBundle hack.
This patch switches us over to calling ICU directly for localized currency
symbols, and then removes all the mechanism for sneaking fake ResourceBundle
implementations in. The code's a lot simpler too, because ICU's default
behavior is what we want anyway.