OSDN Git Service
Android (Google) Code Review [Thu, 5 Nov 2009 18:23:43 +0000 (13:23 -0500)]
Merge change I7b302183
* changes:
Remove cruft in the default libdvm.so and add 3 more special targets.
Android (Google) Code Review [Thu, 5 Nov 2009 01:22:15 +0000 (20:22 -0500)]
Merge change Ic5176ecb
* changes:
Remove deadlock-prone thread pool.
Elliott Hughes [Thu, 5 Nov 2009 00:00:06 +0000 (16:00 -0800)]
Remove deadlock-prone thread pool.
This is only test code, so let's not make it any more complicated than it
needs to be.
(The code sometimes locked the Vector before the individual Worker, and
sometimes the other way round.)
Dan Bornstein [Wed, 4 Nov 2009 23:34:14 +0000 (15:34 -0800)]
Only compile in multicast support on Linux, for the time being.
The calls and structs provided by the underlying platform for
multicast aren't yet exactly well-established POSIX standards, and the
current Linux code is still not considered to be super-robust, and as
such it isn't a good idea to try to duplicate its functionality for
other platforms. We will revisit the issue once the Linux side has
matured a bit.
Change-Id: I630086e22f6980726fd4523cb60dfc8c9fb9b011
Android (Google) Code Review [Wed, 4 Nov 2009 22:56:07 +0000 (17:56 -0500)]
Merge change Id9fcfa6d
* changes:
Fix for inline string indexof; added regression tests
Bill Buzbee [Wed, 4 Nov 2009 00:52:53 +0000 (16:52 -0800)]
Fix for inline string indexof; added regression tests
Ben Cheng [Wed, 4 Nov 2009 00:19:11 +0000 (16:19 -0800)]
Remove cruft in the default libdvm.so and add 3 more special targets.
The idea is similar to having libc.so as the default/optimal build and
libc_debug.so at a handy place.
libdvm.so : default build to be installed with JIT on and assertion off.
libdvm_interp.so: JIT statically compiled out and assertion off.
libdvm_assert.so: assert/JIT-tuning enabled.
libdvm_sv.so : assert/JIT-self-verification enabled.
Compile time of "mmm dalvik" from clean build with -j1:
real 2m36.144s
user 2m23.029s
sys 0m12.253s
Compile time of "mmm dalvik" from touching Interp.c with -j1:
real 0m8.493s
user 0m7.416s
sys 0m1.280s
Code size:
638152 Nov 3 16:17 libdvm.so
785604 Nov 3 16:17 libdvm_assert.so
556888 Nov 3 16:17 libdvm_interp.so
793804 Nov 3 16:17 libdvm_sv.so
Android (Google) Code Review [Wed, 4 Nov 2009 21:29:46 +0000 (16:29 -0500)]
Merge change Ib62b9223
* changes:
Emitting JUnit+Ant style XML from the jtreg test runner.
Android (Google) Code Review [Wed, 4 Nov 2009 20:16:35 +0000 (15:16 -0500)]
Merge change I6b080ffc
* changes:
Another couple of tweaks to deal with the ragged end of standardization.
Android (Google) Code Review [Wed, 4 Nov 2009 19:45:16 +0000 (14:45 -0500)]
Merge change I7e695ea9
* changes:
Remove duplication in OpenSSLSocket/OpenSSLServerSocket.
Dan Bornstein [Tue, 3 Nov 2009 23:10:26 +0000 (15:10 -0800)]
Another couple of tweaks to deal with the ragged end of standardization.
Change-Id: I6b080ffcc1832a902e21f5137f42e4d860c407f0
Jesse Wilson [Wed, 4 Nov 2009 19:18:01 +0000 (11:18 -0800)]
Emitting JUnit+Ant style XML from the jtreg test runner.
This change adds some unfortunate code duplication between
the jtreg runner and the CoreTestSuite runner. I'd like to
eventually loop back and create a unified test runner for
either type of test.
Android (Google) Code Review [Wed, 4 Nov 2009 02:01:55 +0000 (21:01 -0500)]
Merge change I71684d91
* changes:
CharsetDecoderICU/CharsetEncoderICU should take arrayOffset into account.
Android (Google) Code Review [Wed, 4 Nov 2009 01:46:08 +0000 (20:46 -0500)]
Merge change Ic80147bd
* changes:
Adding timeouts to jtreg runner.
Jesse Wilson [Wed, 4 Nov 2009 00:45:07 +0000 (16:45 -0800)]
Adding timeouts to jtreg runner.
Also fixing some problems with the Android.mk which was
pointing at an old version of the Run class.
Elliott Hughes [Wed, 4 Nov 2009 00:36:49 +0000 (16:36 -0800)]
Remove duplication in OpenSSLSocket/OpenSSLServerSocket.
Elliott Hughes [Tue, 3 Nov 2009 23:52:10 +0000 (15:52 -0800)]
CharsetDecoderICU/CharsetEncoderICU should take arrayOffset into account.
CharsetDecoderICU and CharsetEncoderICU special-case array-backed ByteBuffers
and CharBuffers for performance reasons, but they shouldn't assume that the
backing array always has offset 0.
An external user hit this while using the jAudioTagger library.
Test cases from user submission:
http://code.google.com/p/android/issues/detail?id=4237
See also:
2234697
Elliott Hughes [Tue, 3 Nov 2009 21:32:16 +0000 (13:32 -0800)]
Remove more @KnownFailures now I've run tests.AllTests.
A lunchtime run of the full suite turned up more.
Ben Cheng [Tue, 3 Nov 2009 20:20:28 +0000 (12:20 -0800)]
Hide JIT-specific constants when JIT is not configured.
Android (Google) Code Review [Tue, 3 Nov 2009 19:52:25 +0000 (14:52 -0500)]
Merge change Ia61d31e2
* changes:
Remove @KnownFailure from a bunch of tests that now pass.
Elliott Hughes [Tue, 3 Nov 2009 19:44:56 +0000 (11:44 -0800)]
Remove @KnownFailure from a bunch of tests that now pass.
Looks like we got some of our Locales back.
Ben Cheng [Thu, 29 Oct 2009 21:39:18 +0000 (14:39 -0700)]
Implement chaining up to the first 64 cases in a switch statement.
Bill Buzbee [Tue, 3 Nov 2009 16:06:02 +0000 (08:06 -0800)]
Back out inline string optimizations until cause of instability tracked down.
Elliott Hughes [Tue, 3 Nov 2009 02:16:19 +0000 (18:16 -0800)]
Ensure dalvikvm sets "user.name" to "root" for our tests.
dalvikvm sets "user.name" to $USER, but that environment variable isn't set
when we run the tests. I was looking at our DatagramSocketTest failure, and
it turns out it's another instance of "root can do stuff other users can't".
The typical way harmony tests check whether they're running as root is to
compare "user.name" against "root", but from run-core-tests they see "".
Android (Google) Code Review [Tue, 3 Nov 2009 00:51:25 +0000 (19:51 -0500)]
Merge change I22212019
* changes:
Kill OSNetworkSystem.inheritedChannelImpl.
Android (Google) Code Review [Mon, 2 Nov 2009 23:35:57 +0000 (18:35 -0500)]
Merge change I57dd1032
* changes:
Supporting expected results for the jtreg test runner.
Android (Google) Code Review [Mon, 2 Nov 2009 23:32:38 +0000 (18:32 -0500)]
Merge change Ie098e2fa
* changes:
Fixing PipedWriters/PipedOutputStreams silent failures during close().
Elliott Hughes [Mon, 2 Nov 2009 23:25:05 +0000 (15:25 -0800)]
Kill OSNetworkSystem.inheritedChannelImpl.
This code is broken (and more broken than upstream), and not obviously relevant
to our platform. Let's make it clear that all this currently does is return
null.
The changes in the Java side bring us back in sync with upstream.
Jesse Wilson [Mon, 2 Nov 2009 21:58:26 +0000 (13:58 -0800)]
Fixing PipedWriters/PipedOutputStreams silent failures during close().
See bug
2224903 and jtreg test java.io.BufferedWriter.Cleanup.
Android (Google) Code Review [Mon, 2 Nov 2009 22:51:29 +0000 (17:51 -0500)]
Merge change I04f3b02b
* changes:
Jit - optimized inline string compareto, indexof; fill_array_data bug fix
Dan Bornstein [Thu, 29 Oct 2009 17:15:42 +0000 (10:15 -0700)]
Some more adjustments to deal with building for a BSD(-like) target.
Change-Id: I5e33c3db160ae3af6e324492e0b6a7a0dfb9719b
Android (Google) Code Review [Mon, 2 Nov 2009 21:33:43 +0000 (16:33 -0500)]
Merge change I318b1449
* changes:
More OSNetworkSystem cleanup.
Elliott Hughes [Sat, 31 Oct 2009 00:54:32 +0000 (17:54 -0700)]
More OSNetworkSystem cleanup.
valgrind didn't like what we were doing here, specifically the way we
were setting ss_family to AF_INET if getsockopt IP_MULTICAST_IF didn't
return an AF_INET address, and ignoring the fact that the rest of
the sockaddr_storage doesn't necessarily correspond to an AF_INET address.
Linux seems to return an AF_UNSPEC address (rather than INADDR_ANY) if we
haven't set a multicast interface, so we have to do the conversion ourselves.
More disturbingly (and unfixed by this patch) we sometimes see ss_family
come back as 127 (when AF_MAX is 32 on our system). My guess is that the
kernel is just handing back bad data we gave it earlier, but I'll come back
to see about fixing multicast properly later.
I've inlined socketAddressToString into osNetworkSystem_byteArrayToIpString,
its only caller, because it's clearer that way now we've simplified the
division of error handling between the two.
I've brought getSocketLocalAddressImpl and getSocketLocalPortImpl in line
with each other and changed them to at least log errors. I've also added
a new test that fails, to demonstrate that this implementation is broken
as designed.
I've changed the name of JAVASOCKOPT_IP_MULTICAST_IF to match the Java
constant.
I've fixed the exception we throw if we're asked to convert a bad address
family's address from code that can't throw IOException --- AssertionError
doesn't have a String constructor. Really, we need to kill this code, so
I've added a TODO.
I've also made a real push to get rid of most of the SOCKERR_*-based error
reporting. (I had a transient failure with a meaningless error message
that sent me to the source to work out which errno it was actually
trying to report.)
I've changed setTTL to call setTimeToLive, and change the implementation
of the latter to pass Integer rather than Byte to the native implementation,
since that's what the native code needs anyway and native Byte support was
only for TTL.
Bug:
2225748
Bill Buzbee [Mon, 2 Nov 2009 17:23:49 +0000 (09:23 -0800)]
Jit - optimized inline string compareto, indexof; fill_array_data bug fix
Added flushAllRegs() prior to C handlers in preparation for upcoming support
for holding live/dirty values in physical registers.
Jesse Wilson [Fri, 30 Oct 2009 23:53:05 +0000 (16:53 -0700)]
Supporting expected results for the jtreg test runner.
This is necessary to suppress false positives when dalvik
intentionally differs from the RI. This came up in the fix
for issue
2224903.
Also adding additional features to the jtreg runner to make
it useful as an iterative development tool:
- debugger support, to debug through running tests
- verbose output, to aid in diagnosing hangs
Also adding a few ".expected" files for known test failures.
Hopefully this is scalable.
Renaming Run to TestRun and extracting Result as a top-level enum.
Android (Google) Code Review [Mon, 2 Nov 2009 04:47:27 +0000 (23:47 -0500)]
Merge change I88e8376e
* changes:
Update logging to r820767
Android (Google) Code Review [Sat, 31 Oct 2009 17:32:13 +0000 (13:32 -0400)]
Merge change Id46d9a48
* changes:
Fixing 1 of the 4 BufferedReader test failures in bug
2224903.
Jesse Wilson [Fri, 30 Oct 2009 01:36:38 +0000 (18:36 -0700)]
Fixing 1 of the 4 BufferedReader test failures in bug
2224903.
This CL includes the following functional changes:
- changing read to not clear the mark upon reading EOF
- changing read(char[], int, int) to use the 'read
directly from the source stream' shortcut when the
mark has exceeded its limit. Previously we took the
shortcut only when the mark was unset.
And these nonfunctional changes
- rewrote read(char[], int, int) dramatically. The new
revision contains only one call to 'System.arrayCopy'
and the related bookkeeping. Previously there was one call
before the loop, and another call in the loop.
- renamed markpos to mark
- renamed marklimit to markLimit
- renamed count to end (it isn't a count, it's a position)
- simplifying conditions that used >= when > was impossible
- reducing the number of field reads where convenient
Android (Google) Code Review [Fri, 30 Oct 2009 22:29:32 +0000 (18:29 -0400)]
Merge change I474dc860
* changes:
Rewrite NativeBN_twosCompFitsIntoBytes.
Bill Buzbee [Fri, 30 Oct 2009 22:00:52 +0000 (15:00 -0700)]
Fixed typo introduced during comment reformatting.
Android (Google) Code Review [Fri, 30 Oct 2009 21:37:44 +0000 (17:37 -0400)]
Merge change Ib000d44f
* changes:
Major registor allocation rework - stage 1.
Bill Buzbee [Thu, 24 Sep 2009 00:17:35 +0000 (17:17 -0700)]
Major registor allocation rework - stage 1.
Direct usage of registers abstracted out.
Live values tracked locally. Redundant loads and stores suppressed.
Address of registers and register pairs unified w/ single "location" mechanism
Register types inferred using existing dataflow analysis pass.
Interim (i.e. Hack) mechanism for storing register liveness info. Rewrite TBD.
Stubbed-out code for linear scan allocation (for loop and long traces)
Moved optimistic lock check for monitor-enter/exit inline for Thumb2
Minor restructuring, renaming and general cleanup of codegen
Renaming of enums to follow coding convention
Formatting fixes introduced by the enum renaming
Rewrite of RallocUtil.c and addition of linear scan to come in stage 2.
Elliott Hughes [Fri, 30 Oct 2009 06:06:37 +0000 (23:06 -0700)]
Rewrite NativeBN_twosCompFitsIntoBytes.
valgrind complains about invalid 4-byte reads, caused by "case 8" in the
BNInterface.c function I'm removing here, which assumed that if we're checking
whether a BIGNUM fits in 8 bytes, it must require more than 4 bytes (and so
accessing d[1] is acceptable).
We can implement this in Java using the existing BigInteger.bitLength
method (which may call down to native code, but that native code looks okay).
Also remove a related commented-out method.
Bugs:
2223213,
2225642
Android (Google) Code Review [Thu, 29 Oct 2009 22:01:56 +0000 (18:01 -0400)]
Merge change I006c279b
* changes:
Remove broken .so and fix bogus test.
Elliott Hughes [Thu, 29 Oct 2009 21:02:57 +0000 (14:02 -0700)]
Remove broken .so and fix bogus test.
valgrind doesn't like this because the .so *only* exists for x86 (contrary to
the claim in the @AndroidOnly annotation) but it's broken there, returning
a char* instead of a jstring.
I'm not really sure what they were trying to test here, but let's assume it
was that Runtime.getRuntime().load behaves like System.load, and fix the
tests that way.
Bug:
2223234
Android (Google) Code Review [Thu, 29 Oct 2009 18:38:23 +0000 (14:38 -0400)]
Merge change I4a356627
* changes:
Change the jtreg tool to perform both building and running steps.
Android (Google) Code Review [Thu, 29 Oct 2009 00:49:00 +0000 (20:49 -0400)]
Merge change I8fa1a78a
* changes:
Make run-core-tests with no arguments equivalent to tests.AllTests.
Jesse Wilson [Thu, 29 Oct 2009 00:36:00 +0000 (17:36 -0700)]
Change the jtreg tool to perform both building and running steps.
Elliott Hughes [Wed, 28 Oct 2009 23:19:48 +0000 (16:19 -0700)]
Make run-core-tests with no arguments equivalent to tests.AllTests.
Previous behavior would run the same set of tests, but without going through
the regular pre- and post-processing, and without initializing the command-line
flags to their default values.
Android (Google) Code Review [Wed, 28 Oct 2009 22:07:59 +0000 (18:07 -0400)]
Merge change Id7694644
* changes:
Script for compiling and dexing jtreg tests for Dalvik.
Jesse Wilson [Wed, 28 Oct 2009 00:08:33 +0000 (17:08 -0700)]
Script for compiling and dexing jtreg tests for Dalvik.
Android (Google) Code Review [Wed, 28 Oct 2009 20:25:36 +0000 (16:25 -0400)]
Merge change I8c671e53
* changes:
Implement ProcessBuilder.redirectErrorStream.
Elliott Hughes [Tue, 27 Oct 2009 20:39:09 +0000 (13:39 -0700)]
Implement ProcessBuilder.redirectErrorStream.
Also simplify and correct the security to ensure that the user can't modify
the command to be executed after the SecurityManager has approved it.
Bug:
2180063
Elliott Hughes [Tue, 27 Oct 2009 23:53:15 +0000 (16:53 -0700)]
Fix a few FindBugs warnings in code that isn't upstream.
Bugs:
2099642,
2099637
Jesse Wilson [Tue, 27 Oct 2009 00:49:25 +0000 (17:49 -0700)]
Update logging to r820767
Elliott Hughes [Mon, 26 Oct 2009 23:38:13 +0000 (16:38 -0700)]
Remove OSNetworkSystem.sendStream and all use of ErrorCodeException.
Removing OSNetworkSystem.sendStream brings us in line with harmony. I've
also rewritten writeSocketImpl to not make a temporary copy of the data it's
going to send.
The weird code in writeSocketDirectImpl that threw ErrorCodeException turns out
to be a very awkward way of returning zero to the only two callers that are
paying attention. (Harmony actually calls the equivalent of this code every
time it throws SocketException from native code, but these two callers were
the only places that checked for the special case.)
Dan Bornstein [Mon, 26 Oct 2009 23:30:39 +0000 (16:30 -0700)]
The officially sanctioned way to get memcpy() is to #include <string.h>.
Change-Id: Ie157d9305df5f9b86a09ea2224666fd2c054cda4
Android (Google) Code Review [Mon, 26 Oct 2009 22:41:14 +0000 (18:41 -0400)]
Merge change I4c4d050d
* changes:
Clone TEMP_FAILURE_RETRY in JNIHelp.h, to make up for (take your pick) laggard libc implementations not keeping up with the times or (perhaps) agressively modern libc implementations too eagerly expanding upon the standard.
Android (Google) Code Review [Mon, 26 Oct 2009 21:09:10 +0000 (17:09 -0400)]
Merge change Ibc04ef43
* changes:
Remove dead native org.apache.harmony.nio.AddressUtils code.
Dan Bornstein [Mon, 26 Oct 2009 20:33:22 +0000 (13:33 -0700)]
Clone TEMP_FAILURE_RETRY in JNIHelp.h, to make up for (take your pick)
laggard libc implementations not keeping up with the times or
(perhaps) agressively modern libc implementations too eagerly
expanding upon the standard.
Change-Id: I4c4d050d15a00f4e82f8beb2b9c386b7c652f495
Elliott Hughes [Mon, 26 Oct 2009 20:14:07 +0000 (13:14 -0700)]
Remove dead native org.apache.harmony.nio.AddressUtils code.
This code is dead at the moment, and were it ever to become live, I'm pretty
sure we'd want to start again from scratch rather than do whatever the author
of this had in mind.
Android (Google) Code Review [Mon, 26 Oct 2009 19:14:26 +0000 (15:14 -0400)]
Merge change I8a7a4c56
* changes:
Split libcore/Android.mk into two files, one for Java code and one for native code, and make each have a set of rules for building on the host.
Android (Google) Code Review [Mon, 26 Oct 2009 18:50:11 +0000 (14:50 -0400)]
Merge change Ibebb78b6
* changes:
Switch ProcessManager and System over to C++.
Elliott Hughes [Mon, 26 Oct 2009 18:18:00 +0000 (11:18 -0700)]
DeleteLocalRef the result of GetObjectClass more consistently.
Should fix VM crashes in tests.java.sql.StressTest, which can now be
re-enabled.
I've also added a "throwoom" to the one place where this code
calls malloc but doesn't check the result.
Bug:
2213053
Dan Bornstein [Sat, 24 Oct 2009 22:33:49 +0000 (15:33 -0700)]
Split libcore/Android.mk into two files, one for Java code and one for
native code, and make each have a set of rules for building on the host.
I also tightened up how sub.mk processing works and documented it
a little better.
Change-Id: I8a7a4c5697b2f22c4d69941dba381d6452200911
Android (Google) Code Review [Mon, 26 Oct 2009 17:04:31 +0000 (13:04 -0400)]
Merge change I66e35647
* changes:
A new hygenic way for tests to clean up before or after execution.
Jesse Wilson [Fri, 23 Oct 2009 22:31:41 +0000 (15:31 -0700)]
A new hygenic way for tests to clean up before or after execution.
This replaces PrefsTester and is more general purpose.
Android (Google) Code Review [Mon, 26 Oct 2009 05:06:43 +0000 (01:06 -0400)]
Merge change I968363e2
* changes:
Suppressing StressTest which is causing our continuous build to fail.
Jesse Wilson [Sun, 25 Oct 2009 18:00:06 +0000 (11:00 -0700)]
Suppressing StressTest which is causing our continuous build to fail.
We're tracking this under issue
2213053.
Android (Google) Code Review [Sat, 24 Oct 2009 21:39:51 +0000 (17:39 -0400)]
Merge change Ibf565c9c
* changes:
Change the host build to include whole static libraries, and to name them "*-host".
Dan Bornstein [Sat, 24 Oct 2009 20:23:37 +0000 (13:23 -0700)]
Change the host build to include whole static libraries, and to name
them "*-host".
Change-Id: Ibf565c9c4b0709eb25edd71786b269895a1616a4
Elliott Hughes [Sat, 24 Oct 2009 01:10:44 +0000 (18:10 -0700)]
Switch ProcessManager and System over to C++.
Bug
2180063 will require changes to ProcessManager, so now's a good time
to make the switch in this directory.
Android (Google) Code Review [Sat, 24 Oct 2009 00:33:11 +0000 (20:33 -0400)]
Merge change I410514c5
* changes:
Expose hooks for more efficient log handling in Android apps.
Dan Bornstein [Fri, 23 Oct 2009 20:25:03 +0000 (13:25 -0700)]
Sort out libnativehelper, and make related comments less redundant.
Change-Id: If25babc7b3232449a3ba8503431865273d4f481a
Android (Google) Code Review [Fri, 23 Oct 2009 19:20:02 +0000 (15:20 -0400)]
Merge change I3628c655
* changes:
OSMemorySystem.mmap fixes.
Android (Google) Code Review [Fri, 23 Oct 2009 19:13:13 +0000 (15:13 -0400)]
Merge change I834d8b2c
* changes:
Remove OSNetworkSystem.receiveStream.
Android (Google) Code Review [Fri, 23 Oct 2009 14:35:22 +0000 (10:35 -0400)]
Merge change Idb16cc7f
* changes:
Add a reference table dump call.
Jesse Wilson [Wed, 21 Oct 2009 22:44:25 +0000 (15:44 -0700)]
Expose hooks for more efficient log handling in Android apps.
This change introduces a new interface, DalvikLogHandler. Log
handlers that implement it opt-in to more efficient log handling
for common-case log messages. The API requires far fewer objects
to be allocated to log a message.
A related change in frameworks/base adopts this optimization
in the built-in AndroidHandler.
This optimization resulted in a 2.75x improvement on my device:
from 154ns to 56ns per message.
Android (Google) Code Review [Fri, 23 Oct 2009 01:27:41 +0000 (21:27 -0400)]
Merge change I93fe0d1b
* changes:
Re-enable SSL handshake cutthrough support (and fixed unittest)
Andy McFadden [Fri, 23 Oct 2009 00:24:45 +0000 (17:24 -0700)]
Add a reference table dump call.
This adds a hidden method to android.os.Debug that causes the contents
of various reference tables to be dumped. Currently it's the local,
global, and pinned array tables from JNI.
Bug
2075355
Elliott Hughes [Fri, 23 Oct 2009 00:25:01 +0000 (17:25 -0700)]
OSMemorySystem.mmap fixes.
Stop silently truncating the arguments to mmap. Check they're actually valid.
Fix mmap to actually throw IOException on error, as it claimed to do.
Correct parameter name 'alignment' to 'offset'.
Remove dead code (getPageSize).
Android (Google) Code Review [Thu, 22 Oct 2009 23:59:10 +0000 (19:59 -0400)]
Merge change Ia1dc94d5
* changes:
Encode recommended practice wrt libffi in comments, and attempt to actually follow those recommendations.
Elliott Hughes [Thu, 22 Oct 2009 00:09:13 +0000 (17:09 -0700)]
Remove OSNetworkSystem.receiveStream.
Harmony removed this some time ago, and -- if we change our read/readDirect
implementations slightly -- we can too.
I've also added some bounds checking in the Java so we don't ask native code
to perform a buffer overrun for us.
I've also rewritten the native readSocketImpl to use GetByteArrayElements and
ReleaseByteArrayElements rather than its own custom stack/heap allocation and
arbitrary 64KiB limit. (As far as I can tell from the harmony history, the
limit dates from when they always read into an on-stack buffer, and was never
removed.)
I've also brought us in line with harmony so we only pass 'address' to
readDirect, rather than 'address' and 'offset'.
I've changed SocketTest to match upstream and -- since they pulled out some
of the tests into a new file -- I've added their UnixSocketTest so we don't
miss out. Our old SocketTest's test_getInputStream is the only test my new
code doesn't pass, but I think the old SocketTest was broken and the new
SocketTest/UnixSocketTest is correct.
I've also brought us back into line with harmony's MulticastSocketTest. With
the up-to-date tests, the new code behaves the same as the old code. (With
our old tests, the new code fails the joinGroup test with a
NullPointerException instead of a junit comparison failure.)
Dan Bornstein [Thu, 22 Oct 2009 22:58:32 +0000 (15:58 -0700)]
Encode recommended practice wrt libffi in comments, and attempt to actually
follow those recommendations.
Change-Id: Ia1dc94d50158e322d4dc96fc8528c408f2a3be1c
Rodrigo Ipince [Thu, 22 Oct 2009 20:21:02 +0000 (13:21 -0700)]
Fix for unmatched entry/exit points in test traces
Added support for the creation of test traces with unmatched entries/exits (current implementation segfaulted in some cases)
Nagendra Modadugu [Thu, 22 Oct 2009 17:23:58 +0000 (10:23 -0700)]
Re-enable SSL handshake cutthrough support (and fixed unittest)
Android (Google) Code Review [Thu, 22 Oct 2009 17:55:38 +0000 (13:55 -0400)]
Merge change Ibeb7d4a2
* changes:
Cleaning up synchronization in Logger.
Jesse Wilson [Wed, 21 Oct 2009 21:57:48 +0000 (14:57 -0700)]
Cleaning up synchronization in Logger.
Formerly any logged message would require synchronization on the shared
global lock to access the root logger's handlers. This change replaces
synchronization on loggers with a combination of copy-on-write and
volatile fields.
Also moving handler initialization from lazy to eager - the code has
moved from initHandlers() to setManager().
Also tidying up the info(), severe() type methods to delegate to avoid
unnecessary duplication.
Android (Google) Code Review [Thu, 22 Oct 2009 14:34:55 +0000 (10:34 -0400)]
Merge change I3d8565f0
* changes:
Collation.getSortKey returns keys generated by a different algorithm
Android (Google) Code Review [Thu, 22 Oct 2009 14:22:32 +0000 (10:22 -0400)]
Merge change I5ea630ca
* changes:
Use a binary search for sparse switch statements.
Android (Google) Code Review [Thu, 22 Oct 2009 14:19:51 +0000 (10:19 -0400)]
Merge change Id1f4cf7b
* changes:
Clear pending exception before throwing a new one.
Andy McFadden [Wed, 21 Oct 2009 23:59:31 +0000 (16:59 -0700)]
Use a binary search for sparse switch statements.
Added a couple of edge cases to test 015.
For bug
2119870.
Andy McFadden [Wed, 21 Oct 2009 22:36:48 +0000 (15:36 -0700)]
Clear pending exception before throwing a new one.
The JNI helper function that throws an exception calls FindClass, which
isn't allowed if an exception is currently pending. Some of our code
called this when an operation failed without noting that the thing that
failed already threw an exception; this caused the VM to blow up in a
rather unhelpful way.
We now log the class name and optional message from the original
exception, clear it, and then allocate & throw the new one.
For bug
2141867.
Android (Google) Code Review [Wed, 21 Oct 2009 20:05:07 +0000 (16:05 -0400)]
Merge change Id434c469
* changes:
More OSNetworkSystem cleanup.
Elliott Hughes [Wed, 21 Oct 2009 05:58:23 +0000 (22:58 -0700)]
More OSNetworkSystem cleanup.
Rewrite OSNetworkSystem.connect in terms of connectStreamWithTimeoutSocketImpl
in Java rather than in native code. Remove OSNetworkSystem.connectSocketImpl.
Make INetworkSystem.connect void, since the return value is always 0.
Use TEMP_FAILURE_RETRY rather than explicit do loops to retry interrupted
system calls.
Fix peekDatagramImpl to actually update the byte[] in the passed-in
InetAddress.
Stop pulling the int fd out of the FileDescriptor each time round the loop
in sendStreamImpl and sendDatagramImpl2.
More tiny steps towards eliminating the SOCKERR_ nonsense in favor of errno.
Prefer sizeof(variable) to sizeof(type).
Remove a few more superfluous "struct" keywords.
Android (Google) Code Review [Wed, 21 Oct 2009 16:53:08 +0000 (12:53 -0400)]
Merge change Iacd79b8a
* changes:
Avoid shadowing fields from the superclass testcase.
Jesse Wilson [Wed, 21 Oct 2009 01:49:47 +0000 (18:49 -0700)]
Avoid shadowing fields from the superclass testcase.
Android (Google) Code Review [Wed, 21 Oct 2009 01:10:03 +0000 (21:10 -0400)]
Merge change I54b596ca
* changes:
Expose the portable "strerror_r" used by jniThrowIOException.
Elliott Hughes [Tue, 20 Oct 2009 23:59:01 +0000 (16:59 -0700)]
Expose the portable "strerror_r" used by jniThrowIOException.
Also add one example caller I used to test this, and update the
libnativehelper README file.
Android (Google) Code Review [Tue, 20 Oct 2009 23:13:32 +0000 (19:13 -0400)]
Merge change Ib28d3a82
* changes:
Don't over flush the code cache at startup time.