summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Avoid a type conversion during comparisonNeil Fuller2015-01-061-1/+1
|/ | | | | | | Tiny change after commit 2237a9d0ea59928f8852c9f599bdd9a6930e727d to compare a long with a long. Change-Id: Iaba2d7246295f3f23c760fe72195136208a95933
* Merge "Fix Harmony's HostnameVerifierTest breakage."Alex Klyubin2015-01-051-3/+3
|\
| * Fix Harmony's HostnameVerifierTest breakage.Alex Klyubin2015-01-051-3/+3
| | | | | | | | | | | | | | | | | | | | These tests got broken by recent changes to the platform-default HostnameVerifier which no longer matches *.domain.com to domain.com. This CL fixes the affected tests by changing their expectaions. Bug: 18869757 Change-Id: I293b5f97f603a26a13cfd272a6175ef217ed4de3
* | Merge "Extend ArrayList fastpath to Collections.sort(List<T>, Comparator<T>)."Narayan Kamath2015-01-022-14/+47
|\ \
| * | Extend ArrayList fastpath to Collections.sort(List<T>, Comparator<T>).Narayan Kamath2015-01-022-14/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My original reasons for not extending it were bogus. We can safely cast Object[] to T[] in this case. Also tidy up the benchmark by changing buildList(.. boolean isArrayList) to buildList(.. Class<T extends List<Integer> list. AFTER SortWithComparator_arrayList, arrayListLength=4} 10881.97 ns; σ=64.97 ns @ 3 trials SortWithComparator_arrayList, arrayListLength=16} 33235.73 ns; σ=127.45 ns @ 3 trials SortWithComparator_arrayList, arrayListLength=64} 130317.52 ns; σ=135.31 ns @ 3 trials SortWithComparator_arrayList, arrayListLength=256} 495200.19 ns; σ=1120.86 ns @ 3 trials SortWithComparator_arrayList, arrayListLength=1024} 1990796.02 ns; σ=19151.58 ns @ 6 trials BEFORE SortWithComparator_arrayList, arrayListLength=4} 40030.32 ns; σ=509.60 ns @ 10 trials SortWithComparator_arrayList, arrayListLength=16} 122122.08 ns; σ=182.58 ns @ 3 trials SortWithComparator_arrayList, arrayListLength=64} 457833.87 ns; σ=1311.54 ns @ 3 trials SortWithComparator_arrayList, arrayListLength=256} 1764647.22 ns; σ=35150.74 ns @ 10 trials SortWithComparator_arrayList, arrayListLength=1024} 7127679.90 ns; σ=122546.75 ns @ 10 trials bug: 18821961 Change-Id: I22a18d99598dfacbdc54cf75e38dbc32ab027754
* | | Merge "Fix documentation for Calendar#clone."Narayan Kamath2015-01-022-1/+75
|\ \ \ | |/ / |/| |
| * | Fix documentation for Calendar#clone.Narayan Kamath2014-12-312-1/+75
|/ / | | | | | | | | | | | | | | | | Also add a test to make the behaviour of clone explicit. This should all be very obvious but it's probably best to make it clear. bug: https://code.google.com/p/android/issues/detail?id=3370 Change-Id: Ib17dccbf016a1dce4e21da089fd3597d6bfabe79
* | Merge "Fix CharsetEncoder.canEncode for empty CharSequences"Narayan Kamath2014-12-311-0/+4
|\ \
| * | Fix CharsetEncoder.canEncode for empty CharSequencesNarayan Kamath2014-12-311-0/+4
|/ / | | | | | | | | | | | | | | | | Broken by change c0c629a1 in which we started checking whether the encoded buffer was non-empty. Fixes org.apache.harmony.tests.java.nio.charset.ASCIICharsetEncoderTest#testCanEncodeCharSequence Change-Id: I9078f7f00a0f962e4f7eb113bdfa1445794d89b8
* | Merge "Add a zero-copy path for Collections.sort() on ArrayList."Narayan Kamath2014-12-303-7/+91
|\ \
| * | Add a zero-copy path for Collections.sort() on ArrayList.Narayan Kamath2014-12-303-7/+91
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given that ArrayLists are array backed, we can sort the underlying array in place. A similar optimisation can be applied to Vector and CopyOnWriteArrayList but vector isn't used often enough to slow everything else down with an instanceof check and nobody should be daft enough to try sorting a CopyOnWriteArrayList. Note that it's possible to apply the same optimisation to Collections.sort(List<T>, Comparator<? super T>) but it involves a larger refactoring to allow us to use Object[] instead of T[] and is accompanied by a general loss of readability. ArrayList performance improves for all array sizes : BEFORE Scenario{vm=app_process, trial=0, benchmark=Sort_arrayList, arrayListLength=4} 39021.26 ns; σ=206.27 ns @ 3 trials Scenario{vm=app_process, trial=0, benchmark=Sort_arrayList, arrayListLength=16} 120903.59 ns; σ=1188.88 ns @ 5 trials Scenario{vm=app_process, trial=0, benchmark=Sort_arrayList, arrayListLength=64} 435484.98 ns; σ=19141.88 ns @ 10 trials Scenario{vm=app_process, trial=0, benchmark=Sort_arrayList, arrayListLength=256} 1772876.81 ns; σ=5542.74 ns @ 3 trials Scenario{vm=app_process, trial=0, benchmark=Sort_arrayList, arrayListLength=1024} 7289431.83 ns; σ=110869.13 ns @ 10 trials AFTER Scenario{vm=app_process, trial=0, benchmark=Sort_arrayList, arrayListLength=4} 9161.79 ns; σ=90.04 ns @ 6 trials Scenario{vm=app_process, trial=0, benchmark=Sort_arrayList, arrayListLength=16} 29988.90 ns; σ=74.05 ns @ 3 trials Scenario{vm=app_process, trial=0, benchmark=Sort_arrayList, arrayListLength=64} 118142.86 ns; σ=1133.52 ns @ 7 trials Scenario{vm=app_process, trial=0, benchmark=Sort_arrayList, arrayListLength=256} 456091.11 ns; σ=9110.18 ns @ 10 trials Scenario{vm=app_process, trial=0, benchmark=Sort_arrayList, arrayListLength=1024} 1851939.39 ns; σ=69542.41 ns @ 10 trials For all other lists, there's no measurable difference for most sizes. length == 4 is harder to be sure about, given the large standard deviations and we'd expect the time spent in instanceof to be larger relative to the rest of what's going on. BEFORE Scenario{vm=app_process, trial=0, benchmark=Sort_vector, arrayListLength=4} 49002.02 ns; σ=1392.58 ns @ 10 trials Scenario{vm=app_process, trial=0, benchmark=Sort_vector, arrayListLength=16} 154967.88 ns; σ=332.29 ns @ 3 trials Scenario{vm=app_process, trial=0, benchmark=Sort_vector, arrayListLength=64} 588207.14 ns; σ=1863.60 ns @ 3 trials Scenario{vm=app_process, trial=0, benchmark=Sort_vector, arrayListLength=256} 2292967.79 ns; σ=4578.14 ns @ 3 trials Scenario{vm=app_process, trial=0, benchmark=Sort_vector, arrayListLength=1024} 9299582.60 ns; σ=179459.24 ns @ 10 trials AFTER Scenario{vm=app_process, trial=0, benchmark=Sort_vector, arrayListLength=4} 49324.98 ns; σ=240.86 ns @ 3 trials Scenario{vm=app_process, trial=0, benchmark=Sort_vector, arrayListLength=16} 155639.91 ns; σ=215.12 ns @ 3 trials Scenario{vm=app_process, trial=0, benchmark=Sort_vector, arrayListLength=64} 581950.81 ns; σ=938.11 ns @ 3 trials Scenario{vm=app_process, trial=0, benchmark=Sort_vector, arrayListLength=256} 2285933.64 ns; σ=13265.42 ns @ 3 trials Scenario{vm=app_process, trial=0, benchmark=Sort_vector, arrayListLength=1024} 8981475.84 ns; σ=431676.48 ns @ 10 trials bug: 18821961 Change-Id: I30a3eaf89ff478663f555c93556167107da10873
* | Merge "Fix integer overflow issue in ZoneInfo."Narayan Kamath2014-12-302-9/+34
|\ \
| * | Fix integer overflow issue in ZoneInfo.Narayan Kamath2014-12-302-9/+34
|/ / | | | | | | | | | | | | | | | | | | | | The least messy fix is to change mTransitions to long[] despite the underlying tzdata being ints. This leads to neater code than comparing the unix time (as a long) against the first and last element of the transitions array. bug: 18839557 Change-Id: Ife562749e8b2160f664d566a0a2aae14a0aea36e
* | Merge "MimeUtils: add ODF presentation (template)"Elliott Hughes2014-12-271-0/+2
|\ \
| * | MimeUtils: add ODF presentation (template)Miklos Vajna2014-12-271-0/+2
|/ / | | | | | | | | | | | | | | If ODF text, spreadsheet and graphics is there, then leaving out presentation makes little sense. Change-Id: Ice81f480a751537d757a33bae4de94c0b6097daf Signed-off-by: Miklos Vajna <vmiklos@vmiklos.hu>
* | Merge "Fix thread correctness issue in OldAndroidMonitorTest."Narayan Kamath2014-12-241-7/+7
|\ \
| * | Fix thread correctness issue in OldAndroidMonitorTest.Junjie Hu2014-12-241-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The waiter thread was looping on a non-volatile variable and therefore not guaranteed to observe any reads or writes to that variable. Signed-off-by: Junjie Hu <junjie.hu@mediatek.com> Change-Id: I6e52e456636774c492690179b9d84a250aec2637
* | | Merge "Create GregorianCalendar via a delegate."Narayan Kamath2014-12-241-1/+7
|\ \ \ | |/ / |/| |
| * | Create GregorianCalendar via a delegate.Deepanshu Gupta2014-12-241-1/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | GregorianCalendar has a minimum-cost constructor that is not available on the host. This change wraps the call to that constructor in a static method that LayoutLib can replace. Bug: http://b.android.com/79160 (cherry picked from commit 8edeef21e47c2fd104fc6e1c8b26fc913945e0b9) Change-Id: I6cfdf2e4401dfb02efca3a41d61cd474b58da850
* | Merge "Move heap trimming daemon and GC deamon into a single daemon"Mathieu Chartier2014-12-202-33/+27
|\ \
| * | Move heap trimming daemon and GC deamon into a single daemonMathieu Chartier2014-12-192-33/+27
| |/ | | | | | | | | Bug: 18739541 Change-Id: Icf309cd8981372f24caa7c8b98a2e0591b1d90ea
* | Merge "Add various system calls needed by the zygote."Elliott Hughes2014-12-185-0/+52
|\ \
| * | Add various system calls needed by the zygote.Elliott Hughes2014-12-175-0/+52
| | | | | | | | | | | | | | | Bug: 18719692 Change-Id: I91a943369bc3b331e7e06e758f729b008c3c041c
* | | Merge "Add hwp to MimeUtils map."Elliott Hughes2014-12-181-0/+1
|\ \ \ | |/ / |/| |
| * | Add hwp to MimeUtils map.Sungmin Choi2014-12-171-0/+1
|/ / | | | | | | | | Bug: 18788282 Change-Id: I9e28278eae3812387440dbfce196a20c32e24b30
* | Merge "Don't TEMP_FAILURE_RETRY calls that can't fail."Elliott Hughes2014-12-171-4/+4
|\ \
| * | Don't TEMP_FAILURE_RETRY calls that can't fail.Elliott Hughes2014-12-171-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that while GCC doesn't care, clang is unhappy with us because it notices that we're comparing an unsigned value (like a uid_t) against -1: libcore/luni/src/main/native/libcore_io_Posix.cpp:727:12: error: comparison of integers of different signs: 'typeof (getegid())' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare] return TEMP_FAILURE_RETRY(getegid()); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bug: 18759467 Change-Id: If71b11cbdd0cda2b8efcc1706eb49856c3770bb8
* | Merge "Don't try to build the libcore native code on the Mac."Elliott Hughes2014-12-171-0/+4
|\ \
| * | Don't try to build the libcore native code on the Mac.Elliott Hughes2014-12-171-0/+4
|/ / | | | | | | Change-Id: I79c5389af44ff2aea784d4f57c82d6aebf560132
* | Merge "Fix poll to never return EINTR."Elliott Hughes2014-12-175-44/+56
|\ \ | |/ |/|
| * Fix poll to never return EINTR.Elliott Hughes2014-12-175-44/+56
| | | | | | | | | | Bug: 18759467 Change-Id: Ia5b97a55318b5990ad6b80d15641223aa4fb06f5
* | Merge "Add a hidden API for detecting response charsets."Narayan Kamath2014-12-162-0/+142
|\ \
| * | Add a hidden API for detecting response charsets.Narayan Kamath2014-12-162-0/+142
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | This is meant to be a partial replacement for apache's EntityUtils.toString for internal callers. Providing a stand in replacement seems like a bad idea because that API tries to coerce all responses into strings, even those that are binary. I'm torn about EntityUtils. It was a useful "utility" in some cases, but dangerous in others. bug: 18027885 Change-Id: Ia02ffe86b5ef5caecbe86069967a549ff09335e5
* | Merge "Repurpose "HexEncoding" for internal users."Narayan Kamath2014-12-165-97/+179
|\ \ | |/ |/|
| * Repurpose "HexEncoding" for internal users.Narayan Kamath2014-12-165-97/+179
| | | | | | | | | | | | | | | | | | Frameworks callers either roll their own or use an internal apache class. Given that apache is going away, we need to provide them with an alternative. bug: 18027885 Change-Id: Iec01cba9f3d2027828457c0b450eac0dd08fcaf6
* | Merge "Remove unnecessary include directives."Elliott Hughes2014-12-152-9/+2
|\ \
| * | Remove unnecessary include directives.Elliott Hughes2014-12-152-9/+2
| | | | | | | | | | | | | | | | | | These are all picked up by virtue of the libraries that we use. Change-Id: Ib5e86c65d53f3448d5f1d0c0d24f0f63ef5f1868
* | | Merge "Move GC daemon locking logic into heap"Mathieu Chartier2014-12-152-21/+13
|\ \ \ | |/ / |/| |
| * | Move GC daemon locking logic into heapMathieu Chartier2014-12-152-21/+13
|/ / | | | | | | | | | | | | | | Fixes deadlock caused by acquirng the mutator lock while synchronizing on the daemon thread. Bug: 18739541 Change-Id: Ib3ac3788081d3d471195a6e3a8ed163237616a4f
* | Merge "Update ByteBuffer positions in Posix.* functions."Narayan Kamath2014-12-155-45/+176
|\ \
| * | Update ByteBuffer positions in Posix.* functions.Narayan Kamath2014-12-155-45/+176
|/ / | | | | | | | | | | | | | | | | | | | | Also add tests in libcore.io.OsTest and update (and simplify) callers that were updating the position themselves. bug: 18641009 (cherry picked from commit f3b61eaf1931ae8393e54202a717334a4971ebdf) Change-Id: I8a810b2dfde7c13278807381bdfe7f532a3481a0
* | Merge "When connecting to a SOCKS proxy, use the resolved IP"Neil Fuller2014-12-151-7/+3
|\ \
| * | When connecting to a SOCKS proxy, use the resolved IPNeil Fuller2014-12-081-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Noticed while inspecting the code. In HttpURLConnection a similar change was made recently (commit 797fdc6cc6bf16372e9464f189b535148f944ce9). Previously if the Proxy was specified with a resolved InetSocketAddress (i.e. one with a specific IP address already determined) the hostname would still be used to work out an IP address to connect to. For host names with multiple IPs the host connected to could be a different one than the one specified. Now if the InetAddress has been resolved it will be used. In the case where the InetAddress is bad this may delay DNS / resolution errors to later in the connection process. It will, however, avoid the "connect to a different host" issue, and avoid a reverse DNS lookup here when the host is not yet known. Change-Id: I46df5c38942f2d356ba2fd4541e0269021fd6496
* | | Merge "Fix InetSocketAddress.getHostString(): return the name if available"Neil Fuller2014-12-154-1/+55
|\ \ \
| * | | Fix InetSocketAddress.getHostString(): return the name if availableNeil Fuller2014-12-034-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getHostString() would return the IP address in one of the three scenarios possible: 1) InetSocketAddress created with a name - already worked, name returned. 2) InetSocketAddress create with an InetAddress with only an address - already worked, address returned. 3) InetSocketAddress create with an InetAddress with an address and name: would return the address. Change-Id: Id9d1addda5cef589ac56db5397e00e842cf8c5d7
* | | | Merge "Fix Mac build (control reaches end of non-void function)."Elliott Hughes2014-12-131-0/+1
|\ \ \ \
| * | | | Fix Mac build (control reaches end of non-void function).Elliott Hughes2014-12-121-0/+1
|/ / / / | | | | | | | | | | | | Change-Id: I94d85f1848db7c787f423ca9e7f7695ffd754a56
* | | | Merge "Fix Mac build (unused parameter)."Elliott Hughes2014-12-131-1/+1
|\ \ \ \
| * | | | Fix Mac build (unused parameter).Elliott Hughes2014-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I164eb9083cc17f858dcbb0da046184440881395d
* | | | | Merge "Only allow one requestGC at a time"Mathieu Chartier2014-12-131-0/+6
|\ \ \ \ \