Skip to content
forked from openjdk/jdk

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
theaoqi committed Sep 19, 2022
2 parents 3e50300 + 0d51f63 commit 9b721b1
Show file tree
Hide file tree
Showing 448 changed files with 7,055 additions and 8,678 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,14 @@ on:
workflow_call:
inputs:
gcc-major-version:
required: false
required: true
type: string
default: '10'
apt-gcc-version:
required: false
required: true
type: string
default: '10.3.0-1ubuntu1~20.04'
apt-gcc-cross-suffix:
required: false
apt-gcc-cross-version:
required: true
type: string
default: 'cross1'

jobs:
build-cross-compile:
Expand Down Expand Up @@ -95,8 +92,8 @@ jobs:
sudo apt-get install \
gcc-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
g++-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-version }}${{ inputs.apt-gcc-cross-suffix }} \
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-version }}${{ inputs.apt-gcc-cross-suffix }} \
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
Expand Down Expand Up @@ -143,8 +140,8 @@ jobs:
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
--with-sysroot=sysroot
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-10
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-10
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
- name: 'Build'
id: build
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ on:
required: false
type: string
default: '[ "debug", "release" ]'
gcc-major-version:
required: true
type: string
gcc-package-suffix:
required: false
type: string
default: ''
apt-gcc-version:
required: true
type: string
Expand Down Expand Up @@ -101,8 +108,8 @@ jobs:
fi
sudo apt-get update
sudo apt-get install --only-upgrade apt
sudo apt-get install gcc-${{ inputs.apt-gcc-version }} g++-${{ inputs.apt-gcc-version }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }}=${{ inputs.apt-gcc-version }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }}=${{ inputs.apt-gcc-version }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
- name: 'Configure'
run: >
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ jobs:
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
gcc-major-version: '10'
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
# 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'

Expand All @@ -133,7 +134,9 @@ jobs:
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x86
apt-gcc-version: '10-multilib'
gcc-major-version: '10'
gcc-package-suffix: '-multilib'
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
apt-architecture: 'i386'
# Some multilib libraries do not have proper inter-dependencies, so we have to
# install their dependencies manually.
Expand All @@ -149,7 +152,8 @@ jobs:
platform: linux-x64
make-target: 'hotspot'
debug-levels: '[ "debug" ]'
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
gcc-major-version: '10'
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
extra-conf-options: '--disable-precompiled-headers'
if: needs.select.outputs.linux-x64-variants == 'true'

Expand All @@ -161,7 +165,8 @@ jobs:
platform: linux-x64
make-target: 'hotspot'
debug-levels: '[ "debug" ]'
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
gcc-major-version: '10'
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers'
if: needs.select.outputs.linux-x64-variants == 'true'

Expand All @@ -173,7 +178,8 @@ jobs:
platform: linux-x64
make-target: 'hotspot'
debug-levels: '[ "debug" ]'
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
gcc-major-version: '10'
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers'
if: needs.select.outputs.linux-x64-variants == 'true'

Expand All @@ -186,7 +192,8 @@ jobs:
make-target: 'hotspot'
# Technically this is not the "debug" level, but we can't inject a new matrix state for just this job
debug-levels: '[ "debug" ]'
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
gcc-major-version: '10'
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers'
if: needs.select.outputs.linux-x64-variants == 'true'

Expand All @@ -196,6 +203,10 @@ jobs:
- select
- build-linux-x64
uses: ./.github/workflows/build-cross-compile.yml
with:
gcc-major-version: '10'
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
apt-gcc-cross-version: '10.3.0-1ubuntu1~20.04cross1'
if: needs.select.outputs.linux-cross-compile == 'true'

build-macos-x64:
Expand Down
3 changes: 3 additions & 0 deletions doc/testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ <h2 id="using-make-test-the-run-test-framework">Using &quot;make test&quot; (the
<h3 id="configuration">Configuration</h3>
<p>To be able to run JTReg tests, <code>configure</code> needs to know where to find the JTReg test framework. If it is not picked up automatically by configure, use the <code>--with-jtreg=&lt;path to jtreg home&gt;</code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc. (An alternative is to set the <code>JT_HOME</code> environment variable to point to the JTReg home before running <code>configure</code>.)</p>
<p>To be able to run microbenchmarks, <code>configure</code> needs to know where to find the JMH dependency. Use <code>--with-jmh=&lt;path to JMH jars&gt;</code> to point to a directory containing the core JMH and transitive dependencies. The recommended dependencies can be retrieved by running <code>sh make/devkit/createJMHBundle.sh</code>, after which <code>--with-jmh=build/jmh/jars</code> should work.</p>
<p>When tests fail or timeout, jtreg runs its failure handler to capture necessary data from the system where the test was run. This data can then be used to analyze the test failures. Collecting this data involves running various commands (which are listed in files residing in <code>test/failure_handler/src/share/conf</code>) and some of these commands use <code>sudo</code>. If the system's <code>sudoers</code> file isn't configured to allow running these commands, then it can result in password being prompted during the failure handler execution. Typically, when running locally, collecting this additional data isn't always necessary. To disable running the failure handler, use <code>--enable-jtreg-failure-handler=no</code> when running <code>configure</code>. If, however, you want to let the failure handler to run and don't want to be prompted for sudo password, then you can configure your <code>sudoers</code> file appropriately. Please read the necessary documentation of your operating system to see how to do that; here we only show one possible way of doing that - edit the <code>/etc/sudoers.d/sudoers</code> file to include the following line:</p>
<pre><code>johndoe ALL=(ALL) NOPASSWD: /sbin/dmesg</code></pre>
<p>This line configures <code>sudo</code> to <em>not</em> prompt for password for the <code>/sbin/dmesg</code> command (this is one of the commands that is listed in the files at <code>test/failure_handler/src/share/conf</code>), for the user <code>johndoe</code>. Here <code>johndoe</code> is the user account under which the jtreg tests are run. Replace the username with a relevant user account of your system.</p>
<h2 id="test-selection">Test selection</h2>
<p>All functionality is available using the <code>test</code> make target. In this use case, the test or tests to be executed is controlled using the <code>TEST</code> variable. To speed up subsequent test runs with no source code changes, <code>test-only</code> can be used instead, which do not depend on the source and test image build.</p>
<p>For some common top-level tests, direct make targets have been generated. This includes all JTReg test groups, the hotspot gtest, and custom tests (if present). This means that <code>make test-tier1</code> is equivalent to <code>make test TEST=&quot;tier1&quot;</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>test TEST=&quot;x&quot;</code> solution needs to be used.</p>
Expand Down
25 changes: 25 additions & 0 deletions doc/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,31 @@ containing the core JMH and transitive dependencies. The recommended
dependencies can be retrieved by running `sh make/devkit/createJMHBundle.sh`,
after which `--with-jmh=build/jmh/jars` should work.

When tests fail or timeout, jtreg runs its failure handler to capture necessary
data from the system where the test was run. This data can then be used to
analyze the test failures. Collecting this data involves running various commands
(which are listed in files residing in `test/failure_handler/src/share/conf`)
and some of these commands use `sudo`. If the system's `sudoers` file isn't
configured to allow running these commands, then it can result in password being
prompted during the failure handler execution. Typically, when running locally,
collecting this additional data isn't always necessary. To disable running the
failure handler, use `--enable-jtreg-failure-handler=no` when running `configure`.
If, however, you want to let the failure handler to run and don't want to be
prompted for sudo password, then you can configure your `sudoers` file
appropriately. Please read the necessary documentation of your operating system
to see how to do that; here we only show one possible way of doing that - edit
the `/etc/sudoers.d/sudoers` file to include the following line:

```
johndoe ALL=(ALL) NOPASSWD: /sbin/dmesg
```

This line configures `sudo` to _not_ prompt for password for the `/sbin/dmesg`
command (this is one of the commands that is listed in the files
at `test/failure_handler/src/share/conf`), for the user `johndoe`. Here `johndoe`
is the user account under which the jtreg tests are run. Replace the username
with a relevant user account of your system.

## Test selection

All functionality is available using the `test` make target. In this use case,
Expand Down
8 changes: 7 additions & 1 deletion make/CreateJmods.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ else
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM}'
endif

# Unless we are creating a very large module, use the small tool JVM options
JMOD_SMALL_FLAGS :=
ifeq ($(findstring $(MODULE), java.base java.desktop jdk.localedata), )
JMOD_SMALL_FLAGS += $(JAVA_TOOL_FLAGS_SMALL)
endif

# Create jmods in the support dir and then move them into place to keep the
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
$(eval $(call SetupExecute, create_$(JMOD_FILE), \
Expand All @@ -234,7 +240,7 @@ $(eval $(call SetupExecute, create_$(JMOD_FILE), \
OUTPUT_FILE := $(JMODS_DIR)/$(JMOD_FILE), \
SUPPORT_DIR := $(JMODS_SUPPORT_DIR), \
PRE_COMMAND := $(RM) $(JMODS_DIR)/$(JMOD_FILE) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
COMMAND := $(JMOD) create --module-version $(VERSION_SHORT) \
COMMAND := $(JMOD) $(JMOD_SMALL_FLAGS) create --module-version $(VERSION_SHORT) \
--target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
--module-path $(JMODS_DIR) $(JMOD_FLAGS) \
--date $(SOURCE_DATE_ISO_8601) \
Expand Down
2 changes: 1 addition & 1 deletion make/autoconf/spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ JAVAC = $(JAVAC_CMD)
JAVADOC = $(JAVADOC_CMD)
JAR = $(JAR_CMD)
JLINK = $(JLINK_CMD)
JMOD = $(JMOD_CMD) $(JAVA_TOOL_FLAGS_SMALL)
JMOD = $(JMOD_CMD)

BUILD_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@
BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS)
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/cpu/aarch64/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -1909,19 +1909,19 @@ static enum RC rc_class(OptoReg::Name reg) {
}

// we have 32 int registers * 2 halves
int slots_of_int_registers = RegisterImpl::max_slots_per_register * RegisterImpl::number_of_registers;
int slots_of_int_registers = Register::number_of_registers * Register::max_slots_per_register;

if (reg < slots_of_int_registers) {
return rc_int;
}

// we have 32 float register * 8 halves
int slots_of_float_registers = FloatRegisterImpl::max_slots_per_register * FloatRegisterImpl::number_of_registers;
int slots_of_float_registers = FloatRegister::number_of_registers * FloatRegister::max_slots_per_register;
if (reg < slots_of_int_registers + slots_of_float_registers) {
return rc_float;
}

int slots_of_predicate_registers = PRegisterImpl::max_slots_per_register * PRegisterImpl::number_of_registers;
int slots_of_predicate_registers = PRegister::number_of_registers * PRegister::max_slots_per_register;
if (reg < slots_of_int_registers + slots_of_float_registers + slots_of_predicate_registers) {
return rc_predicate;
}
Expand Down Expand Up @@ -3368,7 +3368,7 @@ encode %{
} else {
relocInfo::relocType rtype = $src->constant_reloc();
if (rtype == relocInfo::oop_type) {
__ movoop(dst_reg, (jobject)con, /*immediate*/true);
__ movoop(dst_reg, (jobject)con);
} else if (rtype == relocInfo::metadata_type) {
__ mov_metadata(dst_reg, (Metadata*)con);
} else {
Expand Down
Loading

0 comments on commit 9b721b1

Please sign in to comment.