summaryrefslogtreecommitdiff
path: root/openjdk_java_files.bp
Commit message (Collapse)AuthorAgeFilesLines
* Remove 3 APIs from @CorePlatformApiVictor Chang2020-12-161-1/+1
| | | | | | Bug: 154796679 Test: m droid Change-Id: I72fd2b0541693fdc2608e744a46229ce6914994b
* Switch to OpenJDK 8 java/mathHans Boehm2020-08-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "Un-@hide java.util.concurrent.Flow.*"Treehugger Robot2020-01-171-1/+1
|\
| * Un-@hide java.util.concurrent.Flow.*Tobias Thierer2020-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL moves Flow.java to openjdk_javadoc_files which has the effect of adding the interfaces contained in it to the public API surface. The file derives from OpenJDK 9+181 and is identical to the upstream version except that a piece of documentation referring to the SubmissionPublisher class (not present on Android) has been removed. The file contains only interfaces with no default methods, so there are no tests. Fixes: 129875045 Test: Treehugger Change-Id: Ie44055c927b2feb86f064526eca32851bfc34b76
* | Update misc java.util classes to OpenJDK 9+181 and immediately expose APITobias Thierer2020-01-171-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers - integration of all changes from OpenJDK 9+181 into java.util.{AbstractList,List,Map,Objects,Set}. - Map, List, Set gain static of() / ofEntries() factory methods. - Objects gains misc static checker methods. - When implementing RandomAccess, AbstractList.spliterator() as well as subList.spliterator() is now built on top of random-access List.get(int) rather than List.iterator(). - addition of various new files that are needed by those. - addition of Nullablity annotations for the new APIs. Changes to reference upstream versions -------------------------------------- While the other files were previously derived from OpenJDK 8u121-b13, Map.java was previously derived from OpenJDK 9b113+. After this CL, all of the touched files derive from OpenJDK 9+181 with no further changes waiting to be integrated; Android-changed and similar markers note where Android carries local patches. Notes on test coverage ---------------------- This CL adds test coverage for the new APIs/behavior. The test coverage for Set.of() duplicates a bunch of logic from the List.of() coverage. I experimented with ways to reuse code but that reduced clarity and I didn't want to spend a lot of effort on a major rearchitecture of the tests. AbstractListTest asserts that iterator() is not called while exercising basic existing Android spliterator, and checks the fail-fast behavior guaranteed by the documentation. Bug: 147483640 Test: atest CtsLibcoreTestCases:libcore.java.util.{Map,List,Set}OfTest Test: atest CtsLibcoreTestCases:libcore.java.util.{AbstractList,Objects}Test Test: atest CtsLibcoreTestCases Test: Checked how the added @implSpec appear in generated docs: they appear under headings "Implementation Requirements:". Change-Id: I362ec405b270ba00fe3176dc19f08943b7d350d5
* Add internal class java.util.concurrent.Flow from OpenJDK 9+181Tobias Thierer2020-01-101-0/+1
| | | | | | | | | | | | | | | | | | | This file is exactly identical to the copy in OpenJDK9+181, checked out per instructions from: https://android.googlesource.com/platform/libcore/+/7a23698de2d48fcc806413ff758e17232c3739aa/tools/upstream/src/main/java/libcore/CompareUpstreams.java#62 A future CL might add this class to the public API but for now, it is listed in openjdk_internal_files which has the same effect as @hide but allowed me to keep the file exactly identical to upstream. Since this purely a collection of interfaces with no default methods, no tests were added. Editing the documentation to remove references to classes (SubmissionPublisher) that Android does not carry is left to a follow-on CL. Test: Treehugger Bug: 129875045 Change-Id: I634b9bd479f7984d5263520f6922abb0207cf7bf
* Restrict visibility of stubs librariesPaul Duffin2019-10-141-0/+2
| | | | | | | | | | | | | | | | | | | | A change to add system_modules to droidstubs build rules allows the same system modules to be used to create the stubs as will be used to compile them. That avoids the need to duplicate the libs from the system modules on the droidstubs and allows their visibility to be restricted. When sdk_version: "none" is specified it is required that the system_modules property is also set; consistent with how it behaves on java_library. That requires system_modules: "none" to be added to droidstubs rules. Bug: 142534789 Test: m checkbuild built offline-sdk-docs without my changes and took base copy repeated with my changes and compared with base copy verified that only the timestamp.js file had changed. Change-Id: Id62970a91e86253c122358c26891c9d9c8765507
* Split intra core API into Conscrypt, ART, I18N modulesPaul Duffin2019-10-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extracts art_module_api_files filegroup from core_api_files to just contain the files provided by the ART module. Adds droidstubs and java_library definitions to generate the stubs sources and compile them for each of the art, conscrypt and i18n modules. Also adds a java_system_modules definition for art module intra core api stubs to allow it to be used to build the i18n and conscrypt libraries. Removes generation of core-intra-stubs and instead builds core.intra.stubs from the module specific libraries. The art module reuses the API specification files (e.g. mmodules/intracoreapi/api/intra/current-api.txt, the other modules have their own directory. The changes have been made in here to make reviewing easier. However, the intent is that the i18n and conscrypt build rules and API specification files will be moved to external/icu and external/conscrypt respectively in a follow up change. The core-libart-oj.depscheck build module has been modified to be more consistent with core-all and consequently has to use the i18n stubs source due to limitations with javac. A follow up change will switch core-all over to build against i18n stubs source at which point this will become unnecessary and will be removed. Test: m checkbuild Bug: 141935400 Change-Id: I8d820c0303614939ff8a042ba4f75511bebcdbe7
* Use filegroupJiyong Park2019-09-131-0/+1
| | | | | | | | | | 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
* Remove overlaps in openjdk filegroupsPaul Duffin2019-07-261-5/+0
| | | | | | | | | | | | | | | | The openjdk_internal_files and openjdk_mmodule_extra_files should be disjoint but they actually overlap, with the following duplicate files: ojluni/src/main/java/sun/misc/Cleaner.java ojluni/src/main/java/sun/nio/ch/DirectBuffer.java ojluni/src/main/java/sun/security/jca/Providers.java ojluni/src/main/java/sun/security/pkcs/PKCS7.java ojluni/src/main/java/sun/security/pkcs/SignerInfo.java This removes the duplicates. Bug: 138207002 Test: m droid Change-Id: Ie20cb23302f8762c7683f60d28d88fe9829804a8
* Set default visibility to privatePaul Duffin2019-07-021-0/+3
| | | | | | | | | | | | 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
* Stubs generation should not depend on core_platformPaul Duffin2019-06-251-2/+2
| | | | | Test: m droid Change-Id: Ia3835306970445b6f224b1c329dc4e63b845e544
* Replace no_framework_libs: true with sdk_version: "core_platform"Paul Duffin2019-06-121-2/+2
| | | | | | Bug: 134566750 Test: m Change-Id: I154a1324deef7fdb9dabf51f2924f5efdec72aa5
* Reformat all .bp files using bpfmt -wPaul Duffin2019-05-151-3/+4
| | | | | | Bug: 132757397 Test: TH Change-Id: I1201b3e6116ba5f1578e800fd65ecdd2f13a6645
* Work around Java 9 build failures due to @Generated annotations.Pete Gillin2019-05-101-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Some code generation tools, notably dagger, produce output which includes a @Generated annotation when built with javac -source 9 -target 9. This annotation is not part of any Android API, so compilation fails. As a workaround for this dagger behaviour, this change introduces a stub for that annotations, available at compile time only, to keep javac happy. (This topic should be reverted if dagger is fixed not to use the annotation in its output.) The upstream source for Generated.java is OpenJDK 9+181. N.B. The problem this is fixing does not manifest in AOSP, only in downstream branches. Bug: 123891440 Test: EXPERIMENTAL_USE_OPENJDK9=true make droid (cherry picked from commit 81dd1d9418f62f6888063aeec53e15d123948f0c) Merged-In: I06ff179384160a598b70959a0b0cd82d439490ce Change-Id: I55971ce65c74bac75b32f1258a96de7368ac97c0
* Move some Unsafe.* methods to core platform APIDavid Brazdil2019-04-101-1/+1
| | | | | | | These are used by the framework's protobuf implementation. Test: compiles Change-Id: I8a8aebbdd94c0012768b7a16732e708ee35714e6
* Tidy up API build variablesNeil Fuller2019-02-261-4/+0
| | | | | | | | | | | | | | | | | 1) Delete unused Docs.mk. This removes the last reference to non_openjdk_java_files.bp and openjdk_java_files.bp filegroups from .mk files. This means that export_to_make_var can be removed in those files. 2) Introduce a filegroup, core_public_api_files, that can be used from frameworks/base/ rather than "internal" variables defined in non_openjdk_java_files.bp, openjdk_java_files.bp and conscrypt. Bug: 126332291 Test: build only Merged-In: I3c85d17dd7405e65a6be9e60831b1a07e4f08abf Change-Id: I3c85d17dd7405e65a6be9e60831b1a07e4f08abf
* Add stubs for hiddenapiPaul Duffin2018-10-311-0/+6
| | | | | | | | | | | | | | | | | | Adds stubs for ojluni classes some of whose hidden members are used by applications. Each such member is annotated with the UnsupportedAppUsage annotation. The stubs are built as part of the core-oj-hiddenapi target from which the build will extract information about the hidden class members that are used by applications. This was tested by making and then manually checking that the generated out/target/common/obj/PACKAGING/hiddenapi-light-greylist.txt was the same (after sorting) before and after this change. Test: see above Bug: 117818301 Change-Id: Icfe773e00ba1f96a379b705f26ef631ec34fee5e
* Add more APIs to CorePlatformApi for internalNeil Fuller2018-10-161-1/+1
| | | | | | | | | Internal builds have more dependencies on core libs. This adds required CorePlatformApi elements. Bug: 113148576 Test: build (internal) Change-Id: I48942689a4d0e7cb9cbd0a4254a0a7af3a23b261
* More @CorePlatformApi annotations for libcoreNeil Fuller2018-10-051-4/+4
| | | | | | | | These annotations are required for further targets to build. Bug: 113148576 Test: build Change-Id: I695c6b973835b5de2311e0ed99cb2fb55b69bc94
* Add libcore API needed by framework to core.platform.api.stubsPaul Duffin2018-10-051-2/+7
| | | | | | | | | Tested by adding a dependency from framework to core.platform.api.stubs and modifying the build to disable link type checking. Test: make checkbuild Bug: 113148576 Change-Id: I618ade912f8cb4429b441a610ea16a9aa16c3398
* Tag assorted CorePlatformApi APIs (2)Neil Fuller2018-10-021-1/+1
| | | | | | | | | | | These were found while investigating targets besides "framework" needed by targets that are closely tied to framework. e.g. framework/core/services, framework/opt/telephony. Bug: 113148576 Test: build Change-Id: Ic45624d1404e8ee31ddf6c975b4bd6a8d1f8710a
* Merge "Add mechanism for adding new files to ojluni/annotations."Pete Gillin2018-10-011-0/+28
|\
| * Add mechanism for adding new files to ojluni/annotations.Pete Gillin2018-09-271-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | This change adds two new make targets which create empty stub files suitable for copying into ojluni/annotations, which the developer can then annotate. The instructions (and a description of the previously undocumented mmodule subdirectory) are included in the README. Bug: 64930165 Bug: 115746226 Test: Followed the steps added to the README Change-Id: Iea070ffb97cd93731f24ba379fd3a38d0b70b9c6
* | Fix 'path' attribute for libcore filegroups.Tobias Thierer2018-09-271-6/+0
|/ | | | | | | | | | | | | non-lambda filegroups were accidentally referring to the lambda path. This was a harmless mistake; it should only affect internal paths used during builds. Since openjdk_java_files contains files in different source directories, and since path is optional, this CL drops the attribute altogether. Bug: 116082167 Test: Treehugger Change-Id: I484384c63a94cd139523b74cc80f500a373a21a5
* Add intra-core API required by conscryptNeil Fuller2018-09-261-2/+2
| | | | | | | | | | | | | | An initial set of methods that need to be visible in the intra-core API surface for conscrypt to compile. There's a fix in JavaLibrary.bp to the core-current-stubs-gen target to stop files in openjdk_mmodule_extra_files showing up in the core.current.stubs. Bug: 110404540 Bug: 113148576 Test: build Change-Id: I4bade4dac925cfcb14df9335918319be897ac50d
* Pave the way for external mainline module API annotations.Pete Gillin2018-09-261-6/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change prepares for adding mainline mode API annotations (@CorePlatformApi etc.) supplied in external .annotated.java files so they are not carried as patches in ojluni source files. No real annotations are introduced in this change, and it has no effect on the generated stubs for any of the affected targets (except, seemingly, a few trivial whitespace changes). Specifically, this change does the following: - Adds a placeholder .annotated.java file (to be removed as soon as we have any real ones). - Adds a @libcore.api.Hide annotation we can use as an alternative to the @hide javadoc tag. - Changes the relevant mainline module API droidstubs rules to merge in the .annotated.java annotations and to respect the @Hide annotation. - Refactors the openjdk_java_files targets to create a new category of source file, those which are annotated for the mainline module APIs but are not part of the public API. (The alternative to doing this would be to move them into the public category and change all the public API droidstubs to merge in the .annotated.java annotations and to respect @Hide, which would be significantly more invasive.) - Changes the relevant mainline module API droidstubs rules use the new source categories. Bug: 115746226 Test: `make core-platform-api-stubs core-intra-stubs core-libart+oj-intra-stubs` Change-Id: I33e80603686112d3eb5a05debb58f13764b819b6
* Verify j.l.invoke.MethodHandleInfo/Natives against OpenJDK 8u121-b13Paul Duffin2018-09-061-0/+1
| | | | | | | | | | | | | | | | | | | | The MethodHandleInfo class has a number of patches to inline constants and methods from the upstream MethodHandleNatives class instead of just including the MethodHandleNatives class. This change adds the MethodHandleNatives class and reverts those patches. The MethodHandleNatives class does require some patches in order to remove code that does not compile or which is otherwise unused. However, patches that remove code are generally less risky and easier to maintain than patches that change the code so this seems like a better trade off. The refKind...() methods in MethodHandleInfo could not be removed because they were accidentally added to the public API in API level 26. The removal of those methods can be tracked under bug 114175595. Bug: 74379469 Test: make checkbuild, flash and start up device Change-Id: I843707564e9cf5c7fbf52bfa7ce4b6a2b10c0836
* Remove unused package-private class java.lang.StringCoding.Pete Gillin2017-10-041-1/+0
| | | | | | | | This was inherited from upstream but is unused in android due to changes in java.lang.String et al. Test: make checkbuild Change-Id: Id6f9db95139d39c1c7dbc818ef757ed2f67028b2
* Introduce java.lang.invoke.VarHandle APIs.Orion Hodson2017-10-021-0/+1
| | | | | | | | | | | | | | | | | These are present in preparation for OpenJDK 9 to allow VM support for VarHandle accessors and fences to be developed. For this initial import the VarHandle APIs are hidden and unimplemented. The implementation path will follow the approach taken with the MethodHandle API: public API compatability and alternative implementation strategy based on VM functionality. The files in this CL under ojluni/ define the APIs and are based on the corresponding files in upstream OpenJDK 9+181. Bug: 65872996 Test: m -j32 Change-Id: I678ab2239507b349a9701a4a6f5bbc92bf18b40d
* Revert "Revert "Convert libcore java to Android.bp""Colin Cross2017-09-281-0/+1781
| | | | | | | | | | | This reverts commit 9762264100d81d3dd653cbca2996b288c52f9546. Jack is disabled everywhere now. This reapplies I20a0f0327172bc51db47c7c56ccc806e20cf1244 with updates for changes to Soong and to add sources to the core-lambda-stubs jar. Test: m -j checkbuild Change-Id: I77c9dc558bc6c0f3833b1b79a0707c498e560628
* Revert "Convert libcore java to Android.bp"Colin Cross2017-09-211-1777/+0
| | | | | | | | This reverts commit 70d863fdc17969b4638caf830d0567adc20a6100. Reason for revert: Broke the few remaining builds that still use jack Change-Id: I437d583cf33d68e6d8fa3367e1ea54848b56e05b
* Convert libcore java to Android.bpColin Cross2017-09-211-0/+1777
See build/soong/README.md for more information. Test: m -j checkbuild Test: classes.dex for core-oj is identical Test: classes.dex for core-libart only has extra bridge methods (b/65645120) Change-Id: I0f81937dcc6efba87e7f61b2d5840b18068cd587