mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-22 08:21:48 +01:00
Compare commits
5 Commits
bookmark3
...
vpr/win_bu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e19b381386 | ||
|
|
05e5825e91 | ||
|
|
af2c3fb0bb | ||
|
|
d1f108da17 | ||
|
|
5a5356aaed |
245
.github/README.md
vendored
245
.github/README.md
vendored
@@ -1,245 +0,0 @@
|
||||
[](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
|
||||
|
||||
# Welcome to JetBrains Runtime!
|
||||
|
||||
JetBrains Runtime is a fork of [OpenJDK](https://github.com/openjdk/jdk) available for Windows, Mac OS X, and Linux.
|
||||
It supports enhanced class redefinition ([DCEVM](https://ssw.jku.at/dcevm/)),
|
||||
features optional [JCEF](https://github.com/JetBrains/jcef), a framework for embedding Chromium-based browsers,
|
||||
includes a number of improvements in font rendering, keyboards support,
|
||||
windowing/focus subsystems, HiDPI, accessibility, and performance, provides better desktop integration
|
||||
and bugfixes not yet present in OpenJDK.
|
||||
|
||||
> **_NOTE_**: This is a **development** branch that is periodically synchronized with
|
||||
> the [OpenJDK master](https://github.com/openjdk/jdk/tree/master) branch.
|
||||
>
|
||||
Release builds are based on these branches:
|
||||
* [jbr11](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr11) (JDK 11)
|
||||
* [jbr17](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr17) (JDK 17)
|
||||
* [jbr21](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr21) (JDK 21)
|
||||
|
||||
Download the latest releases of JetBrains Runtime to use with JetBrains IDEs. The full list
|
||||
can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases).
|
||||
|
||||
## Releases based on JDK 21
|
||||
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
|-------------|---------------------------------------------------------------------------------------------------------|---------------|
|
||||
| 2025.1 | [21.0.6-b872.80](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.6b872.80) | 03-Feb-2025 |
|
||||
| 2024.3 | [21.0.5-b631.28](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.5b631.28) | 26-Nov-2024 |
|
||||
| 2024.2 | [21.0.4-b509.30](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.5b509.30) | 26-Nov-2024 |
|
||||
| 2024.1 | [21.0.2-b346.3](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.2b346.3) | 30-Jan-2024 |
|
||||
|
||||
## Releases based on JDK 17
|
||||
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
|-------------|--------------------------------------------------------------------------------------------------------|---------------|
|
||||
| 2024.2 | [17.0.11-b1312.2](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.11b1312.2) | 18-Jun-2024|
|
||||
| 2024.1 | [17.0.12-b1207.37](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.12b1207.37) | 15-Oct-2024|
|
||||
| 2023.3 | [17.0.12-b1087.25](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.12b1087.25) | 02-Sep-2024|
|
||||
| 2023.2 | [17.0.12-b1000.54](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.12b1000.54) | 02-Sep-2024|
|
||||
| 2023.1 | [17.0.10-b829.27](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.10b829.27) | 21-Mar-2024 |
|
||||
| 2022.3 | [17.0.6-b653.34](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b653.34) | 28-Feb-2023 |
|
||||
| 2022.2 | [17.0.6-b469.82](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b469.82) | 06-Mar-2023 |
|
||||
|
||||
## Releases based on JDK 11
|
||||
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
|-------------|-------------------------------------------------------------------------------------------------------|---------------|
|
||||
| 2022.1 | [11_0_16-b2043.64](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_16b2043.64) | 10-Nov-2022 |
|
||||
| 2021.3 | [11_0_14_1-b1751.46](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_14_1b1751.46) | 21-Feb-2022 |
|
||||
| 2021.2 | [11_0_13-b1504.49](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jb11_0_13-b1504.49) | 15-Nov-2021 |
|
||||
| 2021.1 | [11.0.11+9-b1341.60](https://github.com/JetBrains/JetBrainsRuntime/issues/171#issuecomment-1248891540)| 15-Jun-2021 |
|
||||
| 2020.3 | [11_0_10-b1145.115](https://github.com/JetBrains/JetBrainsRuntime/issues/171#issuecomment-1249243977) | 21-Jun-2021 |
|
||||
|
||||
## Contents
|
||||
- [Welcome to JetBrains Runtime](#welcome-to-jetbrains-runtime)
|
||||
- [Why Use JetBrains Runtime?](#why-use-jetbrains-runtime)
|
||||
- [Products Built on JetBrains Runtime](#products-built-on-jetbrains-runtime)
|
||||
- [Getting Sources](#getting-sources)
|
||||
- [macOS, Linux](#macos-linux)
|
||||
- [Windows](#sources-windows)
|
||||
- [Configuring the Build Environment](#configuring-the-build-environment)
|
||||
- [Linux (Docker)](#linux-docker)
|
||||
- [Ubuntu Linux](#ubuntu-linux)
|
||||
- [Windows](#build-windows)
|
||||
- [macOS](#macos)
|
||||
- [Developing](#developing)
|
||||
- [Contributing](#contributing)
|
||||
- [Resources](#resources)
|
||||
|
||||
## Why Use JetBrains Runtime?
|
||||
* **Embedded browser**: JetBrains Runtime includes the Java Chromium Embedded Framework ([JCEF](https://github.com/JetBrains/jcef)), which
|
||||
enables you to embed a Chromium-based browsers in your JVM-based application.
|
||||
To use it, [download a build with JCEF](https://github.com/JetBrains/JetBrainsRuntime/releases).
|
||||
* **Enhanced class re-definition** with the [DCEVM](https://ssw.jku.at/dcevm/) technology that makes it easier to reload
|
||||
changed code without restarting JVM; this feature needs to be explicitly enabled with `-XX:+AllowEnhancedClassRedefinition`.
|
||||
* **Better FPS performance** for graphics-intensive applications.
|
||||
* **Improved font rendering**, **keyboard input** (such as shortcuts and multinational keyboards),
|
||||
**HiDPI** and **accessibility** support.
|
||||
* **Robust desktop experience**: GUI-related fixes often reach JetBrains Runtime much earlier than the corresponding version of OpenJDK.
|
||||
|
||||
## Products Built on JetBrains Runtime
|
||||
* [Android Studio](https://developer.android.com/studio). The official IDE for Google's Android operating system.
|
||||
* [CLion](https://www.jetbrains.com/clion/). A cross-platform IDE for C and C++ from JetBrains.
|
||||
* [DataGrip](https://www.jetbrains.com/datagrip/). The IDE for Databases and SQL from JetBrains.
|
||||
* [GoLand](https://www.jetbrains.com/go/). The cross-platform Go IDE from JetBrains.
|
||||
* [IntelliJ IDEA](https://www.jetbrains.com/idea/). The IDE for JVM from JetBrains.
|
||||
* [JProfiler](https://www.ej-technologies.com/products/jprofiler/overview.html). The Java profiler.
|
||||
* [PhpStorm](https://www.jetbrains.com/phpstorm/). The PHP IDE from JetBrains.
|
||||
* [PyCharm](https://www.jetbrains.com/pycharm/). The Python IDE from JetBrains.
|
||||
* [Rider](https://www.jetbrains.com/rider/). The cross-platform .NET IDE from JetBrains.
|
||||
* [RubyMine](https://www.jetbrains.com/ruby/). The Ruby and Rails IDE from JetBrains.
|
||||
* [Toolbox App](https://www.jetbrains.com/toolbox-app/). JetBrains IDE manager.
|
||||
* [WebStorm](https://www.jetbrains.com/webstorm/). The JavaScript IDE from JetBrains.
|
||||
* [YourKit](https://www.yourkit.com/). Java and .NET profilers.
|
||||
|
||||
## Getting Sources
|
||||
### macOS, Linux
|
||||
```
|
||||
git config --global core.autocrlf input
|
||||
git clone git@github.com:JetBrains/JetBrainsRuntime.git
|
||||
```
|
||||
|
||||
### Windows
|
||||
<a name="sources-windows"></a>
|
||||
```
|
||||
git config --global core.autocrlf false
|
||||
git clone git@github.com:JetBrains/JetBrainsRuntime.git
|
||||
```
|
||||
|
||||
## Configuring the Build Environment
|
||||
Here are quick per-platform instructions for those who can't wait to get started.
|
||||
Please refer to [OpenJDK build docs](https://openjdk.java.net/groups/build/doc/building.html) for in-depth
|
||||
coverage of all the details.
|
||||
|
||||
> **_TIP:_** To get a preliminary report of what's missing, run `./configure` and check its output.
|
||||
> It would usually have meaningful advice on how to solve the problem.
|
||||
|
||||
### Linux (Docker)
|
||||
Download an image from [Docker Hub](https://hub.docker.com/repository/docker/jetbrains/runtime/general) related to your architecture:
|
||||
```
|
||||
$ docker pull jetbrains/runtime:oraclelinux8_aarch64
|
||||
```
|
||||
or
|
||||
```
|
||||
$ docker pull jetbrains/runtime:oraclelinux8_x64
|
||||
```
|
||||
Create and run a new container from the downloaded image
|
||||
```
|
||||
$ docker run -v $JetBrainsRuntime:/JetBrainsRuntime -it jetbrains/runtime:oraclelinux8_[arch]
|
||||
```
|
||||
where `$JetBrainsRuntime` is a full path to the directory where the repository was cloned to.
|
||||
|
||||
Run these commands in the container:
|
||||
```
|
||||
# cd /JetBrainsRuntime
|
||||
# sh ./configure
|
||||
# make images
|
||||
```
|
||||
|
||||
### Ubuntu Linux
|
||||
Install the necessary tools, libraries, and headers with:
|
||||
```
|
||||
$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev \
|
||||
libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev libspeechd-dev libwayland-dev \
|
||||
wayland-protocols libxkbcommon-x11-0
|
||||
```
|
||||
Get Java 23 (for instance, [Azul Zulu Builds of OpenJDK 23](https://www.azul.com/downloads/?version=java-23&os=linux&package=jdk#zulu)).
|
||||
|
||||
Then run the following:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ sh ./configure
|
||||
$ make images
|
||||
```
|
||||
This will build the release configuration under `./build/linux-x86_64-server-release/`.
|
||||
|
||||
### Windows
|
||||
<a name="build-windows"></a>
|
||||
Install the following:
|
||||
* [Cygwin x64](http://www.cygwin.com/).
|
||||
Required packages: `autoconf`, `binutils`, `cpio`, `diffutils`, `file`, `gawk`, `gcc-core`, `make`, `m4`, `unzip`, `zip`.
|
||||
Install those together with Cygwin.
|
||||
* [Visual Studio compiler toolset](https://visualstudio.microsoft.com/downloads/).
|
||||
Install with the desktop development kit, which includes Windows SDK and compilers.
|
||||
Visual Studio 2019 is supported by default.
|
||||
* Java 21 (for instance, [Azul Zulu Builds of OpenJDK 21](https://www.azul.com/downloads/?version=java-21-lts&os=windows&package=jdk#zulu)).
|
||||
If you have problems while configuring, read [Java tips on Cygwin](http://horstmann.com/articles/cygwin-tips.html).
|
||||
|
||||
From the command line:
|
||||
```
|
||||
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
|
||||
"c:\Program_Files\cygwin64\bin\mintty.exe" /bin/bash -l
|
||||
```
|
||||
The first command sets up environment variables, the second starts a Cygwin shell with the proper environment.
|
||||
|
||||
In the Cygwin shell:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ bash configure --with-toolchain-version=2019
|
||||
$ make images
|
||||
```
|
||||
This will build the release configuration under `./build/windows-x86_64-server-release/`.
|
||||
|
||||
#### Enable optional NVDA screen reader support
|
||||
If you want to add support of a11y announcing via [NVDA screen reader](https://www.nvaccess.org/about-nvda/),
|
||||
you will need to bundle the NVDA Controller Client library.
|
||||
You can do it with the following steps:
|
||||
1. Download the NVDA Controller Client library. You can find the link in its official README [here](https://github.com/nvaccess/nvda/blob/master/extras/controllerClient/readme.md)
|
||||
2. Pass the path to the unpacked package to `configure` via an additional flag `--with-nvdacontrollerclient=<path>`.
|
||||
The build system will search the required library files under `<path>/<target-arch>`.
|
||||
|
||||
#### Disable optional JAWS screen reader support
|
||||
JBR is built with built-in support of JAWS screen reader.
|
||||
If you want to disable it, run `configure` with the additional flag `--disable-jaws-client`.
|
||||
|
||||
### macOS
|
||||
Install the following:
|
||||
* Xcode command line developer tools and `autoconf` via [Homebrew](https://brew.sh/).
|
||||
* Java 21 (for instance, [Azul Zulu Builds of OpenJDK 21](https://www.azul.com/downloads/?version=java-21-lts&os=macos&package=jdk#zulu)).
|
||||
|
||||
From the command line:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ sh ./configure
|
||||
$ make images
|
||||
```
|
||||
This will build the release configuration under `./build/macosx-x86_64-server-release/`.
|
||||
|
||||
## Developing
|
||||
You can use [CLion](https://www.jetbrains.com/clion/) to develop native parts of the JetBrains Runtime and
|
||||
[IntelliJ IDEA](https://www.jetbrains.com/idea/) for the parts written in Java.
|
||||
Both require projects to be created.
|
||||
|
||||
### CLion
|
||||
Run
|
||||
```
|
||||
$ make compile-commands
|
||||
```
|
||||
in the git root and open the resulting `build/.../compile_commands.json` file as a project.
|
||||
Then use `Tools | Compilation Database | Change Project Root` to point to git root of this repository.
|
||||
|
||||
See also this detailed step-by-step tutorial for all platforms:
|
||||
[How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).
|
||||
|
||||
### IDEA
|
||||
Run
|
||||
```
|
||||
$ sh ./bin/idea.sh
|
||||
```
|
||||
in the git root to generate project files (add `--help` for options). If you have multiple
|
||||
configurations (for example, `release` and `fastdebug`), supply the `--conf <conf_name>` argument.
|
||||
Then open the git root directory as a project in IDEA.
|
||||
|
||||
## Contributing
|
||||
We are happy to receive your pull requests!
|
||||
Before you submit one, please sign our [Contributor License Agreement (CLA)](https://www.jetbrains.com/agreements/cla/).
|
||||
|
||||
## Resources
|
||||
* [JetBrains Runtime on GitHub](https://github.com/JetBrains/JetBrainsRuntime).
|
||||
* [OpenJDK build instructions](https://openjdk.java.net/groups/build/doc/building.html).
|
||||
* [OpenJDK test instructions](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk/master/doc/building.html#running-tests).
|
||||
* [How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).
|
||||
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@@ -31,7 +31,6 @@ on:
|
||||
- master
|
||||
- pr/*
|
||||
- jdk*
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
platforms:
|
||||
|
||||
270
.github/workflows/pr.yml
vendored
270
.github/workflows/pr.yml
vendored
@@ -1,270 +0,0 @@
|
||||
#
|
||||
# Copyright 2000-2023 JetBrains s.r.o.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
name: 'Build OpenJDK on pull request'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
###
|
||||
### Determine platforms to include
|
||||
###
|
||||
select:
|
||||
name: 'Select platforms'
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
linux-x64: ${{ steps.include.outputs.linux-x64 }}
|
||||
linux-x86: ${{ steps.include.outputs.linux-x86 }}
|
||||
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
|
||||
macos-x64: ${{ steps.include.outputs.macos-x64 }}
|
||||
macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
|
||||
windows-x64: ${{ steps.include.outputs.windows-x64 }}
|
||||
windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }}
|
||||
windows-x86: ${{ steps.include.outputs.windows-x86 }}
|
||||
|
||||
steps:
|
||||
# This function must be inlined in main.yml, or we'd be forced to checkout the repo
|
||||
- name: 'Check what jobs to run'
|
||||
id: include
|
||||
run: |
|
||||
# Determine which platform jobs to run
|
||||
|
||||
# Returns 'true' if the input platform list matches any of the platform monikers given as argument,
|
||||
# 'false' otherwise.
|
||||
# arg $1: platform name or names to look for
|
||||
function check_platform() {
|
||||
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
|
||||
input='${{ github.event.inputs.platforms }}'
|
||||
elif [[ $GITHUB_EVENT_NAME == push ]]; then
|
||||
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
|
||||
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
|
||||
>&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch'
|
||||
echo 'false'
|
||||
return
|
||||
else
|
||||
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
|
||||
fi
|
||||
fi
|
||||
|
||||
normalized_input="$(echo ,$input, | tr -d ' ')"
|
||||
if [[ "$normalized_input" == ",," ]]; then
|
||||
# For an empty input, assume all platforms should run
|
||||
echo 'true'
|
||||
return
|
||||
else
|
||||
# Check for all acceptable platform names
|
||||
for part in $* ; do
|
||||
if echo "$normalized_input" | grep -q -e ",$part," ; then
|
||||
echo 'true'
|
||||
return
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo 'false'
|
||||
}
|
||||
|
||||
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
|
||||
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
|
||||
echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
|
||||
echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
|
||||
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
|
||||
echo "windows-x86=$(check_platform windows-x86 windows x86)" >> $GITHUB_OUTPUT
|
||||
echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
|
||||
echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
|
||||
|
||||
###
|
||||
### Build jobs
|
||||
###
|
||||
|
||||
build-linux-x64:
|
||||
name: linux-x64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
|
||||
if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'
|
||||
|
||||
build-linux-x86:
|
||||
name: linux-x86
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x86
|
||||
gcc-major-version: '10'
|
||||
gcc-package-suffix: '-multilib'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-architecture: 'i386'
|
||||
# Some multilib libraries do not have proper inter-dependencies, so we have to
|
||||
# install their dependencies manually.
|
||||
apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386'
|
||||
extra-conf-options: '--with-target-bits=32'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x86 == 'true'
|
||||
|
||||
build-linux-cross-compile:
|
||||
name: linux-cross-compile
|
||||
needs:
|
||||
- select
|
||||
- build-linux-x64
|
||||
uses: ./.github/workflows/build-cross-compile.yml
|
||||
with:
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-gcc-cross-version: '10.4.0-4ubuntu1~22.04cross1'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-cross-compile == 'true'
|
||||
|
||||
build-macos-x64:
|
||||
name: macos-x64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-x64
|
||||
xcode-toolset-version: '12.5.1'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.macos-x64 == 'true'
|
||||
|
||||
build-macos-aarch64:
|
||||
name: macos-aarch64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
xcode-toolset-version: '12.5.1'
|
||||
extra-conf-options: '--openjdk-target=aarch64-apple-darwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.macos-aarch64 == 'true'
|
||||
|
||||
build-windows-x64:
|
||||
name: windows-x64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-x64
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-architecture: 'x86.x64'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-x64 == 'true'
|
||||
|
||||
build-windows-x86:
|
||||
name: windows-x86
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-x86
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-architecture: 'x86'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-x86 == 'true'
|
||||
|
||||
build-windows-aarch64:
|
||||
name: windows-aarch64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-aarch64
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-architecture: 'arm64'
|
||||
make-target: 'hotspot'
|
||||
extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-aarch64 == 'true'
|
||||
|
||||
build-docs:
|
||||
name: docs
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
debug-levels: '[ "debug" ]'
|
||||
make-target: 'docs-jdk-bundles'
|
||||
# Make sure we never try to make full docs, since that would require a
|
||||
# build JDK, and we do not need the additional testing of the graphs.
|
||||
extra-conf-options: '--disable-full-docs'
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.docs == 'true'
|
||||
|
||||
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
|
||||
remove-bundles:
|
||||
name: 'Remove bundle artifacts'
|
||||
runs-on: ubuntu-22.04
|
||||
if: always()
|
||||
needs:
|
||||
- build-linux-x64
|
||||
- build-linux-x86
|
||||
- build-linux-cross-compile
|
||||
- build-macos-x64
|
||||
- build-macos-aarch64
|
||||
- build-windows-x64
|
||||
- build-windows-aarch64
|
||||
- build-windows-x86
|
||||
|
||||
steps:
|
||||
# Hack to get hold of the api environment variables that are only defined for actions
|
||||
- name: 'Get API configuration'
|
||||
id: api
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'
|
||||
|
||||
- name: 'Remove bundle artifacts'
|
||||
run: |
|
||||
# Find and remove all bundle artifacts
|
||||
ALL_ARTIFACT_URLS="$(curl -s \
|
||||
-H 'Accept: application/json;api-version=6.0-preview' \
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
|
||||
'${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')"
|
||||
BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')"
|
||||
for url in $BUNDLE_ARTIFACT_URLS; do
|
||||
echo "Removing $url"
|
||||
curl -s \
|
||||
-H 'Accept: application/json;api-version=6.0-preview' \
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
|
||||
-X DELETE "$url" \
|
||||
|| echo "Failed to remove bundle"
|
||||
done
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -22,4 +22,3 @@ NashornProfile.txt
|
||||
/.cache
|
||||
/.gdbinit
|
||||
/.lldbinit
|
||||
/jbr-api/
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
[](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
|
||||
|
||||
# Welcome to the JDK!
|
||||
|
||||
For build instructions please see the
|
||||
|
||||
296
bin/idea.sh
296
bin/idea.sh
@@ -25,26 +25,7 @@
|
||||
# Shell script for generating an IDEA project from a given list of modules
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [-h|--help] [-q|--quiet] [-a|--absolute-paths] [-r|--root <path>] [-o|--output <path>] [-c|--conf <conf_name>] [modules...]"
|
||||
echo " -h | --help"
|
||||
echo " -q | --quiet
|
||||
No stdout output"
|
||||
echo " -a | --absolute-paths
|
||||
Use absolute paths to this jdk, so that generated .idea
|
||||
project files can be moved independently of jdk sources"
|
||||
echo " -r | --root <path>
|
||||
Project content root
|
||||
Default: $TOPLEVEL_DIR"
|
||||
echo " -o | --output <path>
|
||||
Where .idea directory with project files will be generated
|
||||
(e.g. using '-o .' will place project files in './.idea')
|
||||
Default: same as --root"
|
||||
echo " -c | --conf <conf_name>
|
||||
make configuration (release, slowdebug etc)"
|
||||
echo " [modules...]
|
||||
Generate project modules for specific java modules
|
||||
(e.g. 'java.base java.desktop')
|
||||
Default: all existing modules (java.* and jdk.*)"
|
||||
echo "usage: $0 [-h|--help] [-v|--verbose] [-o|--output <path>] [-c|--conf <conf_name>] [modules]+"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -52,13 +33,10 @@ SCRIPT_DIR=`dirname $0`
|
||||
#assume TOP is the dir from which the script has been called
|
||||
TOP=`pwd`
|
||||
cd $SCRIPT_DIR; SCRIPT_DIR=`pwd`
|
||||
if [ "x$TOPLEVEL_DIR" = "x" ] ; then
|
||||
cd .. ; TOPLEVEL_DIR=`pwd`
|
||||
fi
|
||||
cd $TOP;
|
||||
|
||||
VERBOSE=true
|
||||
ABSOLUTE_PATHS=false
|
||||
IDEA_OUTPUT=$TOP/.idea
|
||||
VERBOSE="false"
|
||||
CONF_ARG=
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
@@ -67,24 +45,14 @@ do
|
||||
usage
|
||||
;;
|
||||
|
||||
-q | --quiet )
|
||||
VERBOSE=false
|
||||
;;
|
||||
|
||||
-a | --absolute-paths )
|
||||
ABSOLUTE_PATHS=true
|
||||
;;
|
||||
|
||||
-r | --root )
|
||||
TOPLEVEL_DIR="$2"
|
||||
shift
|
||||
-v | --vebose )
|
||||
VERBOSE="true"
|
||||
;;
|
||||
|
||||
-o | --output )
|
||||
IDEA_OUTPUT="$2/.idea"
|
||||
IDEA_OUTPUT=$2/.idea
|
||||
shift
|
||||
;;
|
||||
|
||||
-c | --conf )
|
||||
CONF_ARG="CONF_NAME=$2"
|
||||
shift
|
||||
@@ -101,17 +69,20 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "x$IDEA_OUTPUT" = "x" ] ; then
|
||||
IDEA_OUTPUT="$TOPLEVEL_DIR/.idea"
|
||||
if [ -e $IDEA_OUTPUT ] ; then
|
||||
rm -r $IDEA_OUTPUT
|
||||
fi
|
||||
mkdir -p $IDEA_OUTPUT || exit 1
|
||||
cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd`
|
||||
|
||||
if [ "x$TOPLEVEL_DIR" = "x" ] ; then
|
||||
cd $SCRIPT_DIR/..
|
||||
TOPLEVEL_DIR=`pwd`
|
||||
cd $IDEA_OUTPUT
|
||||
fi
|
||||
|
||||
mkdir -p $IDEA_OUTPUT || exit 1
|
||||
cd "$TOP" ; cd $TOPLEVEL_DIR; TOPLEVEL_DIR=`pwd`
|
||||
cd "$TOP" ; cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd`
|
||||
cd ..; IDEA_OUTPUT_PARENT=`pwd`
|
||||
cd "$SCRIPT_DIR/.." ; OPENJDK_DIR=`pwd`
|
||||
|
||||
IDEA_MAKE="$OPENJDK_DIR/make/ide/idea/jdk"
|
||||
MAKE_DIR="$SCRIPT_DIR/../make"
|
||||
IDEA_MAKE="$MAKE_DIR/ide/idea/jdk"
|
||||
IDEA_TEMPLATE="$IDEA_MAKE/template"
|
||||
|
||||
cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
|
||||
@@ -123,31 +94,31 @@ if [ -d "$TEMPLATES_OVERRIDE" ] ; then
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$VERBOSE" = true ] ; then
|
||||
echo "Will generate IDEA project files in \"$IDEA_OUTPUT\" for project \"$TOPLEVEL_DIR\""
|
||||
if [ "$VERBOSE" = "true" ] ; then
|
||||
echo "output dir: $IDEA_OUTPUT"
|
||||
echo "idea template dir: $IDEA_TEMPLATE"
|
||||
fi
|
||||
|
||||
cd $TOP ; make idea-gen-config ALLOW=TOPLEVEL_DIR,IDEA_OUTPUT_PARENT,IDEA_OUTPUT,MODULES TOPLEVEL_DIR="$TOPLEVEL_DIR" \
|
||||
IDEA_OUTPUT_PARENT="$IDEA_OUTPUT_PARENT" IDEA_OUTPUT="$IDEA_OUTPUT" MODULES="$*" $CONF_ARG || exit 1
|
||||
cd $TOP ; make idea-gen-config ALLOW=IDEA_OUTPUT,MODULES IDEA_OUTPUT=$IDEA_OUTPUT MODULES="$*" $CONF_ARG || exit 1
|
||||
cd $SCRIPT_DIR
|
||||
|
||||
. $IDEA_OUTPUT/env.cfg
|
||||
|
||||
# Expect MODULES, MODULE_NAMES, RELATIVE_PROJECT_DIR, RELATIVE_BUILD_DIR to be set
|
||||
if [ "xMODULES" = "x" ] ; then
|
||||
echo "FATAL: MODULES is empty" >&2; exit 1
|
||||
# Expect MODULE_ROOTS, MODULE_NAMES, BOOT_JDK & SPEC to be set
|
||||
if [ "x$MODULE_ROOTS" = "x" ] ; then
|
||||
echo "FATAL: MODULE_ROOTS is empty" >&2; exit 1
|
||||
fi
|
||||
|
||||
if [ "x$MODULE_NAMES" = "x" ] ; then
|
||||
echo "FATAL: MODULE_NAMES is empty" >&2; exit 1
|
||||
fi
|
||||
|
||||
if [ "x$RELATIVE_PROJECT_DIR" = "x" ] ; then
|
||||
echo "FATAL: RELATIVE_PROJECT_DIR is empty" >&2; exit 1
|
||||
if [ "x$BOOT_JDK" = "x" ] ; then
|
||||
echo "FATAL: BOOT_JDK is empty" >&2; exit 1
|
||||
fi
|
||||
|
||||
if [ "x$RELATIVE_BUILD_DIR" = "x" ] ; then
|
||||
echo "FATAL: RELATIVE_BUILD_DIR is empty" >&2; exit 1
|
||||
if [ "x$SPEC" = "x" ] ; then
|
||||
echo "FATAL: SPEC is empty" >&2; exit 1
|
||||
fi
|
||||
|
||||
if [ -d "$TOPLEVEL_DIR/.hg" ] ; then
|
||||
@@ -158,43 +129,6 @@ if [ -d "$TOPLEVEL_DIR/.git" ] ; then
|
||||
VCS_TYPE="Git"
|
||||
fi
|
||||
|
||||
if [ "$ABSOLUTE_PATHS" = true ] ; then
|
||||
if [ "x$PATHTOOL" != "x" ]; then
|
||||
PROJECT_DIR="`$PATHTOOL -am $OPENJDK_DIR`"
|
||||
TOPLEVEL_PROJECT_DIR="`$PATHTOOL -am $TOPLEVEL_DIR`"
|
||||
else
|
||||
PROJECT_DIR="$OPENJDK_DIR"
|
||||
TOPLEVEL_PROJECT_DIR="$TOPLEVEL_DIR"
|
||||
fi
|
||||
MODULE_DIR="$PROJECT_DIR"
|
||||
TOPLEVEL_MODULE_DIR="$TOPLEVEL_PROJECT_DIR"
|
||||
cd "$IDEA_OUTPUT_PARENT" && cd "$RELATIVE_BUILD_DIR" && BUILD_DIR="`pwd`"
|
||||
CLION_SCRIPT_TOPDIR="$OPENJDK_DIR"
|
||||
CLION_PROJECT_DIR="$PROJECT_DIR"
|
||||
else
|
||||
if [ "$RELATIVE_PROJECT_DIR" = "." ] ; then
|
||||
PROJECT_DIR=""
|
||||
else
|
||||
PROJECT_DIR="/$RELATIVE_PROJECT_DIR"
|
||||
fi
|
||||
if [ "$RELATIVE_TOPLEVEL_PROJECT_DIR" = "." ] ; then
|
||||
TOPLEVEL_PROJECT_DIR=""
|
||||
else
|
||||
TOPLEVEL_PROJECT_DIR="/$RELATIVE_TOPLEVEL_PROJECT_DIR"
|
||||
fi
|
||||
MODULE_DIR="\$MODULE_DIR\$$PROJECT_DIR"
|
||||
PROJECT_DIR="\$PROJECT_DIR\$$PROJECT_DIR"
|
||||
TOPLEVEL_MODULE_DIR="\$MODULE_DIR\$$TOPLEVEL_PROJECT_DIR"
|
||||
TOPLEVEL_PROJECT_DIR="\$PROJECT_DIR\$$TOPLEVEL_PROJECT_DIR"
|
||||
BUILD_DIR="\$PROJECT_DIR\$/$RELATIVE_BUILD_DIR"
|
||||
CLION_SCRIPT_TOPDIR="$CLION_RELATIVE_PROJECT_DIR"
|
||||
CLION_PROJECT_DIR="\$PROJECT_DIR\$/$CLION_SCRIPT_TOPDIR"
|
||||
fi
|
||||
if [ "$VERBOSE" = true ] ; then
|
||||
echo "Project root: $PROJECT_DIR"
|
||||
echo "Generating IDEA project files..."
|
||||
fi
|
||||
|
||||
### Replace template variables
|
||||
|
||||
NUM_REPLACEMENTS=0
|
||||
@@ -218,106 +152,116 @@ add_replacement() {
|
||||
eval TO$NUM_REPLACEMENTS='$2'
|
||||
}
|
||||
|
||||
add_replacement "###PATHTOOL###" "$PATHTOOL"
|
||||
add_replacement "###CLION_SCRIPT_TOPDIR###" "$CLION_SCRIPT_TOPDIR"
|
||||
add_replacement "###CLION_PROJECT_DIR###" "$CLION_PROJECT_DIR"
|
||||
add_replacement "###PROJECT_DIR###" "$PROJECT_DIR"
|
||||
add_replacement "###MODULE_DIR###" "$MODULE_DIR"
|
||||
add_replacement "###TOPLEVEL_PROJECT_DIR###" "$TOPLEVEL_PROJECT_DIR"
|
||||
add_replacement "###TOPLEVEL_MODULE_DIR###" "$TOPLEVEL_MODULE_DIR"
|
||||
add_replacement "###MODULE_NAMES###" "$MODULE_NAMES"
|
||||
add_replacement "###VCS_TYPE###" "$VCS_TYPE"
|
||||
add_replacement "###BUILD_DIR###" "$BUILD_DIR"
|
||||
add_replacement "###RELATIVE_BUILD_DIR###" "$RELATIVE_BUILD_DIR"
|
||||
if [ "x$PATHTOOL" != "x" ]; then
|
||||
add_replacement "###BASH_RUNNER_PREFIX###" "\$PROJECT_DIR\$/.idea/bash.bat"
|
||||
else
|
||||
add_replacement "###BASH_RUNNER_PREFIX###" ""
|
||||
fi
|
||||
if [ "x$PATHTOOL" != "x" ]; then
|
||||
SPEC_DIR=`dirname $SPEC`
|
||||
if [ "x$CYGPATH" != "x" ]; then
|
||||
add_replacement "###BUILD_DIR###" "`$CYGPATH -am $SPEC_DIR`"
|
||||
add_replacement "###IMAGES_DIR###" "`$CYGPATH -am $SPEC_DIR`/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "`$CYGPATH -am $TOPLEVEL_DIR`"
|
||||
add_replacement "###IDEA_DIR###" "`$CYGPATH -am $IDEA_OUTPUT`"
|
||||
if [ "x$JT_HOME" = "x" ]; then
|
||||
add_replacement "###JTREG_HOME###" ""
|
||||
else
|
||||
add_replacement "###JTREG_HOME###" "`$PATHTOOL -am $JT_HOME`"
|
||||
add_replacement "###JTREG_HOME###" "`$CYGPATH -am $JT_HOME`"
|
||||
fi
|
||||
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
add_replacement "###BUILD_DIR###" "`wslpath -am $SPEC_DIR`"
|
||||
add_replacement "###IMAGES_DIR###" "`wslpath -am $SPEC_DIR`/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "`wslpath -am $TOPLEVEL_DIR`"
|
||||
add_replacement "###IDEA_DIR###" "`wslpath -am $IDEA_OUTPUT`"
|
||||
if [ "x$JT_HOME" = "x" ]; then
|
||||
add_replacement "###JTREG_HOME###" ""
|
||||
else
|
||||
add_replacement "###JTREG_HOME###" "`wslpath -am $JT_HOME`"
|
||||
fi
|
||||
else
|
||||
add_replacement "###BUILD_DIR###" "$SPEC_DIR"
|
||||
add_replacement "###JTREG_HOME###" "$JT_HOME"
|
||||
add_replacement "###IMAGES_DIR###" "$SPEC_DIR/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "$TOPLEVEL_DIR"
|
||||
add_replacement "###IDEA_DIR###" "$IDEA_OUTPUT"
|
||||
fi
|
||||
|
||||
MODULE_IMLS=""
|
||||
TEST_MODULE_DEPENDENCIES=""
|
||||
for module in $MODULE_NAMES; do
|
||||
MODULE_IMLS="$MODULE_IMLS<module fileurl=\"file://\$PROJECT_DIR$/.idea/$module.iml\" filepath=\"\$PROJECT_DIR$/.idea/$module.iml\" /> "
|
||||
TEST_MODULE_DEPENDENCIES="$TEST_MODULE_DEPENDENCIES<orderEntry type=\"module\" module-name=\"$module\" scope=\"TEST\" /> "
|
||||
SOURCE_PREFIX="<sourceFolder url=\"file://"
|
||||
SOURCE_POSTFIX="\" isTestSource=\"false\" />"
|
||||
|
||||
for root in $MODULE_ROOTS; do
|
||||
if [ "x$CYGPATH" != "x" ]; then
|
||||
root=`$CYGPATH -am $root`
|
||||
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
root=`wslpath -am $root`
|
||||
fi
|
||||
|
||||
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
|
||||
done
|
||||
add_replacement "###MODULE_IMLS###" "$MODULE_IMLS"
|
||||
add_replacement "###TEST_MODULE_DEPENDENCIES###" "$TEST_MODULE_DEPENDENCIES"
|
||||
|
||||
add_replacement "###SOURCE_ROOTS###" "$SOURCES"
|
||||
|
||||
replace_template_dir "$IDEA_OUTPUT"
|
||||
|
||||
### Generate module project files
|
||||
### Compile the custom Logger
|
||||
|
||||
if [ "$VERBOSE" = true ] ; then
|
||||
echo "Generating project modules:"
|
||||
fi
|
||||
(
|
||||
DEFAULT_IFS="$IFS"
|
||||
IFS='#'
|
||||
for value in $MODULES; do
|
||||
(
|
||||
eval "$value"
|
||||
if [ "$VERBOSE" = true ] ; then
|
||||
echo " $module"
|
||||
fi
|
||||
MAIN_SOURCE_DIRS=""
|
||||
CONTENT_ROOTS=""
|
||||
IFS=' '
|
||||
for dir in $moduleSrcDirs; do
|
||||
case $dir in
|
||||
"src/"*) MAIN_SOURCE_DIRS="$MAIN_SOURCE_DIRS <sourceFolder url=\"file://$MODULE_DIR/$dir\" isTestSource=\"false\" />" ;;
|
||||
*"/support/gensrc/$module") ;; # Exclude generated sources to avoid module-info conflicts, see https://youtrack.jetbrains.com/issue/IDEA-185108
|
||||
*) CONTENT_ROOTS="$CONTENT_ROOTS <content url=\"file://$MODULE_DIR/$dir\">\
|
||||
<sourceFolder url=\"file://$MODULE_DIR/$dir\" isTestSource=\"false\" generated=\"true\" /></content>" ;;
|
||||
esac
|
||||
done
|
||||
if [ "x$MAIN_SOURCE_DIRS" != "x" ] ; then
|
||||
CONTENT_ROOTS="<content url=\"file://$MODULE_DIR/src/$module\">$MAIN_SOURCE_DIRS</content>$CONTENT_ROOTS"
|
||||
fi
|
||||
add_replacement "###MODULE_CONTENT_ROOTS###" "$CONTENT_ROOTS"
|
||||
DEPENDENCIES=""
|
||||
for dep in $moduleDependencies; do
|
||||
case $MODULE_NAMES in # Exclude skipped modules from dependencies
|
||||
*"$dep"*) DEPENDENCIES="$DEPENDENCIES<orderEntry type=\"module\" module-name=\"$dep\" /> "
|
||||
esac
|
||||
done
|
||||
add_replacement "###DEPENDENCIES###" "$DEPENDENCIES"
|
||||
cp "$IDEA_OUTPUT/module.iml" "$IDEA_OUTPUT/$module.iml"
|
||||
IFS="$DEFAULT_IFS"
|
||||
replace_template_file "$IDEA_OUTPUT/$module.iml"
|
||||
)
|
||||
done
|
||||
)
|
||||
rm "$IDEA_OUTPUT/module.iml"
|
||||
CLASSES=$IDEA_OUTPUT/classes
|
||||
|
||||
### Create shell script runner for Windows
|
||||
|
||||
if [ "x$PATHTOOL" != "x" ]; then
|
||||
echo "@echo off" > "$IDEA_OUTPUT/bash.bat"
|
||||
if [ "x$WSL_DISTRO_NAME" != "x" ] ; then
|
||||
echo "wsl -d $WSL_DISTRO_NAME --cd \"%cd%\" -e %*" >> "$IDEA_OUTPUT/bash.bat"
|
||||
if [ "x$ANT_HOME" = "x" ] ; then
|
||||
# try some common locations
|
||||
if [ -f "/usr/share/ant/lib/ant.jar" ] ; then
|
||||
ANT_HOME="/usr/share/ant"
|
||||
else
|
||||
echo "$WINENV_ROOT\bin\bash.exe -l -c \"cd %CD:\=/%/ && %*\"" >> "$IDEA_OUTPUT/bash.bat"
|
||||
try_ant=$(ls /opt/homebrew/Cellar/ant/*/libexec/lib/ant.jar 2> /dev/null | sort -r | head -n 1)
|
||||
if [ "x$try_ant" != "x" ] ; then
|
||||
ANT_HOME=$(cd $(dirname $try_ant)/.. && pwd)
|
||||
else
|
||||
try_ant=$(ls /usr/local/Cellar/ant/*/libexec/lib/ant.jar 2> /dev/null | sort -r | head -n 1)
|
||||
if [ "x$try_ant" != "x" ] ; then
|
||||
ANT_HOME=$(cd $(dirname $try_ant)/.. && pwd)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [ ! -f "$ANT_HOME/lib/ant.jar" ] ; then
|
||||
echo "FATAL: ANT_HOME is incorrect. Try removing it and use autodetection, or fix the value" >&2; exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x$ANT_HOME" = "x" ] ; then
|
||||
echo "FATAL: cannot find ant. Try setting ANT_HOME." >&2; exit 1
|
||||
fi
|
||||
CP=$ANT_HOME/lib/ant.jar
|
||||
rm -rf $CLASSES; mkdir $CLASSES
|
||||
|
||||
# If we have a Windows boot JDK, we need a .exe suffix
|
||||
if [ -e "$BOOT_JDK/bin/java.exe" ] ; then
|
||||
JAVAC=javac.exe
|
||||
else
|
||||
JAVAC=javac
|
||||
fi
|
||||
|
||||
if [ "$VERBOSE" = true ] ; then
|
||||
IDEA_PROJECT_DIR="`dirname $IDEA_OUTPUT`"
|
||||
if [ "x$PATHTOOL" != "x" ]; then
|
||||
IDEA_PROJECT_DIR="`$PATHTOOL -am $IDEA_PROJECT_DIR`"
|
||||
fi
|
||||
echo "
|
||||
Now you can open \"$IDEA_PROJECT_DIR\" as IDEA project
|
||||
You can also run 'bash \"$IDEA_OUTPUT/jdk-clion/update-project.sh\"' to generate Clion project"
|
||||
fi
|
||||
# If we are on WSL, the boot JDK might be either Windows or Linux,
|
||||
# and we need to use realpath instead of CYGPATH to make javac work on both.
|
||||
# We need to handle this case first since CYGPATH might be set on WSL.
|
||||
if [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
JAVAC_SOURCE_FILE=`realpath --relative-to=./ $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
|
||||
JAVAC_SOURCE_PATH=`realpath --relative-to=./ $IDEA_OUTPUT/src`
|
||||
JAVAC_CLASSES=`realpath --relative-to=./ $CLASSES`
|
||||
ANT_TEMP=`mktemp -d -p ./`
|
||||
cp $ANT_HOME/lib/ant.jar $ANT_TEMP/ant.jar
|
||||
JAVAC_CP=$ANT_TEMP/ant.jar
|
||||
elif [ "x$CYGPATH" != "x" ] ; then ## CYGPATH may be set in env.cfg
|
||||
JAVAC_SOURCE_FILE=`$CYGPATH -am $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
|
||||
JAVAC_SOURCE_PATH=`$CYGPATH -am $IDEA_OUTPUT/src`
|
||||
JAVAC_CLASSES=`$CYGPATH -am $CLASSES`
|
||||
JAVAC_CP=`$CYGPATH -am $CP`
|
||||
else
|
||||
JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java
|
||||
JAVAC_SOURCE_PATH=$IDEA_OUTPUT/src
|
||||
JAVAC_CLASSES=$CLASSES
|
||||
JAVAC_CP=$CP
|
||||
fi
|
||||
|
||||
$BOOT_JDK/bin/$JAVAC -d $JAVAC_CLASSES -sourcepath $JAVAC_SOURCE_PATH -cp $JAVAC_CP $JAVAC_SOURCE_FILE
|
||||
|
||||
if [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
rm -rf $ANT_TEMP
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
java.base,
|
||||
java.compiler,
|
||||
java.datatransfer,
|
||||
java.desktop,
|
||||
java.instrument,
|
||||
@@ -23,7 +22,6 @@ java.xml.crypto,
|
||||
jdk.accessibility,
|
||||
jdk.attach,
|
||||
jdk.charsets,
|
||||
jdk.compiler,
|
||||
jdk.crypto.cryptoki,
|
||||
jdk.crypto.ec,
|
||||
jdk.dynalink,
|
||||
|
||||
@@ -46,7 +46,6 @@ function do_configure {
|
||||
--with-toolchain-version=$TOOLCHAIN_VERSION \
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--with-build-jdk=$BUILD_JDK \
|
||||
--with-nvdacontrollerclient=$NVDA_PATH \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes \
|
||||
$DISABLE_WARNINGS_AS_ERRORS \
|
||||
|
||||
@@ -37,7 +37,6 @@ function do_configure {
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=$TOOLCHAIN_VERSION \
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--with-nvdacontrollerclient=$NVDA_PATH \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes \
|
||||
$DISABLE_WARNINGS_AS_ERRORS \
|
||||
|
||||
@@ -33,7 +33,6 @@ function do_configure {
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=$TOOLCHAIN_VERSION \
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--with-nvdacontrollerclient=$NVDA_PATH \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes \
|
||||
$DISABLE_WARNINGS_AS_ERRORS \
|
||||
|
||||
@@ -100,7 +100,6 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
|
||||
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
|
||||
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
|
||||
CREATE_API_DIGEST := true, \
|
||||
PROCESS_JBR_API := true, \
|
||||
CLEAN := $(CLEAN), \
|
||||
CLEAN_FILES := $(CLEAN_FILES), \
|
||||
COPY := $(COPY), \
|
||||
|
||||
@@ -87,7 +87,7 @@ $(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := $(TOPDIR)/make/jdk/src/classes, \
|
||||
INCLUDES := build/tools/depend, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/plugins, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/depend, \
|
||||
DISABLED_WARNINGS := options, \
|
||||
JAVAC_FLAGS := \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
|
||||
@@ -100,21 +100,13 @@ $(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
|
||||
--add-exports jdk.internal.opt/jdk.internal.opt=jdk.javadoc.interim, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupJavaCompilation, COMPILE_JBR_API_PLUGIN, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := $(TOPDIR)/make/jdk/src/classes, \
|
||||
INCLUDES := build/tools/jbrapi, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/plugins, \
|
||||
))
|
||||
DEPEND_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services/com.sun.source.util.Plugin
|
||||
|
||||
PLUGINS_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/plugins/META-INF/services/com.sun.source.util.Plugin
|
||||
|
||||
$(PLUGINS_SERVICE_PROVIDER):
|
||||
$(call MakeDir, $(BUILDTOOLS_OUTPUTDIR)/plugins/META-INF/services)
|
||||
$(DEPEND_SERVICE_PROVIDER):
|
||||
$(call MakeDir, $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services)
|
||||
$(ECHO) build.tools.depend.Depend > $@
|
||||
$(ECHO) build.tools.jbrapi.JBRApiPlugin >> $@
|
||||
|
||||
TARGETS += $(COMPILE_DEPEND) $(COMPILE_JBR_API_PLUGIN) $(PLUGINS_SERVICE_PROVIDER)
|
||||
TARGETS += $(COMPILE_DEPEND) $(DEPEND_SERVICE_PROVIDER)
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -47,7 +47,6 @@ $(JCOV_IMAGE_DIR)/release: $(JCOV_INPUT_IMAGE_DIR)/release
|
||||
-t $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)/template.xml \
|
||||
-rt $(JCOV_HOME)/lib/jcov_network_saver.jar \
|
||||
-exclude 'java.lang.Object' \
|
||||
-exclude 'jdk.internal.org.objectweb.**' \
|
||||
-exclude jdk.test.Main -exclude '**\$Proxy*' \
|
||||
$(JCOV_FILTERS) \
|
||||
$(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)
|
||||
|
||||
@@ -47,6 +47,12 @@ include $(TOPDIR)/make/common/MakeBase.gmk
|
||||
include $(TOPDIR)/make/InitSupport.gmk
|
||||
include $(TOPDIR)/make/common/LogUtils.gmk
|
||||
|
||||
# Force early generation of module-deps.gmk and find-tests.gmk
|
||||
GENERATE_MODULE_DEPS_FILE := true
|
||||
include $(TOPDIR)/make/common/Modules.gmk
|
||||
GENERATE_FIND_TESTS_FILE := true
|
||||
include $(TOPDIR)/make/common/FindTests.gmk
|
||||
|
||||
# Parse COMPARE_BUILD (for makefile development)
|
||||
$(eval $(call ParseCompareBuild))
|
||||
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
#
|
||||
# Copyright 2000-2023 JetBrains s.r.o.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Utils.gmk
|
||||
|
||||
JBR_API_ORIGIN := https://github.com/JetBrains/JetBrainsRuntimeApi.git
|
||||
JBR_API_DIR := $(TOPDIR)/jbr-api
|
||||
|
||||
ARTIFACT_NAME := jbr-api-SNAPSHOT
|
||||
ifeq ($(call isBuildOsEnv, windows.cygwin windows.msys2), true)
|
||||
HOME := $$USERPROFILE
|
||||
M2_REPO := $(shell $(PATHTOOL) $(HOME))/.m2/repository
|
||||
else ifeq ($(call isBuildOsEnv, windows.wsl1 windows.wsl2), true)
|
||||
HOME := `cmd.exe /C "echo %USERPROFILE%" 2> /dev/null`
|
||||
M2_REPO := $(shell $(PATHTOOL) $(HOME))/.m2/repository
|
||||
else
|
||||
M2_REPO := $(HOME)/.m2/repository
|
||||
endif
|
||||
M2_ARTIFACT := $(M2_REPO)/com/jetbrains/jbr-api/SNAPSHOT
|
||||
M2_POM_CONTENT := \
|
||||
<?xml version="1.0" encoding="UTF-8"?> \
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" \
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> \
|
||||
<modelVersion>4.0.0</modelVersion> \
|
||||
<groupId>com.jetbrains</groupId> \
|
||||
<artifactId>jbr-api</artifactId> \
|
||||
<version>SNAPSHOT</version> \
|
||||
</project> \
|
||||
|
||||
jbr-api:
|
||||
if [ -d "$(JBR_API_DIR)" ]; then \
|
||||
$(GIT) -C "$(JBR_API_DIR)" fetch; \
|
||||
$(GIT) -C "$(JBR_API_DIR)" merge-base --is-ancestor origin/main HEAD || \
|
||||
$(ECHO) "!!! Current JBR API revision is outdated, update the branch in $(JBR_API_DIR) !!!"; \
|
||||
else \
|
||||
$(ECHO) "JBR API directory does not exist. Initializing..."; \
|
||||
$(GIT) clone "$(JBR_API_ORIGIN)" "$(JBR_API_DIR)" --config core.autocrlf=false; \
|
||||
fi
|
||||
$(BASH) "$(JBR_API_DIR)/tools/build.sh" dev "$(BOOT_JDK)"
|
||||
if [ -d "$(M2_REPO)" ]; then \
|
||||
$(MKDIR) -p $(M2_ARTIFACT); \
|
||||
$(ECHO) "$(M2_POM_CONTENT)" > $(M2_ARTIFACT)/$(ARTIFACT_NAME).pom; \
|
||||
$(CP) "$(JBR_API_DIR)/out/$(ARTIFACT_NAME).jar" "$(M2_ARTIFACT)"; \
|
||||
$(ECHO) "Installed into local Maven repository as com.jetbrains:jbr-api:SNAPSHOT"; \
|
||||
else \
|
||||
$(ECHO) "No Maven repository found at $(M2_REPO) - skipping local installation"; \
|
||||
fi
|
||||
|
||||
.PHONY: jbr-api
|
||||
@@ -361,7 +361,7 @@ $(eval $(call SetupTarget, vscode-project-ccls, \
|
||||
|
||||
$(eval $(call SetupTarget, idea-gen-config, \
|
||||
MAKEFILE := ide/idea/jdk/IdeaGenConfig, \
|
||||
ARGS := IDEA_OUTPUT="$(IDEA_OUTPUT)" MODULES="$(MODULES)" TOPLEVEL_DIR="$(TOPLEVEL_DIR)" IDEA_OUTPUT_PARENT="$(IDEA_OUTPUT_PARENT)", \
|
||||
ARGS := IDEA_OUTPUT="$(IDEA_OUTPUT)" MODULES="$(MODULES)", \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
@@ -1483,17 +1483,10 @@ print-tests:
|
||||
|
||||
create-main-targets-include:
|
||||
$(call LogInfo, Generating main target list)
|
||||
$(call MakeDir, $(MAKESUPPORT_OUTPUTDIR))
|
||||
@$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
|
||||
$(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
|
||||
|
||||
################################################################################
|
||||
# JBR API
|
||||
|
||||
$(eval $(call SetupTarget, jbr-api, \
|
||||
MAKEFILE := JBRApi, \
|
||||
TARGET := jbr-api \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, Main-post.gmk))
|
||||
|
||||
@@ -301,7 +301,8 @@ test-prebuilt:
|
||||
# are always found and parsed, call FindTests.gmk stand alone once
|
||||
# before calling RunTests.gmk.
|
||||
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/common/FindTests.gmk \
|
||||
SPEC=$(SPEC) FINDTESTS_STAND_ALONE=true
|
||||
SPEC=$(SPEC) FINDTESTS_STAND_ALONE=true \
|
||||
GENERATE_FIND_TESTS_FILE=true
|
||||
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
|
||||
TEST="$(TEST)"
|
||||
|
||||
|
||||
@@ -89,8 +89,8 @@ AC_DEFUN([BASIC_SETUP_PATHS_WINDOWS],
|
||||
WINENV_TEMP_DIR=$($PATHTOOL -u $($CMD /q /c echo %TEMP% 2> /dev/null) | $TR -d '\r\n')
|
||||
AC_MSG_RESULT([$WINENV_TEMP_DIR])
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl1" || test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl2"; then
|
||||
# Don't trust the current directory for WSL, but change to an OK temp dir
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl2"; then
|
||||
# Don't trust the current directory for WSL2, but change to an OK temp dir
|
||||
cd "$WINENV_TEMP_DIR"
|
||||
# Bring along confdefs.h or autoconf gets all confused
|
||||
cp "$CONFIGURE_START_DIR/confdefs.h" "$WINENV_TEMP_DIR"
|
||||
@@ -228,7 +228,7 @@ AC_DEFUN([BASIC_WINDOWS_FINALIZE_FIXPATH],
|
||||
# Platform-specific finalization
|
||||
AC_DEFUN([BASIC_WINDOWS_FINALIZE],
|
||||
[
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl1" || test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl2"; then
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl2"; then
|
||||
# Change back from temp dir
|
||||
cd $CONFIGURE_START_DIR
|
||||
fi
|
||||
|
||||
@@ -244,31 +244,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
fi
|
||||
AC_SUBST(HOTSPOT_OVERRIDE_LIBPATH)
|
||||
|
||||
# Should we build the client for the JAWS screen reader?
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
AC_MSG_CHECKING([if JAWS client support is enabled])
|
||||
|
||||
A11Y_JAWS_ANNOUNCING_ENABLED=true
|
||||
AC_ARG_ENABLE(
|
||||
[jaws-client],
|
||||
[AS_HELP_STRING([--disable-jaws-client], [Set to disable to exclude the client for the JAWS screen reader from the build])],
|
||||
[
|
||||
if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
|
||||
AC_MSG_WARN([--[enable|disable]-jaws-client[=*] flags are ignored for headless builds])
|
||||
elif test "x$enableval" != xyes; then
|
||||
A11Y_JAWS_ANNOUNCING_ENABLED=false
|
||||
fi
|
||||
]
|
||||
)
|
||||
if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
|
||||
A11Y_JAWS_ANNOUNCING_ENABLED=false
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$A11Y_JAWS_ANNOUNCING_ENABLED])
|
||||
else
|
||||
A11Y_JAWS_ANNOUNCING_ENABLED=false
|
||||
fi
|
||||
AC_SUBST(A11Y_JAWS_ANNOUNCING_ENABLED)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2024, JetBrains s.r.o.. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Check if a potential dbus library match is correct and usable
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_DBUS],
|
||||
[
|
||||
AC_ARG_WITH(dbus-includes, [AS_HELP_STRING([--with-dbus-includes],
|
||||
[specify include directories for the dbus files as list separated by space])])
|
||||
|
||||
if test "x$NEEDS_LIB_DBUS" = xfalse; then
|
||||
DBUS_CFLAGS=
|
||||
DBUS_FOUND=false
|
||||
else
|
||||
if test "x${with_dbus_includes}" != x; then
|
||||
DBUS_FOUND=true
|
||||
DBUS_CFLAGS=""
|
||||
for include in $with_dbus_includes; do
|
||||
DBUS_CFLAGS="${DBUS_CFLAGS}-I${include} "
|
||||
done
|
||||
else
|
||||
PKG_CHECK_MODULES(DBUS, dbus-1, [DBUS_FOUND=true], [
|
||||
DBUS_FOUND=false
|
||||
AC_MSG_NOTICE([Can't find dbus-1 library. This library is needed to use some features. You can install dbus-1 library or specify include directories manually by giving --with-dbus-includes option.])
|
||||
])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(DBUS_CFLAGS)
|
||||
AC_SUBST(DBUS_FOUND)
|
||||
])
|
||||
@@ -1,121 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, JetBrains s.r.o.. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Setup nvdacontrollerclient (The library for communication with
|
||||
# NVDA - a screen reader for Microsoft Windows)
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_NVDACONTROLLERCLIENT], [
|
||||
# To enable NVDA, user specifies neither --with-nvdacontrollerclient or
|
||||
# a pair (--with-nvdacontrollerclient-include, --with-nvdacontrollerclient-lib)
|
||||
AC_ARG_WITH(nvdacontrollerclient, [AS_HELP_STRING([--with-nvdacontrollerclient],
|
||||
[specify prefix directory for the NVDA Controller Client library package
|
||||
(expecting headers and libs under PATH/<target-arch>/)])])
|
||||
AC_ARG_WITH(nvdacontrollerclient-include, [AS_HELP_STRING([--with-nvdacontrollerclient-include],
|
||||
[specify directory for the NVDA Controller Client include files])])
|
||||
AC_ARG_WITH(nvdacontrollerclient-lib, [AS_HELP_STRING([--with-nvdacontrollerclient-lib],
|
||||
[specify directory for the NVDA Controller Client library])])
|
||||
|
||||
NVDACONTROLLERCLIENT_FOUND=no
|
||||
NVDACONTROLLERCLIENT_LIB=
|
||||
NVDACONTROLLERCLIENT_DLL=
|
||||
NVDACONTROLLERCLIENT_CFLAGS=
|
||||
|
||||
if test "x${NEEDS_LIB_NVDACONTROLLERCLIENT}" = "xtrue" ; then
|
||||
if (test "x${with_nvdacontrollerclient_include}" = "x" && test "x${with_nvdacontrollerclient_lib}" != "x") || \
|
||||
(test "x${with_nvdacontrollerclient_include}" != "x" && test "x${with_nvdacontrollerclient_lib}" = "x") ; then
|
||||
AC_MSG_ERROR([Must specify both or neither of --with-nvdacontrollerclient-include and --with-nvdacontrollerclient-lib])
|
||||
elif (test "x${with_nvdacontrollerclient}" != "x" && test "x${with_nvdacontrollerclient_include}" != "x") ; then
|
||||
AC_MSG_ERROR([Must specify either --with-nvdacontrollerclient or a pair (--with-nvdacontrollerclient-include, --with-nvdacontrollerclient-lib)])
|
||||
fi
|
||||
|
||||
if (test "x${with_nvdacontrollerclient}" != "x") || \
|
||||
(test "x${with_nvdacontrollerclient_include}" != "x" && test "x${with_nvdacontrollerclient_lib}" != "x") ; then
|
||||
|
||||
AC_MSG_CHECKING([for nvdacontrollerclient])
|
||||
|
||||
if test "x${OPENJDK_TARGET_OS}" != "xwindows" ; then
|
||||
AC_MSG_ERROR([--with-nvdacontrollerclient[-*] flags are applicable only to Windows builds])
|
||||
fi
|
||||
|
||||
if test "x${OPENJDK_TARGET_CPU_ARCH}" = "xaarch64" ; then
|
||||
NVDACONTROLLERCLIENT_BIN_BASENAME="nvdaControllerClient32"
|
||||
NVDACONTROLLERCLIENT_ARCHDIR="arm64"
|
||||
elif test "x${OPENJDK_TARGET_CPU_ARCH}" = "xx86" && test "x${OPENJDK_TARGET_CPU_BITS}" = "x64" ; then
|
||||
NVDACONTROLLERCLIENT_BIN_BASENAME="nvdaControllerClient64"
|
||||
NVDACONTROLLERCLIENT_ARCHDIR="x64"
|
||||
elif test "x${OPENJDK_TARGET_CPU_ARCH}" = "xx86" && test "x${OPENJDK_TARGET_CPU_BITS}" = "x32" ; then
|
||||
NVDACONTROLLERCLIENT_BIN_BASENAME="nvdaControllerClient32"
|
||||
NVDACONTROLLERCLIENT_ARCHDIR="x86"
|
||||
else
|
||||
AC_MSG_ERROR([The nvdacontrollerclient library exists only for x86_32, x86_64, AArch64 architectures])
|
||||
fi
|
||||
|
||||
if test "x${with_nvdacontrollerclient}" != "x" ; then
|
||||
# NVDACONTROLLERCLIENT_ARCHDIR is used only here
|
||||
NVDACONTROLLERCLIENT_INC_PATH="${with_nvdacontrollerclient}/${NVDACONTROLLERCLIENT_ARCHDIR}"
|
||||
NVDACONTROLLERCLIENT_BIN_PATH="${with_nvdacontrollerclient}/${NVDACONTROLLERCLIENT_ARCHDIR}"
|
||||
else
|
||||
NVDACONTROLLERCLIENT_INC_PATH="${with_nvdacontrollerclient_include}"
|
||||
NVDACONTROLLERCLIENT_BIN_PATH="${with_nvdacontrollerclient_lib}"
|
||||
fi
|
||||
|
||||
POTENTIAL_NVDACONTROLLERCLIENT_DLL="${NVDACONTROLLERCLIENT_BIN_PATH}/${NVDACONTROLLERCLIENT_BIN_BASENAME}.dll"
|
||||
POTENTIAL_NVDACONTROLLERCLIENT_LIB="${NVDACONTROLLERCLIENT_BIN_PATH}/${NVDACONTROLLERCLIENT_BIN_BASENAME}.lib"
|
||||
POTENTIAL_NVDACONTROLLERCLIENT_EXP="${NVDACONTROLLERCLIENT_BIN_PATH}/${NVDACONTROLLERCLIENT_BIN_BASENAME}.exp"
|
||||
|
||||
if ! test -s "${POTENTIAL_NVDACONTROLLERCLIENT_DLL}" || \
|
||||
! test -s "${POTENTIAL_NVDACONTROLLERCLIENT_LIB}" || \
|
||||
! test -s "${POTENTIAL_NVDACONTROLLERCLIENT_EXP}" ; then
|
||||
AC_MSG_ERROR([Could not find ${NVDACONTROLLERCLIENT_BIN_BASENAME}.dll and/or ${NVDACONTROLLERCLIENT_BIN_BASENAME}.lib and/or ${NVDACONTROLLERCLIENT_BIN_BASENAME}.exp inside ${NVDACONTROLLERCLIENT_BIN_PATH}])
|
||||
fi
|
||||
if ! test -s "${NVDACONTROLLERCLIENT_INC_PATH}/nvdaController.h" ; then
|
||||
AC_MSG_ERROR([Could not find the header file nvdaController.h inside ${NVDACONTROLLERCLIENT_INC_PATH}])
|
||||
fi
|
||||
|
||||
NVDACONTROLLERCLIENT_CFLAGS="-I${NVDACONTROLLERCLIENT_INC_PATH}"
|
||||
NVDACONTROLLERCLIENT_DLL="${POTENTIAL_NVDACONTROLLERCLIENT_DLL}"
|
||||
NVDACONTROLLERCLIENT_LIB="${POTENTIAL_NVDACONTROLLERCLIENT_LIB}"
|
||||
NVDACONTROLLERCLIENT_FOUND=yes
|
||||
|
||||
AC_MSG_RESULT([includes at ${NVDACONTROLLERCLIENT_INC_PATH} ; binaries at ${NVDACONTROLLERCLIENT_BIN_PATH}])
|
||||
fi
|
||||
elif test "x${with_nvdacontrollerclient}" != "x" || \
|
||||
test "x${with_nvdacontrollerclient_include}" != "x" || test "x${with_nvdacontrollerclient_lib}" != "x" ; then
|
||||
AC_MSG_WARN([[nvdacontrollerclient is not used, so --with-nvdacontrollerclient[-*] is ignored]])
|
||||
fi
|
||||
|
||||
if test "x${NVDACONTROLLERCLIENT_FOUND}" = "xyes" ; then
|
||||
A11Y_NVDA_ANNOUNCING_ENABLED=true
|
||||
else
|
||||
A11Y_NVDA_ANNOUNCING_ENABLED=false
|
||||
fi
|
||||
|
||||
AC_SUBST(A11Y_NVDA_ANNOUNCING_ENABLED)
|
||||
AC_SUBST(NVDACONTROLLERCLIENT_CFLAGS)
|
||||
AC_SUBST(NVDACONTROLLERCLIENT_DLL)
|
||||
AC_SUBST(NVDACONTROLLERCLIENT_LIB)
|
||||
])
|
||||
@@ -1,92 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, JetBrains s.r.o.. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Setup speechd
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_SPEECHD],
|
||||
[
|
||||
AC_ARG_WITH(speechd, [AS_HELP_STRING([--with-speechd],
|
||||
[specify prefix directory for the libspeechd package
|
||||
(expecting the headers under PATH/include); required for AccessibleAnnouncer to work])])
|
||||
AC_ARG_WITH(speechd-include, [AS_HELP_STRING([--with-speechd-include],
|
||||
[specify directory for the speechd include files])])
|
||||
|
||||
if test "x$NEEDS_LIB_SPEECHD" = xfalse || test "x${with_speechd}" = xno || \
|
||||
test "x${with_speechd_include}" = xno; then
|
||||
if (test "x${with_speechd}" != x && test "x${with_speechd}" != xno) || \
|
||||
(test "x${with_speechd_include}" != x && test "x${with_speechd_include}" != xno); then
|
||||
AC_MSG_WARN([[speechd not used, so --with-speechd[-*] is ignored]])
|
||||
fi
|
||||
A11Y_SPEECHD_ANNOUNCING_ENABLED=false
|
||||
SPEECHD_CFLAGS=
|
||||
SPEECHD_LIBS=
|
||||
else
|
||||
SPEECHD_FOUND=no
|
||||
|
||||
if test "x${with_speechd}" != x && test "x${with_speechd}" != xyes; then
|
||||
AC_MSG_CHECKING([for speechd header and library])
|
||||
if test -s "${with_speechd}/include/libspeechd.h"; then
|
||||
SPEECHD_CFLAGS="-I${with_speechd}/include"
|
||||
SPEECHD_LIBS="-L${with_speechd}/lib -lspeechd"
|
||||
SPEECHD_FOUND=yes
|
||||
AC_MSG_RESULT([$SPEECHD_FOUND])
|
||||
else
|
||||
AC_MSG_ERROR([Can't find 'include/libspeechd.h' under ${with_speechd} given with the --with-speechd option.])
|
||||
fi
|
||||
fi
|
||||
if test "x${with_speechd_include}" != x; then
|
||||
AC_MSG_CHECKING([for speechd headers])
|
||||
if test -s "${with_speechd_include}/libspeechd.h"; then
|
||||
SPEECHD_CFLAGS="-I${with_speechd_include}"
|
||||
SPEECHD_FOUND=yes
|
||||
AC_MSG_RESULT([$SPEECHD_FOUND])
|
||||
else
|
||||
AC_MSG_ERROR([Can't find 'include/libspeechd.h' under ${with_speechd} given with the --with-speechd-include option.])
|
||||
fi
|
||||
fi
|
||||
if test "x$SPEECHD_FOUND" = xno; then
|
||||
# Are the libspeechd headers installed in the default /usr/include location?
|
||||
AC_CHECK_HEADERS([libspeechd.h],
|
||||
[ SPEECHD_FOUND=yes ],
|
||||
[ SPEECHD_FOUND=no; break ]
|
||||
)
|
||||
if test "x$SPEECHD_FOUND" = xyes; then
|
||||
SPEECHD_CFLAGS=
|
||||
SPEECHD_LIBS="-lspeechd"
|
||||
fi
|
||||
fi
|
||||
if test "x$SPEECHD_FOUND" = xno; then
|
||||
A11Y_SPEECHD_ANNOUNCING_ENABLED=false
|
||||
else
|
||||
A11Y_SPEECHD_ANNOUNCING_ENABLED=true
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(A11Y_SPEECHD_ANNOUNCING_ENABLED)
|
||||
AC_SUBST(SPEECHD_CFLAGS)
|
||||
AC_SUBST(SPEECHD_LIBS)
|
||||
])
|
||||
@@ -1,216 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2023, JetBrains s.r.o.. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Setup wayland
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_WAYLAND],
|
||||
[
|
||||
AC_ARG_WITH(wayland, [AS_HELP_STRING([--with-wayland],
|
||||
[specify prefix directory for the wayland package
|
||||
(expecting the headers under PATH/include)])])
|
||||
AC_ARG_WITH(wayland-include, [AS_HELP_STRING([--with-wayland-include],
|
||||
[specify directory for the wayland include files])])
|
||||
AC_ARG_WITH(wayland-lib, [AS_HELP_STRING([--with-wayland-lib],
|
||||
[specify directory for the wayland library files])])
|
||||
AC_ARG_WITH(wayland-protocols, [AS_HELP_STRING([--with-wayland-protocols],
|
||||
[specify the root directory for the wayland protocols xml files])])
|
||||
AC_ARG_WITH(gtk-shell1-protocol, [AS_HELP_STRING([--with-gtk-shell1-protocol],
|
||||
[specify the path to the gtk-shell1 Wayland protocol xml file])])
|
||||
|
||||
if test "x$NEEDS_LIB_WAYLAND" = xfalse; then
|
||||
if (test "x${with_wayland}" != x && test "x${with_wayland}" != xno) || \
|
||||
(test "x${with_wayland_include}" != x && test "x${with_wayland_include}" != xno); then
|
||||
AC_MSG_WARN([[wayland not used, so --with-wayland[-*] is ignored]])
|
||||
fi
|
||||
WAYLAND_CFLAGS=
|
||||
WAYLAND_LIBS=
|
||||
VULKAN_FLAGS=
|
||||
VULKAN_ENABLED=false
|
||||
else
|
||||
WAYLAND_FOUND=no
|
||||
WAYLAND_INCLUDES=
|
||||
WAYLAND_DEFINES=
|
||||
if test "x${with_wayland}" = xno || test "x${with_wayland_include}" = xno; then
|
||||
AC_MSG_ERROR([It is not possible to disable the use of wayland. Remove the --without-wayland option.])
|
||||
fi
|
||||
|
||||
if test "x${with_wayland}" != x; then
|
||||
AC_MSG_CHECKING([for wayland headers])
|
||||
if test -s "${with_wayland}/include/wayland-client.h" && test -s "${with_wayland}/include/wayland-cursor.h"; then
|
||||
WAYLAND_INCLUDES="-I${with_wayland}/include"
|
||||
WAYLAND_LIBS="-L${with_wayland}/lib -lwayland-client -lwayland-cursor"
|
||||
|
||||
WAYLAND_FOUND=yes
|
||||
AC_MSG_RESULT([$WAYLAND_FOUND])
|
||||
else
|
||||
AC_MSG_ERROR([Can't find 'include/wayland-client.h' and 'include/wayland-cursor.h' under ${with_wayland} given with the --with-wayland option.])
|
||||
fi
|
||||
fi
|
||||
if test "x${with_wayland_include}" != x; then
|
||||
AC_MSG_CHECKING([for wayland headers])
|
||||
if test -s "${with_wayland_include}/wayland-client.h" && test -s "${with_wayland_include}/wayland-cursor.h"; then
|
||||
WAYLAND_INCLUDES="-I${with_wayland_include}"
|
||||
WAYLAND_FOUND=yes
|
||||
AC_MSG_RESULT([$WAYLAND_FOUND])
|
||||
else
|
||||
AC_MSG_ERROR([Can't find 'wayland-client.h' and 'wayland-cursor.h' under ${with_wayland_include} given with the --with-wayland-include option.])
|
||||
fi
|
||||
fi
|
||||
UTIL_REQUIRE_PROGS(WAYLAND_SCANNER, wayland-scanner)
|
||||
if test "x${with_wayland_protocols}" != x; then
|
||||
WAYLAND_PROTOCOLS_ROOT=${with_wayland_protocols}
|
||||
else
|
||||
WAYLAND_PROTOCOLS_ROOT=/usr/share/wayland-protocols/
|
||||
fi
|
||||
GTK_SHELL1_PROTOCOL_PATH=
|
||||
if test "x${with_gtk_shell1_protocol}" != x && test "x${with_gtk_shell1_protocol}" != xno; then
|
||||
AC_MSG_CHECKING([for the gtk-shell1 Wayland protocol])
|
||||
if test -s "${with_gtk_shell1_protocol}"; then
|
||||
WAYLAND_DEFINES="${WAYLAND_DEFINES} -DHAVE_GTK_SHELL1"
|
||||
GTK_SHELL1_PROTOCOL_PATH="${with_gtk_shell1_protocol}"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_ERROR([Can't find gtk-shell1 protocol in ${with_gtk_shell1_protocol} given with the --with-gtk-shell1-protocol option.])
|
||||
fi
|
||||
fi
|
||||
if test "x${with_wayland_lib}" != x; then
|
||||
WAYLAND_LIBS="-L${with_wayland_lib} -lwayland-client -lwayland-cursor"
|
||||
fi
|
||||
|
||||
if test "x$WAYLAND_FOUND" = xno; then
|
||||
# Are the wayland headers installed in the default /usr/include location?
|
||||
AC_CHECK_HEADERS([wayland-client.h wayland-cursor.h],
|
||||
[ WAYLAND_FOUND=yes ],
|
||||
[ WAYLAND_FOUND=no; break ]
|
||||
)
|
||||
if test "x$WAYLAND_FOUND" = xyes; then
|
||||
WAYLAND_INCLUDES=
|
||||
WAYLAND_LIBS="-lwayland-client -lwayland-cursor"
|
||||
DEFAULT_WAYLAND=yes
|
||||
fi
|
||||
fi
|
||||
if test "x$WAYLAND_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([wayland])
|
||||
AC_MSG_ERROR([Could not find wayland! $HELP_MSG ])
|
||||
fi
|
||||
WAYLAND_CFLAGS="${WAYLAND_INCLUDES} ${WAYLAND_DEFINES}"
|
||||
|
||||
# Checking for vulkan sdk
|
||||
|
||||
AC_ARG_WITH(vulkan, [AS_HELP_STRING([--with-vulkan],
|
||||
[specify whether we use vulkan])])
|
||||
|
||||
AC_ARG_WITH(vulkan-include, [AS_HELP_STRING([--with-vulkan-include],
|
||||
[specify directory for the vulkan include files ({with-vulkan-include}/vulkan/vulkan.h)])])
|
||||
|
||||
AC_ARG_WITH(vulkan-shader-compiler, [AS_HELP_STRING([--with-vulkan-shader-compiler],
|
||||
[specify which shader compiler to use: glslc/glslangValidator])])
|
||||
|
||||
if test "x$SUPPORTS_LIB_VULKAN" = xfalse; then
|
||||
|
||||
if (test "x${with_vulkan}" != x && test "x${with_vulkan}" != xno) || \
|
||||
(test "x${with_vulkan_include}" != x && test "x${with_vulkan_include}" != xno); then
|
||||
AC_MSG_WARN([[vulkan not used, so --with-vulkan-include is ignored]])
|
||||
fi
|
||||
VULKAN_FLAGS=
|
||||
VULKAN_ENABLED=false
|
||||
else
|
||||
# Do not build vulkan rendering pipeline by default
|
||||
if (test "x${with_vulkan}" = x && test "x${with_vulkan_include}" = x) || \
|
||||
test "x${with_vulkan}" = xno || test "x${with_vulkan_include}" = xno ; then
|
||||
VULKAN_FLAGS=
|
||||
VULKAN_ENABLED=false
|
||||
else
|
||||
VULKAN_FOUND=no
|
||||
|
||||
if test "x${with_vulkan_include}" != x; then
|
||||
AC_MSG_CHECKING([for vulkan.h])
|
||||
if test -s "${with_vulkan_include}/vulkan/vulkan.h"; then
|
||||
VULKAN_FOUND=yes
|
||||
VULKAN_FLAGS="-DVK_USE_PLATFORM_WAYLAND_KHR -I${with_vulkan_include} -DVULKAN_ENABLED"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Can't find 'vulkan/vulkan.h' under '${with_vulkan_include}'])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$VULKAN_FOUND" = xno; then
|
||||
# Check vulkan sdk location
|
||||
AC_CHECK_HEADERS([$VULKAN_SDK/include/vulkan/vulkan.h],
|
||||
[ VULKAN_FOUND=yes
|
||||
VULKAN_FLAGS="-DVK_USE_PLATFORM_WAYLAND_KHR -I${VULKAN_SDK}/include -DVULKAN_ENABLED"
|
||||
],
|
||||
[ VULKAN_FOUND=no; break ]
|
||||
)
|
||||
fi
|
||||
|
||||
if test "x$VULKAN_FOUND" = xno; then
|
||||
# Check default /usr/include location
|
||||
AC_CHECK_HEADERS([vulkan/vulkan.h],
|
||||
[ VULKAN_FOUND=yes
|
||||
VULKAN_FLAGS="-DVK_USE_PLATFORM_WAYLAND_KHR -DVULKAN_ENABLED"
|
||||
],
|
||||
[ VULKAN_FOUND=no; break ]
|
||||
)
|
||||
fi
|
||||
|
||||
if test "x$VULKAN_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([vulkan])
|
||||
AC_MSG_ERROR([Could not find vulkan! $HELP_MSG ])
|
||||
else
|
||||
# Find shader compiler - glslc or glslangValidator
|
||||
if (test "x${with_vulkan_shader_compiler}" = x || test "x${with_vulkan_shader_compiler}" = xglslc); then
|
||||
UTIL_LOOKUP_PROGS(GLSLC, glslc)
|
||||
SHADER_COMPILER="$GLSLC"
|
||||
VULKAN_SHADER_COMPILER="glslc --target-env=vulkan1.2 -mfmt=num -o"
|
||||
fi
|
||||
|
||||
if (test "x${with_vulkan_shader_compiler}" = x || test "x${with_vulkan_shader_compiler}" = xglslangValidator) && \
|
||||
test "x$SHADER_COMPILER" = x; then
|
||||
UTIL_LOOKUP_PROGS(GLSLANG, glslangValidator)
|
||||
SHADER_COMPILER="$GLSLANG"
|
||||
VULKAN_SHADER_COMPILER="glslangValidator --target-env vulkan1.2 -x -o"
|
||||
fi
|
||||
|
||||
if test "x$SHADER_COMPILER" != x; then
|
||||
VULKAN_ENABLED=true
|
||||
else
|
||||
AC_MSG_ERROR([Can't find shader compiler])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(VULKAN_FLAGS)
|
||||
AC_SUBST(VULKAN_SHADER_COMPILER)
|
||||
AC_SUBST(VULKAN_ENABLED)
|
||||
AC_SUBST(WAYLAND_CFLAGS)
|
||||
AC_SUBST(WAYLAND_LIBS)
|
||||
AC_SUBST(WAYLAND_PROTOCOLS_ROOT)
|
||||
AC_SUBST(GTK_SHELL1_PROTOCOL_PATH)
|
||||
])
|
||||
@@ -33,10 +33,7 @@ m4_include([lib-freetype.m4])
|
||||
m4_include([lib-hsdis.m4])
|
||||
m4_include([lib-std.m4])
|
||||
m4_include([lib-x11.m4])
|
||||
m4_include([lib-speechd.m4])
|
||||
m4_include([lib-nvdacontrollerclient.m4])
|
||||
m4_include([lib-dbus.m4])
|
||||
m4_include([lib-wayland.m4])
|
||||
|
||||
m4_include([lib-tests.m4])
|
||||
|
||||
################################################################################
|
||||
@@ -44,27 +41,14 @@ m4_include([lib-tests.m4])
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
|
||||
[
|
||||
# Check if X11, wayland and vulkan is needed
|
||||
# Check if X11 is needed
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# No X11 and wayland support on windows or macosx
|
||||
# No X11 support on windows or macosx
|
||||
NEEDS_LIB_X11=false
|
||||
NEEDS_LIB_SPEECHD=false
|
||||
NEEDS_LIB_WAYLAND=false
|
||||
SUPPORTS_LIB_VULKAN=false
|
||||
else
|
||||
# All other instances need X11, even if building headless only, libawt still
|
||||
# needs X11 headers.
|
||||
NEEDS_LIB_X11=true
|
||||
|
||||
if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
|
||||
NEEDS_LIB_SPEECHD=false
|
||||
NEEDS_LIB_WAYLAND=false
|
||||
SUPPORTS_LIB_VULKAN=false
|
||||
else
|
||||
NEEDS_LIB_SPEECHD=true
|
||||
NEEDS_LIB_WAYLAND=true
|
||||
SUPPORTS_LIB_VULKAN=true
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if fontconfig is needed
|
||||
@@ -90,13 +74,11 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
|
||||
NEEDS_LIB_FREETYPE=true
|
||||
fi
|
||||
|
||||
# Check if alsa and dbus is needed
|
||||
# Check if alsa is needed
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
NEEDS_LIB_ALSA=true
|
||||
NEEDS_LIB_DBUS=true
|
||||
else
|
||||
NEEDS_LIB_ALSA=false
|
||||
NEEDS_LIB_DBUS=false
|
||||
fi
|
||||
|
||||
# Check if ffi is needed
|
||||
@@ -105,13 +87,6 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
|
||||
else
|
||||
NEEDS_LIB_FFI=false
|
||||
fi
|
||||
|
||||
# Check if nvdacontrollerclient is needed
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows && test "x$ENABLE_HEADLESS_ONLY" != xtrue; then
|
||||
NEEDS_LIB_NVDACONTROLLERCLIENT=true
|
||||
else
|
||||
NEEDS_LIB_NVDACONTROLLERCLIENT=false
|
||||
fi
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -151,10 +126,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
LIB_SETUP_LIBFFI
|
||||
LIB_SETUP_MISC_LIBS
|
||||
LIB_SETUP_X11
|
||||
LIB_SETUP_SPEECHD
|
||||
LIB_SETUP_NVDACONTROLLERCLIENT
|
||||
LIB_SETUP_DBUS
|
||||
LIB_SETUP_WAYLAND
|
||||
|
||||
LIB_TESTS_SETUP_GTEST
|
||||
|
||||
# Math library
|
||||
|
||||
@@ -466,33 +466,6 @@ UBSAN_LDFLAGS := @UBSAN_LDFLAGS@
|
||||
X_CFLAGS := @X_CFLAGS@
|
||||
X_LIBS := @X_LIBS@
|
||||
|
||||
# Necessary additional compiler flags to compile dbus
|
||||
DBUS_CFLAGS := @DBUS_CFLAGS@
|
||||
DBUS_FOUND := @DBUS_FOUND@
|
||||
|
||||
# Linux speechd a11y announcer
|
||||
A11Y_SPEECHD_ANNOUNCING_ENABLED:=@A11Y_SPEECHD_ANNOUNCING_ENABLED@
|
||||
SPEECHD_CFLAGS:=@SPEECHD_CFLAGS@
|
||||
SPEECHD_LIBS:=@SPEECHD_LIBS@
|
||||
|
||||
# Windows NVDA a11y announcer
|
||||
A11Y_NVDA_ANNOUNCING_ENABLED:=@A11Y_NVDA_ANNOUNCING_ENABLED@
|
||||
NVDACONTROLLERCLIENT_CFLAGS:=@NVDACONTROLLERCLIENT_CFLAGS@
|
||||
NVDACONTROLLERCLIENT_DLL:=@NVDACONTROLLERCLIENT_DLL@
|
||||
NVDACONTROLLERCLIENT_LIB:=@NVDACONTROLLERCLIENT_LIB@
|
||||
|
||||
# Windows the client for the JAWS screen reader
|
||||
A11Y_JAWS_ANNOUNCING_ENABLED:=@A11Y_JAWS_ANNOUNCING_ENABLED@
|
||||
|
||||
WAYLAND_CFLAGS:=@WAYLAND_CFLAGS@
|
||||
WAYLAND_LIBS:=@WAYLAND_LIBS@
|
||||
WAYLAND_PROTOCOLS_ROOT:=@WAYLAND_PROTOCOLS_ROOT@
|
||||
WAYLAND_SCANNER:=@WAYLAND_SCANNER@
|
||||
GTK_SHELL1_PROTOCOL_PATH:=@GTK_SHELL1_PROTOCOL_PATH@
|
||||
VULKAN_FLAGS:=@VULKAN_FLAGS@
|
||||
VULKAN_SHADER_COMPILER:=@VULKAN_SHADER_COMPILER@
|
||||
VULKAN_ENABLED:=@VULKAN_ENABLED@
|
||||
|
||||
# The lowest required version of macosx
|
||||
MACOSX_VERSION_MIN := @MACOSX_VERSION_MIN@
|
||||
# The highest allowed version of macosx
|
||||
|
||||
@@ -62,10 +62,11 @@ $(foreach root, $(JTREG_TESTROOTS), \
|
||||
# Cache the expensive to calculate test names in a generated makefile.
|
||||
FIND_TESTS_CACHE_FILE := $(MAKESUPPORT_OUTPUTDIR)/find-tests.gmk
|
||||
|
||||
# If this file is deemed outdated, it will automatically get regenerated
|
||||
# by this rule before being included below.
|
||||
$(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES) \
|
||||
$(TOPDIR)/test/make/TestMake.gmk
|
||||
ifeq ($(GENERATE_FIND_TESTS_FILE), true)
|
||||
# If this file is deemed outdated, it will automatically get regenerated
|
||||
# by this rule before being included below.
|
||||
$(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES) \
|
||||
$(TOPDIR)/test/make/TestMake.gmk
|
||||
$(call MakeTargetDir)
|
||||
( $(foreach root, $(JTREG_TESTROOTS), \
|
||||
$(PRINTF) "\n$(root)_JTREG_TEST_GROUPS := " ; \
|
||||
@@ -78,6 +79,7 @@ $(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES) \
|
||||
$(MAKE) -s --no-print-directory $(MAKE_ARGS) \
|
||||
SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \
|
||||
TARGETS_FILE=$@
|
||||
endif
|
||||
|
||||
-include $(FIND_TESTS_CACHE_FILE)
|
||||
|
||||
|
||||
@@ -167,7 +167,6 @@ endef
|
||||
# CREATE_API_DIGEST Set to true to use a javac plugin to generate a public API
|
||||
# hash which can be used for down stream dependencies to only rebuild
|
||||
# when the API changes.
|
||||
# PROCESS_JBR_API Set to true to use an annotation processor to generate JBR API bindings.
|
||||
# KEEP_ALL_TRANSLATIONS Set to true to skip translation filtering
|
||||
SetupJavaCompilation = $(NamedParamsMacroTemplate)
|
||||
define SetupJavaCompilationBody
|
||||
@@ -291,20 +290,11 @@ define SetupJavaCompilationBody
|
||||
"-XDLOG_LEVEL=$(LOG_LEVEL)" \
|
||||
#
|
||||
|
||||
$1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/plugins/_the.COMPILE_DEPEND_batch
|
||||
endif
|
||||
|
||||
ifeq ($$($1_PROCESS_JBR_API), true)
|
||||
# Automatic path conversion doesn't work for two arguments, so call fixpath manually
|
||||
$1_JBR_API_FLAGS := -Xplugin:"jbr-api $$(call FixPath, $$($1_BIN)/java.base/META-INF/jbrapi.registry) $$(call FixPath, $(TOPDIR)/jb/jbr-api.version)"
|
||||
$1_EXTRA_DEPS := $$($1_EXTRA_DEPS) $$(BUILDTOOLS_OUTPUTDIR)/plugins/_the.COMPILE_JBR_API_PLUGIN_batch
|
||||
endif
|
||||
|
||||
ifeq ($$(call Or, $$($1_CREATE_API_DIGEST) $$($1_PROCESS_JBR_API)), true)
|
||||
$1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch
|
||||
# including the compilation output on the classpath, so that incremental
|
||||
# compilations in unnamed module can refer to other classes from the same
|
||||
# source root, which are not being recompiled in this compilation:
|
||||
$1_AUGMENTED_CLASSPATH += $$(BUILDTOOLS_OUTPUTDIR)/plugins $$($1_BIN)
|
||||
$1_AUGMENTED_CLASSPATH += $$(BUILDTOOLS_OUTPUTDIR)/depend $$($1_BIN)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_AUGMENTED_CLASSPATH), )
|
||||
@@ -500,7 +490,7 @@ define SetupJavaCompilationBody
|
||||
$$(call MakeDir, $$(@D))
|
||||
$$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \
|
||||
$$($1_JAVAC_CMD) $$($1_FLAGS) \
|
||||
$$($1_API_DIGEST_FLAGS) $$($1_JBR_API_FLAGS) \
|
||||
$$($1_API_DIGEST_FLAGS) \
|
||||
-XDmodifiedInputs=$$($1_MODFILELIST_FIXED) \
|
||||
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_FILELIST)) && \
|
||||
$(TOUCH) $$@
|
||||
|
||||
@@ -172,8 +172,9 @@ MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
|
||||
|
||||
MODULE_INFOS := $(call FindAllModuleInfos, *)
|
||||
|
||||
$(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
|
||||
$(call DependOnVariable, MODULE_INFOS, $(MAKESUPPORT_OUTPUTDIR)/MODULE_INFOS.vardeps)
|
||||
ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
|
||||
$(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
|
||||
$(call DependOnVariable, MODULE_INFOS, $(MAKESUPPORT_OUTPUTDIR)/MODULE_INFOS.vardeps)
|
||||
$(call MakeTargetDir)
|
||||
$(RM) $@
|
||||
$(foreach m, $(MODULE_INFOS), \
|
||||
@@ -206,6 +207,7 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
|
||||
printf(" %s", $$0) } \
|
||||
END { printf("\n") }' $m \
|
||||
) >> $@ $(NEWLINE))
|
||||
endif
|
||||
|
||||
-include $(MODULE_DEPS_MAKEFILE)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -125,7 +125,9 @@ else ifeq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, aarch64)),
|
||||
endif
|
||||
endif
|
||||
|
||||
JVM_PRECOMPILED_HEADER := $(TOPDIR)/src/hotspot/share/precompiled/precompiled.hpp
|
||||
ifeq ($(call isTargetOs, linux macosx windows), true)
|
||||
JVM_PRECOMPILED_HEADER := $(TOPDIR)/src/hotspot/share/precompiled/precompiled.hpp
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetCpu, x86), true)
|
||||
JVM_EXCLUDE_PATTERNS += x86_64
|
||||
|
||||
@@ -118,7 +118,11 @@ else ifeq ($(call isTargetOs, macosx), true)
|
||||
endif
|
||||
|
||||
else ifeq ($(call isTargetOs, aix), true)
|
||||
BUILD_LIBJVM_synchronizer.cpp_CXXFLAGS := -fno-inline
|
||||
ifeq ($(TOOLCHAIN_TYPE), clang)
|
||||
BUILD_LIBJVM_synchronizer.cpp_CXXFLAGS := -fno-inline
|
||||
else
|
||||
BUILD_LIBJVM_synchronizer.cpp_CXXFLAGS := -qnoinline
|
||||
endif
|
||||
BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE)
|
||||
# Disable aggressive optimizations for functions in sharedRuntimeTrig.cpp
|
||||
# and sharedRuntimeTrans.cpp on ppc64.
|
||||
@@ -142,13 +146,6 @@ else ifeq ($(call isTargetOs, aix), true)
|
||||
# Disable ELF decoder on AIX (AIX uses XCOFF).
|
||||
JVM_EXCLUDE_PATTERNS += elf
|
||||
|
||||
JVM_PRECOMPILED_HEADER_EXCLUDE := \
|
||||
sharedRuntimeTrig.cpp \
|
||||
sharedRuntimeTrans.cpp \
|
||||
synchronizer.cpp \
|
||||
$(OPT_SPEED_SRC) \
|
||||
#
|
||||
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
JVM_PRECOMPILED_HEADER_EXCLUDE := \
|
||||
bytecodeInterpreter.cpp \
|
||||
|
||||
@@ -42,22 +42,15 @@ endif
|
||||
OUT := $(IDEA_OUTPUT)/env.cfg
|
||||
|
||||
idea:
|
||||
$(ECHO) "MODULES=\"$(foreach mod, $(MODULES), \
|
||||
module='$(mod)' \
|
||||
moduleSrcDirs='$(foreach m,$(call FindModuleSrcDirs,$(mod)),$(call RelativePath,$m,$(topdir)))' \
|
||||
moduleDependencies='$(call FindTransitiveDepsForModule,$(mod))' \
|
||||
#)\"" > $(OUT)
|
||||
$(RM) $(OUT)
|
||||
$(ECHO) "SUPPORT=$(SUPPORT_OUTPUTDIR)" >> $(OUT)
|
||||
$(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(MODULES), $(call FindModuleSrcDirs, $(mod)))\"" >> $(OUT)
|
||||
$(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(MODULES), $(mod)))\"" >> $(OUT)
|
||||
$(ECHO) "RELATIVE_TOPLEVEL_PROJECT_DIR=\"$(call RelativePath,$(TOPLEVEL_DIR),$(IDEA_OUTPUT_PARENT))\"" >> $(OUT)
|
||||
$(ECHO) "RELATIVE_PROJECT_DIR=\"$(call RelativePath,$(TOPLEVEL_DIR),$(IDEA_OUTPUT_PARENT))\"" >> $(OUT)
|
||||
# $(ECHO) "RELATIVE_PROJECT_DIR=\"$(call RelativePath,$(topdir),$(IDEA_OUTPUT_PARENT))\"" >> $(OUT)
|
||||
$(ECHO) "RELATIVE_BUILD_DIR=\"$(call RelativePath,$(OUTPUTDIR),$(IDEA_OUTPUT_PARENT))\"" >> $(OUT)
|
||||
$(ECHO) "CLION_RELATIVE_PROJECT_DIR=\"$(call RelativePath,$(topdir),$(IDEA_OUTPUT_PARENT)/.idea/jdk-clion)\"" >> $(OUT)
|
||||
$(ECHO) "PATHTOOL=\"$(PATHTOOL)\"" >> $(OUT)
|
||||
$(ECHO) "SEL_MODULES=\"$(MODULES)\"" >> $(OUT)
|
||||
$(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT)
|
||||
$(ECHO) "CYGPATH=\"$(PATHTOOL)\"" >> $(OUT)
|
||||
$(ECHO) "SPEC=\"$(SPEC)\"" >> $(OUT)
|
||||
$(ECHO) "JT_HOME=\"$(JT_HOME)\"" >> $(OUT)
|
||||
$(ECHO) "WINENV_ROOT=\"$(WINENV_ROOT)\"" >> $(OUT)
|
||||
|
||||
all: idea
|
||||
|
||||
|
||||
42
make/ide/idea/jdk/build.xml
Normal file
42
make/ide/idea/jdk/build.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- importing.xml -->
|
||||
<project name="jdk">
|
||||
|
||||
<taskdef name="wrapLogger" classname="idea.IdeaLoggerWrapper" classpath="${idea.dir}/classes"/>
|
||||
|
||||
<wrapLogger/>
|
||||
|
||||
<macrodef name="call-make">
|
||||
<attribute name="dir"/>
|
||||
<attribute name="args"/>
|
||||
<sequential>
|
||||
<exec executable="make" dir="@{dir}" failonerror="true">
|
||||
<arg line="@{args}"/>
|
||||
<env key="CLASSPATH" value = ""/>
|
||||
</exec>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<target name="cond-clean" unless="${intellij.ismake}">
|
||||
<antcall target="clean"/>
|
||||
</target>
|
||||
|
||||
<target name="post-make" depends="cond-clean, build-module"/>
|
||||
|
||||
<!--
|
||||
**** Global JDK Build Targets
|
||||
-->
|
||||
|
||||
<target name="clean">
|
||||
<echo message="base = ${basedir}"/>
|
||||
<call-make dir = "${build.target.dir}" args = "reconfigure"/>
|
||||
<call-make dir = "${build.target.dir}" args = "clean"/>
|
||||
</target>
|
||||
|
||||
<target name="images">
|
||||
<call-make dir = "${build.target.dir}" args = "images"/>
|
||||
</target>
|
||||
|
||||
<target name="build-module">
|
||||
<call-make dir = "${build.target.dir}" args = "${module.name}"/>
|
||||
</target>
|
||||
</project>
|
||||
14
make/ide/idea/jdk/template/ant.xml
Normal file
14
make/ide/idea/jdk/template/ant.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AntConfiguration">
|
||||
<buildFile url="file://###ROOT_DIR###/make/ide/idea/jdk/build.xml">
|
||||
<properties>
|
||||
<property name="intellij.ismake" value="$IsMake$" />
|
||||
<property name="build.target.dir" value="###BUILD_DIR###" />
|
||||
<property name="module.name" value="###MODULE_NAMES###" />
|
||||
<property name="idea.dir" value="###IDEA_DIR###" />
|
||||
</properties>
|
||||
<executeOn event="afterCompilation" target="post-make" />
|
||||
</buildFile>
|
||||
</component>
|
||||
</project>
|
||||
@@ -3,10 +3,10 @@
|
||||
<component name="CompilerConfiguration">
|
||||
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||
<excludeFromCompile>
|
||||
<directory url="file://###PROJECT_DIR###/src" includeSubdirectories="true" />
|
||||
<directory url="file://###PROJECT_DIR###/build" includeSubdirectories="true" />
|
||||
<directory url="file://###PROJECT_DIR###/make" includeSubdirectories="true" />
|
||||
<directory url="file://###PROJECT_DIR###/test" includeSubdirectories="false" />
|
||||
<directory url="file://###ROOT_DIR###/src" includeSubdirectories="true" />
|
||||
<directory url="file://###ROOT_DIR###/build" includeSubdirectories="true" />
|
||||
<directory url="file://###ROOT_DIR###/make" includeSubdirectories="true" />
|
||||
<directory url="file://###ROOT_DIR###/test" includeSubdirectories="true" />
|
||||
</excludeFromCompile>
|
||||
<resourceExtensions />
|
||||
<wildcardResourcePatterns>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<component name="CopyrightManager">
|
||||
<copyright>
|
||||
<option name="notice" value="Copyright &#36;originalComment.match("Copyright (\d+)", 1, "-")&#36;today.year JetBrains s.r.o. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (a copy is included in the LICENSE file that accompanied this code). You should have received a copy of the GNU General Public License version 2 along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions." />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="allowReplaceKeyword" value="JetBrains" />
|
||||
<option name="myName" value="JetBrains" />
|
||||
<option name="myLocal" value="true" />
|
||||
</copyright>
|
||||
</component>
|
||||
@@ -1,7 +0,0 @@
|
||||
<component name="CopyrightManager">
|
||||
<copyright>
|
||||
<option name="allowReplaceRegexp" value="JetBrains" />
|
||||
<option name="notice" value="Copyright &#36;originalComment.match("Copyright (\d+)", 1, "-")&#36;today.year JetBrains s.r.o. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation. Oracle designates this particular file as subject to the "Classpath" exception as provided by Oracle in the LICENSE file that accompanied this code. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (a copy is included in the LICENSE file that accompanied this code). You should have received a copy of the GNU General Public License version 2 along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions." />
|
||||
<option name="myName" value="JetBrainsCE" />
|
||||
</copyright>
|
||||
</component>
|
||||
@@ -1,7 +1,3 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings default="JetBrainsCE">
|
||||
<module2copyright>
|
||||
<element module="TestFiles" copyright="JetBrains" />
|
||||
</module2copyright>
|
||||
</settings>
|
||||
</component>
|
||||
<settings default="" />
|
||||
</component>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<component name="CopyrightManager">
|
||||
<copyright>
|
||||
<option name="notice" value="Copyright &#36;originalComment.match("Copyright (\d+)", 1, "-")&#36;today.year JetBrains s.r.o. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (a copy is included in the LICENSE file that accompanied this code). You should have received a copy of the GNU General Public License version 2 along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions." />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="allowReplaceKeyword" value="JetBrains" />
|
||||
<option name="myName" value="JetBrains" />
|
||||
<option name="myLocal" value="true" />
|
||||
</copyright>
|
||||
</component>
|
||||
@@ -1,7 +0,0 @@
|
||||
<component name="CopyrightManager">
|
||||
<copyright>
|
||||
<option name="allowReplaceRegexp" value="JetBrains" />
|
||||
<option name="notice" value="Copyright &#36;originalComment.match("Copyright (\d+)", 1, "-")&#36;today.year JetBrains s.r.o. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation. Oracle designates this particular file as subject to the "Classpath" exception as provided by Oracle in the LICENSE file that accompanied this code. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (a copy is included in the LICENSE file that accompanied this code). You should have received a copy of the GNU General Public License version 2 along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions." />
|
||||
<option name="myName" value="JetBrainsCE" />
|
||||
</copyright>
|
||||
</component>
|
||||
@@ -1,7 +0,0 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings default="JetBrainsCE">
|
||||
<module2copyright>
|
||||
<element module="TestFiles" copyright="JetBrains" />
|
||||
</module2copyright>
|
||||
</settings>
|
||||
</component>
|
||||
25
make/ide/idea/jdk/template/jdk-clion/.idea/misc.xml
generated
25
make/ide/idea/jdk/template/jdk-clion/.idea/misc.xml
generated
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CidrRootsConfiguration">
|
||||
<excludeRoots>
|
||||
<file path="###CLION_PROJECT_DIR###/build" />
|
||||
<file path="###CLION_PROJECT_DIR###/make" />
|
||||
</excludeRoots>
|
||||
</component>
|
||||
<component name="CompDBSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<CompDBProjectSettings>
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</CompDBProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
<component name="CompDBWorkspace" PROJECT_DIR="$PROJECT_DIR$">
|
||||
<contentRoot DIR="###CLION_PROJECT_DIR###" />
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
</project>
|
||||
@@ -1,3 +0,0 @@
|
||||
<component name="DependencyValidationManager">
|
||||
<scope name="TestFiles" pattern="file[test]:*/" />
|
||||
</component>
|
||||
@@ -1,5 +0,0 @@
|
||||
<component name="DependencyValidationManager">
|
||||
<state>
|
||||
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
||||
</state>
|
||||
</component>
|
||||
16
make/ide/idea/jdk/template/jdk-clion/.idea/vcs.xml
generated
16
make/ide/idea/jdk/template/jdk-clion/.idea/vcs.xml
generated
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="IssueNavigationConfiguration">
|
||||
<option name="links">
|
||||
<list>
|
||||
<IssueNavigationLink>
|
||||
<option name="issueRegexp" value="(?:^|\s|\p{Punct})(?:JDK-)?(\d{7})(?=$|\s|\p{Punct})" />
|
||||
<option name="linkRegexp" value="https://bugs.openjdk.java.net/browse/JDK-$1" />
|
||||
</IssueNavigationLink>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="###CLION_PROJECT_DIR###" vcs="###VCS_TYPE###" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ClangdSettings">
|
||||
<option name="formatViaClangd" value="false" />
|
||||
</component>
|
||||
<component name="CompDBLocalSettings">
|
||||
<option name="availableProjects">
|
||||
<map>
|
||||
<entry>
|
||||
<key>
|
||||
<ExternalProjectPojo>
|
||||
<option name="name" value="jdk-clion" />
|
||||
<option name="path" value="$PROJECT_DIR$" />
|
||||
</ExternalProjectPojo>
|
||||
</key>
|
||||
<value>
|
||||
<list>
|
||||
<ExternalProjectPojo>
|
||||
<option name="name" value="jdk-clion" />
|
||||
<option name="path" value="$PROJECT_DIR$" />
|
||||
</ExternalProjectPojo>
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
<option name="projectSyncType">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="RE_IMPORT" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ExternalProjectsData">
|
||||
<projectState path="$PROJECT_DIR$">
|
||||
<ProjectState />
|
||||
</projectState>
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="RunOnceActivity.cidr.known.project.marker" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="cf.first.check.clang-format" value="false" />
|
||||
<property name="cidr.known.project.marker" value="true" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
<property name="settings.editor.selected.configurable" value="CPPToolchains" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
TOPDIR="###CLION_SCRIPT_TOPDIR###"
|
||||
BUILD_DIR="###RELATIVE_BUILD_DIR###"
|
||||
PATHTOOL="###PATHTOOL###"
|
||||
|
||||
|
||||
|
||||
cd "`dirname $0`"
|
||||
SCRIPT_DIR="`pwd`"
|
||||
cd "$TOPDIR"
|
||||
|
||||
echo "Updating Clion project files in \"$SCRIPT_DIR\" for project \"`pwd`\""
|
||||
|
||||
set -o pipefail
|
||||
make compile-commands SPEC="$BUILD_DIR/spec.gmk" | sed 's/^/ /' || exit 1
|
||||
|
||||
if [ "x$PATHTOOL" != "x" ]; then
|
||||
CLION_PROJECT_DIR="`$PATHTOOL -am $SCRIPT_DIR`"
|
||||
sed "s/\\\\\\\\\\\\\\\\/\\\\\\\\/g" "$BUILD_DIR/compile_commands.json" > "$SCRIPT_DIR/compile_commands.json"
|
||||
else
|
||||
CLION_PROJECT_DIR="$SCRIPT_DIR"
|
||||
cp "$BUILD_DIR/compile_commands.json" "$SCRIPT_DIR"
|
||||
fi
|
||||
|
||||
echo "
|
||||
Now you can open \"$CLION_PROJECT_DIR\" as Clion project
|
||||
If Clion complains about missing files when loading a project, building it may help:
|
||||
cd \"`pwd`\" && make SPEC=\"$BUILD_DIR/spec.gmk\""
|
||||
@@ -2,9 +2,10 @@
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://###TOPLEVEL_MODULE_DIR###">
|
||||
<excludeFolder url="file://###MODULE_DIR###/build" />
|
||||
<excludeFolder url="file://###MODULE_DIR###/make" />
|
||||
<content url="file://###ROOT_DIR###">
|
||||
###SOURCE_ROOTS###
|
||||
<excludeFolder url="file://###ROOT_DIR###/build" />
|
||||
<excludeFolder url="file://###ROOT_DIR###/make" />
|
||||
</content>
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
|
||||
@@ -6,8 +6,11 @@
|
||||
<component name="JTRegService">
|
||||
<path>###JTREG_HOME###</path>
|
||||
<workDir>###BUILD_DIR###</workDir>
|
||||
<jre alt="true" value="###BUILD_DIR###/images/jdk" />
|
||||
<jre alt="true" value="###IMAGES_DIR###" />
|
||||
<options></options>
|
||||
<ant>
|
||||
<target file="file://###ROOT_DIR###/make/ide/idea/jdk/build.xml" name="images" />
|
||||
</ant>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" assert-keyword="true" project-jdk-type="JavaSDK">
|
||||
<output url="file://###BUILD_DIR###/idea" />
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
###MODULE_CONTENT_ROOTS###
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
###DEPENDENCIES###
|
||||
<orderEntry type="inheritedJdk" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/jdk.iml" filepath="$PROJECT_DIR$/.idea/jdk.iml" />
|
||||
###MODULE_IMLS###
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/test.iml" filepath="$PROJECT_DIR$/.idea/test.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<component name="DependencyValidationManager">
|
||||
<scope name="TestFiles" pattern="file[test]:*/" />
|
||||
</component>
|
||||
13
make/ide/idea/jdk/template/src/idea/IdeaLoggerWrapper.java
Normal file
13
make/ide/idea/jdk/template/src/idea/IdeaLoggerWrapper.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package idea;
|
||||
|
||||
import org.apache.tools.ant.Task;
|
||||
|
||||
/**
|
||||
* This class implements a custom Ant task which replaces the standard Intellij IDEA Ant logger
|
||||
* with a custom one which generates tighter output.
|
||||
*/
|
||||
public class IdeaLoggerWrapper extends Task {
|
||||
public void execute() {
|
||||
new JdkIdeaAntLogger(getProject());
|
||||
}
|
||||
}
|
||||
375
make/ide/idea/jdk/template/src/idea/JdkIdeaAntLogger.java
Normal file
375
make/ide/idea/jdk/template/src/idea/JdkIdeaAntLogger.java
Normal file
@@ -0,0 +1,375 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package idea;
|
||||
|
||||
import org.apache.tools.ant.BuildEvent;
|
||||
import org.apache.tools.ant.BuildListener;
|
||||
import org.apache.tools.ant.DefaultLogger;
|
||||
import org.apache.tools.ant.Project;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Stack;
|
||||
|
||||
import static org.apache.tools.ant.Project.*;
|
||||
|
||||
/**
|
||||
* This class is used to wrap the IntelliJ ant logger in order to provide more meaningful
|
||||
* output when building langtools. The basic ant output in IntelliJ can be quite cumbersome to
|
||||
* work with, as it provides two separate views: (i) a tree view, which is good to display build task
|
||||
* in a hierarchical fashion as they are processed; and a (ii) plain text view, which gives you
|
||||
* the full ant output. The main problem is that javac-related messages are buried into the
|
||||
* ant output (which is made very verbose by IntelliJ in order to support the tree view). It is
|
||||
* not easy to figure out which node to expand in order to see the error message; switching
|
||||
* to plain text doesn't help either, as now the output is totally flat.
|
||||
*
|
||||
* This logger class removes a lot of verbosity from the IntelliJ ant logger by not propagating
|
||||
* all the events to the IntelliJ's logger. In addition, certain events are handled in a custom
|
||||
* fashion, to generate better output during the build.
|
||||
*/
|
||||
public final class JdkIdeaAntLogger extends DefaultLogger {
|
||||
|
||||
/**
|
||||
* This is just a way to pass in customized binary string predicates;
|
||||
*
|
||||
* TODO: replace with {@code BiPredicate<String, String>} and method reference when moving to 8
|
||||
*/
|
||||
enum StringBinaryPredicate {
|
||||
CONTAINS() {
|
||||
@Override
|
||||
boolean apply(String s1, String s2) {
|
||||
return s1.contains(s2);
|
||||
}
|
||||
},
|
||||
STARTS_WITH {
|
||||
@Override
|
||||
boolean apply(String s1, String s2) {
|
||||
return s1.startsWith(s2);
|
||||
}
|
||||
},
|
||||
MATCHES {
|
||||
@Override
|
||||
boolean apply(String s1, String s2) {
|
||||
return s1.matches(s2);
|
||||
}
|
||||
};
|
||||
|
||||
abstract boolean apply(String s1, String s2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Various kinds of ant messages that we shall intercept
|
||||
*/
|
||||
enum MessageKind {
|
||||
|
||||
/** a make error */
|
||||
MAKE_ERROR(StringBinaryPredicate.CONTAINS, MSG_ERR, "error:", "compiler.err"),
|
||||
/** a make warning */
|
||||
MAKE_WARNING(StringBinaryPredicate.CONTAINS, MSG_WARN, "warning:", "compiler.warn"),
|
||||
/** a make note */
|
||||
MAKE_NOTE(StringBinaryPredicate.CONTAINS, MSG_INFO, "note:", "compiler.note"),
|
||||
/** std make output */
|
||||
MAKE_OTHER(StringBinaryPredicate.MATCHES, MSG_INFO, ".*"),
|
||||
/** a javac crash */
|
||||
JAVAC_CRASH(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "An exception has occurred in the compiler"),
|
||||
/** jtreg test success */
|
||||
JTREG_TEST_PASSED(StringBinaryPredicate.STARTS_WITH, MSG_INFO, "Passed: "),
|
||||
/** jtreg test failure */
|
||||
JTREG_TEST_FAILED(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "FAILED: "),
|
||||
/** jtreg test error */
|
||||
JTREG_TEST_ERROR(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "Error: "),
|
||||
/** jtreg report */
|
||||
JTREG_TEST_REPORT(StringBinaryPredicate.STARTS_WITH, MSG_INFO, "Report written");
|
||||
|
||||
StringBinaryPredicate sbp;
|
||||
int priority;
|
||||
String[] keys;
|
||||
|
||||
MessageKind(StringBinaryPredicate sbp, int priority, String... keys) {
|
||||
this.sbp = sbp;
|
||||
this.priority = priority;
|
||||
this.keys = keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does a given message string matches this kind?
|
||||
*/
|
||||
boolean matches(String s) {
|
||||
for (String key : keys) {
|
||||
if (sbp.apply(s, key)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This enum is used to represent the list of tasks we need to keep track of during logging.
|
||||
*/
|
||||
enum Task {
|
||||
/** javac task - invoked during compilation */
|
||||
MAKE("exec", MessageKind.MAKE_ERROR, MessageKind.MAKE_WARNING, MessageKind.MAKE_NOTE,
|
||||
MessageKind.MAKE_OTHER, MessageKind.JAVAC_CRASH),
|
||||
/** jtreg task - invoked during test execution */
|
||||
JTREG("jtreg", MessageKind.JTREG_TEST_PASSED, MessageKind.JTREG_TEST_FAILED, MessageKind.JTREG_TEST_ERROR, MessageKind.JTREG_TEST_REPORT),
|
||||
/** initial synthetic task when the logger is created */
|
||||
ROOT("") {
|
||||
@Override
|
||||
boolean matches(String s) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
/** synthetic task catching any other tasks not in this list */
|
||||
ANY("") {
|
||||
@Override
|
||||
boolean matches(String s) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
String taskName;
|
||||
MessageKind[] msgs;
|
||||
|
||||
Task(String taskName, MessageKind... msgs) {
|
||||
this.taskName = taskName;
|
||||
this.msgs = msgs;
|
||||
}
|
||||
|
||||
boolean matches(String s) {
|
||||
return s.equals(taskName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This enum is used to represent the list of targets we need to keep track of during logging.
|
||||
* A regular expression is used to match a given target name.
|
||||
*/
|
||||
enum Target {
|
||||
/** jtreg target - executed when launching tests */
|
||||
JTREG("jtreg") {
|
||||
@Override
|
||||
String getDisplayMessage(BuildEvent e) {
|
||||
return "Running jtreg tests: " + e.getProject().getProperty("jtreg.tests");
|
||||
}
|
||||
},
|
||||
/** build selected modules */
|
||||
BUILD_MODULE("build-module") {
|
||||
@Override
|
||||
String getDisplayMessage(BuildEvent e) {
|
||||
return "Building modules: " + e.getProject().getProperty("module.name") + "...";
|
||||
}
|
||||
},
|
||||
/** build images */
|
||||
BUILD_IMAGES("images") {
|
||||
@Override
|
||||
String getDisplayMessage(BuildEvent e) {
|
||||
return "Building images...";
|
||||
}
|
||||
},
|
||||
/** build images */
|
||||
CONFIGURE("-do-configure") {
|
||||
@Override
|
||||
String getDisplayMessage(BuildEvent e) {
|
||||
return "Configuring build...";
|
||||
}
|
||||
},
|
||||
/** synthetic target catching any other target not in this list */
|
||||
ANY("") {
|
||||
@Override
|
||||
String getDisplayMessage(BuildEvent e) {
|
||||
return "Executing Ant target(s): " + e.getProject().getProperty("ant.project.invoked-targets");
|
||||
}
|
||||
@Override
|
||||
boolean matches(String msg) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
String targetRegex;
|
||||
|
||||
Target(String targetRegex) {
|
||||
this.targetRegex = targetRegex;
|
||||
}
|
||||
|
||||
boolean matches(String msg) {
|
||||
return msg.matches(targetRegex);
|
||||
}
|
||||
|
||||
abstract String getDisplayMessage(BuildEvent e);
|
||||
}
|
||||
|
||||
/**
|
||||
* A custom build event used to represent status changes which should be notified inside
|
||||
* Intellij
|
||||
*/
|
||||
static class StatusEvent extends BuildEvent {
|
||||
|
||||
/** the target to which the status update refers */
|
||||
Target target;
|
||||
|
||||
StatusEvent(BuildEvent e, Target target) {
|
||||
super(new StatusTask(e, target.getDisplayMessage(e)));
|
||||
this.target = target;
|
||||
setMessage(getTask().getTaskName(), 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* A custom task used to channel info regarding a status change
|
||||
*/
|
||||
static class StatusTask extends org.apache.tools.ant.Task {
|
||||
StatusTask(BuildEvent event, String msg) {
|
||||
setProject(event.getProject());
|
||||
setOwningTarget(event.getTarget());
|
||||
setTaskName(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** wrapped ant logger (IntelliJ's own logger) */
|
||||
DefaultLogger logger;
|
||||
|
||||
/** flag - is this the first target we encounter? */
|
||||
boolean firstTarget = true;
|
||||
|
||||
/** flag - should subsequent failures be suppressed ? */
|
||||
boolean suppressTaskFailures = false;
|
||||
|
||||
/** flag - have we ran into a javac crash ? */
|
||||
boolean crashFound = false;
|
||||
|
||||
/** stack of status changes associated with pending targets */
|
||||
Stack<StatusEvent> statusEvents = new Stack<>();
|
||||
|
||||
/** stack of pending tasks */
|
||||
Stack<Task> tasks = new Stack<>();
|
||||
|
||||
public JdkIdeaAntLogger(Project project) {
|
||||
for (Object o : project.getBuildListeners()) {
|
||||
if (o instanceof DefaultLogger) {
|
||||
this.logger = (DefaultLogger)o;
|
||||
project.removeBuildListener((BuildListener)o);
|
||||
project.addBuildListener(this);
|
||||
}
|
||||
}
|
||||
tasks.push(Task.ROOT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildStarted(BuildEvent event) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildFinished(BuildEvent event) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void targetStarted(BuildEvent event) {
|
||||
EnumSet<Target> statusKinds = firstTarget ?
|
||||
EnumSet.allOf(Target.class) :
|
||||
EnumSet.complementOf(EnumSet.of(Target.ANY));
|
||||
|
||||
String targetName = event.getTarget().getName();
|
||||
|
||||
for (Target statusKind : statusKinds) {
|
||||
if (statusKind.matches(targetName)) {
|
||||
StatusEvent statusEvent = new StatusEvent(event, statusKind);
|
||||
statusEvents.push(statusEvent);
|
||||
logger.taskStarted(statusEvent);
|
||||
firstTarget = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void targetFinished(BuildEvent event) {
|
||||
if (!statusEvents.isEmpty()) {
|
||||
StatusEvent lastEvent = statusEvents.pop();
|
||||
if (lastEvent.target.matches(event.getTarget().getName())) {
|
||||
logger.taskFinished(lastEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskStarted(BuildEvent event) {
|
||||
String taskName = event.getTask().getTaskName();
|
||||
System.err.println("task started " + taskName);
|
||||
for (Task task : Task.values()) {
|
||||
if (task.matches(taskName)) {
|
||||
tasks.push(task);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskFinished(BuildEvent event) {
|
||||
if (tasks.peek() == Task.ROOT) {
|
||||
//we need to 'close' the root task to get nicer output
|
||||
logger.taskFinished(event);
|
||||
} else if (!suppressTaskFailures && event.getException() != null) {
|
||||
//the first (innermost) task failure should always be logged
|
||||
event.setMessage(event.getException().toString(), 0);
|
||||
event.setException(null);
|
||||
//note: we turn this into a plain message to avoid stack trace being logged by Idea
|
||||
logger.messageLogged(event);
|
||||
suppressTaskFailures = true;
|
||||
}
|
||||
tasks.pop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageLogged(BuildEvent event) {
|
||||
String msg = event.getMessage();
|
||||
|
||||
boolean processed = false;
|
||||
|
||||
if (!tasks.isEmpty()) {
|
||||
Task task = tasks.peek();
|
||||
for (MessageKind messageKind : task.msgs) {
|
||||
if (messageKind.matches(msg)) {
|
||||
event.setMessage(msg, messageKind.priority);
|
||||
processed = true;
|
||||
if (messageKind == MessageKind.JAVAC_CRASH) {
|
||||
crashFound = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getPriority() == MSG_ERR || crashFound) {
|
||||
//we log errors regardless of owning task
|
||||
logger.messageLogged(event);
|
||||
suppressTaskFailures = true;
|
||||
} else if (processed) {
|
||||
logger.messageLogged(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://###MODULE_DIR###/test/jdk"></content>
|
||||
<orderEntry type="sourceFolder" forTests="true" />
|
||||
###TEST_MODULE_DEPENDENCIES###
|
||||
<orderEntry type="inheritedJdk" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -4,13 +4,13 @@
|
||||
<option name="links">
|
||||
<list>
|
||||
<IssueNavigationLink>
|
||||
<option name="issueRegexp" value="(?:^|\s|\p{Punct})(?:JDK-)?(\d{7})(?=$|\s|\p{Punct})" />
|
||||
<option name="linkRegexp" value="https://bugs.openjdk.java.net/browse/JDK-$1" />
|
||||
<option name="issueRegexp" value="\d{7}" />
|
||||
<option name="linkRegexp" value="https://bugs.openjdk.org/browse/JDK-$0" />
|
||||
</IssueNavigationLink>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="###TOPLEVEL_PROJECT_DIR###" vcs="###VCS_TYPE###" />
|
||||
<mapping directory="###ROOT_DIR###" vcs="###VCS_TYPE###" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
@@ -2,62 +2,63 @@
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<ignored path="jdk.iws" />
|
||||
<ignored path="###PROJECT_DIR###/build/idea/out/" />
|
||||
<ignored path="###ROOT_DIR###/build/idea/out/" />
|
||||
<ignored path=".idea/" />
|
||||
</component>
|
||||
<component name="StructureViewFactory">
|
||||
<option name="ACTIVE_ACTIONS" value=",ALPHA_COMPARATOR" />
|
||||
</component>
|
||||
<component name="RunManager" selected="Shell Script.images">
|
||||
<configuration name="clean" type="ShConfigurationType" folderName="make">
|
||||
<option name="SCRIPT_TEXT" value="###BASH_RUNNER_PREFIX### make clean" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="###PROJECT_DIR###" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="images" type="ShConfigurationType" folderName="make">
|
||||
<option name="SCRIPT_TEXT" value="###BASH_RUNNER_PREFIX### make images" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="###PROJECT_DIR###" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="reconfigure" type="ShConfigurationType" folderName="make">
|
||||
<option name="SCRIPT_TEXT" value="###BASH_RUNNER_PREFIX### make reconfigure" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="###PROJECT_DIR###" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<list>
|
||||
<item itemvalue="Shell Script.images" />
|
||||
<item itemvalue="Shell Script.clean" />
|
||||
<item itemvalue="Shell Script.reconfigure" />
|
||||
</list>
|
||||
<component name="antWorkspaceConfiguration">
|
||||
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
|
||||
<option name="FILTER_TARGETS" value="false" />
|
||||
<buildFile url="file://###ROOT_DIR###/make/ide/idea/jdk/build.xml">
|
||||
<runInBackground value="false" />
|
||||
<targetFilters>
|
||||
<filter targetName="clean" isVisible="true" />
|
||||
<filter targetName="images" isVisible="true" />
|
||||
</targetFilters>
|
||||
<treeView value="false" />
|
||||
<expanded value="true" />
|
||||
</buildFile>
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="jdk" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="PackagesPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="jdk" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="jdk" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewModuleNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
</panes>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
@@ -1,451 +0,0 @@
|
||||
package build.tools.jbrapi;
|
||||
|
||||
import com.sun.source.tree.CompilationUnitTree;
|
||||
import com.sun.source.tree.Tree;
|
||||
import com.sun.source.util.*;
|
||||
|
||||
import javax.lang.model.element.*;
|
||||
import javax.lang.model.type.ArrayType;
|
||||
import javax.lang.model.type.DeclaredType;
|
||||
import javax.lang.model.type.ExecutableType;
|
||||
import javax.lang.model.type.TypeMirror;
|
||||
import javax.lang.model.util.ElementScanner14;
|
||||
import javax.lang.model.util.Elements;
|
||||
import javax.lang.model.util.Types;
|
||||
import javax.tools.Diagnostic;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.OverlappingFileLockException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.locks.LockSupport;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class JBRApiPlugin implements Plugin {
|
||||
|
||||
enum Binding {
|
||||
SERVICE,
|
||||
PROVIDES,
|
||||
PROVIDED,
|
||||
TWO_WAY
|
||||
}
|
||||
|
||||
record DiagnosticTree(CompilationUnitTree root, Tree tree) {}
|
||||
record TypeBinding(DiagnosticTree diagnostic, TypeElement element, String currentType, String bindType, Binding binding) {}
|
||||
record MethodBinding(DiagnosticTree diagnostic, ExecutableElement element, Registry.StaticDescriptor currentMethod, Registry.StaticMethod bindMethod) {}
|
||||
|
||||
final Map<String, TypeBinding> typeBindings = new HashMap<>();
|
||||
final List<MethodBinding> methodBindings = new ArrayList<>();
|
||||
Elements elements;
|
||||
Trees trees;
|
||||
Types types;
|
||||
|
||||
class Registry {
|
||||
|
||||
record Type(String type, Binding binding) {}
|
||||
record StaticMethod(String type, String name) {}
|
||||
record StaticDescriptor(StaticMethod method, String descriptor) {}
|
||||
|
||||
final Map<String, Type> types = new HashMap<>();
|
||||
final Map<StaticDescriptor, StaticMethod> methods = new HashMap<>();
|
||||
final Set<Object> internal = new HashSet<>();
|
||||
|
||||
void validateInternal(DiagnosticTree diagnostic, String currentType, Binding binding, TypeElement bindType) {
|
||||
if (bindType.getKind() != ElementKind.CLASS && bindType.getKind() != ElementKind.INTERFACE) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid JBR API binding:" + currentType + " -> " +
|
||||
bindType.getQualifiedName().toString() + " (not a class or interface)",
|
||||
diagnostic.tree, diagnostic.root);
|
||||
} else if (bindType.getModifiers().contains(Modifier.FINAL) || bindType.getModifiers().contains(Modifier.SEALED)) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid JBR API binding:" + currentType + " -> " +
|
||||
bindType.getQualifiedName().toString() + " (not inheritable)",
|
||||
diagnostic.tree, diagnostic.root);
|
||||
}
|
||||
if (binding != Binding.SERVICE) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid JBR API binding:" + currentType + " -> " +
|
||||
bindType.getQualifiedName().toString() + " (internal, non-service)",
|
||||
diagnostic.tree, diagnostic.root);
|
||||
}
|
||||
}
|
||||
|
||||
void validateInternalMethod(DiagnosticTree diagnostic, StaticDescriptor currentMethod, TypeElement bindType, String bindMethod) {
|
||||
boolean methodFound = false;
|
||||
for (Element m : bindType.getEnclosedElements()) {
|
||||
if (m.getKind() == ElementKind.METHOD &&
|
||||
!m.getModifiers().contains(Modifier.STATIC) &&
|
||||
!m.getModifiers().contains(Modifier.FINAL) &&
|
||||
m.getSimpleName().contentEquals(bindMethod) &&
|
||||
descriptor(m.asType()).equals(currentMethod.descriptor)) {
|
||||
methodFound = true;
|
||||
}
|
||||
}
|
||||
if (!methodFound) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid static binding: " +
|
||||
currentMethod.method.type + "#" + currentMethod.method.name + " -> " +
|
||||
bindType.getQualifiedName().toString() + "#" + bindMethod +
|
||||
" (no matching method found, type conversions are not allowed for internal bindings)",
|
||||
diagnostic.tree, diagnostic.root);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> addBindings() {
|
||||
List<String> unresolvedErrors = new ArrayList<>();
|
||||
List<TypeBinding> addedTypes = new ArrayList<>();
|
||||
List<MethodBinding> addedMethods = new ArrayList<>();
|
||||
Set<Object> validated = new HashSet<>();
|
||||
// Remove changed bindings.
|
||||
for (TypeBinding type : typeBindings.values()) {
|
||||
if (type.bindType != null) addedTypes.add(type);
|
||||
types.remove(type.currentType);
|
||||
}
|
||||
for (MethodBinding method : methodBindings) {
|
||||
if (method.bindMethod != null) addedMethods.add(method);
|
||||
methods.remove(method.currentMethod);
|
||||
}
|
||||
methods.entrySet().removeIf(m -> typeBindings.containsKey(m.getKey().method.type));
|
||||
// Build inverse binding map.
|
||||
Map<String, String> inverseTypes = types.entrySet().stream().collect(Collectors.toMap(
|
||||
e -> e.getValue().type, Map.Entry::getKey, (a, b) -> {
|
||||
unresolvedErrors.add("Conflicting JBR API binding: " + a + " and "+ b + " binds to the same type");
|
||||
return a + "," + b;
|
||||
}));
|
||||
Map<StaticDescriptor, StaticMethod> inverseMethods = methods.entrySet().stream().collect(Collectors.toMap(
|
||||
e -> new StaticDescriptor(e.getValue(), e.getKey().descriptor), e -> e.getKey().method, (a, b) -> {
|
||||
unresolvedErrors.add("Conflicting JBR API binding: " +
|
||||
a.type + "#" + a.name + " and "+ b.type + "#" + b.name + " binds to the same method");
|
||||
return new StaticMethod(a.type + "," + b.type, a.name + "," + b.name);
|
||||
}));
|
||||
// Add new bindings.
|
||||
for (TypeBinding type : addedTypes) types.put(type.currentType, new Type(type.bindType, type.binding));
|
||||
for (MethodBinding method : addedMethods) methods.put(method.currentMethod, method.bindMethod);
|
||||
// Validate type bindings.
|
||||
for (TypeBinding type : addedTypes) {
|
||||
String inv = inverseTypes.get(type.bindType);
|
||||
if (inv != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"Conflicting JBR API binding: " + type.currentType + " -> " + type.bindType + " <- " + inv,
|
||||
type.diagnostic.tree, type.diagnostic.root);
|
||||
inverseTypes.put(type.bindType, inv + "," + type.currentType);
|
||||
} else inverseTypes.put(type.bindType, type.currentType);
|
||||
Type next = types.get(type.bindType);
|
||||
if (next != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"Conflicting JBR API binding: " + type.currentType + " -> " + type.bindType + " -> " + next,
|
||||
type.diagnostic.tree, type.diagnostic.root);
|
||||
}
|
||||
String prev = inverseTypes.get(type.currentType);
|
||||
if (prev != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"Conflicting JBR API binding: " + prev + " -> " + type.currentType + " -> " + type.bindType,
|
||||
type.diagnostic.tree, type.diagnostic.root);
|
||||
}
|
||||
if (validated.add(type.currentType)) {
|
||||
TypeElement bindElement = elements.getTypeElement(type.bindType);
|
||||
if (bindElement != null) {
|
||||
internal.add(type.currentType);
|
||||
validateInternal(type.diagnostic, type.currentType, type.binding, bindElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Validate method bindings.
|
||||
for (MethodBinding method : addedMethods) {
|
||||
StaticDescriptor invDescriptor = new StaticDescriptor(method.bindMethod, method.currentMethod.descriptor);
|
||||
StaticMethod inv = inverseMethods.get(invDescriptor);
|
||||
if (inv != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Conflicting JBR API binding: " +
|
||||
method.currentMethod.method.type + "#" + method.currentMethod.method.name + " -> " +
|
||||
method.bindMethod.type + "#" + method.bindMethod.name + " <- " +
|
||||
inv.type + "#" + inv.name,
|
||||
method.diagnostic.tree, method.diagnostic.root);
|
||||
inverseMethods.put(invDescriptor, new StaticMethod(
|
||||
inv.type + "," + method.currentMethod.method.type, inv.name + "," + method.currentMethod.method.name));
|
||||
} else inverseMethods.put(invDescriptor, method.currentMethod.method);
|
||||
if (validated.add(method.currentMethod)) {
|
||||
TypeElement bindElement = elements.getTypeElement(method.bindMethod.type);
|
||||
if (bindElement != null) {
|
||||
internal.add(method.currentMethod);
|
||||
validateInternalMethod(method.diagnostic, method.currentMethod, bindElement, method.bindMethod.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
// [Re]validate remaining.
|
||||
types.forEach((k, v) -> {
|
||||
if (validated.add(k)) {
|
||||
TypeBinding type = typeBindings.get(v.type);
|
||||
if (type != null) {
|
||||
internal.add(k);
|
||||
validateInternal(type.diagnostic, k, v.binding, type.element);
|
||||
} else if (elements.getTypeElement(v.type) != null) {
|
||||
internal.add(k); // Couldn't validate, but at least found the type.
|
||||
if (v.binding != Binding.SERVICE) {
|
||||
unresolvedErrors.add("Invalid JBR API binding:" + k + " -> " + v.type + " (internal, non-service)");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
methods.forEach((k, v) -> {
|
||||
if (validated.add(k)) {
|
||||
TypeBinding type = typeBindings.get(v.type);
|
||||
if (type != null) {
|
||||
internal.add(k);
|
||||
validateInternalMethod(type.diagnostic, k, type.element, v.name);
|
||||
} else if (elements.getTypeElement(v.type) != null) {
|
||||
internal.add(k); // Couldn't validate, but at least found the type.
|
||||
}
|
||||
}
|
||||
});
|
||||
return unresolvedErrors;
|
||||
}
|
||||
|
||||
void read(RandomAccessFile file) throws IOException {
|
||||
String s;
|
||||
while ((s = file.readLine()) != null) {
|
||||
String[] tokens = s.split(" ");
|
||||
switch (tokens[0]) {
|
||||
case "TYPE" -> {
|
||||
types.put(tokens[1], new Type(tokens[2], Binding.valueOf(tokens[3])));
|
||||
if (tokens.length > 4 && tokens[4].equals("INTERNAL")) internal.add(tokens[1]);
|
||||
}
|
||||
case "STATIC" -> {
|
||||
StaticDescriptor descriptor = new StaticDescriptor(new StaticMethod(
|
||||
tokens[1], tokens[2]), tokens[3]);
|
||||
methods.put(descriptor, new StaticMethod(tokens[4], tokens[5]));
|
||||
if (tokens.length > 6 && tokens[6].equals("INTERNAL")) internal.add(descriptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void write(RandomAccessFile file) throws IOException {
|
||||
for (var t : types.entrySet()) {
|
||||
file.writeBytes("TYPE " + t.getKey() + " " + t.getValue().type + " " + t.getValue().binding +
|
||||
(internal.contains(t.getKey()) ? " INTERNAL\n" : "\n"));
|
||||
}
|
||||
for (var t : methods.entrySet()) {
|
||||
file.writeBytes("STATIC " + t.getKey().method.type + " " + t.getKey().method.name + " " +
|
||||
t.getKey().descriptor + " " + t.getValue().type + " " + t.getValue().name +
|
||||
(internal.contains(t.getKey()) ? " INTERNAL\n" : "\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String descriptor(TypeMirror t) {
|
||||
return switch (t.getKind()) {
|
||||
case VOID -> "V";
|
||||
case BOOLEAN -> "Z";
|
||||
case BYTE -> "B";
|
||||
case CHAR -> "C";
|
||||
case SHORT -> "S";
|
||||
case INT -> "I";
|
||||
case LONG -> "J";
|
||||
case FLOAT -> "F";
|
||||
case DOUBLE -> "D";
|
||||
case ARRAY -> "[" + descriptor(((ArrayType) t).getComponentType());
|
||||
case DECLARED -> "L" + elements.getBinaryName((TypeElement) ((DeclaredType) t).asElement())
|
||||
.toString().replace('.', '/') + ";";
|
||||
case EXECUTABLE -> "(" + ((ExecutableType) t).getParameterTypes().stream().map(this::descriptor)
|
||||
.collect(Collectors.joining()) + ")" + descriptor(((ExecutableType) t).getReturnType());
|
||||
case TYPEVAR, WILDCARD, UNION, INTERSECTION -> descriptor(types.erasure(t));
|
||||
default -> throw new RuntimeException("Cannot generate descriptor for type: " + t);
|
||||
};
|
||||
}
|
||||
|
||||
Registry.StaticDescriptor staticDescriptor(String type, ExecutableElement e) {
|
||||
return new Registry.StaticDescriptor(new Registry.StaticMethod(type, e.getSimpleName().toString()), descriptor(e.asType()));
|
||||
}
|
||||
|
||||
AnnotationValue annotationValue(AnnotationMirror m) {
|
||||
if (m == null) return null;
|
||||
return m.getElementValues().entrySet().stream()
|
||||
.filter(t -> t.getKey().getSimpleName().contentEquals("value"))
|
||||
.map(Map.Entry::getValue).findFirst().orElseThrow();
|
||||
}
|
||||
|
||||
static boolean isJavaIdentifier(String name, int from, int to) {
|
||||
if (!Character.isJavaIdentifierStart(name.charAt(from))) return false;
|
||||
for (int i = from + 1; i < to; i++) {
|
||||
if (!Character.isJavaIdentifierPart(name.charAt(i))) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
static boolean isJavaIdentifier(String name) {
|
||||
if (name == null || name.isEmpty()) return false;
|
||||
return isJavaIdentifier(name, 0, name.length());
|
||||
}
|
||||
static boolean isJavaTypeIdentifier(String name) {
|
||||
if (name == null || name.isEmpty()) return false;
|
||||
for (int i = 0; i < name.length();) {
|
||||
int next = name.indexOf('.', i);
|
||||
if (next == -1) next = name.length();
|
||||
if (!isJavaIdentifier(name, i, next)) return false;
|
||||
i = next + 1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void scan(CompilationUnitTree root, Element e) {
|
||||
// Get current type name.
|
||||
String currentType;
|
||||
if (e.getKind() == ElementKind.CLASS || e.getKind() == ElementKind.INTERFACE) {
|
||||
currentType = ((TypeElement) e).getQualifiedName().toString();
|
||||
} else if (e.getKind() == ElementKind.METHOD && e.getModifiers().contains(Modifier.STATIC)) {
|
||||
currentType = ((QualifiedNameable) e.getEnclosingElement()).getQualifiedName().toString();
|
||||
} else currentType = null;
|
||||
|
||||
// Find the annotation.
|
||||
AnnotationMirror providedMirror = null, providesMirror = null, serviceMirror = null;
|
||||
for (AnnotationMirror m : elements.getAllAnnotationMirrors(e)) {
|
||||
switch (m.getAnnotationType().toString()) {
|
||||
case "com.jetbrains.exported.JBRApi.Provided" -> providedMirror = m;
|
||||
case "com.jetbrains.exported.JBRApi.Provides" -> providesMirror = m;
|
||||
case "com.jetbrains.exported.JBRApi.Service" -> serviceMirror = m;
|
||||
}
|
||||
}
|
||||
|
||||
AnnotationMirror mirror = null;
|
||||
AnnotationValue value = null;
|
||||
Binding binding = null;
|
||||
if (serviceMirror != null) {
|
||||
if (providesMirror == null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"@Service also requires @Provides", trees.getTree(e, serviceMirror), root);
|
||||
return;
|
||||
}
|
||||
if (providedMirror != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"@Service cannot be used with @Provided", trees.getTree(e, serviceMirror), root);
|
||||
return;
|
||||
}
|
||||
value = annotationValue(mirror = providesMirror);
|
||||
binding = Binding.SERVICE;
|
||||
} else if (providesMirror != null) {
|
||||
value = annotationValue(mirror = providesMirror);
|
||||
if (providedMirror != null) {
|
||||
AnnotationValue v = annotationValue(providedMirror);
|
||||
if (!value.getValue().toString().equals(v.getValue().toString())) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"@Provided and @Provides doesn't match", trees.getTree(e, mirror, value), root);
|
||||
return;
|
||||
}
|
||||
binding = Binding.TWO_WAY;
|
||||
} else binding = Binding.PROVIDES;
|
||||
} else if (providedMirror != null) {
|
||||
value = annotationValue(mirror = providedMirror);
|
||||
binding = Binding.PROVIDED;
|
||||
}
|
||||
|
||||
if (value != null && value.getValue().toString().isEmpty()) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"Empty JBR API binding",
|
||||
trees.getTree(e, mirror, value), root);
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentType == null) {
|
||||
if (value != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"JBR API annotations are only allowed on classes, interfaces and static methods",
|
||||
trees.getTree(e, mirror), root);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (value != null && e.getKind() == ElementKind.METHOD && binding != Binding.PROVIDES) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"Only @Provides is allowed for static methods",
|
||||
trees.getTree(e, mirror), root);
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine class/method names.
|
||||
String bindType = null, bindMethod = null;
|
||||
if (value != null) {
|
||||
bindType = value.getValue().toString();
|
||||
if (e.getKind() == ElementKind.METHOD) {
|
||||
int splitIndex = bindType.indexOf('#');
|
||||
if (splitIndex != -1) {
|
||||
bindMethod = bindType.substring(splitIndex + 1);
|
||||
bindType = bindType.substring(0, splitIndex);
|
||||
if (!isJavaIdentifier(bindMethod)) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid method identifier: " + bindMethod,
|
||||
trees.getTree(e, mirror, value), root);
|
||||
return;
|
||||
}
|
||||
} else bindMethod = e.getSimpleName().toString();
|
||||
}
|
||||
if (!isJavaTypeIdentifier(bindType)) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid type identifier: " + bindType,
|
||||
trees.getTree(e, mirror, value), root);
|
||||
return;
|
||||
}
|
||||
if (Character.isUpperCase(bindType.charAt(0))) bindType = "com.jetbrains." + bindType; // Short form
|
||||
}
|
||||
|
||||
// Add entry.
|
||||
DiagnosticTree diagnostic = new DiagnosticTree(root, trees.getTree(e, mirror, value));
|
||||
if (e.getKind() == ElementKind.METHOD) {
|
||||
ExecutableElement m = (ExecutableElement) e;
|
||||
methodBindings.add(new MethodBinding(diagnostic, m, staticDescriptor(currentType, m),
|
||||
bindType == null ? null : new Registry.StaticMethod(bindType, bindMethod)));
|
||||
} else {
|
||||
typeBindings.put(currentType, new TypeBinding(diagnostic, (TypeElement) e, currentType, bindType, binding));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "jbr-api";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(JavacTask jt, String... args) {
|
||||
Path output = Path.of(args[0]);
|
||||
String implVersion;
|
||||
try {
|
||||
implVersion = Files.readString(Path.of(args[1])).strip();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
elements = jt.getElements();
|
||||
trees = Trees.instance(jt);
|
||||
types = jt.getTypes();
|
||||
jt.addTaskListener(new TaskListener() {
|
||||
@Override
|
||||
public void finished(TaskEvent te) {
|
||||
if (te.getKind() == TaskEvent.Kind.ANALYZE && te.getTypeElement() != null) {
|
||||
new ElementScanner14<Void, CompilationUnitTree>() {
|
||||
@Override
|
||||
public Void visitModule(ModuleElement e, CompilationUnitTree unused) { return null; }
|
||||
@Override
|
||||
public Void visitPackage(PackageElement e, CompilationUnitTree unused) { return null; }
|
||||
@Override
|
||||
public Void scan(Element e, CompilationUnitTree root) {
|
||||
JBRApiPlugin.this.scan(root, e);
|
||||
e.accept(this, root);
|
||||
return null;
|
||||
}
|
||||
}.scan(te.getTypeElement(), te.getCompilationUnit());
|
||||
} else if (te.getKind() == TaskEvent.Kind.COMPILATION) {
|
||||
try (RandomAccessFile file = new RandomAccessFile(output.toFile(), "rw");
|
||||
FileChannel channel = file.getChannel()) {
|
||||
for (;;) {
|
||||
try { if (channel.lock() != null) break; } catch (OverlappingFileLockException ignore) {}
|
||||
LockSupport.parkNanos(10_000000);
|
||||
}
|
||||
Registry r = new Registry();
|
||||
r.read(file);
|
||||
var unresolvedErrors = r.addBindings();
|
||||
file.setLength(0);
|
||||
file.writeBytes("VERSION " + implVersion + "\n");
|
||||
r.write(file);
|
||||
if (!unresolvedErrors.isEmpty()) {
|
||||
throw new RuntimeException(String.join("\n", unresolvedErrors));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1142,8 +1142,6 @@ public class WrapperGenerator {
|
||||
pw.println("/* This file is an automatically generated file, please do not edit this file, modify the XlibParser.java file instead !*/\n" );
|
||||
pw.println("#include <X11/Xlib.h>\n#include <X11/Xutil.h>\n#include <X11/Xos.h>\n#include <X11/Xatom.h>\n#include <stdio.h>\n");
|
||||
pw.println("#include <X11/extensions/Xdbe.h>");
|
||||
pw.println("#include <X11/extensions/XI2.h>");
|
||||
pw.println("#include <X11/extensions/XInput2.h>");
|
||||
pw.println("#include <X11/XKBlib.h>");
|
||||
pw.println("#include \"awt_p.h\"");
|
||||
pw.println("#include \"color.h\"");
|
||||
|
||||
@@ -61,7 +61,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
|
||||
-DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"', \
|
||||
DISABLED_WARNINGS_gcc_ProcessImpl_md.c := unused-result, \
|
||||
DISABLED_WARNINGS_clang_TimeZone_md.c := unused-variable, \
|
||||
DISABLED_WARNINGS_clang_jni_util.c := format-nonliteral, \
|
||||
JDK_LIBS := libjvm, \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_aix := $(LIBDL) $(LIBM), \
|
||||
|
||||
@@ -82,13 +82,3 @@ $(eval $(call SetupCopyLegalFiles, COPY_LEGAL, \
|
||||
TARGETS += $(COPY_LEGAL)
|
||||
|
||||
################################################################################
|
||||
|
||||
FONTFILE_SRC_DIR := $(TOPDIR)/src/java.desktop/share
|
||||
FONTFILE_SRCS := $(wildcard $(FONTFILE_SRC_DIR)/fonts/*.ttf) $(wildcard $(FONTFILE_SRC_DIR)/fonts/*.otf) $(FONTFILE_SRC_DIR)/fonts/fonts.dir $(FONTFILE_SRC_DIR)/fonts/font.conf
|
||||
FONTFILE_TARGET_FILES := $(subst $(FONTFILE_SRC_DIR),$(LIB_DST_DIR),$(FONTFILE_SRCS))
|
||||
|
||||
$(LIB_DST_DIR)/fonts/%: $(FONTFILE_SRC_DIR)/fonts/%
|
||||
$(call install-file)
|
||||
|
||||
|
||||
TARGETS += $(FONTFILE_TARGET_FILES)
|
||||
|
||||
@@ -38,10 +38,6 @@ endif
|
||||
|
||||
include gensrc/GensrcSwing.gmk
|
||||
|
||||
ifeq ($(call isTargetOs, windows macosx), false)
|
||||
include gensrc/GensrcWayland.gmk
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
include GensrcProperties.gmk
|
||||
|
||||
@@ -58,10 +58,7 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
EXCLUDES += \
|
||||
sun/awt/screencast \
|
||||
sun/awt/X11 \
|
||||
sun/awt/wl \
|
||||
sun/java2d/wl \
|
||||
sun/java2d/x11 \
|
||||
sun/java2d/vulkan \
|
||||
sun/java2d/jules \
|
||||
sun/java2d/xr \
|
||||
com/sun/java/swing/plaf/gtk \
|
||||
|
||||
@@ -95,7 +95,6 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_QueuingApplicationDelegate.m := \
|
||||
objc-method-access, \
|
||||
DISABLED_WARNINGS_clang_ThreadUtilities.m := format-nonliteral, \
|
||||
JDK_LIBS := java.base:libjava, \
|
||||
LIBS_macosx := \
|
||||
-framework Accelerate \
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2024, JetBrains s.r.o.. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
#
|
||||
# Generate C header and source files for Wayland protocols
|
||||
#
|
||||
|
||||
WAYLAND_GENSRC_DIR = $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/wayland
|
||||
WAYLAND_BASIC_PROTOCOL_FILES := \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/stable/viewporter/viewporter.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/stable/xdg-shell/xdg-shell.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/staging/xdg-activation/xdg-activation-v1.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/unstable/primary-selection/primary-selection-unstable-v1.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/unstable/xdg-output/xdg-output-unstable-v1.xml \
|
||||
$(GTK_SHELL1_PROTOCOL_PATH) \
|
||||
#
|
||||
|
||||
WAYLAND_PROTOCOL_FILES := \
|
||||
$(WAYLAND_BASIC_PROTOCOL_FILES) \
|
||||
$(MODULE_SRC)/share/native/libwakefield/protocol/wakefield.xml \
|
||||
#
|
||||
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_wayland_protocols: $(WAYLAND_PROTOCOL_FILES)
|
||||
$(call LogInfo, Generating Wayland protocol source and header files)
|
||||
$(call MakeTargetDir)
|
||||
$(call MakeDir, $(WAYLAND_GENSRC_DIR))
|
||||
@for p in $^; do \
|
||||
HEADER=$$(basename "$$p" | $(SED) 's/\.[^.]*$$//').h; \
|
||||
$(WAYLAND_SCANNER) client-header $$p $(WAYLAND_GENSRC_DIR)/$$HEADER; \
|
||||
done
|
||||
@for p in $^; do \
|
||||
CODE=$$(basename "$$p" | $(SED) 's/\.[^.]*$$//').c; \
|
||||
$(WAYLAND_SCANNER) private-code $$p $(WAYLAND_GENSRC_DIR)/$$CODE; \
|
||||
done
|
||||
$(TOUCH) $@
|
||||
|
||||
GENSRC_WAYLAND := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_wayland_protocols
|
||||
|
||||
TARGETS += $(GENSRC_WAYLAND)
|
||||
@@ -54,14 +54,9 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/font \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d/opengl \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
|
||||
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/launcher \
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(DBUS_FOUND), false)
|
||||
LIBAWT_EXCLUDE_FILES += dbus_interface.c dbus_interface.h
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux macosx aix), true)
|
||||
LIBAWT_EXCLUDE_FILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
|
||||
endif
|
||||
@@ -89,10 +84,6 @@ LIBAWT_EXTRA_HEADER_DIRS := \
|
||||
|
||||
LIBAWT_CFLAGS := -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES -DMLIB_NO_LIBSUNMATH
|
||||
|
||||
ifeq ($(DBUS_FOUND), true)
|
||||
LIBAWT_CFLAGS += -DDBUS_FOUND
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE -DMLIB_OS64BIT
|
||||
LIBAWT_RCFLAGS ?= -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
|
||||
@@ -100,36 +91,6 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
$(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
|
||||
endif
|
||||
|
||||
# Setup NVDA a11y announcer
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
A11Y_NVDA_ANNOUNCING_CFLAGS := -DNO_A11Y_NVDA_ANNOUNCING
|
||||
A11Y_NVDA_ANNOUNCING_LIBS :=
|
||||
A11Y_NVDA_ANNOUNCING_DEPENDENCIES :=
|
||||
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
ifeq ($(A11Y_NVDA_ANNOUNCING_ENABLED), true)
|
||||
A11Y_NVDA_ANNOUNCING_CFLAGS := $(NVDACONTROLLERCLIENT_CFLAGS)
|
||||
A11Y_NVDA_ANNOUNCING_LIBS := $(NVDACONTROLLERCLIENT_LIB)
|
||||
A11Y_NVDA_ANNOUNCING_DEPENDENCIES := $(NVDACONTROLLERCLIENT_DLL)
|
||||
endif
|
||||
endif
|
||||
|
||||
LIBAWT_CFLAGS += $(A11Y_NVDA_ANNOUNCING_CFLAGS)
|
||||
endif
|
||||
|
||||
# Setup the client for the JAWS screen reader
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
A11Y_JAWS_ANNOUNCING_CFLAGS := -DNO_A11Y_JAWS_ANNOUNCING
|
||||
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
ifeq ($(A11Y_JAWS_ANNOUNCING_ENABLED), true)
|
||||
A11Y_JAWS_ANNOUNCING_CFLAGS :=
|
||||
endif
|
||||
endif
|
||||
|
||||
LIBAWT_CFLAGS += $(A11Y_JAWS_ANNOUNCING_CFLAGS)
|
||||
endif
|
||||
|
||||
# -fgcse-after-reload improves performance of MaskFill in Java2D by 20% for
|
||||
# some gcc
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
|
||||
@@ -137,7 +98,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
|
||||
EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \
|
||||
EXCLUDE_FILES := $(LIBAWT_EXCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(LIBAWT_CFLAGS) $(X_CFLAGS) $(DBUS_CFLAGS), \
|
||||
CFLAGS := $(LIBAWT_CFLAGS) $(X_CFLAGS), \
|
||||
CXXFLAGS := $(LIBAWT_CFLAGS) $(X_CFLAGS), \
|
||||
CFLAGS_gcc := -fgcse-after-reload, \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
|
||||
@@ -153,11 +114,10 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
|
||||
DISABLED_WARNINGS_clang_debug_trace.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_Trace.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_TransformHelper.c := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_system_properties.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_microsoft := 4244 4996, \
|
||||
DISABLED_WARNINGS_microsoft_awt_Toolkit.cpp := 4267, \
|
||||
LDFLAGS_windows := -delayload:comctl32.dll -delayload:comdlg32.dll \
|
||||
-delayload:gdi32.dll -delayload:gdiplus.dll -delayload:imm32.dll -delayload:ole32.dll \
|
||||
-delayload:gdi32.dll -delayload:imm32.dll -delayload:ole32.dll \
|
||||
-delayload:shell32.dll -delayload:shlwapi.dll -delayload:user32.dll \
|
||||
-delayload:winmm.dll -delayload:winspool.drv, \
|
||||
JDK_LIBS := java.base:libjava java.base:libjvm, \
|
||||
@@ -172,52 +132,12 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
|
||||
-framework Metal \
|
||||
-framework OpenGL, \
|
||||
LIBS_windows := advapi32.lib comctl32.lib comdlg32.lib delayimp.lib \
|
||||
gdi32.lib gdiplus.lib imm32.lib kernel32.lib ole32.lib shell32.lib shlwapi.lib \
|
||||
user32.lib uuid.lib winmm.lib winspool.lib dwmapi.lib $(A11Y_NVDA_ANNOUNCING_LIBS), \
|
||||
gdi32.lib imm32.lib kernel32.lib ole32.lib shell32.lib shlwapi.lib \
|
||||
user32.lib uuid.lib winmm.lib winspool.lib, \
|
||||
VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
|
||||
EXTRA_RCFLAGS := $(LIBAWT_RCFLAGS), \
|
||||
))
|
||||
|
||||
ifeq ($(call isTargetOs, windows)+$(ENABLE_HEADLESS_ONLY)+$(A11Y_NVDA_ANNOUNCING_ENABLED), true+false+true)
|
||||
$(eval $(call SetupCopyFiles, COPY_NVDA_DEPENDENCIES, \
|
||||
FILES := $(A11Y_NVDA_ANNOUNCING_DEPENDENCIES), \
|
||||
DEST := $(BUILD_LIBAWT_OUTPUT_DIR), \
|
||||
))
|
||||
|
||||
$(COPY_NVDA_DEPENDENCIES): $(A11Y_NVDA_ANNOUNCING_DEPENDENCIES)
|
||||
$(BUILD_LIBAWT): $(COPY_NVDA_DEPENDENCIES)
|
||||
|
||||
TARGETS += $(COPY_NVDA_DEPENDENCIES)
|
||||
endif
|
||||
|
||||
# Compile Vulkan shaders
|
||||
define compile-spirv
|
||||
$(call MakeTargetDir)
|
||||
$(VULKAN_SHADER_COMPILER) '$(call DecodeSpace, $@)' '$(call DecodeSpace, $<)'
|
||||
endef
|
||||
spirv-name = $(strip $1).h
|
||||
|
||||
ifeq ($(VULKAN_ENABLED), true)
|
||||
$(eval $(call SetupCopyFiles, COMPILE_VULKAN_SHADERS, \
|
||||
SRC := $(TOPDIR)/src/$(MODULE)/share/glsl/vulkan, \
|
||||
FILES := $(call FindFiles, $(TOPDIR)/src/$(MODULE)/share/glsl/vulkan), \
|
||||
DEST := $(SUPPORT_OUTPUTDIR)/headers/java.desktop/vulkan/spirv, \
|
||||
MACRO := compile-spirv, \
|
||||
NAME_MACRO := spirv-name, \
|
||||
))
|
||||
VULKAN_SHADER_LIST = $(SUPPORT_OUTPUTDIR)/headers/java.desktop/vulkan/shader_list.h
|
||||
$(VULKAN_SHADER_LIST): $(COMPILE_VULKAN_SHADERS)
|
||||
> $(VULKAN_SHADER_LIST) $(NEWLINE) \
|
||||
$(foreach f, $(patsubst $(TOPDIR)/src/$(MODULE)/share/glsl/vulkan/%,%,$(call FindFiles, $(TOPDIR)/src/$(MODULE)/share/glsl/vulkan)), \
|
||||
$(ECHO) SHADER_ENTRY\($(subst .,$(COMMA),$(subst /,_,$f))\) >> $(VULKAN_SHADER_LIST) $(NEWLINE) \
|
||||
$(ECHO) '#ifdef INCLUDE_BYTECODE' >> $(VULKAN_SHADER_LIST) $(NEWLINE) \
|
||||
$(ECHO) '#include "spirv/$f.h"' >> $(VULKAN_SHADER_LIST) $(NEWLINE) \
|
||||
$(ECHO) BYTECODE_END >> $(VULKAN_SHADER_LIST) $(NEWLINE) \
|
||||
$(ECHO) '#endif' >> $(VULKAN_SHADER_LIST) $(NEWLINE) \
|
||||
)
|
||||
$(BUILD_LIBAWT): $(VULKAN_SHADER_LIST)
|
||||
endif
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT)
|
||||
|
||||
# Mac and Windows only use the native AWT lib, do not build libawt_headless
|
||||
@@ -237,7 +157,6 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
common/awt/debug \
|
||||
common/font \
|
||||
common/java2d/opengl \
|
||||
common/java2d/vulkan \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
@@ -257,12 +176,11 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
|
||||
NAME := awt_headless, \
|
||||
EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
|
||||
EXCLUDES := medialib wl vulkan, \
|
||||
EXCLUDES := medialib, \
|
||||
ONLY_EXPORTED := $(LIBAWT_HEADLESS_ONLY_EXPORTED), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -DHEADLESS=true $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) \
|
||||
$(X_CFLAGS) $(DBUS_CFLAGS), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB), \
|
||||
$(X_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc := unused-variable, \
|
||||
DISABLED_WARNINGS_clang := unused-variable, \
|
||||
@@ -289,20 +207,6 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
|
||||
common/font \
|
||||
#
|
||||
|
||||
ifeq ($(A11Y_SPEECHD_ANNOUNCING_ENABLED), true)
|
||||
A11Y_SPEECHD_ANNOUNCING_CFLAGS :=
|
||||
else
|
||||
A11Y_SPEECHD_ANNOUNCING_CFLAGS := -DNO_A11Y_SPEECHD_ANNOUNCING
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
LIBAWT_XAWT_EXTRA_SRC += \
|
||||
$(TOPDIR)/src/$(MODULE)/linux/native/libawt_xawt \
|
||||
#
|
||||
endif
|
||||
|
||||
LIBAWT_XAWT_CFLAGS += $(SPEECHD_CFLAGS) $(A11Y_SPEECHD_ANNOUNCING_CFLAGS)
|
||||
|
||||
LIBAWT_XAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_xawt/awt \
|
||||
@@ -334,9 +238,9 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
|
||||
NAME := awt_xawt, \
|
||||
EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
|
||||
EXCLUDES := medialib debug wl vulkan, \
|
||||
EXCLUDES := medialib debug, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -DXAWT -DXAWT_HACK $(LIBAWT_XAWT_CFLAGS) $(DBUS_CFLAGS) \
|
||||
CFLAGS := -DXAWT -DXAWT_HACK $(LIBAWT_XAWT_CFLAGS) \
|
||||
$(FONTCONFIG_CFLAGS) $(CUPS_CFLAGS) $(X_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := int-to-pointer-cast unused-variable, \
|
||||
DISABLED_WARNINGS_clang := unused-variable, \
|
||||
@@ -344,7 +248,6 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
|
||||
DISABLED_WARNINGS_gcc_GLXSurfaceData.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_gtk3_interface.c := parentheses type-limits \
|
||||
unused-function, \
|
||||
DISABLED_WARNINGS_gcc_keycode_cache.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_screencast_pipewire.c := undef, \
|
||||
@@ -358,7 +261,6 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
|
||||
DISABLED_WARNINGS_gcc_XRBackendNative.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_XToolkit.c := unused-result, \
|
||||
DISABLED_WARNINGS_gcc_XWindow.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_awt_InputMethod.c := unused-label, \
|
||||
DISABLED_WARNINGS_clang_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_gtk3_interface.c := unused-function parentheses, \
|
||||
DISABLED_WARNINGS_clang_GLXSurfaceData.c := unused-function, \
|
||||
@@ -366,7 +268,6 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
|
||||
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_screencast_pipewire.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_awt_InputMethod.c := unused-label, \
|
||||
DISABLED_WARNINGS_clang_XWindow.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_aix := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_aix_awt_Taskbar.c := parentheses, \
|
||||
@@ -378,7 +279,7 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
|
||||
parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_awt_InputMethod.c := unused-function sign-compare, \
|
||||
JDK_LIBS := libawt java.base:libjava, \
|
||||
LIBS_unix := $(LIBDL) $(LIBM) $(SPEECHD_LIBS) $(X_LIBS) -lX11 -lXext -lXi -lXrender \
|
||||
LIBS_unix := $(LIBDL) $(LIBM) $(X_LIBS) -lX11 -lXext -lXi -lXrender \
|
||||
-lXtst, \
|
||||
LIBS_linux := -lpthread, \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_XAWT_STATIC_EXCLUDE_OBJS), \
|
||||
@@ -387,103 +288,6 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
|
||||
TARGETS += $(BUILD_LIBAWT_XAWT)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows macosx), false)
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
LIBAWT_WLAWT_EXTRA_SRC := \
|
||||
common/awt \
|
||||
common/java2d \
|
||||
common/font \
|
||||
common/wayland \
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/wayland \
|
||||
#
|
||||
|
||||
LIBAWT_WLAWT_EXCLUDES := medialib debug opengl x11
|
||||
LIBAWT_WLAWT_EXCLUDE_FILES := common/awt/X11Color.c common/awt/awt_Font.c
|
||||
|
||||
# Substitute Vulkan with stubs if disabled.
|
||||
ifeq ($(VULKAN_ENABLED), false)
|
||||
LIBAWT_WLAWT_EXCLUDES += vulkan
|
||||
LIBAWT_WLAWT_EXTRA_FILES += $(TOPDIR)/src/$(MODULE)/share/native/common/java2d/vulkan/VKStubs.c
|
||||
endif
|
||||
|
||||
LIBAWT_WLAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_wlawt/awt \
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/wayland \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/awt/systemscale \
|
||||
common/font \
|
||||
common/java2d \
|
||||
common/java2d/wl \
|
||||
common/java2d/vulkan \
|
||||
common/wayland \
|
||||
java.base:libjvm \
|
||||
java.base:libjava \
|
||||
libvmahpp \
|
||||
#
|
||||
|
||||
# Enable 'wakefield' extension for java.awt.Robot support
|
||||
WAKEFIELD_ROBOT_CFLAGS=-DWAKEFIELD_ROBOT
|
||||
|
||||
LIBAWT_WLAWT_CFLAGS += -DWLAWT \
|
||||
$(WAKEFIELD_ROBOT_CFLAGS) \
|
||||
$(FONTCONFIG_CFLAGS) \
|
||||
$(VULKAN_FLAGS) \
|
||||
$(WAYLAND_CFLAGS) \
|
||||
$(CUPS_CFLAGS)
|
||||
|
||||
LIBAWT_WLAWT_CXXFLAGS += $(VULKAN_FLAGS)
|
||||
|
||||
ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
# Turn off all warnings for the following files since they contain warnings
|
||||
# that cannot be turned of individually.
|
||||
# redefining a macro
|
||||
BUILD_LIBAWT_WLAWT_awt_Font.c_CFLAGS := -w
|
||||
# initializing a declared 'extern'
|
||||
BUILD_LIBAWT_WLAWT_debug_mem.c_CFLAGS := -w
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_WLAWT, \
|
||||
NAME := awt_wlawt, \
|
||||
EXCLUDE_FILES := $(LIBAWT_WLAWT_EXCLUDE_FILES), \
|
||||
EXTRA_FILES := $(LIBAWT_WLAWT_EXTRA_FILES), \
|
||||
EXTRA_SRC := $(LIBAWT_WLAWT_EXTRA_SRC), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_WLAWT_EXTRA_HEADER_DIRS), \
|
||||
EXCLUDES := $(LIBAWT_WLAWT_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
LINK_TYPE := C++, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_WLAWT_CFLAGS), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBAWT_WLAWT_CXXFLAGS), \
|
||||
WARNINGS_AS_ERRORS_xlc := false, \
|
||||
DISABLED_WARNINGS_C_gcc := type-limits pointer-to-int-cast \
|
||||
unused-result maybe-uninitialized format unused-variable \
|
||||
format-security int-to-pointer-cast parentheses \
|
||||
implicit-fallthrough undef unused-function, \
|
||||
DISABLED_WARNINGS_CXX_gcc := undef, \
|
||||
DISABLED_WARNINGS_clang := parentheses format undef \
|
||||
logical-op-parentheses format-nonliteral int-conversion, \
|
||||
DISABLED_WARNINGS_gcc_awt_InputMethod.c := unused-label, \
|
||||
DISABLED_WARNINGS_gcc_CUPSfuncs.c := unused-variable, \
|
||||
DISABLED_WARNINGS_gcc_VKRenderQueue.c := unused-variable unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_clang_awt_InputMethod.c := unused-label, \
|
||||
DISABLED_WARNINGS_clang_CUPSfuncs.c := unused-variable, \
|
||||
DISABLED_WARNINGS_clang_VKRenderQueue.c := unused-variable unused-but-set-variable, \
|
||||
JDK_LIBS := libawt java.base:libjava java.base:libjvm, \
|
||||
LIBS := $(WAYLAND_LIBS), \
|
||||
LIBS_unix := $(LIBDL) $(LIBM), \
|
||||
LIBS_linux := -lpthread -lrt, \
|
||||
))
|
||||
|
||||
$(BUILD_LIBAWT_WLAWT): $(call FindLib, java.base, java)
|
||||
|
||||
$(BUILD_LIBAWT_WLAWT): $(BUILD_LIBAWT)
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_WLAWT)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
##############################################################################
|
||||
## Build libawt_lwawt
|
||||
@@ -499,21 +303,16 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_lwawt/awt \
|
||||
libawt_lwawt/font \
|
||||
libawt_lwawt/java2d \
|
||||
libawt_lwawt/java2d/opengl \
|
||||
libawt_lwawt/java2d/metal \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/java2d \
|
||||
common/java2d/opengl \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
LIBAWT_LWAWT_EXCLUDE_FILES := fontpath.c awt_Font.c X11Color.c
|
||||
LIBAWT_LWAWT_EXCLUDES := \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d/vulkan \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib \
|
||||
#
|
||||
LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
|
||||
|
||||
LIBAWT_LWAWT_STATIC_EXCLUDE_OBJS := systemScale.o
|
||||
|
||||
@@ -542,8 +341,6 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_PrinterView.m := enum-conversion, \
|
||||
DISABLED_WARNINGS_clang_SystemHotkey.m := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_system_properties.c := format-nonliteral, \
|
||||
JDK_LIBS := libawt java.base:libjava libosxapp, \
|
||||
LIBS_macosx := $(LIBM) \
|
||||
-framework Accelerate \
|
||||
@@ -551,13 +348,11 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
-framework AudioToolbox \
|
||||
-framework Carbon \
|
||||
-framework Cocoa \
|
||||
-framework IOKit \
|
||||
-framework ExceptionHandling \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework Metal \
|
||||
-framework OpenGL \
|
||||
-framework QuartzCore \
|
||||
-framework UniformTypeIdentifiers \
|
||||
-framework Security, \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_LWAWT_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
@@ -141,9 +141,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
#
|
||||
|
||||
LIBSPLASHSCREEN_HEADER_DIRS := \
|
||||
libsplashscreen \
|
||||
common/awt/utility \
|
||||
common/awt/systemscale \
|
||||
libosxapp \
|
||||
java.base:libjava \
|
||||
java.base:libjvm \
|
||||
@@ -213,21 +211,14 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
|
||||
else
|
||||
LIBWLSPLASHSCREEN_CFLAGS := -DWITH_WL $(LIBSPLASHSCREEN_CFLAGS) $(X_CFLAGS) $(WAYLAND_CFLAGS)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS += systemScale.o
|
||||
LIBSPLASHSCREEN_EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c
|
||||
LIBSPLASHSCREEN_LIBS := $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(LIBZ_LIBS) $(PNG_LIBS)
|
||||
LIBSPLASHSCREEN_DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough shift-negative-value maybe-uninitialized unused-function type-limits unused-result unused-but-set-variable
|
||||
LIBSPLASHSCREEN_DISABLED_WARNINGS_clang := deprecated-non-prototype format-nonliteral sign-compare incompatible-pointer-types deprecated-declarations
|
||||
LIBWLSPLASHSCREEN_HEADER_DIRS := common/wayland $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/wayland
|
||||
LIBWLSPLASHSCREEN_EXTRA_SRC := common/wayland
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
|
||||
NAME := splashscreen, \
|
||||
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC) libxsplashscreen libsplashscreen, \
|
||||
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
|
||||
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
|
||||
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
|
||||
@@ -236,7 +227,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
|
||||
CXXFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
|
||||
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := libxsplashscreen $(LIBSPLASHSCREEN_HEADER_DIRS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc_dgif_lib.c := sign-compare, \
|
||||
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
|
||||
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
|
||||
@@ -246,9 +237,8 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_impl.c := implicit-fallthrough \
|
||||
sign-compare unused-function, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_sys_common.c := type-limits \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_sys.c := type-limits \
|
||||
unused-but-set-variable unused-result unused-variable, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_sys.c := unused-variable \
|
||||
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_dgif_lib.c := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
|
||||
@@ -265,7 +255,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
LDFLAGS_windows := -delayload:user32.dll, \
|
||||
JDK_LIBS_windows := java.base:libjava, \
|
||||
JDK_LIBS_macosx := libosxapp, \
|
||||
LIBS := $(LIBSPLASHSCREEN_LIBS), \
|
||||
LIBS := $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(LIBZ_LIBS) $(PNG_LIBS), \
|
||||
LIBS_unix := $(LIBM) -lpthread, \
|
||||
LIBS_linux := $(LIBDL) $(X_LIBS) -lX11 -lXext, \
|
||||
LIBS_macosx := -liconv \
|
||||
@@ -279,29 +269,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBWLSPLASHSCREEN, \
|
||||
NAME := wlsplashscreen, \
|
||||
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC) $(LIBWLSPLASHSCREEN_EXTRA_SRC) libwlsplashscreen libsplashscreen, \
|
||||
EXTRA_FILES := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/wayland/xdg-shell.c, \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
|
||||
DISABLED_WARNINGS_gcc := $(LIBSPLASHSCREEN_DISABLED_WARNINGS_gcc), \
|
||||
DISABLED_WARNINGS_clang := $(LIBSPLASHSCREEN_DISABLED_WARNINGS_clang), \
|
||||
EXCLUDE_FILES := $(LIBSPLASHSCREEN_EXCLUDE_FILES), \
|
||||
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBWLSPLASHSCREEN_CFLAGS) \
|
||||
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS) $(LIBWLSPLASHSCREEN_HEADER_DIRS) libwlsplashscreen, \
|
||||
LIBS := -lwayland-client -lwayland-cursor $(LIBSPLASHSCREEN_LIBS) -lrt, \
|
||||
LIBS_unix := $(LIBDL) $(LIBM) -lpthread, \
|
||||
LIBS_aix := -liconv, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBSPLASHSCREEN)
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
TARGETS += $(BUILD_LIBWLSPLASHSCREEN)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
@@ -376,7 +344,6 @@ else
|
||||
endif
|
||||
|
||||
LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
|
||||
java.base:libjvm \
|
||||
common/awt \
|
||||
common/awt/utility \
|
||||
common/font \
|
||||
@@ -405,9 +372,9 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c X11TextRenderer.c
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c X11TextRenderer.c \
|
||||
lcdglyph.c lcdglyphDW.cpp
|
||||
fontpath.c lcdglyph.c
|
||||
else
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += lcdglyph.c lcdglyphDW.cpp
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c lcdglyph.c
|
||||
endif
|
||||
|
||||
LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
|
||||
@@ -427,7 +394,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
|
||||
CFLAGS_windows = -DCC_NOEX, \
|
||||
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
|
||||
EXTRA_SRC := $(LIBFONTMANAGER_EXTRA_SRC), \
|
||||
DISABLED_WARNINGS_gcc := $(HARFBUZZ_DISABLED_WARNINGS_gcc) unused-result, \
|
||||
DISABLED_WARNINGS_gcc := $(HARFBUZZ_DISABLED_WARNINGS_gcc), \
|
||||
DISABLED_WARNINGS_CXX_gcc := $(HARFBUZZ_DISABLED_WARNINGS_CXX_gcc), \
|
||||
DISABLED_WARNINGS_clang := $(HARFBUZZ_DISABLED_WARNINGS_clang), \
|
||||
DISABLED_WARNINGS_microsoft := $(HARFBUZZ_DISABLED_WARNINGS_microsoft), \
|
||||
@@ -447,48 +414,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
|
||||
|
||||
TARGETS += $(BUILD_LIBFONTMANAGER)
|
||||
|
||||
ifeq ($(call isTargetOs, windows macosx), false)
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
LIBFONTMANAGER_XAWT_EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES)
|
||||
LIBFONTMANAGER_XAWT_CFLAGS := $(LIBFONTMANAGER_CFLAGS)
|
||||
LIBFONTMANAGER_XAWT_OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION)
|
||||
LIBFONTMANAGER_XAWT_EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS) \
|
||||
libfontmanager java.base:libjava
|
||||
LIBFONTMANAGER_XAWT_EXTRA_SRC :=
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER_XAWT, \
|
||||
NAME := fontmanager_xawt, \
|
||||
EXCLUDE_FILES := $(LIBFONTMANAGER_XAWT_EXCLUDE_FILES) \
|
||||
AccelGlyphCache.c, \
|
||||
LINK_TYPE := C++, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_XAWT_CFLAGS), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_XAWT_CFLAGS), \
|
||||
OPTIMIZATION := $(LIBFONTMANAGER_XAWT_OPTIMIZATION), \
|
||||
CFLAGS_windows = -DCC_NOEX, \
|
||||
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_XAWT_EXTRA_HEADER_DIRS), \
|
||||
EXTRA_SRC := $(LIBFONTMANAGER_XAWT_EXTRA_SRC), \
|
||||
WARNINGS_AS_ERRORS_xlc := false, \
|
||||
DISABLED_WARNINGS_gcc := $(HARFBUZZ_DISABLED_WARNINGS_gcc), \
|
||||
DISABLED_WARNINGS_CXX_gcc := $(HARFBUZZ_DISABLED_WARNINGS_CXX_gcc), \
|
||||
DISABLED_WARNINGS_clang := $(HARFBUZZ_DISABLED_WARNINGS_clang), \
|
||||
DISABLED_WARNINGS_microsoft := $(HARFBUZZ_DISABLED_WARNINGS_microsoft), \
|
||||
LDFLAGS := $(LDFLAGS_CXX_JDK), \
|
||||
LDFLAGS_FILTER_OUT :=-Wl$(COMMA)-z$(COMMA)defs, \
|
||||
LDFLAGS_aix := -Wl$(COMMA)-berok, \
|
||||
JDK_LIBS := libfontmanager libawt java.base:libjava $(LIBFONTMANAGER_JDK_LIBS), \
|
||||
LIBS := $(LIBFONTMANAGER_LIBS), \
|
||||
LIBS_unix := $(LIBM), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBFONTMANAGER_XAWT): $(BUILD_LIBFONTMANAGER)
|
||||
$(BUILD_LIBFONTMANAGER_XAWT): $(BUILD_LIBAWT_XAWT)
|
||||
|
||||
TARGETS += $(BUILD_LIBFONTMANAGER_XAWT)
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
##############################################################################
|
||||
## Build libosxui
|
||||
|
||||
@@ -64,8 +64,6 @@ BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libstringPlatformChars := java.base:libjava
|
||||
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libTracePinnedThreads := java.base:libjvm
|
||||
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libNewDirectByteBuffer := java.base:libjava
|
||||
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libGetXSpace := java.base:libjava
|
||||
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libFatalErrorTest := java.base:libjava
|
||||
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libLogEventTest := java.base:libjava
|
||||
|
||||
# Platform specific setup
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
@@ -112,17 +110,6 @@ else
|
||||
BUILD_JDK_JTREG_EXCLUDE += exeLibraryCache.c
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libwindows_touch_robot := user32.lib
|
||||
BUILD_JDK_JTREG_EXCLUDE += libtouchscreen_device.c
|
||||
else
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
BUILD_JDK_JTREG_EXCLUDE += libwindows_touch_robot.c
|
||||
else
|
||||
BUILD_JDK_JTREG_EXCLUDE += libtouchscreen_device.c libwindows_touch_robot.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
# Unconditionally compile with debug symbols and don't ever perform
|
||||
# stripping during the test libraries' build.
|
||||
|
||||
@@ -1,320 +0,0 @@
|
||||
package j2dbench.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.DirectoryIteratorException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* The class reads J2DBench scores and reports them into output stream in format applicable for TeamCity charts.
|
||||
* The directory, where J2DBench result files placed, is specified via command line parameter like follows:
|
||||
* <p>
|
||||
* <code>-basexml | -b <xml file path></code>
|
||||
* </p>
|
||||
* This directory must contain one file with pattern <code>*{openjdk}*.{res}</code> which is considered as a container
|
||||
* of reference scores and several <code>*{jbsdk}*.{res}</code>.
|
||||
* <p>
|
||||
* <p> Names of these files have several mandatory fields separated by <code>"_"</code> and look like
|
||||
* <code>osName_jdkName_renderName_*.res</code>
|
||||
* </p>
|
||||
* <p>
|
||||
* If any of score is less than corresponding reference value by 5% then exit code <code>1</code> is returned otherwise
|
||||
* exit code <code>0</code> is returned.
|
||||
* <p>
|
||||
* Standard output will contain scores in format required for TeamCity charts.
|
||||
* <p>
|
||||
* Created by vprovodin on 13/02/2017.
|
||||
*/
|
||||
public class TCChartReporter {
|
||||
|
||||
private static boolean printTCValues = false;
|
||||
private static boolean printValues = false;
|
||||
|
||||
private static final DecimalFormat decimalFormat =
|
||||
new DecimalFormat("0.00");
|
||||
|
||||
private static FileSystem defaultFileSystem = FileSystems.getDefault();
|
||||
|
||||
private static double getMeasurementError(String testCaseName, String osName) {
|
||||
if (testCaseName.contains("text.Rendering.tests.drawString") && osName.toLowerCase().contains("lin") )
|
||||
return 0.18;
|
||||
return 0.1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Level at which tests are grouped to be displayed in summary
|
||||
*/
|
||||
private static final int LEVEL = 2;
|
||||
|
||||
/**
|
||||
* Holds the groups and corresponding group-display-names
|
||||
*/
|
||||
private static List<String> groups = new ArrayList<>();
|
||||
private static Map<String, Double> referenceValues = new HashMap<>();
|
||||
private static boolean testFailed = false;
|
||||
|
||||
private static void printUsage() {
|
||||
String usage =
|
||||
"\njava TCChartReporter [options] " +
|
||||
" \n\n" +
|
||||
"where options include: " +
|
||||
" \n" +
|
||||
" -basexml | -b <xml file path> " +
|
||||
"path to base-build result";
|
||||
System.out.println(usage);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* String = getTestResultsTableForSummary()
|
||||
*/
|
||||
private static double generateTestCaseReport(
|
||||
Object key,
|
||||
Map<String, J2DAnalyzer.ResultHolder> testCaseResult,
|
||||
Map<String, Integer> testCaseResultCount) {
|
||||
|
||||
Integer curTestCountObj = testCaseResultCount.get(key.toString());
|
||||
int curTestCount = 0;
|
||||
if (curTestCountObj != null) {
|
||||
curTestCount = curTestCountObj;
|
||||
}
|
||||
|
||||
double totalScore = 0;
|
||||
|
||||
for (int i = 0; i < curTestCount; i++) {
|
||||
J2DAnalyzer.ResultHolder resultTCR = testCaseResult.get(key.toString() + "_" + i);
|
||||
totalScore = totalScore + resultTCR.getScore();
|
||||
}
|
||||
|
||||
return totalScore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate Testcase Summary Report for TC - *.out
|
||||
*/
|
||||
private static void generateTestCaseSummaryReport(
|
||||
String OJRname,
|
||||
Map<String, Double> consoleResult,
|
||||
Map<String, J2DAnalyzer.ResultHolder> testCaseResult,
|
||||
Map<String, Integer> testCaseResultCount,
|
||||
boolean rememberReference) {
|
||||
|
||||
String curGroupName, curTestName;
|
||||
|
||||
Object[] groupNameArray = groups.toArray();
|
||||
|
||||
Object[] testCaseList = consoleResult.keySet().toArray();
|
||||
Arrays.sort(testCaseList);
|
||||
|
||||
for (Object aGroupNameArray : groupNameArray) {
|
||||
|
||||
double value;
|
||||
curGroupName = aGroupNameArray.toString();
|
||||
|
||||
for (Object aTestCaseList : testCaseList) {
|
||||
|
||||
curTestName = aTestCaseList.toString();
|
||||
|
||||
if (curTestName.contains(curGroupName)) {
|
||||
|
||||
value = generateTestCaseReport(curTestName, testCaseResult, testCaseResultCount);
|
||||
|
||||
if (printTCValues)
|
||||
System.out.println("##teamcity[buildStatisticValue key='" + (OJRname.isEmpty() ? "" : OJRname + ".") + curTestName
|
||||
+ "' value='" + decimalFormat.format(value) + "']");
|
||||
if (printValues)
|
||||
System.out.println((OJRname.isEmpty() ? "" : OJRname + ".") + curTestName + "," + decimalFormat.format(value));
|
||||
if (rememberReference) {
|
||||
referenceValues.put(curTestName, value);
|
||||
} else {
|
||||
double refValue = referenceValues.getOrDefault(curTestName, 0.);
|
||||
if (Math.abs(value/refValue - 1) >= getMeasurementError(curTestName, OJRname)) {
|
||||
System.err.println(OJRname);
|
||||
System.err.println(curTestName);
|
||||
System.err.println("\treferenceValue=" + refValue);
|
||||
System.err.println("\t actualValue=" + value);
|
||||
System.err.println("\t diff:" + ((value / refValue - 1) * 100));
|
||||
testFailed = (value < refValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
public static void main(String args[]) {
|
||||
|
||||
String baseXML = null;
|
||||
int group = 2;
|
||||
|
||||
/* ---- Analysis Mode ----
|
||||
BEST = 1;
|
||||
WORST = 2;
|
||||
AVERAGE = 3;
|
||||
MIDAVG = 4;
|
||||
------------------------ */
|
||||
int analyzerMode = 4;
|
||||
|
||||
try {
|
||||
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
|
||||
if (args[i].startsWith("-basexml") ||
|
||||
args[i].startsWith("-b")) {
|
||||
i++;
|
||||
baseXML = args[i];
|
||||
} else if (args[i].startsWith("-tc")) {
|
||||
printTCValues = true;
|
||||
} else if (args[i].startsWith("-v"))
|
||||
printValues = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
printUsage();
|
||||
}
|
||||
|
||||
XMLHTMLReporter.setGroupLevel(group);
|
||||
J2DAnalyzer.setMode(analyzerMode);
|
||||
if (baseXML != null) {
|
||||
generateComparisonReport(defaultFileSystem.getPath(baseXML));
|
||||
} else {
|
||||
printUsage();
|
||||
}
|
||||
|
||||
if (testFailed)
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Test Group to the list
|
||||
*/
|
||||
private static void addGroup(String testName) {
|
||||
|
||||
String testNameSplit[] = testName.replace('.', '_').split("_");
|
||||
StringBuilder group = new StringBuilder(testNameSplit[0]);
|
||||
for (int i = 1; i < LEVEL; i++) {
|
||||
group.append(".").append(testNameSplit[i]);
|
||||
}
|
||||
|
||||
if (!groups.contains(group.toString()))
|
||||
groups.add(group.toString());
|
||||
}
|
||||
|
||||
private static List<Path> listResFiles(Path dir, String pattern) throws IOException {
|
||||
List<Path> result = new ArrayList<>();
|
||||
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, pattern)) {
|
||||
for (Path entry : stream) {
|
||||
result.add(entry);
|
||||
}
|
||||
} catch (DirectoryIteratorException ex) {
|
||||
throw ex.getCause();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the reports from the base & target result XML
|
||||
*/
|
||||
private static void generateComparisonReport(Path directoryToResFiles) {
|
||||
|
||||
if (directoryToResFiles.toFile().isDirectory()) {
|
||||
List<Path> jbsdkFiles, openjdkFiles;
|
||||
|
||||
try {
|
||||
jbsdkFiles = listResFiles(directoryToResFiles, "*{jbsdk,jbre}*.{res}");
|
||||
openjdkFiles = listResFiles(directoryToResFiles, "*{openjdk}*.{res}");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
readScores(openjdkFiles.get(0), true);
|
||||
|
||||
for (Path file : jbsdkFiles) {
|
||||
readScores(file, false);
|
||||
}
|
||||
} else {
|
||||
readScores(directoryToResFiles, true);
|
||||
}
|
||||
}
|
||||
|
||||
private static void readScores(Path file, boolean rememberReference) {
|
||||
String fileName = file.getName(file.getNameCount() - 1).toString();
|
||||
String osName="", jdkName="", renderName="";
|
||||
if (fileName.contains("win") || fileName.contains("linux") || fileName.contains("osx")) {
|
||||
String[] fileNameComponents = fileName.split("_");
|
||||
if (fileNameComponents.length > 0)
|
||||
osName = fileNameComponents[0];
|
||||
if (fileNameComponents.length > 1)
|
||||
jdkName = fileNameComponents[1];
|
||||
if (fileNameComponents.length > 2)
|
||||
renderName = fileNameComponents[2];
|
||||
}
|
||||
|
||||
String resultXMLFileName = file.toString();
|
||||
|
||||
J2DAnalyzer.results = new Vector();
|
||||
J2DAnalyzer.readResults(resultXMLFileName);
|
||||
J2DAnalyzer.SingleResultSetHolder baseSRSH =
|
||||
(J2DAnalyzer.SingleResultSetHolder) J2DAnalyzer.results.elementAt(0);
|
||||
Enumeration baseEnum_ = baseSRSH.getKeyEnumeration();
|
||||
Vector<String> baseKeyvector = new Vector<>();
|
||||
while (baseEnum_.hasMoreElements()) {
|
||||
baseKeyvector.add((String) baseEnum_.nextElement());
|
||||
}
|
||||
String baseKeys[] = new String[baseKeyvector.size()];
|
||||
baseKeyvector.copyInto(baseKeys);
|
||||
J2DAnalyzer.sort(baseKeys);
|
||||
|
||||
Map<String, Double> consoleBaseRes = new HashMap<>();
|
||||
|
||||
Map<String, J2DAnalyzer.ResultHolder> testCaseBaseResult = new HashMap<>();
|
||||
Map<String, Integer> testCaseResultCount = new HashMap<>();
|
||||
|
||||
for (String baseKey : baseKeys) {
|
||||
|
||||
J2DAnalyzer.ResultHolder baseTCR =
|
||||
baseSRSH.getResultByKey(baseKey);
|
||||
|
||||
Integer curTestCountObj = testCaseResultCount.get(baseTCR.getName());
|
||||
int curTestCount = 0;
|
||||
if (curTestCountObj != null) {
|
||||
curTestCount = curTestCountObj;
|
||||
}
|
||||
curTestCount++;
|
||||
testCaseBaseResult.put(baseTCR.getName() + "_" + (curTestCount - 1), baseTCR);
|
||||
testCaseResultCount.put(baseTCR.getName(), curTestCount);
|
||||
|
||||
addGroup(baseTCR.getName());
|
||||
|
||||
Double curTotalScoreObj = consoleBaseRes.get(baseTCR.getName());
|
||||
double curTotalScore = 0;
|
||||
if (curTotalScoreObj != null) {
|
||||
curTotalScore = curTotalScoreObj;
|
||||
}
|
||||
curTotalScore = curTotalScore + baseTCR.getScore();
|
||||
consoleBaseRes.put(baseTCR.getName(), curTotalScore);
|
||||
}
|
||||
|
||||
String OJRname = osName + "." + jdkName + "." + renderName;
|
||||
generateTestCaseSummaryReport((OJRname.length() == 2? "": OJRname),
|
||||
consoleBaseRes,
|
||||
testCaseBaseResult,
|
||||
testCaseResultCount,
|
||||
rememberReference);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4341,48 +4341,22 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return start;
|
||||
}
|
||||
|
||||
// ChaCha20 block function. This version parallelizes 4 quarter
|
||||
// round operations at a time. It uses 16 SIMD registers to
|
||||
// produce 4 blocks of key stream.
|
||||
// ChaCha20 block function. This version parallelizes by loading
|
||||
// individual 32-bit state elements into vectors for four blocks
|
||||
// (e.g. all four blocks' worth of state[0] in one register, etc.)
|
||||
//
|
||||
// state (int[16]) = c_rarg0
|
||||
// keystream (byte[256]) = c_rarg1
|
||||
// keystream (byte[1024]) = c_rarg1
|
||||
// return - number of bytes of keystream (always 256)
|
||||
//
|
||||
// In this approach, we load the 512-bit start state sequentially into
|
||||
// 4 128-bit vectors. We then make 4 4-vector copies of that starting
|
||||
// state, with each successive set of 4 vectors having a +1 added into
|
||||
// the first 32-bit lane of the 4th vector in that group (the counter).
|
||||
// By doing this, we can perform the block function on 4 512-bit blocks
|
||||
// within one run of this intrinsic.
|
||||
// The alignment of the data across the 4-vector group is such that at
|
||||
// the start it is already aligned for the first round of each two-round
|
||||
// loop iteration. In other words, the corresponding lanes of each vector
|
||||
// will contain the values needed for that quarter round operation (e.g.
|
||||
// elements 0/4/8/12, 1/5/9/13, 2/6/10/14, etc.).
|
||||
// In between each full round, a lane shift must occur. Within a loop
|
||||
// iteration, between the first and second rounds, the 2nd, 3rd, and 4th
|
||||
// vectors are rotated left 32, 64 and 96 bits, respectively. The result
|
||||
// is effectively a diagonal orientation in columnar form. After the
|
||||
// second full round, those registers are left-rotated again, this time
|
||||
// 96, 64, and 32 bits - returning the vectors to their columnar organization.
|
||||
// After all 10 iterations, the original state is added to each 4-vector
|
||||
// working state along with the add mask, and the 4 vector groups are
|
||||
// sequentially written to the memory dedicated for the output key stream.
|
||||
//
|
||||
// For a more detailed explanation, see Goll and Gueron, "Vectorization of
|
||||
// ChaCha Stream Cipher", 2014 11th Int. Conf. on Information Technology:
|
||||
// New Generations, Las Vegas, NV, USA, April 2014, DOI: 10.1109/ITNG.2014.33
|
||||
address generate_chacha20Block_qrpar() {
|
||||
Label L_Q_twoRounds, L_Q_cc20_const;
|
||||
address generate_chacha20Block_blockpar() {
|
||||
Label L_twoRounds, L_cc20_const;
|
||||
// The constant data is broken into two 128-bit segments to be loaded
|
||||
// onto SIMD registers. The first 128 bits are a counter add overlay
|
||||
// that adds +1/+0/+0/+0 to the vectors holding replicated state[12].
|
||||
// onto FloatRegisters. The first 128 bits are a counter add overlay
|
||||
// that adds +0/+1/+2/+3 to the vector holding replicated state[12].
|
||||
// The second 128-bits is a table constant used for 8-bit left rotations.
|
||||
// on 32-bit lanes within a SIMD register.
|
||||
__ BIND(L_Q_cc20_const);
|
||||
__ emit_int64(0x0000000000000001UL);
|
||||
__ emit_int64(0x0000000000000000UL);
|
||||
__ BIND(L_cc20_const);
|
||||
__ emit_int64(0x0000000100000000UL);
|
||||
__ emit_int64(0x0000000300000002UL);
|
||||
__ emit_int64(0x0605040702010003UL);
|
||||
__ emit_int64(0x0E0D0C0F0A09080BUL);
|
||||
|
||||
@@ -4392,144 +4366,100 @@ class StubGenerator: public StubCodeGenerator {
|
||||
address start = __ pc();
|
||||
__ enter();
|
||||
|
||||
int i, j;
|
||||
const Register state = c_rarg0;
|
||||
const Register keystream = c_rarg1;
|
||||
const Register loopCtr = r10;
|
||||
const Register tmpAddr = r11;
|
||||
|
||||
const FloatRegister aState = v0;
|
||||
const FloatRegister bState = v1;
|
||||
const FloatRegister cState = v2;
|
||||
const FloatRegister dState = v3;
|
||||
const FloatRegister a1Vec = v4;
|
||||
const FloatRegister b1Vec = v5;
|
||||
const FloatRegister c1Vec = v6;
|
||||
const FloatRegister d1Vec = v7;
|
||||
// Skip the callee-saved registers v8 - v15
|
||||
const FloatRegister a2Vec = v16;
|
||||
const FloatRegister b2Vec = v17;
|
||||
const FloatRegister c2Vec = v18;
|
||||
const FloatRegister d2Vec = v19;
|
||||
const FloatRegister a3Vec = v20;
|
||||
const FloatRegister b3Vec = v21;
|
||||
const FloatRegister c3Vec = v22;
|
||||
const FloatRegister d3Vec = v23;
|
||||
const FloatRegister a4Vec = v24;
|
||||
const FloatRegister b4Vec = v25;
|
||||
const FloatRegister c4Vec = v26;
|
||||
const FloatRegister d4Vec = v27;
|
||||
const FloatRegister scratch = v28;
|
||||
const FloatRegister addMask = v29;
|
||||
const FloatRegister stateFirst = v0;
|
||||
const FloatRegister stateSecond = v1;
|
||||
const FloatRegister stateThird = v2;
|
||||
const FloatRegister stateFourth = v3;
|
||||
const FloatRegister origCtrState = v28;
|
||||
const FloatRegister scratch = v29;
|
||||
const FloatRegister lrot8Tbl = v30;
|
||||
|
||||
// Load the initial state in the first 4 quadword registers,
|
||||
// then copy the initial state into the next 4 quadword registers
|
||||
// that will be used for the working state.
|
||||
__ ld1(aState, bState, cState, dState, __ T16B, Address(state));
|
||||
// Organize SIMD registers in an array that facilitates
|
||||
// putting repetitive opcodes into loop structures. It is
|
||||
// important that each grouping of 4 registers is monotonically
|
||||
// increasing to support the requirements of multi-register
|
||||
// instructions (e.g. ld4r, st4, etc.)
|
||||
const FloatRegister workSt[16] = {
|
||||
v4, v5, v6, v7, v16, v17, v18, v19,
|
||||
v20, v21, v22, v23, v24, v25, v26, v27
|
||||
};
|
||||
|
||||
// Load the index register for 2 constant 128-bit data fields.
|
||||
// The first represents the +1/+0/+0/+0 add mask. The second is
|
||||
// the 8-bit left rotation.
|
||||
__ adr(tmpAddr, L_Q_cc20_const);
|
||||
__ ldpq(addMask, lrot8Tbl, Address(tmpAddr));
|
||||
// Load from memory and interlace across 16 SIMD registers,
|
||||
// With each word from memory being broadcast to all lanes of
|
||||
// each successive SIMD register.
|
||||
// Addr(0) -> All lanes in workSt[i]
|
||||
// Addr(4) -> All lanes workSt[i + 1], etc.
|
||||
__ mov(tmpAddr, state);
|
||||
for (i = 0; i < 16; i += 4) {
|
||||
__ ld4r(workSt[i], workSt[i + 1], workSt[i + 2], workSt[i + 3], __ T4S,
|
||||
__ post(tmpAddr, 16));
|
||||
}
|
||||
|
||||
__ mov(a1Vec, __ T16B, aState);
|
||||
__ mov(b1Vec, __ T16B, bState);
|
||||
__ mov(c1Vec, __ T16B, cState);
|
||||
__ mov(d1Vec, __ T16B, dState);
|
||||
// Pull in constant data. The first 16 bytes are the add overlay
|
||||
// which is applied to the vector holding the counter (state[12]).
|
||||
// The second 16 bytes is the index register for the 8-bit left
|
||||
// rotation tbl instruction.
|
||||
__ adr(tmpAddr, L_cc20_const);
|
||||
__ ldpq(origCtrState, lrot8Tbl, Address(tmpAddr));
|
||||
__ addv(workSt[12], __ T4S, workSt[12], origCtrState);
|
||||
|
||||
__ mov(a2Vec, __ T16B, aState);
|
||||
__ mov(b2Vec, __ T16B, bState);
|
||||
__ mov(c2Vec, __ T16B, cState);
|
||||
__ addv(d2Vec, __ T4S, d1Vec, addMask);
|
||||
|
||||
__ mov(a3Vec, __ T16B, aState);
|
||||
__ mov(b3Vec, __ T16B, bState);
|
||||
__ mov(c3Vec, __ T16B, cState);
|
||||
__ addv(d3Vec, __ T4S, d2Vec, addMask);
|
||||
|
||||
__ mov(a4Vec, __ T16B, aState);
|
||||
__ mov(b4Vec, __ T16B, bState);
|
||||
__ mov(c4Vec, __ T16B, cState);
|
||||
__ addv(d4Vec, __ T4S, d3Vec, addMask);
|
||||
|
||||
// Set up the 10 iteration loop
|
||||
// Set up the 10 iteration loop and perform all 8 quarter round ops
|
||||
__ mov(loopCtr, 10);
|
||||
__ BIND(L_Q_twoRounds);
|
||||
__ BIND(L_twoRounds);
|
||||
|
||||
// The first set of operations on the vectors covers the first 4 quarter
|
||||
// round operations:
|
||||
// Qround(state, 0, 4, 8,12)
|
||||
// Qround(state, 1, 5, 9,13)
|
||||
// Qround(state, 2, 6,10,14)
|
||||
// Qround(state, 3, 7,11,15)
|
||||
__ cc20_quarter_round(a1Vec, b1Vec, c1Vec, d1Vec, scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(a2Vec, b2Vec, c2Vec, d2Vec, scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(a3Vec, b3Vec, c3Vec, d3Vec, scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(a4Vec, b4Vec, c4Vec, d4Vec, scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(workSt[0], workSt[4], workSt[8], workSt[12],
|
||||
scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(workSt[1], workSt[5], workSt[9], workSt[13],
|
||||
scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(workSt[2], workSt[6], workSt[10], workSt[14],
|
||||
scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(workSt[3], workSt[7], workSt[11], workSt[15],
|
||||
scratch, lrot8Tbl);
|
||||
|
||||
// Shuffle the b1Vec/c1Vec/d1Vec to reorganize the state vectors to
|
||||
// diagonals. The a1Vec does not need to change orientation.
|
||||
__ cc20_shift_lane_org(b1Vec, c1Vec, d1Vec, true);
|
||||
__ cc20_shift_lane_org(b2Vec, c2Vec, d2Vec, true);
|
||||
__ cc20_shift_lane_org(b3Vec, c3Vec, d3Vec, true);
|
||||
__ cc20_shift_lane_org(b4Vec, c4Vec, d4Vec, true);
|
||||
|
||||
// The second set of operations on the vectors covers the second 4 quarter
|
||||
// round operations, now acting on the diagonals:
|
||||
// Qround(state, 0, 5,10,15)
|
||||
// Qround(state, 1, 6,11,12)
|
||||
// Qround(state, 2, 7, 8,13)
|
||||
// Qround(state, 3, 4, 9,14)
|
||||
__ cc20_quarter_round(a1Vec, b1Vec, c1Vec, d1Vec, scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(a2Vec, b2Vec, c2Vec, d2Vec, scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(a3Vec, b3Vec, c3Vec, d3Vec, scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(a4Vec, b4Vec, c4Vec, d4Vec, scratch, lrot8Tbl);
|
||||
|
||||
// Before we start the next iteration, we need to perform shuffles
|
||||
// on the b/c/d vectors to move them back to columnar organizations
|
||||
// from their current diagonal orientation.
|
||||
__ cc20_shift_lane_org(b1Vec, c1Vec, d1Vec, false);
|
||||
__ cc20_shift_lane_org(b2Vec, c2Vec, d2Vec, false);
|
||||
__ cc20_shift_lane_org(b3Vec, c3Vec, d3Vec, false);
|
||||
__ cc20_shift_lane_org(b4Vec, c4Vec, d4Vec, false);
|
||||
__ cc20_quarter_round(workSt[0], workSt[5], workSt[10], workSt[15],
|
||||
scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(workSt[1], workSt[6], workSt[11], workSt[12],
|
||||
scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(workSt[2], workSt[7], workSt[8], workSt[13],
|
||||
scratch, lrot8Tbl);
|
||||
__ cc20_quarter_round(workSt[3], workSt[4], workSt[9], workSt[14],
|
||||
scratch, lrot8Tbl);
|
||||
|
||||
// Decrement and iterate
|
||||
__ sub(loopCtr, loopCtr, 1);
|
||||
__ cbnz(loopCtr, L_Q_twoRounds);
|
||||
__ cbnz(loopCtr, L_twoRounds);
|
||||
|
||||
// Once the counter reaches zero, we fall out of the loop
|
||||
// and need to add the initial state back into the working state
|
||||
// represented by the a/b/c/d1Vec registers. This is destructive
|
||||
// on the dState register but we no longer will need it.
|
||||
__ addv(a1Vec, __ T4S, a1Vec, aState);
|
||||
__ addv(b1Vec, __ T4S, b1Vec, bState);
|
||||
__ addv(c1Vec, __ T4S, c1Vec, cState);
|
||||
__ addv(d1Vec, __ T4S, d1Vec, dState);
|
||||
__ mov(tmpAddr, state);
|
||||
|
||||
__ addv(a2Vec, __ T4S, a2Vec, aState);
|
||||
__ addv(b2Vec, __ T4S, b2Vec, bState);
|
||||
__ addv(c2Vec, __ T4S, c2Vec, cState);
|
||||
__ addv(dState, __ T4S, dState, addMask);
|
||||
__ addv(d2Vec, __ T4S, d2Vec, dState);
|
||||
// Add the starting state back to the post-loop keystream
|
||||
// state. We read/interlace the state array from memory into
|
||||
// 4 registers similar to what we did in the beginning. Then
|
||||
// add the counter overlay onto workSt[12] at the end.
|
||||
for (i = 0; i < 16; i += 4) {
|
||||
__ ld4r(stateFirst, stateSecond, stateThird, stateFourth, __ T4S,
|
||||
__ post(tmpAddr, 16));
|
||||
__ addv(workSt[i], __ T4S, workSt[i], stateFirst);
|
||||
__ addv(workSt[i + 1], __ T4S, workSt[i + 1], stateSecond);
|
||||
__ addv(workSt[i + 2], __ T4S, workSt[i + 2], stateThird);
|
||||
__ addv(workSt[i + 3], __ T4S, workSt[i + 3], stateFourth);
|
||||
}
|
||||
__ addv(workSt[12], __ T4S, workSt[12], origCtrState); // Add ctr mask
|
||||
|
||||
__ addv(a3Vec, __ T4S, a3Vec, aState);
|
||||
__ addv(b3Vec, __ T4S, b3Vec, bState);
|
||||
__ addv(c3Vec, __ T4S, c3Vec, cState);
|
||||
__ addv(dState, __ T4S, dState, addMask);
|
||||
__ addv(d3Vec, __ T4S, d3Vec, dState);
|
||||
|
||||
__ addv(a4Vec, __ T4S, a4Vec, aState);
|
||||
__ addv(b4Vec, __ T4S, b4Vec, bState);
|
||||
__ addv(c4Vec, __ T4S, c4Vec, cState);
|
||||
__ addv(dState, __ T4S, dState, addMask);
|
||||
__ addv(d4Vec, __ T4S, d4Vec, dState);
|
||||
|
||||
// Write the final state back to the result buffer
|
||||
__ st1(a1Vec, b1Vec, c1Vec, d1Vec, __ T16B, __ post(keystream, 64));
|
||||
__ st1(a2Vec, b2Vec, c2Vec, d2Vec, __ T16B, __ post(keystream, 64));
|
||||
__ st1(a3Vec, b3Vec, c3Vec, d3Vec, __ T16B, __ post(keystream, 64));
|
||||
__ st1(a4Vec, b4Vec, c4Vec, d4Vec, __ T16B, __ post(keystream, 64));
|
||||
// Write to key stream, storing the same element out of workSt[0..15]
|
||||
// to consecutive 4-byte offsets in the key stream buffer, then repeating
|
||||
// for the next element position.
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 16; j += 4) {
|
||||
__ st4(workSt[j], workSt[j + 1], workSt[j + 2], workSt[j + 3], __ S, i,
|
||||
__ post(keystream, 16));
|
||||
}
|
||||
}
|
||||
|
||||
__ mov(r0, 256); // Return length of output keystream
|
||||
__ leave();
|
||||
@@ -8936,7 +8866,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
#endif // COMPILER2
|
||||
|
||||
if (UseChaCha20Intrinsics) {
|
||||
StubRoutines::_chacha20Block = generate_chacha20Block_qrpar();
|
||||
StubRoutines::_chacha20Block = generate_chacha20Block_blockpar();
|
||||
}
|
||||
|
||||
if (UseBASE64Intrinsics) {
|
||||
|
||||
@@ -1409,14 +1409,6 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
|
||||
load_chr_insn str1_load_chr = str1_isL ? (load_chr_insn)&MacroAssembler::lbu : (load_chr_insn)&MacroAssembler::lhu;
|
||||
load_chr_insn str2_load_chr = str2_isL ? (load_chr_insn)&MacroAssembler::lbu : (load_chr_insn)&MacroAssembler::lhu;
|
||||
|
||||
int base_offset1 = arrayOopDesc::base_offset_in_bytes(T_BYTE);
|
||||
int base_offset2 = arrayOopDesc::base_offset_in_bytes(T_CHAR);
|
||||
|
||||
assert((base_offset1 % (UseCompactObjectHeaders ? 4 :
|
||||
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
|
||||
assert((base_offset2 % (UseCompactObjectHeaders ? 4 :
|
||||
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
|
||||
|
||||
BLOCK_COMMENT("string_compare {");
|
||||
|
||||
// Bizarrely, the counts are passed in bytes, regardless of whether they
|
||||
@@ -1434,24 +1426,6 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
|
||||
mv(cnt2, cnt1);
|
||||
bind(L);
|
||||
|
||||
// Load 4 bytes once to compare for alignment before main loop. Note that this
|
||||
// is only possible for LL/UU case. We need to resort to load_long_misaligned
|
||||
// for both LU and UL cases.
|
||||
if (str1_isL == str2_isL) { // LL or UU
|
||||
beq(str1, str2, DONE);
|
||||
int base_offset = isLL ? base_offset1 : base_offset2;
|
||||
if (AvoidUnalignedAccesses && (base_offset % 8) != 0) {
|
||||
mv(t0, minCharsInWord / 2);
|
||||
ble(cnt2, t0, SHORT_STRING);
|
||||
lwu(tmp1, Address(str1));
|
||||
lwu(tmp2, Address(str2));
|
||||
bne(tmp1, tmp2, DIFFERENCE);
|
||||
addi(str1, str1, 4);
|
||||
addi(str2, str2, 4);
|
||||
subi(cnt2, cnt2, minCharsInWord / 2);
|
||||
}
|
||||
}
|
||||
|
||||
// A very short string
|
||||
mv(t0, minCharsInWord);
|
||||
ble(cnt2, t0, SHORT_STRING);
|
||||
@@ -1460,14 +1434,8 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
|
||||
// load first parts of strings and finish initialization while loading
|
||||
{
|
||||
if (str1_isL == str2_isL) { // LL or UU
|
||||
#ifdef ASSERT
|
||||
Label align_ok;
|
||||
orr(t0, str1, str2);
|
||||
andi(t0, t0, 0x7);
|
||||
beqz(t0, align_ok);
|
||||
stop("bad alignment");
|
||||
bind(align_ok);
|
||||
#endif
|
||||
// check if str1 and str2 is same pointer
|
||||
beq(str1, str2, DONE);
|
||||
// load 8 bytes once to compare
|
||||
ld(tmp1, Address(str1));
|
||||
ld(tmp2, Address(str2));
|
||||
@@ -1484,7 +1452,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
|
||||
sub(cnt2, zr, cnt2);
|
||||
} else if (isLU) { // LU case
|
||||
lwu(tmp1, Address(str1));
|
||||
load_long_misaligned(tmp2, Address(str2), tmp3, (base_offset2 % 8) != 0 ? 4 : 8);
|
||||
ld(tmp2, Address(str2));
|
||||
mv(t0, STUB_THRESHOLD);
|
||||
bge(cnt2, t0, STUB);
|
||||
subi(cnt2, cnt2, 4);
|
||||
@@ -1497,11 +1465,11 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
|
||||
sub(cnt2, zr, cnt2);
|
||||
addi(cnt1, cnt1, 4);
|
||||
} else { // UL case
|
||||
load_long_misaligned(tmp1, Address(str1), tmp3, (base_offset2 % 8) != 0 ? 4 : 8);
|
||||
ld(tmp1, Address(str1));
|
||||
lwu(tmp2, Address(str2));
|
||||
mv(t0, STUB_THRESHOLD);
|
||||
bge(cnt2, t0, STUB);
|
||||
subi(cnt2, cnt2, 4);
|
||||
addi(cnt2, cnt2, -4);
|
||||
slli(t0, cnt2, 1);
|
||||
sub(cnt1, zr, t0);
|
||||
add(str1, str1, t0);
|
||||
@@ -1518,7 +1486,6 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
|
||||
// main loop
|
||||
bind(NEXT_WORD);
|
||||
if (str1_isL == str2_isL) { // LL or UU
|
||||
// both of the two loads are 8-byte aligned
|
||||
add(t0, str1, cnt2);
|
||||
ld(tmp1, Address(t0));
|
||||
add(t0, str2, cnt2);
|
||||
@@ -1528,7 +1495,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
|
||||
add(t0, str1, cnt1);
|
||||
lwu(tmp1, Address(t0));
|
||||
add(t0, str2, cnt2);
|
||||
load_long_misaligned(tmp2, Address(t0), tmp3, (base_offset2 % 8) != 0 ? 4 : 8);
|
||||
ld(tmp2, Address(t0));
|
||||
addi(cnt1, cnt1, 4);
|
||||
inflate_lo32(tmp3, tmp1);
|
||||
mv(tmp1, tmp3);
|
||||
@@ -1537,7 +1504,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
|
||||
add(t0, str2, cnt2);
|
||||
lwu(tmp2, Address(t0));
|
||||
add(t0, str1, cnt1);
|
||||
load_long_misaligned(tmp1, Address(t0), tmp3, (base_offset2 % 8) != 0 ? 4 : 8);
|
||||
ld(tmp1, Address(t0));
|
||||
inflate_lo32(tmp3, tmp2);
|
||||
mv(tmp2, tmp3);
|
||||
addi(cnt1, cnt1, 8);
|
||||
@@ -1670,9 +1637,6 @@ void C2_MacroAssembler::arrays_equals(Register a1, Register a2,
|
||||
int length_offset = arrayOopDesc::length_offset_in_bytes();
|
||||
int base_offset = arrayOopDesc::base_offset_in_bytes(elem_size == 2 ? T_CHAR : T_BYTE);
|
||||
|
||||
assert((base_offset % (UseCompactObjectHeaders ? 4 :
|
||||
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
|
||||
|
||||
Register cnt1 = tmp3;
|
||||
Register cnt2 = tmp1; // cnt2 only used in array length compare
|
||||
Label DONE, SAME, NEXT_WORD, SHORT, TAIL03, TAIL01;
|
||||
@@ -1696,31 +1660,10 @@ void C2_MacroAssembler::arrays_equals(Register a1, Register a2,
|
||||
|
||||
la(a1, Address(a1, base_offset));
|
||||
la(a2, Address(a2, base_offset));
|
||||
|
||||
// Load 4 bytes once to compare for alignment before main loop.
|
||||
if (AvoidUnalignedAccesses && (base_offset % 8) != 0) {
|
||||
subi(cnt1, cnt1, elem_per_word / 2);
|
||||
bltz(cnt1, TAIL03);
|
||||
lwu(tmp1, Address(a1));
|
||||
lwu(tmp2, Address(a2));
|
||||
addi(a1, a1, 4);
|
||||
addi(a2, a2, 4);
|
||||
bne(tmp1, tmp2, DONE);
|
||||
}
|
||||
|
||||
// Check for short strings, i.e. smaller than wordSize.
|
||||
subi(cnt1, cnt1, elem_per_word);
|
||||
bltz(cnt1, SHORT);
|
||||
|
||||
#ifdef ASSERT
|
||||
Label align_ok;
|
||||
orr(t0, a1, a2);
|
||||
andi(t0, t0, 0x7);
|
||||
beqz(t0, align_ok);
|
||||
stop("bad alignment");
|
||||
bind(align_ok);
|
||||
#endif
|
||||
|
||||
// Main 8 byte comparison loop.
|
||||
bind(NEXT_WORD); {
|
||||
ld(tmp1, Address(a1));
|
||||
@@ -1786,45 +1729,20 @@ void C2_MacroAssembler::arrays_equals(Register a1, Register a2,
|
||||
void C2_MacroAssembler::string_equals(Register a1, Register a2,
|
||||
Register result, Register cnt1)
|
||||
{
|
||||
Label SAME, DONE, SHORT, NEXT_WORD, TAIL03, TAIL01;
|
||||
Label SAME, DONE, SHORT, NEXT_WORD;
|
||||
Register tmp1 = t0;
|
||||
Register tmp2 = t1;
|
||||
|
||||
assert_different_registers(a1, a2, result, cnt1, tmp1, tmp2);
|
||||
|
||||
int base_offset = arrayOopDesc::base_offset_in_bytes(T_BYTE);
|
||||
|
||||
assert((base_offset % (UseCompactObjectHeaders ? 4 :
|
||||
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
|
||||
|
||||
BLOCK_COMMENT("string_equals {");
|
||||
|
||||
mv(result, false);
|
||||
|
||||
// Load 4 bytes once to compare for alignment before main loop.
|
||||
if (AvoidUnalignedAccesses && (base_offset % 8) != 0) {
|
||||
subi(cnt1, cnt1, 4);
|
||||
bltz(cnt1, TAIL03);
|
||||
lwu(tmp1, Address(a1));
|
||||
lwu(tmp2, Address(a2));
|
||||
addi(a1, a1, 4);
|
||||
addi(a2, a2, 4);
|
||||
bne(tmp1, tmp2, DONE);
|
||||
}
|
||||
|
||||
// Check for short strings, i.e. smaller than wordSize.
|
||||
subi(cnt1, cnt1, wordSize);
|
||||
bltz(cnt1, SHORT);
|
||||
|
||||
#ifdef ASSERT
|
||||
Label align_ok;
|
||||
orr(t0, a1, a2);
|
||||
andi(t0, t0, 0x7);
|
||||
beqz(t0, align_ok);
|
||||
stop("bad alignment");
|
||||
bind(align_ok);
|
||||
#endif
|
||||
|
||||
// Main 8 byte comparison loop.
|
||||
bind(NEXT_WORD); {
|
||||
ld(tmp1, Address(a1));
|
||||
@@ -1839,6 +1757,8 @@ void C2_MacroAssembler::string_equals(Register a1, Register a2,
|
||||
beqz(tmp1, SAME);
|
||||
|
||||
bind(SHORT);
|
||||
Label TAIL03, TAIL01;
|
||||
|
||||
// 0-7 bytes left.
|
||||
test_bit(tmp1, cnt1, 2);
|
||||
beqz(tmp1, TAIL03);
|
||||
@@ -2592,9 +2512,6 @@ void C2_MacroAssembler::arrays_equals_v(Register a1, Register a2, Register resul
|
||||
int length_offset = arrayOopDesc::length_offset_in_bytes();
|
||||
int base_offset = arrayOopDesc::base_offset_in_bytes(elem_size == 2 ? T_CHAR : T_BYTE);
|
||||
|
||||
assert((base_offset % (UseCompactObjectHeaders ? 4 :
|
||||
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
|
||||
|
||||
BLOCK_COMMENT("arrays_equals_v {");
|
||||
|
||||
// if (a1 == a2), return true
|
||||
|
||||
@@ -4307,7 +4307,7 @@ void MacroAssembler::population_count(Register dst, Register src,
|
||||
{
|
||||
bind(loop);
|
||||
addi(dst, dst, 1);
|
||||
subi(tmp2, tmp1, 1);
|
||||
addi(tmp2, tmp1, -1);
|
||||
andr(tmp1, tmp1, tmp2);
|
||||
bnez(tmp1, loop);
|
||||
}
|
||||
|
||||
@@ -2449,28 +2449,17 @@ class StubGenerator: public StubCodeGenerator {
|
||||
}
|
||||
|
||||
// code for comparing 8 characters of strings with Latin1 and Utf16 encoding
|
||||
void compare_string_8_x_LU(Register tmpL, Register tmpU,
|
||||
Register strL, Register strU, Label& DIFF) {
|
||||
void compare_string_8_x_LU(Register tmpL, Register tmpU, Register strL, Register strU, Label& DIFF) {
|
||||
const Register tmp = x30, tmpLval = x12;
|
||||
|
||||
int base_offset = arrayOopDesc::base_offset_in_bytes(T_CHAR);
|
||||
|
||||
assert((base_offset % (UseCompactObjectHeaders ? 4 :
|
||||
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
|
||||
|
||||
// strL is 8-byte aligned
|
||||
__ ld(tmpLval, Address(strL));
|
||||
__ addi(strL, strL, wordSize);
|
||||
|
||||
// compare first 4 characters
|
||||
__ load_long_misaligned(tmpU, Address(strU), tmp, (base_offset % 8) != 0 ? 4 : 8);
|
||||
__ ld(tmpU, Address(strU));
|
||||
__ addi(strU, strU, wordSize);
|
||||
__ inflate_lo32(tmpL, tmpLval);
|
||||
__ xorr(tmp, tmpU, tmpL);
|
||||
__ bnez(tmp, DIFF);
|
||||
|
||||
// compare second 4 characters
|
||||
__ load_long_misaligned(tmpU, Address(strU), tmp, (base_offset % 8) != 0 ? 4 : 8);
|
||||
__ ld(tmpU, Address(strU));
|
||||
__ addi(strU, strU, wordSize);
|
||||
__ inflate_hi32(tmpL, tmpLval);
|
||||
__ xorr(tmp, tmpU, tmpL);
|
||||
@@ -2504,14 +2493,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
const Register result = x10, str1 = x11, str2 = x13, cnt2 = x14,
|
||||
tmp1 = x28, tmp2 = x29, tmp3 = x30, tmp4 = x12;
|
||||
|
||||
int base_offset1 = arrayOopDesc::base_offset_in_bytes(T_BYTE);
|
||||
int base_offset2 = arrayOopDesc::base_offset_in_bytes(T_CHAR);
|
||||
|
||||
assert((base_offset1 % (UseCompactObjectHeaders ? 4 :
|
||||
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
|
||||
assert((base_offset2 % (UseCompactObjectHeaders ? 4 :
|
||||
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
|
||||
|
||||
// cnt2 == amount of characters left to compare
|
||||
// Check already loaded first 4 symbols
|
||||
__ inflate_lo32(tmp3, isLU ? tmp1 : tmp2);
|
||||
@@ -2528,19 +2509,17 @@ class StubGenerator: public StubCodeGenerator {
|
||||
tmpU = isLU ? tmp2 : tmp1, // where to keep U for comparison
|
||||
tmpL = isLU ? tmp1 : tmp2; // where to keep L for comparison
|
||||
|
||||
if (AvoidUnalignedAccesses && (base_offset1 % 8) == 0) {
|
||||
// Load another 4 bytes from strL to make sure main loop is 8-byte aligned
|
||||
// cnt2 is >= 68 here, no need to check it for >= 0
|
||||
__ lwu(tmpL, Address(strL));
|
||||
__ addi(strL, strL, wordSize / 2);
|
||||
__ load_long_misaligned(tmpU, Address(strU), tmp4, (base_offset2 % 8) != 0 ? 4 : 8);
|
||||
__ addi(strU, strU, wordSize);
|
||||
__ inflate_lo32(tmp3, tmpL);
|
||||
__ mv(tmpL, tmp3);
|
||||
__ xorr(tmp3, tmpU, tmpL);
|
||||
__ bnez(tmp3, CALCULATE_DIFFERENCE);
|
||||
__ subi(cnt2, cnt2, wordSize / 2);
|
||||
}
|
||||
// make sure main loop is 8 byte-aligned, we should load another 4 bytes from strL
|
||||
// cnt2 is >= 68 here, no need to check it for >= 0
|
||||
__ lwu(tmpL, Address(strL));
|
||||
__ addi(strL, strL, wordSize / 2);
|
||||
__ ld(tmpU, Address(strU));
|
||||
__ addi(strU, strU, wordSize);
|
||||
__ inflate_lo32(tmp3, tmpL);
|
||||
__ mv(tmpL, tmp3);
|
||||
__ xorr(tmp3, tmpU, tmpL);
|
||||
__ bnez(tmp3, CALCULATE_DIFFERENCE);
|
||||
__ addi(cnt2, cnt2, -wordSize / 2);
|
||||
|
||||
// we are now 8-bytes aligned on strL
|
||||
__ subi(cnt2, cnt2, wordSize * 2);
|
||||
@@ -4514,7 +4493,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
if (multi_block) {
|
||||
int total_adds = vset_sew == Assembler::e32 ? 240 : 608;
|
||||
__ subi(consts, consts, total_adds);
|
||||
__ addi(consts, consts, -total_adds);
|
||||
__ addi(ofs, ofs, vset_sew == Assembler::e32 ? 64 : 128);
|
||||
__ ble(ofs, limit, multi_block_loop);
|
||||
__ mv(c_rarg0, ofs); // return ofs
|
||||
|
||||
@@ -1087,10 +1087,6 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
return result;
|
||||
}
|
||||
|
||||
void * os::dll_load_utf8(const char *filename, char *ebuf, int ebuflen) {
|
||||
return os::dll_load(filename, ebuf, ebuflen);
|
||||
}
|
||||
|
||||
void os::print_dll_info(outputStream *st) {
|
||||
st->print_cr("Dynamic libraries:");
|
||||
LoadedLibraries::print(st);
|
||||
|
||||
@@ -1265,10 +1265,6 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
}
|
||||
#endif // !__APPLE__
|
||||
|
||||
void * os::dll_load_utf8(const char *filename, char *ebuf, int ebuflen) {
|
||||
return os::dll_load(filename, ebuf, ebuflen);
|
||||
}
|
||||
|
||||
static int _print_dll_info_cb(const char * name, address base_address,
|
||||
address top_address, void * param) {
|
||||
outputStream * out = (outputStream *) param;
|
||||
|
||||
@@ -1881,10 +1881,6 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void * os::dll_load_utf8(const char *filename, char *ebuf, int ebuflen) {
|
||||
return os::dll_load(filename, ebuf, ebuflen);
|
||||
}
|
||||
|
||||
void * os::Linux::dlopen_helper(const char *filename, char *ebuf, int ebuflen) {
|
||||
#ifndef IA32
|
||||
bool ieee_handling = IEEE_subnormal_handling_OK();
|
||||
|
||||
@@ -551,12 +551,6 @@ int JVM_HANDLE_XXX_SIGNAL(int sig, siginfo_t* info,
|
||||
{
|
||||
assert(info != nullptr && ucVoid != nullptr, "sanity");
|
||||
|
||||
if (sig == SIGABRT) {
|
||||
// Re-set the handler so that we don't recurse if/when abort() is called
|
||||
// from here.
|
||||
PosixSignals::install_generic_signal_handler(SIGABRT, (void*)SIG_DFL);
|
||||
}
|
||||
|
||||
// Note: it's not uncommon that JNI code uses signal/sigset to install,
|
||||
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
|
||||
// or have a SIGILL handler when detecting CPU type). When that happens,
|
||||
@@ -1338,10 +1332,6 @@ static void install_signal_handlers() {
|
||||
assert(ret == 0, "check");
|
||||
}
|
||||
|
||||
if (CatchSIGABRT) {
|
||||
set_signal_handler(SIGABRT);
|
||||
}
|
||||
|
||||
#if defined(__APPLE__)
|
||||
// lldb (gdb) installs both standard BSD signal handlers, and mach exception
|
||||
// handlers. By replacing the existing task exception handler, we disable lldb's mach
|
||||
|
||||
@@ -43,10 +43,7 @@ product(bool, EnableAllLargePageSizesForWindows, false, \
|
||||
"Windows Server") \
|
||||
\
|
||||
product(bool, UseOSErrorReporting, false, \
|
||||
"Let VM fatal error propagate to the OS (ie. WER on Windows)") \
|
||||
\
|
||||
product(bool, UseCriticalSection, true, EXPERIMENTAL, \
|
||||
"Use the critical section API instead of WaitForSingleObject")
|
||||
"Let VM fatal error propagate to the OS (ie. WER on Windows)")
|
||||
|
||||
// end of RUNTIME_OS_FLAGS
|
||||
|
||||
|
||||
@@ -1684,221 +1684,9 @@ static int _print_module(const char* fname, address base_address,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static errno_t convert_to_UTF16(char const* source_str, UINT source_encoding, LPWSTR* dest_utf16_str) {
|
||||
const int len_estimated = MultiByteToWideChar(source_encoding,
|
||||
MB_ERR_INVALID_CHARS,
|
||||
source_str,
|
||||
-1, // source is null-terminated
|
||||
NULL,
|
||||
0); // estimate characters count
|
||||
if (len_estimated == 0) {
|
||||
// Probably source_str contains characters that cannot be represented in the source_encoding given.
|
||||
*dest_utf16_str = NULL;
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
*dest_utf16_str = NEW_C_HEAP_ARRAY(WCHAR, len_estimated, mtInternal);
|
||||
|
||||
const int len_real = MultiByteToWideChar(source_encoding,
|
||||
MB_ERR_INVALID_CHARS,
|
||||
source_str,
|
||||
-1, // source is null-terminated
|
||||
*dest_utf16_str, len_estimated);
|
||||
assert(len_real == len_estimated, "length already checked above");
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
// Converts a string in the "platform" encoding to UTF16.
|
||||
static errno_t convert_to_UTF16(char const* platform_str, LPWSTR* utf16_str) {
|
||||
return convert_to_UTF16(platform_str, CP_ACP, utf16_str);
|
||||
}
|
||||
|
||||
static errno_t convert_UTF8_to_UTF16(char const* utf8_str, LPWSTR* utf16_str) {
|
||||
return convert_to_UTF16(utf8_str, CP_UTF8, utf16_str);
|
||||
}
|
||||
|
||||
// Converts a wide-character string in UTF-16 encoding to the 8-bit "platform" encoding.
|
||||
// Unless the platform encoding is UTF-8, not all characters in the source string can be represented in the dest string.
|
||||
// The function succeeds in this case anyway and just replaces these with a certain character.
|
||||
static errno_t convert_UTF16_to_platform(LPWSTR source_utf16_str, char*& dest_str) {
|
||||
const int len_estimated = WideCharToMultiByte(CP_ACP,
|
||||
0,
|
||||
source_utf16_str,
|
||||
-1, // source is null-terminated
|
||||
NULL,
|
||||
0, // estimate characters count
|
||||
NULL, NULL);
|
||||
if (len_estimated == 0) {
|
||||
dest_str = NULL;
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
dest_str = NEW_C_HEAP_ARRAY(CHAR, len_estimated, mtInternal);
|
||||
|
||||
const int len_real = WideCharToMultiByte(CP_ACP,
|
||||
0,
|
||||
source_utf16_str,
|
||||
-1, // source is null-terminated
|
||||
dest_str, len_estimated, NULL, NULL);
|
||||
assert(len_real == len_estimated, "length already checked above");
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
class MemoryReleaserW : public StackObj {
|
||||
private:
|
||||
WCHAR* _object_ptr;
|
||||
|
||||
public:
|
||||
MemoryReleaserW(WCHAR * object_ptr) : _object_ptr(object_ptr) {}
|
||||
~MemoryReleaserW() { if (_object_ptr != NULL) FREE_C_HEAP_ARRAY(WCHAR, _object_ptr); }
|
||||
};
|
||||
|
||||
class MemoryReleaser : public StackObj {
|
||||
private:
|
||||
CHAR* _object_ptr;
|
||||
|
||||
public:
|
||||
MemoryReleaser(CHAR * object_ptr) : _object_ptr(object_ptr) {}
|
||||
~MemoryReleaser() { if (_object_ptr != NULL) FREE_C_HEAP_ARRAY(CHAR, _object_ptr); }
|
||||
};
|
||||
|
||||
// Loads .dll/.so and
|
||||
// in case of error it checks if .dll/.so was built for the
|
||||
// same architecture as Hotspot is running on
|
||||
void * os::dll_load_utf8(const char *utf8_name, char *ebuf, int ebuflen) {
|
||||
LPWSTR utf16_name = NULL;
|
||||
errno_t err = convert_UTF8_to_UTF16(utf8_name, &utf16_name);
|
||||
MemoryReleaserW release_utf16_name(utf16_name);
|
||||
if (err != ERROR_SUCCESS) {
|
||||
errno = err;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char* platform_name = NULL; // name of the library converted to the "platform" encoding for use in log messages
|
||||
errno_t ignored_err = convert_UTF16_to_platform(utf16_name, platform_name);
|
||||
MemoryReleaser release_platform_name(platform_name);
|
||||
|
||||
log_info(os)("attempting shared library load of %s", platform_name);
|
||||
|
||||
void * result = LoadLibraryW(utf16_name);
|
||||
|
||||
if (result != NULL) {
|
||||
Events::log(NULL, "Loaded shared library %s", platform_name);
|
||||
// Recalculate pdb search path if a DLL was loaded successfully.
|
||||
SymbolEngine::recalc_search_path();
|
||||
log_info(os)("shared library load of %s was successful", platform_name);
|
||||
return result;
|
||||
}
|
||||
DWORD errcode = GetLastError();
|
||||
// Read system error message into ebuf
|
||||
// It may or may not be overwritten below (in the for loop and just above)
|
||||
lasterror(ebuf, (size_t) ebuflen);
|
||||
ebuf[ebuflen - 1] = '\0';
|
||||
Events::log(NULL, "Loading shared library %s failed, error code %lu", platform_name, errcode);
|
||||
log_info(os)("shared library load of %s failed, error code %lu", platform_name, errcode);
|
||||
|
||||
if (errcode == ERROR_MOD_NOT_FOUND) {
|
||||
strncpy(ebuf, "Can't find dependent libraries", ebuflen - 1);
|
||||
ebuf[ebuflen - 1] = '\0';
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Parsing dll below
|
||||
// If we can read dll-info and find that dll was built
|
||||
// for an architecture other than Hotspot is running in
|
||||
// - then print to buffer "DLL was built for a different architecture"
|
||||
// else call os::lasterror to obtain system error message
|
||||
int fd = ::wopen(utf16_name, O_RDONLY | O_BINARY, 0);
|
||||
if (fd < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint32_t signature_offset;
|
||||
uint16_t lib_arch = 0;
|
||||
bool failed_to_get_lib_arch =
|
||||
( // Go to position 3c in the dll
|
||||
(os::seek_to_file_offset(fd, IMAGE_FILE_PTR_TO_SIGNATURE) < 0)
|
||||
||
|
||||
// Read location of signature
|
||||
(sizeof(signature_offset) !=
|
||||
(::read(fd, (void*)&signature_offset, sizeof(signature_offset))))
|
||||
||
|
||||
// Go to COFF File Header in dll
|
||||
// that is located after "signature" (4 bytes long)
|
||||
(os::seek_to_file_offset(fd,
|
||||
signature_offset + IMAGE_FILE_SIGNATURE_LENGTH) < 0)
|
||||
||
|
||||
// Read field that contains code of architecture
|
||||
// that dll was built for
|
||||
(sizeof(lib_arch) != (::read(fd, (void*)&lib_arch, sizeof(lib_arch))))
|
||||
);
|
||||
|
||||
::close(fd);
|
||||
if (failed_to_get_lib_arch) {
|
||||
// file i/o error - report os::lasterror(...) msg
|
||||
return NULL;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
uint16_t arch_code;
|
||||
char* arch_name;
|
||||
} arch_t;
|
||||
|
||||
static const arch_t arch_array[] = {
|
||||
{IMAGE_FILE_MACHINE_I386, (char*)"IA 32"},
|
||||
{IMAGE_FILE_MACHINE_AMD64, (char*)"AMD 64"},
|
||||
{IMAGE_FILE_MACHINE_ARM64, (char*)"ARM 64"}
|
||||
};
|
||||
#if (defined _M_ARM64)
|
||||
static const uint16_t running_arch = IMAGE_FILE_MACHINE_ARM64;
|
||||
#elif (defined _M_AMD64)
|
||||
static const uint16_t running_arch = IMAGE_FILE_MACHINE_AMD64;
|
||||
#elif (defined _M_IX86)
|
||||
static const uint16_t running_arch = IMAGE_FILE_MACHINE_I386;
|
||||
#else
|
||||
#error Method os::dll_load requires that one of following \
|
||||
is defined :_M_AMD64 or _M_IX86 or _M_ARM64
|
||||
#endif
|
||||
|
||||
|
||||
// Obtain a string for printf operation
|
||||
// lib_arch_str shall contain string what platform this .dll was built for
|
||||
// running_arch_str shall string contain what platform Hotspot was built for
|
||||
char *running_arch_str = NULL, *lib_arch_str = NULL;
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(arch_array); i++) {
|
||||
if (lib_arch == arch_array[i].arch_code) {
|
||||
lib_arch_str = arch_array[i].arch_name;
|
||||
}
|
||||
if (running_arch == arch_array[i].arch_code) {
|
||||
running_arch_str = arch_array[i].arch_name;
|
||||
}
|
||||
}
|
||||
|
||||
assert(running_arch_str,
|
||||
"Didn't find running architecture code in arch_array");
|
||||
|
||||
// If the architecture is right
|
||||
// but some other error took place - report os::lasterror(...) msg
|
||||
if (lib_arch == running_arch) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (lib_arch_str != NULL) {
|
||||
jio_snprintf(ebuf, ebuflen - 1,
|
||||
"Can't load %s-bit .dll on a %s-bit platform",
|
||||
lib_arch_str, running_arch_str);
|
||||
} else {
|
||||
// don't know what architecture this dll was build for
|
||||
jio_snprintf(ebuf, ebuflen - 1,
|
||||
"Can't load this .dll (machine code=0x%x) on a %s-bit platform",
|
||||
lib_arch, running_arch_str);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void * os::dll_load(const char *name, char *ebuf, int ebuflen) {
|
||||
log_info(os)("attempting shared library load of %s", name);
|
||||
void* result;
|
||||
@@ -4887,7 +4675,7 @@ static wchar_t* wide_abs_unc_path(char const* path, errno_t & err, int additiona
|
||||
set_path_prefix(buf, &prefix, &prefix_off, &needs_fullpath);
|
||||
|
||||
LPWSTR unicode_path = nullptr;
|
||||
err = convert_to_UTF16(buf, &unicode_path);
|
||||
err = convert_to_unicode(buf, &unicode_path);
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
if (err != ERROR_SUCCESS) {
|
||||
return nullptr;
|
||||
|
||||
@@ -38,8 +38,6 @@ static INIT_ONCE initialized = INIT_ONCE_STATIC_INIT;
|
||||
static int lock_count = 0;
|
||||
static HANDLE lock_event;
|
||||
static DWORD lock_owner = 0;
|
||||
static CRITICAL_SECTION critical_section;
|
||||
|
||||
|
||||
//
|
||||
// Note that Microsoft's critical region code contains a race
|
||||
@@ -53,13 +51,8 @@ static CRITICAL_SECTION critical_section;
|
||||
//
|
||||
|
||||
static BOOL WINAPI initialize(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context) {
|
||||
if (UseCriticalSection) {
|
||||
bool success = InitializeCriticalSectionAndSpinCount(&critical_section, 0x00000400);
|
||||
assert(success, "unexpected return value from InitializeCriticalSectionAndSpinCount");
|
||||
} else {
|
||||
lock_event = CreateEvent(nullptr, false, true, nullptr);
|
||||
assert(lock_event != nullptr, "unexpected return value from CreateEvent");
|
||||
}
|
||||
lock_event = CreateEvent(nullptr, false, true, nullptr);
|
||||
assert(lock_event != nullptr, "unexpected return value from CreateEvent");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -68,14 +61,10 @@ ThreadCritical::ThreadCritical() {
|
||||
|
||||
DWORD current_thread = GetCurrentThreadId();
|
||||
if (lock_owner != current_thread) {
|
||||
if (UseCriticalSection) {
|
||||
EnterCriticalSection(&critical_section);
|
||||
} else {
|
||||
// Grab the lock before doing anything.
|
||||
DWORD ret = WaitForSingleObject(lock_event, INFINITE);
|
||||
assert(ret != WAIT_FAILED, "WaitForSingleObject failed with error code: %lu", GetLastError());
|
||||
assert(ret == WAIT_OBJECT_0, "WaitForSingleObject failed with return value: %lu", ret);
|
||||
}
|
||||
// Grab the lock before doing anything.
|
||||
DWORD ret = WaitForSingleObject(lock_event, INFINITE);
|
||||
assert(ret != WAIT_FAILED, "WaitForSingleObject failed with error code: %lu", GetLastError());
|
||||
assert(ret == WAIT_OBJECT_0, "WaitForSingleObject failed with return value: %lu", ret);
|
||||
lock_owner = current_thread;
|
||||
}
|
||||
// Atomicity isn't required. Bump the recursion count.
|
||||
@@ -90,12 +79,8 @@ ThreadCritical::~ThreadCritical() {
|
||||
if (lock_count == 0) {
|
||||
// We're going to unlock
|
||||
lock_owner = 0;
|
||||
if (UseCriticalSection) {
|
||||
LeaveCriticalSection(&critical_section);
|
||||
} else {
|
||||
// No lost wakeups, lock_event stays signaled until reset.
|
||||
DWORD ret = SetEvent(lock_event);
|
||||
assert(ret != 0, "unexpected return value from SetEvent");
|
||||
}
|
||||
// No lost wakeups, lock_event stays signaled until reset.
|
||||
DWORD ret = SetEvent(lock_event);
|
||||
assert(ret != 0, "unexpected return value from SetEvent");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -809,19 +809,6 @@ bool BlockBegin::try_merge(ValueStack* new_state, bool has_irreducible_loops) {
|
||||
}
|
||||
}
|
||||
|
||||
for_each_stack_value(existing_state, index, existing_value) {
|
||||
if ( !(existing_value->as_Phi() != NULL && existing_value->as_Phi()->block() == this)) {
|
||||
TRACE_PHI(tty->print_cr("Re-entered loop head without existing phi for stack - bailout"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for_each_local_value(existing_state, index, existing_value) {
|
||||
if (!(existing_value == new_state->local_at(index) || (existing_value->as_Phi() != NULL && existing_value->as_Phi()->as_Phi()->block() == this))) {
|
||||
TRACE_PHI(tty->print_cr("Re-entered loop head without existing phi for modified local - bailout"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
// check that all necessary phi functions are present
|
||||
for_each_stack_value(existing_state, index, existing_value) {
|
||||
|
||||
@@ -78,7 +78,7 @@ static FillersTable* _fillers;
|
||||
static int _num_native_ptrs = 0;
|
||||
|
||||
void ArchiveHeapWriter::init() {
|
||||
if (CDSConfig::is_dumping_heap()) {
|
||||
if (HeapShared::can_write()) {
|
||||
Universe::heap()->collect(GCCause::_java_lang_system_gc);
|
||||
|
||||
_buffer_offset_to_source_obj_table = new BufferOffsetToSourceObjectTable(/*size (prime)*/36137, /*max size*/1 * M);
|
||||
@@ -99,7 +99,7 @@ void ArchiveHeapWriter::add_source_obj(oop src_obj) {
|
||||
|
||||
void ArchiveHeapWriter::write(GrowableArrayCHeap<oop, mtClassShared>* roots,
|
||||
ArchiveHeapInfo* heap_info) {
|
||||
assert(CDSConfig::is_dumping_heap(), "sanity");
|
||||
assert(HeapShared::can_write(), "sanity");
|
||||
allocate_buffer();
|
||||
copy_source_objs_to_buffer(roots);
|
||||
set_requested_address(heap_info);
|
||||
|
||||
@@ -46,7 +46,6 @@ bool CDSConfig::_is_using_full_module_graph = true;
|
||||
bool CDSConfig::_has_aot_linked_classes = false;
|
||||
bool CDSConfig::_has_archived_invokedynamic = false;
|
||||
bool CDSConfig::_old_cds_flags_used = false;
|
||||
bool CDSConfig::_disable_heap_dumping = false;
|
||||
|
||||
char* CDSConfig::_default_archive_path = nullptr;
|
||||
char* CDSConfig::_static_archive_path = nullptr;
|
||||
@@ -533,53 +532,10 @@ bool CDSConfig::current_thread_is_vm_or_dumper() {
|
||||
return t != nullptr && (t->is_VM_thread() || t == _dumper_thread);
|
||||
}
|
||||
|
||||
// If an incompatible VM options is found, return a text message that explains why
|
||||
static const char* check_options_incompatible_with_dumping_heap() {
|
||||
#if INCLUDE_CDS_JAVA_HEAP
|
||||
if (!UseCompressedClassPointers) {
|
||||
return "UseCompressedClassPointers must be true";
|
||||
}
|
||||
|
||||
// Almost all GCs support heap region dump, except ZGC (so far).
|
||||
if (UseZGC) {
|
||||
return "ZGC is not supported";
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
#else
|
||||
return "JVM not configured for writing Java heap objects";
|
||||
#endif
|
||||
}
|
||||
|
||||
void CDSConfig::log_reasons_for_not_dumping_heap() {
|
||||
const char* reason;
|
||||
|
||||
assert(!is_dumping_heap(), "sanity");
|
||||
|
||||
if (_disable_heap_dumping) {
|
||||
reason = "Programmatically disabled";
|
||||
} else {
|
||||
reason = check_options_incompatible_with_dumping_heap();
|
||||
}
|
||||
|
||||
assert(reason != nullptr, "sanity");
|
||||
log_info(cds)("Archived java heap is not supported: %s", reason);
|
||||
}
|
||||
|
||||
#if INCLUDE_CDS_JAVA_HEAP
|
||||
bool CDSConfig::are_vm_options_incompatible_with_dumping_heap() {
|
||||
return check_options_incompatible_with_dumping_heap() != nullptr;
|
||||
}
|
||||
|
||||
|
||||
bool CDSConfig::is_dumping_heap() {
|
||||
if (!is_dumping_static_archive() // heap dump is not supported in dynamic dump
|
||||
|| are_vm_options_incompatible_with_dumping_heap()
|
||||
|| _disable_heap_dumping) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
// heap dump is not supported in dynamic dump
|
||||
return is_dumping_static_archive() && HeapShared::can_write();
|
||||
}
|
||||
|
||||
bool CDSConfig::is_loading_heap() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -46,7 +46,6 @@ class CDSConfig : public AllStatic {
|
||||
static char* _dynamic_archive_path;
|
||||
|
||||
static bool _old_cds_flags_used;
|
||||
static bool _disable_heap_dumping;
|
||||
|
||||
static JavaThread* _dumper_thread;
|
||||
#endif
|
||||
@@ -117,10 +116,6 @@ public:
|
||||
|
||||
// --- Archived java objects
|
||||
|
||||
static bool are_vm_options_incompatible_with_dumping_heap() NOT_CDS_JAVA_HEAP_RETURN_(true);
|
||||
static void log_reasons_for_not_dumping_heap();
|
||||
|
||||
static void disable_heap_dumping() { CDS_ONLY(_disable_heap_dumping = true); }
|
||||
static bool is_dumping_heap() NOT_CDS_JAVA_HEAP_RETURN_(false);
|
||||
static bool is_loading_heap() NOT_CDS_JAVA_HEAP_RETURN_(false);
|
||||
static bool is_initing_classes_at_dump_time() NOT_CDS_JAVA_HEAP_RETURN_(false);
|
||||
|
||||
@@ -1601,7 +1601,7 @@ void FileMapInfo::write_region(int region, char* base, size_t size,
|
||||
// This is an unused region (e.g., a heap region when !INCLUDE_CDS_JAVA_HEAP)
|
||||
requested_base = nullptr;
|
||||
} else if (HeapShared::is_heap_region(region)) {
|
||||
assert(CDSConfig::is_dumping_heap(), "sanity");
|
||||
assert(HeapShared::can_write(), "sanity");
|
||||
#if INCLUDE_CDS_JAVA_HEAP
|
||||
assert(!CDSConfig::is_dumping_dynamic_archive(), "must be");
|
||||
requested_base = (char*)ArchiveHeapWriter::requested_address();
|
||||
|
||||
@@ -86,6 +86,7 @@ struct ArchivableStaticFieldInfo {
|
||||
}
|
||||
};
|
||||
|
||||
bool HeapShared::_disable_writing = false;
|
||||
DumpedInternedStrings *HeapShared::_dumped_interned_strings = nullptr;
|
||||
|
||||
size_t HeapShared::_alloc_count[HeapShared::ALLOC_STAT_SLOTS];
|
||||
@@ -235,6 +236,9 @@ int HeapShared::append_root(oop obj) {
|
||||
objArrayOop HeapShared::root_segment(int segment_idx) {
|
||||
if (CDSConfig::is_dumping_heap()) {
|
||||
assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread");
|
||||
if (!HeapShared::can_write()) {
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
assert(CDSConfig::is_using_archive(), "must be");
|
||||
}
|
||||
@@ -710,7 +714,7 @@ void HeapShared::scan_java_class(Klass* orig_k) {
|
||||
}
|
||||
|
||||
void HeapShared::archive_subgraphs() {
|
||||
assert(CDSConfig::is_dumping_heap(), "must be");
|
||||
assert(HeapShared::can_write(), "must be");
|
||||
|
||||
archive_object_subgraphs(archive_subgraph_entry_fields,
|
||||
false /* is_full_module_graph */);
|
||||
@@ -1870,7 +1874,7 @@ void HeapShared::init_subgraph_entry_fields(ArchivableStaticFieldInfo fields[],
|
||||
}
|
||||
|
||||
void HeapShared::init_subgraph_entry_fields(TRAPS) {
|
||||
assert(CDSConfig::is_dumping_heap(), "must be");
|
||||
assert(HeapShared::can_write(), "must be");
|
||||
_dump_time_subgraph_info_table = new (mtClass)DumpTimeKlassSubGraphInfoTable();
|
||||
init_subgraph_entry_fields(archive_subgraph_entry_fields, CHECK);
|
||||
if (CDSConfig::is_dumping_full_module_graph()) {
|
||||
@@ -1959,7 +1963,7 @@ void HeapShared::initialize_test_class_from_archive(JavaThread* current) {
|
||||
#endif
|
||||
|
||||
void HeapShared::init_for_dumping(TRAPS) {
|
||||
if (CDSConfig::is_dumping_heap()) {
|
||||
if (HeapShared::can_write()) {
|
||||
setup_test_class(ArchiveHeapTestClass);
|
||||
_dumped_interned_strings = new (mtClass)DumpedInternedStrings(INITIAL_TABLE_SIZE, MAX_TABLE_SIZE);
|
||||
init_subgraph_entry_fields(CHECK);
|
||||
|
||||
@@ -143,6 +143,26 @@ class HeapShared: AllStatic {
|
||||
friend class VerifySharedOopClosure;
|
||||
|
||||
public:
|
||||
// Can this VM write a heap region into the CDS archive?
|
||||
static bool can_write() {
|
||||
CDS_JAVA_HEAP_ONLY(
|
||||
if (_disable_writing) {
|
||||
return false;
|
||||
}
|
||||
// Need compressed class pointers for heap region dump.
|
||||
if (!UseCompressedClassPointers) {
|
||||
return false;
|
||||
}
|
||||
// Almost all GCs support heap region dump, except ZGC (so far).
|
||||
return !UseZGC;
|
||||
)
|
||||
NOT_CDS_JAVA_HEAP(return false;)
|
||||
}
|
||||
|
||||
static void disable_writing() {
|
||||
CDS_JAVA_HEAP_ONLY(_disable_writing = true;)
|
||||
}
|
||||
|
||||
static bool is_subgraph_root_class(InstanceKlass* ik);
|
||||
|
||||
// Scratch objects for archiving Klass::java_mirror()
|
||||
@@ -153,6 +173,7 @@ public:
|
||||
|
||||
private:
|
||||
#if INCLUDE_CDS_JAVA_HEAP
|
||||
static bool _disable_writing;
|
||||
static DumpedInternedStrings *_dumped_interned_strings;
|
||||
|
||||
// statistics
|
||||
@@ -356,6 +377,7 @@ private:
|
||||
}
|
||||
|
||||
static int archive_exception_instance(oop exception);
|
||||
static void write_heap(ArchiveHeapInfo* heap_info);
|
||||
|
||||
static bool archive_reachable_objects_from(int level,
|
||||
KlassSubGraphInfo* subgraph_info,
|
||||
@@ -402,7 +424,6 @@ private:
|
||||
#endif // INCLUDE_CDS_JAVA_HEAP
|
||||
|
||||
public:
|
||||
static void write_heap(ArchiveHeapInfo* heap_info) NOT_CDS_JAVA_HEAP_RETURN;
|
||||
static objArrayOop scratch_resolved_references(ConstantPool* src);
|
||||
static void add_scratch_resolved_references(ConstantPool* src, objArrayOop dest) NOT_CDS_JAVA_HEAP_RETURN;
|
||||
static void init_scratch_objects(TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
|
||||
|
||||
@@ -552,7 +552,7 @@ private:
|
||||
FileMapInfo* _map_info;
|
||||
StaticArchiveBuilder& _builder;
|
||||
|
||||
void dump_java_heap_objects();
|
||||
void dump_java_heap_objects(GrowableArray<Klass*>* klasses) NOT_CDS_JAVA_HEAP_RETURN;
|
||||
void dump_shared_symbol_table(GrowableArray<Symbol*>* symbols) {
|
||||
log_info(cds)("Dumping symbol table ...");
|
||||
SymbolTable::write_to_archive(symbols);
|
||||
@@ -653,7 +653,7 @@ void VM_PopulateDumpSharedSpace::doit() {
|
||||
MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);
|
||||
|
||||
#if INCLUDE_CDS_JAVA_HEAP
|
||||
if (CDSConfig::is_dumping_heap() && _extra_interned_strings != nullptr) {
|
||||
if (HeapShared::can_write() && _extra_interned_strings != nullptr) {
|
||||
for (int i = 0; i < _extra_interned_strings->length(); i ++) {
|
||||
OopHandle string = _extra_interned_strings->at(i);
|
||||
HeapShared::add_to_dumped_interned_strings(string.resolve());
|
||||
@@ -675,7 +675,7 @@ void VM_PopulateDumpSharedSpace::doit() {
|
||||
_builder.make_klasses_shareable();
|
||||
MetaspaceShared::make_method_handle_intrinsics_shareable();
|
||||
|
||||
dump_java_heap_objects();
|
||||
dump_java_heap_objects(_builder.klasses());
|
||||
dump_shared_symbol_table(_builder.symbols());
|
||||
|
||||
char* early_serialized_data = dump_early_read_only_tables();
|
||||
@@ -1043,13 +1043,19 @@ bool MetaspaceShared::try_link_class(JavaThread* current, InstanceKlass* ik) {
|
||||
}
|
||||
}
|
||||
|
||||
void VM_PopulateDumpSharedSpace::dump_java_heap_objects() {
|
||||
if (CDSConfig::is_dumping_heap()) {
|
||||
HeapShared::write_heap(&_heap_info);
|
||||
} else {
|
||||
CDSConfig::log_reasons_for_not_dumping_heap();
|
||||
#if INCLUDE_CDS_JAVA_HEAP
|
||||
void VM_PopulateDumpSharedSpace::dump_java_heap_objects(GrowableArray<Klass*>* klasses) {
|
||||
if (!HeapShared::can_write()) {
|
||||
log_info(cds)(
|
||||
"Archived java heap is not supported as UseG1GC "
|
||||
"and UseCompressedClassPointers are required."
|
||||
"Current settings: UseG1GC=%s, UseCompressedClassPointers=%s.",
|
||||
BOOL_TO_STR(UseG1GC), BOOL_TO_STR(UseCompressedClassPointers));
|
||||
return;
|
||||
}
|
||||
HeapShared::write_heap(&_heap_info);
|
||||
}
|
||||
#endif // INCLUDE_CDS_JAVA_HEAP
|
||||
|
||||
void MetaspaceShared::set_shared_metaspace_range(void* base, void *static_top, void* top) {
|
||||
assert(base <= static_top && static_top <= top, "must be");
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#include "utilities/growableArray.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#include "utilities/ostream.hpp"
|
||||
#include "utilities/vmError.hpp"
|
||||
|
||||
volatile size_t ClassLoaderDataGraph::_num_array_classes = 0;
|
||||
volatile size_t ClassLoaderDataGraph::_num_instance_classes = 0;
|
||||
@@ -186,8 +185,7 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool has_class_mirror_
|
||||
inline void assert_is_safepoint_or_gc() {
|
||||
assert(SafepointSynchronize::is_at_safepoint() ||
|
||||
Thread::current()->is_ConcurrentGC_thread() ||
|
||||
Thread::current()->is_Worker_thread() ||
|
||||
VMError::is_error_reported(), // don't crash here again if we have already crashed
|
||||
Thread::current()->is_Worker_thread(),
|
||||
"Must be called by safepoint or GC");
|
||||
}
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ void ClassLoaderExt::record_result(const s2 classpath_index, InstanceKlass* resu
|
||||
ResourceMark rm;
|
||||
log_warning(cds)("CDS heap objects cannot be written because class %s maybe modified by ClassFileLoadHook.",
|
||||
result->external_name());
|
||||
CDSConfig::disable_heap_dumping();
|
||||
HeapShared::disable_writing();
|
||||
}
|
||||
#endif // INCLUDE_CDS_JAVA_HEAP
|
||||
}
|
||||
|
||||
@@ -1012,7 +1012,7 @@ void StringTable::verify_secondary_array_index_bits() {
|
||||
// [1] Store it into _shared_strings_array. Encode its position as a 32-bit index.
|
||||
// [2] Store the index and hashcode into _shared_table.
|
||||
oop StringTable::init_shared_strings_array(const DumpedInternedStrings* dumped_interned_strings) {
|
||||
assert(CDSConfig::is_dumping_heap(), "must be");
|
||||
assert(HeapShared::can_write(), "must be");
|
||||
objArrayOop array = (objArrayOop)(_shared_strings_array.resolve());
|
||||
|
||||
verify_secondary_array_index_bits();
|
||||
|
||||
@@ -424,39 +424,36 @@ InstanceKlass* SystemDictionary::resolve_with_circularity_detection(Symbol* clas
|
||||
assert(next_name != nullptr, "null superclass for resolving");
|
||||
assert(!Signature::is_array(next_name), "invalid superclass name");
|
||||
|
||||
ClassLoaderData* loader_data = class_loader_data(class_loader);
|
||||
// If class_name is already loaded, just return the superclass or superinterface.
|
||||
// Make sure there's a placeholder for the class_name before resolving.
|
||||
// This is used as a claim that this thread is currently loading superclass/classloader
|
||||
// and for ClassCircularity checks.
|
||||
|
||||
if (is_superclass) {
|
||||
InstanceKlass* klassk = loader_data->dictionary()->find_class(THREAD, class_name);
|
||||
if (klassk != nullptr) {
|
||||
// We can come here for two reasons:
|
||||
// (a) RedefineClasses -- the class is already loaded
|
||||
// (b) Rarely, the class might have been loaded by a parallel thread
|
||||
// We can do a quick check against the already assigned superclass's name and loader.
|
||||
InstanceKlass* superk = klassk->java_super();
|
||||
if (superk != nullptr &&
|
||||
superk->name() == next_name &&
|
||||
superk->class_loader() == class_loader()) {
|
||||
return superk;
|
||||
}
|
||||
}
|
||||
}
|
||||
ClassLoaderData* loader_data = class_loader_data(class_loader);
|
||||
Dictionary* dictionary = loader_data->dictionary();
|
||||
|
||||
// can't throw error holding a lock
|
||||
bool throw_circularity_error = false;
|
||||
{
|
||||
MutexLocker mu(THREAD, SystemDictionary_lock);
|
||||
|
||||
// Must check ClassCircularity before resolving next_name (superclass or interface).
|
||||
PlaceholderEntry* probe = PlaceholderTable::get_entry(class_name, loader_data);
|
||||
if (probe != nullptr && probe->check_seen_thread(THREAD, PlaceholderTable::DETECT_CIRCULARITY)) {
|
||||
log_circularity_error(class_name, probe);
|
||||
throw_circularity_error = true;
|
||||
InstanceKlass* klassk = dictionary->find_class(THREAD, class_name);
|
||||
InstanceKlass* quicksuperk;
|
||||
// To support parallel loading: if class is done loading, just return the superclass
|
||||
// if the next_name matches class->super()->name() and if the class loaders match.
|
||||
if (klassk != nullptr && is_superclass &&
|
||||
((quicksuperk = klassk->java_super()) != nullptr) &&
|
||||
((quicksuperk->name() == next_name) &&
|
||||
(quicksuperk->class_loader() == class_loader()))) {
|
||||
return quicksuperk;
|
||||
} else {
|
||||
// Must check ClassCircularity before checking if superclass is already loaded.
|
||||
PlaceholderEntry* probe = PlaceholderTable::get_entry(class_name, loader_data);
|
||||
if (probe && probe->check_seen_thread(THREAD, PlaceholderTable::DETECT_CIRCULARITY)) {
|
||||
log_circularity_error(class_name, probe);
|
||||
throw_circularity_error = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure there's a placeholder for the class_name before resolving.
|
||||
// This is used as a claim that this thread is currently loading superclass/classloader
|
||||
// and for ClassCircularity checks.
|
||||
if (!throw_circularity_error) {
|
||||
// Be careful not to exit resolve_with_circularity_detection without removing this placeholder.
|
||||
PlaceholderEntry* newprobe = PlaceholderTable::find_and_add(class_name,
|
||||
@@ -504,11 +501,12 @@ static void handle_parallel_super_load(Symbol* name,
|
||||
TRAPS) {
|
||||
|
||||
// The result superk is not used; resolve_with_circularity_detection is called for circularity check only.
|
||||
// This passes false to is_superclass to skip doing the unlikely optimization.
|
||||
// This passes true to is_superclass even though it might not be the super class in order to perform the
|
||||
// optimization anyway.
|
||||
Klass* superk = SystemDictionary::resolve_with_circularity_detection(name,
|
||||
superclassname,
|
||||
class_loader,
|
||||
false,
|
||||
true,
|
||||
CHECK);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
||||
@@ -1848,13 +1848,6 @@ bool G1CollectedHeap::try_collect_fullgc(GCCause::Cause cause,
|
||||
const G1GCCounters& counters_before) {
|
||||
assert_heap_not_locked();
|
||||
|
||||
if (cause == GCCause::_jbr_gc_run) {
|
||||
VM_G1CollectForAllocation op(0, // no following allocation
|
||||
counters_before.total_collections(),
|
||||
cause);
|
||||
VMThread::execute(&op);
|
||||
}
|
||||
|
||||
while(true) {
|
||||
VM_G1CollectFull op(counters_before.total_collections(),
|
||||
counters_before.total_full_collections(),
|
||||
|
||||
@@ -50,13 +50,8 @@ bool VM_G1CollectFull::skip_operation() const {
|
||||
void VM_G1CollectFull::doit() {
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
GCCauseSetter x(g1h, _gc_cause);
|
||||
if (_gc_cause == GCCause::_jbr_gc_run) {
|
||||
_gc_succeeded = g1h->do_full_collection(true /* clear_all_soft_refs */,
|
||||
true /* do_maximal_compaction */);
|
||||
} else {
|
||||
_gc_succeeded = g1h->do_full_collection(false /* clear_all_soft_refs */,
|
||||
false /* do_maximal_compaction */);
|
||||
}
|
||||
_gc_succeeded = g1h->do_full_collection(false /* clear_all_soft_refs */,
|
||||
false /* do_maximal_compaction */);
|
||||
}
|
||||
|
||||
VM_G1TryInitiateConcMark::VM_G1TryInitiateConcMark(uint gc_count_before,
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "gc/shared/gcCause.hpp"
|
||||
#include "classfile/classLoaderDataGraph.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "classfile/symbolTable.hpp"
|
||||
@@ -431,8 +430,7 @@ HeapWord* SerialHeap::mem_allocate(size_t size,
|
||||
|
||||
bool SerialHeap::must_clear_all_soft_refs() {
|
||||
return _gc_cause == GCCause::_metadata_GC_clear_soft_refs ||
|
||||
_gc_cause == GCCause::_wb_full_gc ||
|
||||
_gc_cause == GCCause::_jbr_gc_run;
|
||||
_gc_cause == GCCause::_wb_full_gc;
|
||||
}
|
||||
|
||||
bool SerialHeap::is_young_gc_safe() const {
|
||||
|
||||
@@ -125,9 +125,6 @@ const char* GCCause::to_string(GCCause::Cause cause) {
|
||||
case _last_gc_cause:
|
||||
return "ILLEGAL VALUE - last gc cause - ILLEGAL VALUE";
|
||||
|
||||
case _jbr_gc_run:
|
||||
return "JBR full GC";
|
||||
|
||||
default:
|
||||
return "unknown GCCause";
|
||||
}
|
||||
|
||||
@@ -72,7 +72,6 @@ class GCCause : public AllStatic {
|
||||
_g1_periodic_collection,
|
||||
|
||||
_dcmd_gc_run,
|
||||
_jbr_gc_run,
|
||||
|
||||
_shenandoah_stop_vm,
|
||||
_shenandoah_allocation_failure_evac,
|
||||
@@ -91,8 +90,7 @@ class GCCause : public AllStatic {
|
||||
|
||||
inline static bool is_user_requested_gc(GCCause::Cause cause) {
|
||||
return (cause == GCCause::_java_lang_system_gc ||
|
||||
cause == GCCause::_dcmd_gc_run ||
|
||||
cause == GCCause::_jbr_gc_run);
|
||||
cause == GCCause::_dcmd_gc_run);
|
||||
}
|
||||
|
||||
inline static bool is_explicit_full_gc(GCCause::Cause cause) {
|
||||
|
||||
@@ -237,7 +237,7 @@ void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectio
|
||||
evacInfo.set_regular_promoted_free(regular_regions_promoted_free);
|
||||
evacInfo.set_regions_immediate(immediate_regions);
|
||||
evacInfo.set_immediate_size(immediate_garbage);
|
||||
evacInfo.set_free_regions(free_regions);
|
||||
evacInfo.set_regions_freed(free_regions);
|
||||
|
||||
ShenandoahTracer().report_evacuation_info(&evacInfo);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user