OSDN Git Service
Carl Shapiro [Tue, 13 Apr 2010 23:34:33 +0000 (16:34 -0700)]
resolved conflicts for merge of
f0c514ce to dalvik-dev
Change-Id: Ie9274ee7a4e767e197f53bd350c835fedbca3ae9
Elliott Hughes [Tue, 13 Apr 2010 22:30:18 +0000 (15:30 -0700)]
Use the same documentation in all the methods that take a format string.
Change-Id: I8e7d06df72a7b8db9edd17aa2748800329e837fa
Elliott Hughes [Tue, 13 Apr 2010 22:23:01 +0000 (15:23 -0700)]
Remove "Messages" from the annotation module.
Change-Id: I6253fa192bb45fc06db99937aca30ee4dd0bb201
Elliott Hughes [Tue, 13 Apr 2010 21:28:42 +0000 (14:28 -0700)]
Improve documentation about the user's default locale.
Add a bit of text to Locale's class documentation, and include a link from
every method that uses Locale.getDefault(). Also try to consistently say
"user's default locale", as a subliminal hint that this isn't necessarily
the developer's locale, nor en_US.
Bug:
2593000
Change-Id: Ieebe864ed6b9fecbfef5d5415269299739cedd1b
Carl Shapiro [Fri, 9 Apr 2010 22:03:33 +0000 (15:03 -0700)]
Add a mechanism to long a sample of long running lock acquisitions.
Change-Id: Ic91c5f213bcfd72c6f630ef5102da2c6c7cc8ce4
Elliott Hughes [Tue, 13 Apr 2010 01:32:50 +0000 (18:32 -0700)]
Fix String.toLowerCase and toUpperCase.
Rather than try to cope with Lithuanian, let's just hand that one to ICU4C.
I've removed my hand-crafted Azeri/Turkish lowercasing too, in favor of ICU.
Presence of a high surrogate (which implies a supplemental character) is a
good reason to hand over to ICU too.
On the uppercasing side, I've kept our existing hard-coded table and just
added code to defer to ICU for Azeri, Lithuanian, and Turkish (plus
supplemental characters). I don't like the tables, but I don't have proof
that they're incorrect.
Bug:
2340628
Change-Id: I36b556b0444623a5aacc1afc58ebb4d84211d3dc
Elliott Hughes [Mon, 12 Apr 2010 21:29:37 +0000 (14:29 -0700)]
Fix supplementary character support.
Fixes all known bugs in our handling of supplementary characters. This change
introduces a performance regression on the assumption that it won't be released
without a corresponding JIT change to enable the code to be inlined back to
pretty much what it used to be.
Bug:
2587122
Change-Id: I3449c9718bbe32ebe53b6c10454ae1dc82105b59
Elliott Hughes [Mon, 12 Apr 2010 17:29:14 +0000 (10:29 -0700)]
Merge "Throw the same exceptions as the RI from String methods." into dalvik-dev
Brian Carlstrom [Sat, 10 Apr 2010 23:07:24 +0000 (16:07 -0700)]
Merge commit '
7dbf57f6' into manualmerge
Conflicts:
libcore/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
Change-Id: I7cf63f6a1ca7c7604301cb8bb947633ad704a2c0
Elliott Hughes [Sat, 10 Apr 2010 19:01:10 +0000 (12:01 -0700)]
Throw the same exceptions as the RI from String methods.
String has its own StringIndexOutOfBoundsException subclass of
IndexOutOfBoundsException. We can run more tests if we behave
the same.
The RI only admits to IndexOutOfBoundsException, though,
so our documentation and throws clause shouldn't change.
Change-Id: Ib87777f8a42d4bcac21e8f8f00f4dcbc0ada4201
Brian Carlstrom [Sat, 10 Apr 2010 18:54:58 +0000 (11:54 -0700)]
am
5fdfbeff: Fix SSL_shutdown error reporting to print a proper error instead of "Ok"
Elliott Hughes [Sat, 10 Apr 2010 17:22:05 +0000 (10:22 -0700)]
Merge "Fix build by turning a comment into a doc comment. Clarify logic." into dalvik-dev
Elliott Hughes [Sat, 10 Apr 2010 06:36:48 +0000 (23:36 -0700)]
Fix build by turning a comment into a doc comment. Clarify logic.
Now I see what jessewilson was trying to say earlier; rewrite the post-loop
code to say what I guess it was aiming at, which is avoiding an add followed
by a remove in the not completely uncommon case where limit == 0 and the
regular expression is a terminator rather than a true separator ('\n', say).
(Normally the regular expression is a true separator so there will be no
trailing empty string even though limit is 0: "a,b,c".split(","), for example.)
Also, String.isEmpty is our fasest way of recognizing the empty string;
certainly better than equals("").
Change-Id: I82f4ec49fa58efc178e342cf55d4dfbbdad01c75
Elliott Hughes [Sat, 10 Apr 2010 01:22:02 +0000 (18:22 -0700)]
Merge "Make String.split 10x faster." into dalvik-dev
Brian Carlstrom [Sat, 10 Apr 2010 00:49:11 +0000 (17:49 -0700)]
Fix SSL_shutdown error reporting to print a proper error instead of "Ok"
There are other problematic error reporting cases to be fixed later, but this one seems to be the frequently occuring.
Change-Id: Ia5910cffb60cc694066be03d43ac1bb7eab47357
Jesse Wilson [Fri, 9 Apr 2010 23:48:34 +0000 (16:48 -0700)]
Merge "Latest java.util.concurrent from the JSR 166 project." into dalvik-dev
Elliott Hughes [Fri, 9 Apr 2010 23:31:13 +0000 (16:31 -0700)]
Make String.split 10x faster.
Almost all uses of String.split in the Android codebase use trivial single
literal character separators. This patch optimizes that case to avoid the
use of regular expressions entirely.
The 10x speedup isn't the whole story, because the speedup is really
proportional to the number of separators in the input. 10x is easily
achievable, but the speedup could be arbitrarily high.
Before:
benchmark us logarithmic runtime
PatternSplitComma 84.8 XXXXXXXXXXXXXX||||||||||||||
PatternSplitLiteralDot 85.0 XXXXXXXXXXXXXX||||||||||||||
StringSplitComma 166.3 XXXXXXXXXXXXXXXXXXXXXXXXXXXX|
StringSplitHard 173.6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
StringSplitLiteralDot 167.7 XXXXXXXXXXXXXXXXXXXXXXXXXXXX|
After:
benchmark us logarithmic runtime
PatternSplitComma 18.9 XXX|||||||||||||||||||||
PatternSplitLiteralDot 19.0 XXX|||||||||||||||||||||
StringSplitComma 18.8 XXX|||||||||||||||||||||
StringSplitHard 174.2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
StringSplitLiteralDot 18.8 XXX|||||||||||||||||||||
(The benchmarks starting "Pattern" use a precompiled Pattern for performance.
Those starting "String" use String.split and would traditional entail a
temporary Pattern. As you can see, creating Patterns is very expensive for
us, and each one throws a finalizer spanner in the GC works too. The new
fast path avoids all this. I'll commit the benchmark -- along with all the
others I've ever used -- to http://code.google.com/p/dalvik this afternoon.)
Tests? We actually pass _more_ tests after this patch, because the increase
in performance means we don't hit timeouts.
Change-Id: I404298e21a78d72cf5ce6ea675844bf251e3825b
Brian Carlstrom [Fri, 9 Apr 2010 21:22:59 +0000 (14:22 -0700)]
Disable our new javax.net.ssl tests until hangs are resolved
While the hangs all seem to happen during handshaking, there is more
than one root cause. Until I have things working reliably, disabling
the tests to avoid fouling up the continuous build.
Change-Id: Ia57cac2e49284a1050a72d9ea77813307eff5ea8
Jesse Wilson [Wed, 7 Apr 2010 22:07:54 +0000 (15:07 -0700)]
Latest java.util.concurrent from the JSR 166 project.
Code was downloaded from CVS on 2010-april-7 at 10:00pst
http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/
The new interfaces and ArrayDeque class are all from Harmony.
Elliott Hughes [Fri, 9 Apr 2010 17:39:25 +0000 (10:39 -0700)]
Merge "An InlineNative for String.isEmpty, so it's not slower than length() == 0." into dalvik-dev
Andy McFadden [Fri, 9 Apr 2010 14:32:42 +0000 (07:32 -0700)]
Merge "Move the furniture around some more." into dalvik-dev
Andy McFadden [Wed, 7 Apr 2010 22:56:16 +0000 (15:56 -0700)]
Move the furniture around some more.
Mostly just moving things around, with minor changes to behavior.
- Instead of walking through all classes twice (once for verification,
once for optimization), we now walk through them once and do both
operations on a given class before moving on to the next.
- If verification and optimization were disabled, the VM used a special
"no fork + exec" path. It adds complexity for little benefit, so
it's gone.
- Reduced the amount of stuff being passed as arguments through multiple
layers of functions. Notably, a pointer to a read-only lookup table
is now accessed via a global.
- The PROFILE_FIELD_ACCESS define now just blocks the quickening of
field accesses instead of blocking all optimizations. (Not sure this
is worth keeping around.)
Change-Id: I7f7c658e3b682c7251cdf17cae58d79bd04ba2a0
Elliott Hughes [Tue, 6 Apr 2010 01:13:52 +0000 (18:13 -0700)]
An InlineNative for String.isEmpty, so it's not slower than length() == 0.
Before:
benchmark ns logarithmic runtime
IsEmpty 115 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
LengthEqualsZero 21 XXXXX||||||||||||||
With C intrinsic:
IsEmpty 30 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
LengthEqualsZero 20 XXXXXXXXXXXXXXXXXXXX||||||
With assembler intrinsic:
IsEmpty 15 XXXXXXXXXXXXXXXXXXXX||||||
LengthEqualsZero 21 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
(All times on passion.)
Change-Id: Ifcc37fe7b8efdd377675a448e0085e490d6767bc
Elliott Hughes [Thu, 8 Apr 2010 20:58:06 +0000 (13:58 -0700)]
Merge "resolved conflicts for merge of
19252faf to dalvik-dev" into dalvik-dev
Elliott Hughes [Thu, 8 Apr 2010 20:57:31 +0000 (13:57 -0700)]
Merge "Show a summary of failures at the end of a vogar run." into dalvik-dev
Elliott Hughes [Thu, 8 Apr 2010 20:57:04 +0000 (13:57 -0700)]
resolved conflicts for merge of
19252faf to dalvik-dev
Change-Id: Ibf429f9d9d048c01cb8f33b15e8b404d83138b74
Brian Carlstrom [Thu, 8 Apr 2010 20:52:15 +0000 (13:52 -0700)]
Merge "Fixing javax.net.ssl test failures on RI" into dalvik-dev
Elliott Hughes [Thu, 8 Apr 2010 20:11:14 +0000 (13:11 -0700)]
Show a summary of failures at the end of a vogar run.
Super-useful when running a large batch of jtreg tests, and also useful
for comparing against an earlier run (though hopefully we'll have a better
solution for that eventually).
Change-Id: I144f72ea1ae5240393b0b33193d7773537b7ee20
Elliott Hughes [Thu, 8 Apr 2010 20:06:14 +0000 (13:06 -0700)]
Merge "Add Java 6's new java.util.zip API." into dalvik-dev
Brian Carlstrom [Thu, 8 Apr 2010 18:58:15 +0000 (11:58 -0700)]
Fixing javax.net.ssl test failures on RI
vogar wasn't working at checkin on the host so I couldn't easily
retest these changes that came from the code review. Sure enought
there were some problems.
SSLSocketTest now uses a condition variable to synchronize between
the HandshakeCompletedListener and the main thread since the RI
does the callback asynchronously.
Back to ussing Arrays.equals for comparing Session ID byte[] since
Object.equals does not work.
Change-Id: I667b60dc065438efe4e3728d7a44b446ebc15e64
Elliott Hughes [Thu, 8 Apr 2010 01:27:01 +0000 (18:27 -0700)]
Add Java 6's new java.util.zip API.
This passes all but four of the harmony tests. The others fail because our
Deflater works differently to theirs; we already fail the corresponding
Deflater test.
The only jtreg test for ZipError neither passes nor fails: it appears that
this can only be thrown on Windows.
Bug:
2497395
Change-Id: I79687495da42507dda692c890ec939bdbc9be2b3
Elliott Hughes [Thu, 8 Apr 2010 18:10:54 +0000 (11:10 -0700)]
Disable System.setSecurityManager.
We plan on removing SecurityManager checks, which are expensive and non-useful,
especially because Android doesn't use SecurityManager itself. As a first step,
let's ship a release where it's no longer possible to set a SecurityManager.
Bug:
1320501
Change-Id: I88664dbc1d8b087579d54003a1aaed7b3d8412be
Jesse Wilson [Thu, 8 Apr 2010 17:40:43 +0000 (10:40 -0700)]
am
214e2855: am
5dde0c4d: Merge "Adding support for hash \'#\' comments to our JSON parser." into froyo
Merge commit '
214e285536e18e762c3207fecf97dacdd22e472e' into dalvik-dev
* commit '
214e285536e18e762c3207fecf97dacdd22e472e':
Adding support for hash '#' comments to our JSON parser.
Andy McFadden [Thu, 8 Apr 2010 17:40:38 +0000 (10:40 -0700)]
am
abfb34bc: am
c7b7edf7: Merge "Trivial doc change: froyo is 2.2." into froyo
Merge commit '
abfb34bcda2e2320121850a9cb5b10e8f10e9833' into dalvik-dev
* commit '
abfb34bcda2e2320121850a9cb5b10e8f10e9833':
Trivial doc change: froyo is 2.2.
Andy McFadden [Tue, 6 Apr 2010 20:45:38 +0000 (13:45 -0700)]
Trivial doc change: froyo is 2.2.
Change-Id: Icce3770dd318ec8853d5120c13a85656ed1171ea
Jesse Wilson [Wed, 7 Apr 2010 18:38:29 +0000 (11:38 -0700)]
Merge "Fixing a vogar issue where outcomes weren't making their way into XML." into dalvik-dev
Jesse Wilson [Wed, 7 Apr 2010 18:37:56 +0000 (11:37 -0700)]
Merge "Bring the latest Caliper (r102) into vogar." into dalvik-dev
Jesse Wilson [Wed, 7 Apr 2010 17:53:21 +0000 (10:53 -0700)]
Bring the latest Caliper (r102) into vogar.
Jesse Wilson [Wed, 7 Apr 2010 17:52:28 +0000 (10:52 -0700)]
Fixing a vogar issue where outcomes weren't making their way into XML.
Andy McFadden [Wed, 7 Apr 2010 14:27:55 +0000 (07:27 -0700)]
Merge "Correct long-standing thread status change bug." into dalvik-dev
Andy McFadden [Wed, 7 Apr 2010 14:27:30 +0000 (07:27 -0700)]
Merge "Rearrange some things." into dalvik-dev
Jesse Wilson [Wed, 7 Apr 2010 03:25:23 +0000 (20:25 -0700)]
Merge "Adding support for command line args to vogar-initiated processes." into dalvik-dev
Elliott Hughes [Wed, 7 Apr 2010 03:17:36 +0000 (20:17 -0700)]
Fix build by adding missing imports.
Change-Id: I433778b02d3ad67090ee88444700f79b3138d778
Jesse Wilson [Wed, 7 Apr 2010 03:11:13 +0000 (20:11 -0700)]
Adding support for command line args to vogar-initiated processes.
Also adding monitor timeouts for use by the continuous build.
From the huge number of files in this relatively simple CL, it's
becoming clear that we need to simplify vogar's internals!
Elliott Hughes [Wed, 7 Apr 2010 01:17:26 +0000 (18:17 -0700)]
Merge "Actually use ServiceLoader in places where we had a hard-coded equivalent." into dalvik-dev
Jesse Wilson [Wed, 7 Apr 2010 01:00:06 +0000 (18:00 -0700)]
am
5dde0c4d: Merge "Adding support for hash \'#\' comments to our JSON parser." into froyo
Andy McFadden [Wed, 24 Mar 2010 20:25:53 +0000 (13:25 -0700)]
Rearrange some things.
This splits DexOptimize into DexPrepare (which deals with file shuffling
and fork/exec) and Optimize (which does the actual quickening of
instructions). The Optimize functions are now effectively private to
the "analysis" directory.
Twiddled some comments.
No substantive code changes.
Change-Id: Ia51865b259fb32822132e2373997866e360ca86a
Elliott Hughes [Tue, 6 Apr 2010 23:36:51 +0000 (16:36 -0700)]
Actually use ServiceLoader in places where we had a hard-coded equivalent.
I've also removed a file that was causing us to use this code unnecessarily
at run-time to explicitly specify the built-in default PreferencesFactory.
I haven't touched Charset, but should come back and fix that too at some
point.
Change-Id: I3a2145041d048078bdb55ae7b8fa4ec9d8726922
Jesse Wilson [Tue, 6 Apr 2010 22:54:01 +0000 (15:54 -0700)]
Merge "Adding support for hash '#' comments to our JSON parser." into froyo
Carl Shapiro [Tue, 6 Apr 2010 22:35:59 +0000 (15:35 -0700)]
Clean-up the monitor unlock routine. Remove the comment adjacent to
the mon NULL check. As we know, that condition can occur if there was
a mishandling of the lock word. Also, remove the format statement
that attempted to print out the monitor state. In non-assert builds
this may cause a SIGSEGV as the monitor pointer may be invalid.
Change-Id: Ic4eb2d4180ac51b606a728ec7cd781af46f7b47e
Jesse Wilson [Tue, 6 Apr 2010 21:16:28 +0000 (14:16 -0700)]
Adding support for hash '#' comments to our JSON parser.
Neither the JSON RFC nor the documentation of Crockford's
implementation mention these comments, but somehow the
old parser used to support these. And so we shall also.
See bug
2571423.
Change-Id: I77d64c5ec53278d8df5fe1873404f1241320504b
Andy McFadden [Tue, 6 Apr 2010 21:41:03 +0000 (14:41 -0700)]
am
c7b7edf7: Merge "Trivial doc change: froyo is 2.2." into froyo
Andy McFadden [Tue, 6 Apr 2010 21:23:37 +0000 (14:23 -0700)]
Merge "Trivial doc change: froyo is 2.2." into froyo
Andy McFadden [Tue, 6 Apr 2010 19:37:48 +0000 (12:37 -0700)]
Correct long-standing thread status change bug.
If the stars aligned correctly (or you were running valgrind), it was
possible for a thread to change its status to RUNNING immediately after
having its suspend count incremented. The problem is that the thread
initiating the suspension regards the target thread as being in (say)
VMWAIT with sCount=1, which means its safe to kick off a GC. The target
thread thinks it's happily in RUNNING and can go do whatever it wants.
The fix is to move the status change so that it's guarded by the
suspension count mutex.
This shouldn't affect performance. The number of instructions executed
is about the same.
Also, the "self can be NULL" feature of dvmCheckSuspendPending had very
few customers, so we now skip that check and just require it to be set.
For bug
2309331.
Change-Id: Id512e16e321515a467c20b382c85017cef9cea4d
Andy McFadden [Tue, 6 Apr 2010 20:45:38 +0000 (13:45 -0700)]
Trivial doc change: froyo is 2.2.
Change-Id: Icce3770dd318ec8853d5120c13a85656ed1171ea
Brian Carlstrom [Tue, 6 Apr 2010 20:03:55 +0000 (13:03 -0700)]
Merge "Rewrite JSSE code to use one openssl SSL per SSLSocket an one SSL_CTX per SSLSessionContext" into dalvik-dev
Carl Shapiro [Tue, 6 Apr 2010 20:03:15 +0000 (13:03 -0700)]
Merge "Minor code clean-up. Fix a placeholder comment that I left in the code. Change a comment that was added at my request to be less verbose. At the same time, repurpose an unused variable to hold the field offset so the field access code flows without wrapping." into dalvik-dev
Brian Carlstrom [Wed, 3 Mar 2010 00:55:35 +0000 (16:55 -0800)]
Rewrite JSSE code to use one openssl SSL per SSLSocket an one SSL_CTX per SSLSessionContext
Summary:
b/
1758225: Revisit OpenSSL locking
Removed the locking original put in to address b/
1678800 which
had been causing problems for the HeapWorker thread which was
timing out waiting for the lock in the finalizers while other
threads were connecting.
b/
1678800: Reliability tool: Crash in libcrypto @ https://opac.ntu.ac.uk
Properly fixed the native crash by avoid sharing SSL_SESSION objects
between SSL_CTX objects
Testing:
- adb shell run-core-tests --verbose tests.xnet.AllTests
- adb shell run-core-tests --verbose javax.net.ssl.AllTests
- Test app that reloads https://opac.ntu.ac.uk
Details:
Each AbstractSessionContext now has an associated SSL_CTX,
referenced through the sslCtxNativePointer. SSL_CTX on the native
side defines the scope of SSL_SESSION caching, and this brings the
Java SSLSessionContext caching into alignment with the native
code. OpenSSLSessionImpl now uses AbstractSessionContext instead
of SSLSessionContext for access to the underlying SSL_CTX.
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerSessionContext.java
Added AbstractSessionContext.putSession so OpenSSLSocketImpl/OpenSSLSessionImpl can
directly assign to the current AbstractSessionContext (whether it
be a ClientSessionContext or a ServerSessionContext) without
casting.
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerSessionContext.java
Cleaning up use of SSL_CTX and SSL instances in SSLSocket/SSLServerSocket implementation
The major change is that openssl SSL instances are allocated for
the life of the matching Java object, replacing the SSL_CTX and
the SSL objects that had previously been allocated only starting
at handshake time. We should never have been sharing SSL_SESSION
instances between SSL_CTX instances, which was the source of the
native crashes dating back to cupcake which the
OpenSSLSocket.class locking had been preventing.
- NativeCrypto now has better defined and independant wrappers on
openssl functionality. A followon checkin should move the
remaining openssl JNI code here with the intent of being able to
write and end-to-end test of the openssl code using NativeCrypto
without the JSSE implementation classes. The following gives a
list of the new native functions with a mapping to the old
implementation code. The new code has a more functional style
where SSL_CTX and SSL instances are passed and returned as
arguments, not extracted from Java instances
SSL_CTX_new OpenSSLSocketImpl.nativeinit, OpenSSLServerSocketImpl.nativeinit, SSLParameters.nativeinitsslctx
SSL_CTX_get_ciphers_list OpenSSLSocketImpl.nativeGetEnabledCipherSuites
SSL_CTX_free OpenSSLSocketImpl.nativefree, OpenSSLServerSocketImpl.nativefree
SSL_new OpenSSLSocketImpl.nativeinit, OpenSSLSocketImpl.init, OpenSSLServerSocketImpl.nativeinit, OpenSSLServerSocketImpl.init
SSL_get_options OpenSSLSocketImpl.nativesetenabledprotocols
SSL_set_options OpenSSLSocketImpl.nativesetenabledprotocols
SSL_get_ciphers OpenSSLSocketImpl.nativeGetEnabledCipherSuites
SSL_set_cipher_list OpenSSLSocketImpl.nativeSetEnabledCipherSuites
SSL_free OpenSSLSocketImpl.nativefree, OpenSSLServerSocketImpl.nativefree
- While the focus in NativeCrypto is on native code, it also
contains some helpers/wrappers especially for code that doesn't
depend on specific SSL_CTX, SSL instances or that needs to do
massaging of data formats between Java and OpenSSL. Some of
these had previously been duplicated in the client and server
versions of the code. For example:
getSupportedCipherSuites OpenSSLSocketImpl.nativegetsupportedciphersuites, OpenSSLServerSocketImpl.nativegetsupportedciphersuites
getSupportedProtocols OpenSSLSocketImpl.getSupportedProtocols, OpenSSLServerSocketImpl.getSupportedProtocols
getEnabledProtocols OpenSSLSocketImpl.getEnabledProtocols,OpenSSLServerSocketImpl.getEnabledProtocols
setEnabledProtocols OpenSSLSocketImpl.setEnabledProtocols
setEnabledCipherSuites OpenSSLSocketImpl.setEnabledCipherSuites
- Moved JNI initialization from OpenSSLSocketImpl to NativeCrypto
which is the future home of all the openssl related native code.
clinit OpenSSLSocketImpl.nativeinitstatic
- NativeCrypto.CertificateChainVerifier is a new interface to
decouple callbacks from openssl from a specific dependence on a
OpenSSLSocketImpl.verify_callback method. Changed to return
boolean instead of int.
- Renamed OpenSSLSocketImpl.ssl to OpenSSLSocketImpl.sslNativePointer for consistency
- Changed OpenSSLSocketImpl nativeconnect, nativegetsslsession,
nativecipherauthenticationmethod, nativeaccept, nativeread,
nativewrite, nativeinterrupt, nativeclose, nativefree to take
arguments instead of inspect object state in preparation for
moving to NativeCrypto
- other notable NativeCrypto changes included
* adding SSL_SESSION_get_peer_cert_chain,
SSL_SESSION_get_version, and SSL_get_version (and
get_ssl_version) which are "missing methods" in openssl
* ssl_msg_callback_LOG callback and get_content_type for handshake debugging
* removing jfieldID's for our classes now that we pass in values in arguments
* changed aliveAndKicking to be volative since we poll on it to communicate between threads
* changed from C style declarations at beginning of block to C++ at first use on methods with major changes
* stop freeing SSL instances on error, only SSL_clear it
* improved session reuse logging when reproducing b/
1678800
* change verify_callback to return verifyCertificateChain result
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java
x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketFactoryImpl.java
When we accept a server socket, we pass the existing SSL state
instance from the server socket to the newly accepted socket via
the constructor where it is copied with SSL_dup, instead of
through both the constructor and later the accept method.
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java
Cleaned up nativesetclientauth from using SSL_CTX to SSL, passing
ssl as argument in preparation for future movement to
NativeCrypto.
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java
Removed ssl_op_no cache for rarely used enabled protocol methods
so that code could more easily be shared in NativeCrypto between
client and server.
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
Changed public getId, getCreationTime, getPeerCertificates,
getCipherSuite, getProtocol from being instance methods that
looked at the OpenSSLSessionImpl object state to be static mthods
that take the native pointers as arguments in preparation for
moving to NativeCrypto. Rename session -> sslSessionNativePointer
for consistency. Inlined initializeNative, which wasn't really
the native code.
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java
Removed lock on OpenSSLSocketImpl.class lock from around
OpenSSLSocketImpl's use of nativeconnect, nativegetsslsession, and
nativecipherauthenticationmethod as well as OpenSSLSessionImpl's
use of freeImpl, fixing b/
1758225: Revisit OpenSSL locking
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java
Unrelated changes
Removed unused ssl_ctx, nativeinitsslctx, getSSLCTX
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java
Fix bug in both putSession implementations where we cached
sessions with zero length id. Also change indexById to pass in id
in client implementation.
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerSessionContext.java
Make sure we clone SSLParameters passed to the SSLSocketFactory
and SSLServerSocketFactory so that muting the client instance does
not change the server instance and vice versa. Explicitly set
setUseClientMode(false) on the server SSLParameters. These changes
are to bring things more into alignment with the original harmony
classes which properly support client/server role switching during
handshaking.
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketFactoryImpl.java
Make locks object fields final
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
Moved updateInstanceCount(1) logic and sslParameters assignment to init method
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
Changed getCachedClientSession to respect getUseClientMode
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
Spelling of listensers to listeners in javadoc
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
Spelling SSLInputStream to SSLOutputStream in comment
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
Changed shutdownInput and shutdownOutput to call to the underlying socket
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
Set sslNativePointer to 0 when freeing underlying SSL object
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
Removed IOException logging in getSession, which is expected to
simply return SSL_NULL_WITH_NULL_NULL when there are problems.
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
Disabled "Using factory" message on successful creation of
SocketFactory which was a bit noisy running tests. However, added
logging in failure case including the related exception:
x-net/src/main/java/javax/net/ssl/SSLSocketFactory.java
Disabled logging of OpenSSL session deallocation
x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
Register SSLContextImpl as a source of SSL and SSL3 SSLContexts,
not just TLS and TLSv1.
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java
Fix whitespace in comment
x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java
Change-Id: I99975ae22599c7df0d249fa013ae7ea7c9c08051
Carl Shapiro [Tue, 6 Apr 2010 02:23:31 +0000 (19:23 -0700)]
Rename the objBits to the more descriptive liveBits.
Change-Id: Ic1a2915f943cb9541fcc52c6b6a6d9d3b7354b5f
Carl Shapiro [Fri, 26 Mar 2010 22:34:39 +0000 (15:34 -0700)]
Reference class handling overhaul.
* Do not mark through soft-reachable referents when scanning f-
reachable objects.
* Make the SoftReference clearing policy local to better conform to
developer expecataions.
* Eliminate SCHEDULED_REFERENCE_MAGIC, a hold-over from a previous
reference management algorithm.
* Move soft, weak and phantom reference processing into their own
subroutines.
Change-Id: I992788d58f10fa08336e6ac3f0a4dbfa3fc2086f
Carl Shapiro [Tue, 6 Apr 2010 02:36:37 +0000 (19:36 -0700)]
Minor code clean-up. Fix a placeholder comment that I left in the
code. Change a comment that was added at my request to be less
verbose. At the same time, repurpose an unused variable to hold the
field offset so the field access code flows without wrapping.
Change-Id: I27d10c26b76620eb7d5ace55b4e6f76e5e4c44d6
Carl Shapiro [Tue, 6 Apr 2010 01:21:29 +0000 (18:21 -0700)]
Merge "Unlock the monitor mutex before destroying it. This resolves an issue with simulator builds where, unlike bionic, libc checks whether a mutex is in the unlocked state before a destroy and returns EBUSY if the check fails. Until similar checks are added to bionic we now do a trylock, unlock sequence in the assert statements so as not to confuse the simulator build." into dalvik-dev
Carl Shapiro [Sun, 4 Apr 2010 08:56:48 +0000 (01:56 -0700)]
Unlock the monitor mutex before destroying it. This resolves an issue
with simulator builds where, unlike bionic, libc checks whether a
mutex is in the unlocked state before a destroy and returns EBUSY if
the check fails. Until similar checks are added to bionic we now do a
trylock, unlock sequence in the assert statements so as not to confuse
the simulator build.
Change-Id: Iafa3c52edddb17b9a8a2c648c5fd3a58d5d77988
Elliott Hughes [Tue, 6 Apr 2010 00:55:25 +0000 (17:55 -0700)]
resolved conflicts for merge of
dd53c703 to dalvik-dev
Change-Id: Ia95af76e2995ce7fb0778b020baf2882a8b0a3dd
Carl Shapiro [Mon, 5 Apr 2010 23:45:34 +0000 (16:45 -0700)]
Merge "Fix two issues with the partial gc code." into dalvik-dev
Elliott Hughes [Mon, 5 Apr 2010 23:39:58 +0000 (16:39 -0700)]
am
f3c7fd52: Merge "Froyo InputStream.available documentation improvement." into froyo
Elliott Hughes [Mon, 5 Apr 2010 23:13:54 +0000 (16:13 -0700)]
Merge "Froyo InputStream.available documentation improvement." into froyo
Elliott Hughes [Mon, 5 Apr 2010 18:33:58 +0000 (11:33 -0700)]
Froyo InputStream.available documentation improvement.
This method causes a lot of confusion, and we can do a lot better. (Ideally,
the API would either not exist or be something like "public boolean ready()".)
I've removed poor-quality documentation overrides too, so the full
documentation is visible in most places. (InflaterInputStream is an obvious
exception.)
Also, to a lesser extent, improve the InputStream.skip documentation.
Change-Id: I6d6cd788e6a32ad4a2613d1e381610f1ad8575fe
Jesse Wilson [Mon, 5 Apr 2010 22:48:13 +0000 (15:48 -0700)]
Merge "Fix vogar host mode." into dalvik-dev
Jesse Wilson [Mon, 5 Apr 2010 22:25:47 +0000 (15:25 -0700)]
Fix vogar host mode.
Also addressing bdc's comments from change Ibc7cbc81, most
notably an import-ordering issues that impact many files.
Brian Carlstrom [Mon, 5 Apr 2010 22:13:39 +0000 (15:13 -0700)]
Merge "Remove unnecessary final local variables and arguments from javax.net.ssl tests" into dalvik-dev
Brian Carlstrom [Mon, 5 Apr 2010 18:50:10 +0000 (11:50 -0700)]
Remove unnecessary final local variables and arguments from javax.net.ssl tests
Change-Id: Ie4cbad9335e37f785edab9a76c42c229a1d40f57
Jesse Wilson [Mon, 5 Apr 2010 18:21:51 +0000 (11:21 -0700)]
Merge "Removing APIs from dalvik.system that shouldn't have been published." into dalvik-dev
Andy McFadden [Mon, 5 Apr 2010 17:53:07 +0000 (10:53 -0700)]
am
14af5a09: am
54df4ecc: Added a note about android:vmSafeMode.
Merge commit '
14af5a09123df1aa766fb1ab286601fc592e4770' into dalvik-dev
* commit '
14af5a09123df1aa766fb1ab286601fc592e4770':
Added a note about android:vmSafeMode.
Andy McFadden [Mon, 5 Apr 2010 17:45:19 +0000 (10:45 -0700)]
am
54df4ecc: Added a note about android:vmSafeMode.
Andy McFadden [Mon, 5 Apr 2010 17:07:30 +0000 (10:07 -0700)]
Added a note about android:vmSafeMode.
Seems like a good thing to note here, along with the system properties that
accomplish the same thing system-wide.
(This is a minor documentation change only.)
Change-Id: Ib9adbd612d662fd2da3a02f49e730040fba8a7f3
Carl Shapiro [Sun, 4 Apr 2010 08:17:33 +0000 (01:17 -0700)]
Fix two issues with the partial gc code.
* Eliminate a fence error in bitmap aliasing. The heap structure
uses asymetric bounds but the bitmap structure uses symmetric bounds.
Bias accordingly.
* Explicitly covert the immune limit to a uintptr_t to muffle a compiler
warning.
Change-Id: I05e74ab57035ee06eb6d88e773b1d680531a7e2f
Elliott Hughes [Sat, 3 Apr 2010 19:27:56 +0000 (12:27 -0700)]
Merge "More Charset/ICU cleanup." into dalvik-dev
Brian Carlstrom [Sat, 3 Apr 2010 15:13:40 +0000 (08:13 -0700)]
Merge "New "from scratch" Junit tests for javax.net.ssl" into dalvik-dev
Brian Carlstrom [Fri, 2 Apr 2010 21:13:53 +0000 (14:13 -0700)]
New "from scratch" Junit tests for javax.net.ssl
These new tests focusi on areas where I am making OpenSSL
implementation chages, where I found differences from the RI when
working on that code, and places where we were missing functionality
compared to the spec. They all work on the RI, many fail on Dalvik
luni/src/test/java/javax/net/ssl/AllTests.java
luni/src/test/java/javax/net/ssl/SSLContextTest.java
luni/src/test/java/javax/net/ssl/SSLSessionContextTest.java
luni/src/test/java/javax/net/ssl/SSLSessionTest.java
luni/src/test/java/javax/net/ssl/SSLSocketFactoryTest.java
luni/src/test/java/javax/net/ssl/SSLSocketTest.java
Adding my javax.net.ssl.AllTests to the main list
luni/src/test/java/tests/AllTests.java
Adding Bouncy Castle provider /usr/share/java/bcprov.jar to host
classpath for testing with --java-home /usr/lib/jvm/java-6-openjdk
tools/runner/java/dalvik/runner/JavaVm.java
Fix usage comment to reboot to bootloader
run-core-tests
Change-Id: I7a7998fc7bedc7a00b1836517d043c6a27c8bd4d
Elliott Hughes [Sat, 3 Apr 2010 00:19:21 +0000 (17:19 -0700)]
More Charset/ICU cleanup.
I've been feeling guilty about leaving broken double-checked locking (missing
the "volatile") in harmony's Charset code. A quick investigation showed that
the method that it's intended to optimize is basically never called, and the
RI's documentation explicitly says "don't call this; it's slow". So this patch
fixes that.
I've also improved our documentation.
I've also deleted a bunch of dead code.
I've also tidied up some dodgy native string handling.
Change-Id: Iad69ebb3459d9cc4c4ff37b255d458b83fe40132
Ben Cheng [Fri, 2 Apr 2010 23:25:54 +0000 (16:25 -0700)]
am
67050d11: am
bd1326d0: Clean up the codegen for invoking helper callout functions.
Merge commit '
67050d11e5afa7c2396bb0fc4f8d455ea2616f95' into dalvik-dev
* commit '
67050d11e5afa7c2396bb0fc4f8d455ea2616f95':
Clean up the codegen for invoking helper callout functions.
Ben Cheng [Fri, 2 Apr 2010 23:20:07 +0000 (16:20 -0700)]
am
bd1326d0: Clean up the codegen for invoking helper callout functions.
Ben Cheng [Fri, 2 Apr 2010 22:04:53 +0000 (15:04 -0700)]
Clean up the codegen for invoking helper callout functions.
All invoked functions are documented in compiler/codegen/arm/CalloutHelper.h
Bug:
2567981
Change-Id: Ia7cd4107272df1b0b5588fbcc0aafcc6d0723d60
Brian Carlstrom [Fri, 2 Apr 2010 22:59:31 +0000 (15:59 -0700)]
am
85948576: am
4ff253ff: Remove JSON License from NOTICE file
Merge commit '
85948576f0270265ebeca795f41447ad4f549c11' into dalvik-dev
* commit '
85948576f0270265ebeca795f41447ad4f549c11':
Remove JSON License from NOTICE file
Ben Cheng [Fri, 2 Apr 2010 22:59:29 +0000 (15:59 -0700)]
am
bf4d95ea: am
76cacb1f: Merge "Accept the "-Xjitdisableopt" flag as advertised." into froyo
Merge commit '
bf4d95ea7d2e86e93ab372f261baa348c03ef188' into dalvik-dev
* commit '
bf4d95ea7d2e86e93ab372f261baa348c03ef188':
Accept the "-Xjitdisableopt" flag as advertised.
Ben Cheng [Fri, 2 Apr 2010 22:59:26 +0000 (15:59 -0700)]
am
1071056d: am
a497359a: Fix a race condition in JIT state refresh under debugging / misc code cleanup.
Merge commit '
1071056dace973442293b718bf12e328935126f1' into dalvik-dev
* commit '
1071056dace973442293b718bf12e328935126f1':
Fix a race condition in JIT state refresh under debugging / misc code cleanup.
Brian Carlstrom [Fri, 2 Apr 2010 22:59:22 +0000 (15:59 -0700)]
am
3d82ade7: Merge "Have certimport.sh list certificates in BKS keystore after importing for verification/debugging"
Merge commit '
3d82ade7a9b764695bad89d2476a73441118411b' into dalvik-dev
* commit '
3d82ade7a9b764695bad89d2476a73441118411b':
Have certimport.sh list certificates in BKS keystore after importing for verification/debugging
Andy McFadden [Fri, 2 Apr 2010 22:59:18 +0000 (15:59 -0700)]
am
d4b07831: Merge "Fix misuse of ALLOC_DONT_TRACK." into froyo
Merge commit '
d4b078315ae7335c385f70b32810959bd228d976' into dalvik-dev
* commit '
d4b078315ae7335c385f70b32810959bd228d976':
Fix misuse of ALLOC_DONT_TRACK.
Brian Carlstrom [Fri, 2 Apr 2010 22:59:15 +0000 (15:59 -0700)]
am
ea527bc0: Remove debug message from OpenSSL JNI code
Merge commit '
ea527bc08f4d7128eb9d927a16723d20b9d1d217' into dalvik-dev
* commit '
ea527bc08f4d7128eb9d927a16723d20b9d1d217':
Remove debug message from OpenSSL JNI code
Elliott Hughes [Fri, 2 Apr 2010 22:59:11 +0000 (15:59 -0700)]
am
6e138297: Add an @KnownFailure annotation.
Merge commit '
6e138297538fb632944ae1a81f346aec75137399' into dalvik-dev
* commit '
6e138297538fb632944ae1a81f346aec75137399':
Add an @KnownFailure annotation.
Bill Buzbee [Fri, 2 Apr 2010 22:59:07 +0000 (15:59 -0700)]
am
434bae64: Fix for
2542488 JIT codegen bug with overlapping wide operands
Merge commit '
434bae646046871c334b95bd9123a78da66c27c3' into dalvik-dev
* commit '
434bae646046871c334b95bd9123a78da66c27c3':
Fix for
2542488 JIT codegen bug with overlapping wide operands
Ben Cheng [Fri, 2 Apr 2010 22:58:56 +0000 (15:58 -0700)]
am
d5adae17: Improve JIT self verifier test coverage to follow single-step instructions.
Merge commit '
d5adae17d71e86a1a5f3ae7825054e3249fb7879' into dalvik-dev
* commit '
d5adae17d71e86a1a5f3ae7825054e3249fb7879':
Improve JIT self verifier test coverage to follow single-step instructions.
Brian Carlstrom [Fri, 2 Apr 2010 22:01:36 +0000 (15:01 -0700)]
am
4ff253ff: Remove JSON License from NOTICE file
Brian Carlstrom [Fri, 2 Apr 2010 21:40:07 +0000 (14:40 -0700)]
Remove JSON License from NOTICE file
Change-Id: Ie4426f8e33ddef42916e88adeaf672714212d3a3
Elliott Hughes [Fri, 2 Apr 2010 18:47:56 +0000 (11:47 -0700)]
Add Java 6's java.util.ServiceLoader.
New implementation, documentation, and tests, very loosely based on the harmony
code.
We can't run the harmony or jtreg tests because we don't have the infrastructure.
My test just tests the most obvious use cases, on the assumption that at some
point we'll get the other test suites working; quite possibly before anyone ever
wants to use this stuff on Android.
(We might want to switch over existing META-INF/services/ code to use
ServiceLoader. I've raised http://b/
2567593 for this.)
Bug:
2497395
Change-Id: I62b0ac4748204555d3ba9356794a72aff4f4f01e
Jesse Wilson [Thu, 1 Apr 2010 22:44:05 +0000 (15:44 -0700)]
Removing APIs from dalvik.system that shouldn't have been published.
These APIs were deprecated in Eclair and should disappear in Gingerbread.
See bug
2553600.
Jesse Wilson [Thu, 1 Apr 2010 21:44:29 +0000 (14:44 -0700)]
Merge "New method-level granularity and output streaming for vogar." into dalvik-dev
Jesse Wilson [Thu, 1 Apr 2010 06:51:56 +0000 (23:51 -0700)]
New method-level granularity and output streaming for vogar.
Elliott Hughes [Thu, 1 Apr 2010 21:31:56 +0000 (14:31 -0700)]
Merge "Tidy up our getAvailableLocales methods to actually ask ICU4C." into dalvik-dev