summaryrefslogtreecommitdiff
path: root/non_openjdk_java_files.bp
AgeCommit message (Collapse)Author
2021-09-27Switch to OpenJDK 8 java/mathHans Boehm
The main goal here is performance by avoiding JNI and especially NativeAllocationRegistry overhead. We gain a factor of 10 or so on small BigInteger arithmetic. For large computations, we gain substantially in a few cases where OpenJDK seems to use better algorithms. AFAIK, with this version we never lose by integral factors relative to what we had before. A secondary goal is to clean out open BigInteger bugs. The base version is 8u252, which for this part of the tree is identical to June 15 2020 ToT. Note that this means we included the java.math part of https://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/a5f5d7fd9be6 (29 Oct 2019) That appears to be a separable fix that makes no interface changes. I re-added @NonNull annotations. We also removed some code to write certain backwards-compatibility fields during serialization, since we never had those. This also adds a the <X>ValueExact Java 8 BigInteger methods that had not been previously supported. This removes a Harmony test for compatibility with the RI implementation that the RI implementation itself apparently fails. And, IMO, the observed behavior is better than what we previously tested for. Fixed a bunch of comment spelling errors. All of these have now been fixed in upstream ToT. Benchmarking showed that a straight move to the RI version slowed down large multiplications, divisions, and modular exponentiation enough to make it problematic. Thus I reintroduced NativeBN to allow those to fall back to boringssl, at least for sufficiently large inputs. It was moved to a hopefully more appropriate location. The fallback is tuned for 64 bits; for 32 bits it's probably much less useful; much of the boringssl performance advantage comes from 64-bit "digits". The boringssl fallbacks are not completely free, since we need extra conversions on each operation. But since we only do this for large asymptotically expensive computations, we see at mosts tens of percents regressions, which probably qualifies as "in the noise" here. If we find additional performance issues, we can add more boringssl fallbacks; the required code is now fairly straightforward. Unlike the old version, this no longer uses NativeAllocationRegistry or similar mechanisms at all. Native memory is only used on a short-term basis, with explicit deallocation. We no longer use boringssl for simple linear-time operations like addition. Microbenchmark results for the newly added benchmark, and for a close-to-final BigInteger version, listed as "combined": Msecs/iteration Digits: 5/10 50/100 500/1000 5000/10000 Inner product, 1000 terms, factors of larger indicated size: current 2.1 2.5 6.4 168 RI 0.11 0.66 11.0 486 combined 0.12 0.67 9.1 189 Harmonic series, uses smaller indicated size current 3.7 3.2 4.3 17.6 RI 0.16 0.34 1.4 14.3 combined 0.17 0.34 1.23 14.2 (1+1/100000)^100000, larger size current 0.07 0.073 0.33 15.8 RI 0.011 0.049 1.553 63.6 combined 0.011 0.049 0.48 13.6 Single modPow() call, smaller size current 0.005 0.011 1.1 583 RI 0.006 0.038 7.2 5580 combined 0.011 0.012 1.1 541 Single modInverse call, larger size current 0.003 0.014 0.375 27.8 RI 0.003 0.003 0.026 1.6 combined 0.002 0.002 0.008 0.4 Bug: 160641142 Bug: 136887041 Bug: 119491938 Bug: 28214673 Bug: 28251030 Bug: 2950143 Test: AOSP Boots. Ran some manual Calculator tests on Cuttlefish. Change-Id: Id577d99328013b1e3c389973dcb0195fa7f52b0b
2020-01-28Rename ZoneInfoDB -> ZoneInfoDbNeil Fuller
Rename ZoneInfoDB -> ZoneInfoDb to conform with coding standards. Bug: 148086409 Test: treehugger Change-Id: I1054d129cc4d53587a187c32927311f7311754fe
2020-01-23Remove unused UnsupportedAppUsage annotations.Artur Satayev
The new annotation is android.compat.annotation.UnsupportedAppUsage. Test: m Bug: 145132366 Change-Id: Ie13cce08e6d0a7c15427d2c3fc7d4b4d395acedc
2020-01-22Merge "Add APIs for improved MTS testing"Neil Fuller
2020-01-21Add APIs for improved MTS testingNeil Fuller
Bug: 147884233 Test: build Test: atest luni/src/test/java/libcore/libcore/timezone/TimeZoneDataFilesTest.java Change-Id: Idab0ada3bd7da46a414016acbb9d6914f18ac154
2020-01-21Add AsynchronousCloseMonitor to intra-core API.Pete Bentley
This change also adds it to the last-api.txt for the intra-core as it will be required as part of the long-term "stable" intra-core API in order to run mainline Conscrypt on Android 10. This API is unchanged since Android 10 and so this is a backwards compatible change. Note that AsynchronousCloseMonitor is implicitly part of the intra-core API already as its native component is invoked from Conscrypt JNI code. Bug: 147870945 Test: TreeHugger Change-Id: I61c52fc1499860db887c4cce38817913536cc98a
2020-01-16Use ThreadPrioritySetter to set thread priorityRick Yiu
Use ThreadPrioritySetter registered in Android runtime to set thread priority. Bug: 139521784 Test: CtsLibcoreTestCases, device boot to home, thread priority set as expected. Change-Id: I46093c9539be3acca9ca580a1e88676bdfd2de54
2020-01-08Revert "Use ThreadPrioritySetter to set thread priority"Rick Yiu
Revert "Implement the ThreadPrioritySetter interface" Revert submission 1194951-ThreadPrioritySetter2 Reason for revert: need to update new API Reverted Changes: Iee33a26c0: Implement the ThreadPrioritySetter interface I71c5052be: Use ThreadPrioritySetter to set thread priority Change-Id: I98cb32d5d216a83634d38406f574ee76e77daa97
2020-01-03Use ThreadPrioritySetter to set thread priorityRick Yiu
Use ThreadPrioritySetter registered in Android runtime to set thread priority. Bug: 139521784 Test: CtsLibcoreTestCases, device boot to home, thread priority set as expected. Change-Id: I71c5052beb171f966eba97401159306b87e397b7
2019-11-11Move android.compat.annotation package out of libcoreatrost
Test: m + flash Bug: 142650523 Change-Id: I4c50bebb9fbfc3df89d948004c6c16dbb60ce8c7
2019-11-07Merge "Add an API to access telephonylookup.xml on device"Neil Fuller
2019-11-06Add an API to access telephonylookup.xml on deviceNeil Fuller
Add core platform APIs / impl code needed to access telephonylookup.xml on device. There are now two XML files related to time zones: the common code between them has been extracted into the package-private XmlUtils class. Bug: 143451294 Test: atest libcore.libcore.timezone Change-Id: I7da534f92681ca6d567b09355eebb9c88db74ad2
2019-10-28Merge "Move java.nio.charset codes into core-icu4j due to its extensive ↵vichang
usage of ICU"
2019-10-25Move java.nio.charset codes into core-icu4j due to its extensive usage of ICUVictor Chang
- The moved code will be part of i18n module in the future - Some new @IntraCoreApi, e.g. EmptyArray, is unnecessary, but the cleanup will be done in a separate CL. Bug: 138994281 Test: atest --test-mapping external/icu/android_icu4j/src/main/java/com/android/icu/charset:presubmit Change-Id: Ic69725584e4a485595bfc25fc72546abb11a6904
2019-10-24Merge "Remove unused java.nio.charset.ModifiedUtf8"vichang
2019-10-24Remove unused java.nio.charset.ModifiedUtf8Victor Chang
Assume it does not break app because no method is marked with @UnsupportedAppUsage Test: m droid cts Change-Id: Ia18f795ac598d5d8fcc583641a91130c8dd20c26
2019-10-21Remove duplicate libcore/util/NonNull|Nullable.java filesPaul Duffin
Test: m checkbuild Change-Id: I7e5b200906512b11f2f5a0bcbe1ee8704a511bac
2019-10-21Move dalvik.system.VersionCodes to dalvik.annotation.compatPaul Duffin
Avoids splitting packages that are part of java.base. Removes patch_module: "java.base" that was used to work around this issue. Bug: 143057012 Test: m checkbuild Change-Id: Iad65343fd3fde55f2d3b0e68c4bbcd51377d85d9
2019-10-10Stop frameworks/base from accessing annotation source filesPaul Duffin
Adds an art.module.api.annotations that frameworks/base can use instead of the unsupportedappusage_annotation_files filegroup. Also, does some internal cleanup. * Moves the definition of the filegroup(s) into non_openjdk_java_files.bp alongside the rest. * Stops duplicating paths to the various files. * Renames the internal target to make it clearer what it contains. Bug: 142113521 Test: m java Change-Id: I059652d4bb3085da0b975fa8cbd05dd16e16654f
2019-10-03Refactoring: Move MimeMap to libcore.content.type.Tobias Thierer
MimeMap is not specific to Networking (URLConnection.getFileNameMap() is not the only client) so it didn't make sense for the class to live in the old packet. The new packet mirrors frameworks' android.content.type which holds the logic constructing the default instance. The new packet is specific to this purpose (libcore.content did not previously exist) and makes for a more sensible CorePlatformApi that we are more likely to be able to support long term. Bug: 124232146 Bug: 136256059 Test: atest CtsMimeMapTestCases CtsLibcoreTestCases Change-Id: I2a6576cf6f5f06bf159a975ad40a1c09a615e9b5
2019-09-27Move default MimeMap implementation to frameworks.Tobias Thierer
This is the second attempt to submit this CL. The first attempt regressed on app startup because RuntimeInit installed the custom MimeMap from commonInit() which runs post-fork of the zygote, but that was fixed by installing it pre-fork. This CL topic moves the default MimeMap implementation to frameworks. Libcore starts with a minimal implementation sufficient to pass CtsLibcoreTestCases, but frameworks can inject the real implementation. Before this CL topic, the data files and logic (MimeMapImpl) were part of core-*.jar on device; after this CL, they instead live in framework.jar. Tests from MimeMapTest that check behavior of that default implementation also move to a non-libcore CTS test. Planned work for follow-up CL: 1. Make CTS more opinionated, with a plan to assert that all of the default mappings are present. How exactly the expectated mapping will be bundled in CTS is still TBD. 2. Add a vendor.mime.types file (defaults to empty) where vendors can add additional mappings; I plan to make it such that mappings in that file are parsed last but never override any earlier mappings, as if each mime type / file extension was prefixed with '?'. 3. Perhaps enforce that public APIs android.webkit.MimeTypeMap and java.net.URLConnection.getFileNameMap() behave consistently with MimeMap.getDefault(). Test: atest CtsLibcoreTestCases Test: atest CtsMimeMapTestCases Test: Checked that CtsLibcoreTestCases still passes on a build that is missing the MimeMap.setDefault() call from RuntimeInit.java. Test: Checked that app startup time does not regress as part of this CL topic - see http://b/136256059#comment17 Bug: 136256059 Change-Id: I54103f0e1b83bdca5e083b1968ccb50421b94748
2019-09-24Delete libcore.net.http.ResponseUtils, and its test.Pete Gillin
This is unused and @hide. The last test in libcore.libcore.net.http is being deleted by this change, so the TEST_MAPPING which references it is removed as well. Test: make Change-Id: Ief0a803db2137d9ab5b3ffc8d9bd555862a9edcd
2019-09-13Use filegroupJiyong Park
Use filegroup to specify sources files with base directory via 'path' property. This allows the build system to filter Java source files by their packages. Bug: 140764681 Test: m Change-Id: I52760b3cbe3c99f5c48473f667322d6102cb7f53
2019-08-29Merge "Revert "Move default MimeMap implementation to frameworks.""Tobias Thierer
am: d60d516bcc Change-Id: I34fa7b76f95c16293abb8a7fc7dd71f6c8699467
2019-08-28Revert "Move default MimeMap implementation to frameworks."Tobias Thierer
This reverts commit d9e06a7351c25bf3275cffc382e3e7f8c87e6079. Reason for revert: Caused slower app startup (I don't know why). Change-Id: I7865dd97ee202e26236498505af3d746143f74e4
2019-08-23Merge "Move default MimeMap implementation to frameworks."Tobias Thierer
am: 14090d8c85 Change-Id: Ic73f2cfec61853af937bf5eb6635826ee3d9a91d
2019-08-20Move default MimeMap implementation to frameworks.Tobias Thierer
This CL topic moves the default MimeMap implementation to frameworks. Libcore starts with a minimal implementation sufficient to pass CtsLibcoreTestCases, but frameworks can inject the real implementation. Before this CL topic, the data files and logic (MimeMapImpl) were part of core-*.jar on device; after this CL, they instead live in framework.jar. Tests from MimeMapTest that check behavior of that default implementation also move to a non-libcore CTS test. Planned work for follow-up CL: 1. Make CTS more opinionated, with a plan to assert that all of the default mappings are present. How exactly the expectated mapping will be bundled in CTS is still TBD. 2. Add a vendor.mime.types file (defaults to empty) where vendors can add additional mappings; I plan to make it such that mappings in that file are parsed last but never override any earlier mappings, as if each mime type / file extension was prefixed with '?'. 3. Perhaps enforce that public APIs android.webkit.MimeTypeMap and java.net.URLConnection.getFileNameMap() behave consistently with MimeMap.getDefault(). Test: atest CtsLibcoreTestCases Test: atest CtsMimeMapTestCases Test: Checked that CtsLibcoreTestCases still passes on a build that is missing the MimeMap.setDefault() call from RuntimeInit.java. Bug: 136256059 Change-Id: I1621bd2907d5923a19541e3e859238c46187f8df
2019-08-15Merge "Move Half implementations to libcore to allow ART optimizations"Hans Boehm
am: f54cb9109c Change-Id: I9d03803ae3e39bd52afa7d6ee3bd84e8dbff0034
2019-08-14Move Half implementations to libcore to allow ART optimizationsxueliang.zhong
Move Half FP16 implementations to libcore, to allow ART compiler to optimize them with intrinsic implementations. For example, on ARM64 with ARMv8.2 FP16 half registers and instructions: - Half toFloat/toHalf can be implemented with FCVT; - Half floor/ceil/round can be implmented with FRINT(pna); - Half max/min can be implmented with FMIN/FMAX. Such fast Half FP16 intrinsics can help accelerate ColorLong ARGB encoding/decoding in Android framework. Change-Id: I10b835fa6a3a33c9ec19df5de4949681c97b4667
2019-07-03Merge changes I2ba1a613,Icfa4d975Paul Duffin
am: 3598a59db2 Change-Id: I70a14de700c8ddb136096cdb180818bf4390a1ed
2019-07-02Set default visibility to privatePaul Duffin
Takes advantage of a new mechanism for specifying the default visibility of all modules in a package to restrict the visibility of libcore modules as much as possible: package {default_visibility: ["//visibility:private"]} Bug: 133290645 Bug: 134379140 Test: m droid Change-Id: I2ba1a6131993d218fd65cd4a8f0ad29a7a83df14
2019-06-24Merge "Platform Compatibility framework: annotations & basic API." am: ↵Mathew Inwood
7e391faa2f am: 5a71074adb Change-Id: Ic9a3fb9778b163ea4b8ff533845315d8b9b8d3e6
2019-06-24Merge "General tidy up of android.system" am: 5cca1c7bc6Neil Fuller
am: 6a19cb82fe Change-Id: I33a879389aa2d60a32a976a199a37136fc3f884a
2019-06-24Merge "Platform Compatibility framework: annotations & basic API."Mathew Inwood
2019-06-24Merge "General tidy up of android.system"Neil Fuller
2019-06-24General tidy up of android.systemNeil Fuller
This commit changes StructIcmpHdr to the byte[] factory that it effectively already is. StructIcmpHdr is not referenced by anything in android.system.Os so is not the same as other Struct classes. It also add toString() to structs / containers where missing and makes a field final. Bug: 135660232 Test: build / boot Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest Change-Id: I84985c817234aadc2380a08a6afa71400366a6f6
2019-06-21Merge "Remove unused / untested code" am: ec5d60fa82Neil Fuller
am: 4e714431df Change-Id: I6f093919870ab8004167c676640410dc17550f9f
2019-06-21Remove unused / untested codeNeil Fuller
Os.fcntlFlock() is not used and is untested. There seems to be no reason to keep it. Test: build only Bug: 135660232 Change-Id: I55ed799690fd3f273a4aa9e88f567428baf6bbcf
2019-06-19Platform Compatibility framework: annotations & basic API.Mathew Inwood
The annotations form the basis of the new framework, allowing compatibility change IDs to be defined, and targeted to apps based on their targetSdkVersion. No real implementation of the API is provided here, but callbacks are defined to allow an implementation to be provided by higher levels of the stack. Further CLs will implement the APIs added here, add annotation processors to process the break IDs and enforce some policy, and more. An internal NDK API will also be added to allow use from C++ code. The annotations and API are added in libcore to allow their use in all necessary places. Compatibility changes may be implemented in libcore, in frameworks/base or in other places. Putting the basic into libcore allows their usage in all of these places. Bug: 135010838 Test: m Change-Id: Iac22820b6d83679d70ff6615790a2cbf783fc307
2019-05-13Merge "Customizable MIME type <-> file extension mapping, step 3 (attempt ↵Tobias Thierer
#2)." am: 287d9b5a37 am: c8fbf4ca68 Change-Id: I33db15b141063a3469f0ac6d10de4a24779d1508
2019-05-11Customizable MIME type <-> file extension mapping, step 3 (attempt #2).Tobias Thierer
This is attempt #2 to submit this CL. The first attempt failed because some usages of MimeUtils had remained in the downstream -plus-aosp branch. These are now cleaned up by cherry-picking the corresponding internal master changes to that branch. Delete unused class MimeUtils. Some MimeUtils calls used to be on the graylist and used by some apps through reflection; such apps can instead use this public API, for now: android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(String) android.webkit.MimeTypeMap.getSingleton().getExtensionFromMimeType(String) Test: Treehugger Change-Id: I8bec5aebbbcf0a0a4a8e5dc317d188830f219a1e
2019-05-08Merge "Revert "Customizable MIME type <-> file extension mapping, step 3."" ↵Tobias Thierer
am: 0e9ea2bcbf am: 2d85b26917 Change-Id: I6c5a410c425f4931a622d1d6781946b7f336d4fa
2019-05-08Merge "Revert "Customizable MIME type <-> file extension mapping, step 3.""Tobias Thierer
am: 0e9ea2bcbf Change-Id: I6ef357c98ab027ebea792aac4a215a3ad7773394
2019-05-08Revert "Customizable MIME type <-> file extension mapping, step 3."Tobias Thierer
This reverts commit b23d88cba391ac2b0757bf01f7cc7fe0311d3da8. Reason for revert: Caused a build failure in a downstream -plus-aosp branch that still had references to MimeUtils remaining in the sources. Change-Id: I71ab7c03fba233ae60b729c0d2172e909d420307
2019-05-08Merge "Customizable MIME type <-> file extension mapping, step 3." am: ↵Tobias Thierer
40eea593a0 am: 8996619c33 Change-Id: Ib7effb43e0996561bbd335f2def0be4821831998
2019-05-08Merge "Customizable MIME type <-> file extension mapping, step 3."Tobias Thierer
am: 40eea593a0 Change-Id: I36def99acc1d7e328af4c51b991ff4a9ebdc6d82
2019-04-30Customizable MIME type <-> file extension mapping, step 3.Tobias Thierer
Delete unused class MimeUtils. Some MimeUtils calls used to be on the graylist and used by some apps through reflection; such apps can instead use this public API, for now: android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(String) android.webkit.MimeTypeMap.getSingleton().getExtensionFromMimeType(String) Test: Treehugger Change-Id: I409342f1c95d7f2c49b158efa0e43d32081abc76
2019-04-29Merge "Customizable MIME type <-> file extension mapping, step 1." am: ↵Tobias Thierer
b152621257 am: 8f97234ef3 Change-Id: Id611bb49a234a70238b1e505c884ef6616554d14
2019-04-29Merge "Customizable MIME type <-> file extension mapping, step 1."Tobias Thierer
am: b152621257 Change-Id: Ied0adb311cfc201e7b6259e9105752a75ee37f1c
2019-04-26Customizable MIME type <-> file extension mapping, step 1.Tobias Thierer
This CL factors out MimeMap{,Impl} from MimeUtils. MimeMap supports customizing the implementation instance, but this is currently an internal implementation detail; this CL does not change the behavior of any API surface. In future CLs, I plan to do the following: 1.) Expose MimeMap, including {get,compareAndSet}Default, via a new @CorePlatformApi. 2.) Convert existing users of MimeUtils to use MimeMap.getDefault() instead. 3.) Delete MimeUtils. Bug: 120171727 Test: Checked that this CL does not change behavior of MimeUtils by checking that the test logic attached to http://b/122831291#comment7 passes both before and after this CL. Test: atest CtsLibcoreTestCases:libcore.libcore.net.Mime{Map,Utils}Test Change-Id: Idc27c29826a6eb2e4c9c54be058eb0577d525aec