Skip to content

Commit 9b721b1

Browse files
committed
Merge
2 parents 3e50300 + 0d51f63 commit 9b721b1

File tree

448 files changed

+7055
-8678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

448 files changed

+7055
-8678
lines changed

.github/workflows/build-cross-compile.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,14 @@ on:
2929
workflow_call:
3030
inputs:
3131
gcc-major-version:
32-
required: false
32+
required: true
3333
type: string
34-
default: '10'
3534
apt-gcc-version:
36-
required: false
35+
required: true
3736
type: string
38-
default: '10.3.0-1ubuntu1~20.04'
39-
apt-gcc-cross-suffix:
40-
required: false
37+
apt-gcc-cross-version:
38+
required: true
4139
type: string
42-
default: 'cross1'
4340

4441
jobs:
4542
build-cross-compile:
@@ -95,8 +92,8 @@ jobs:
9592
sudo apt-get install \
9693
gcc-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
9794
g++-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
98-
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-version }}${{ inputs.apt-gcc-cross-suffix }} \
99-
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-version }}${{ inputs.apt-gcc-cross-suffix }} \
95+
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
96+
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
10097
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
10198
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 }}
10299
@@ -143,8 +140,8 @@ jobs:
143140
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
144141
--with-sysroot=sysroot
145142
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
146-
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-10
147-
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-10
143+
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
144+
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
148145
149146
- name: 'Build'
150147
id: build

.github/workflows/build-linux.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ on:
4242
required: false
4343
type: string
4444
default: '[ "debug", "release" ]'
45+
gcc-major-version:
46+
required: true
47+
type: string
48+
gcc-package-suffix:
49+
required: false
50+
type: string
51+
default: ''
4552
apt-gcc-version:
4653
required: true
4754
type: string
@@ -101,8 +108,8 @@ jobs:
101108
fi
102109
sudo apt-get update
103110
sudo apt-get install --only-upgrade apt
104-
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 }}
105-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
111+
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 }}
112+
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 }}
106113
107114
- name: 'Configure'
108115
run: >

.github/workflows/main.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ jobs:
123123
uses: ./.github/workflows/build-linux.yml
124124
with:
125125
platform: linux-x64
126-
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
126+
gcc-major-version: '10'
127+
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
127128
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
128129
if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'
129130

@@ -133,7 +134,9 @@ jobs:
133134
uses: ./.github/workflows/build-linux.yml
134135
with:
135136
platform: linux-x86
136-
apt-gcc-version: '10-multilib'
137+
gcc-major-version: '10'
138+
gcc-package-suffix: '-multilib'
139+
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
137140
apt-architecture: 'i386'
138141
# Some multilib libraries do not have proper inter-dependencies, so we have to
139142
# install their dependencies manually.
@@ -149,7 +152,8 @@ jobs:
149152
platform: linux-x64
150153
make-target: 'hotspot'
151154
debug-levels: '[ "debug" ]'
152-
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
155+
gcc-major-version: '10'
156+
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
153157
extra-conf-options: '--disable-precompiled-headers'
154158
if: needs.select.outputs.linux-x64-variants == 'true'
155159

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

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

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

@@ -196,6 +203,10 @@ jobs:
196203
- select
197204
- build-linux-x64
198205
uses: ./.github/workflows/build-cross-compile.yml
206+
with:
207+
gcc-major-version: '10'
208+
apt-gcc-version: '10.3.0-1ubuntu1~20.04'
209+
apt-gcc-cross-version: '10.3.0-1ubuntu1~20.04cross1'
199210
if: needs.select.outputs.linux-cross-compile == 'true'
200211

201212
build-macos-x64:

doc/testing.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ <h2 id="using-make-test-the-run-test-framework">Using &quot;make test&quot; (the
6464
<h3 id="configuration">Configuration</h3>
6565
<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>
6666
<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>
67+
<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>
68+
<pre><code>johndoe ALL=(ALL) NOPASSWD: /sbin/dmesg</code></pre>
69+
<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>
6770
<h2 id="test-selection">Test selection</h2>
6871
<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>
6972
<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>

doc/testing.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,31 @@ containing the core JMH and transitive dependencies. The recommended
4343
dependencies can be retrieved by running `sh make/devkit/createJMHBundle.sh`,
4444
after which `--with-jmh=build/jmh/jars` should work.
4545

46+
When tests fail or timeout, jtreg runs its failure handler to capture necessary
47+
data from the system where the test was run. This data can then be used to
48+
analyze the test failures. Collecting this data involves running various commands
49+
(which are listed in files residing in `test/failure_handler/src/share/conf`)
50+
and some of these commands use `sudo`. If the system's `sudoers` file isn't
51+
configured to allow running these commands, then it can result in password being
52+
prompted during the failure handler execution. Typically, when running locally,
53+
collecting this additional data isn't always necessary. To disable running the
54+
failure handler, use `--enable-jtreg-failure-handler=no` when running `configure`.
55+
If, however, you want to let the failure handler to run and don't want to be
56+
prompted for sudo password, then you can configure your `sudoers` file
57+
appropriately. Please read the necessary documentation of your operating system
58+
to see how to do that; here we only show one possible way of doing that - edit
59+
the `/etc/sudoers.d/sudoers` file to include the following line:
60+
61+
```
62+
johndoe ALL=(ALL) NOPASSWD: /sbin/dmesg
63+
```
64+
65+
This line configures `sudo` to _not_ prompt for password for the `/sbin/dmesg`
66+
command (this is one of the commands that is listed in the files
67+
at `test/failure_handler/src/share/conf`), for the user `johndoe`. Here `johndoe`
68+
is the user account under which the jtreg tests are run. Replace the username
69+
with a relevant user account of your system.
70+
4671
## Test selection
4772

4873
All functionality is available using the `test` make target. In this use case,

make/CreateJmods.gmk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ else
226226
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM}'
227227
endif
228228

229+
# Unless we are creating a very large module, use the small tool JVM options
230+
JMOD_SMALL_FLAGS :=
231+
ifeq ($(findstring $(MODULE), java.base java.desktop jdk.localedata), )
232+
JMOD_SMALL_FLAGS += $(JAVA_TOOL_FLAGS_SMALL)
233+
endif
234+
229235
# Create jmods in the support dir and then move them into place to keep the
230236
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
231237
$(eval $(call SetupExecute, create_$(JMOD_FILE), \
@@ -234,7 +240,7 @@ $(eval $(call SetupExecute, create_$(JMOD_FILE), \
234240
OUTPUT_FILE := $(JMODS_DIR)/$(JMOD_FILE), \
235241
SUPPORT_DIR := $(JMODS_SUPPORT_DIR), \
236242
PRE_COMMAND := $(RM) $(JMODS_DIR)/$(JMOD_FILE) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
237-
COMMAND := $(JMOD) create --module-version $(VERSION_SHORT) \
243+
COMMAND := $(JMOD) $(JMOD_SMALL_FLAGS) create --module-version $(VERSION_SHORT) \
238244
--target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
239245
--module-path $(JMODS_DIR) $(JMOD_FLAGS) \
240246
--date $(SOURCE_DATE_ISO_8601) \

make/autoconf/spec.gmk.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ JAVAC = $(JAVAC_CMD)
664664
JAVADOC = $(JAVADOC_CMD)
665665
JAR = $(JAR_CMD)
666666
JLINK = $(JLINK_CMD)
667-
JMOD = $(JMOD_CMD) $(JAVA_TOOL_FLAGS_SMALL)
667+
JMOD = $(JMOD_CMD)
668668

669669
BUILD_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@
670670
BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS)

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,19 +1909,19 @@ static enum RC rc_class(OptoReg::Name reg) {
19091909
}
19101910

19111911
// we have 32 int registers * 2 halves
1912-
int slots_of_int_registers = RegisterImpl::max_slots_per_register * RegisterImpl::number_of_registers;
1912+
int slots_of_int_registers = Register::number_of_registers * Register::max_slots_per_register;
19131913

19141914
if (reg < slots_of_int_registers) {
19151915
return rc_int;
19161916
}
19171917

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

1924-
int slots_of_predicate_registers = PRegisterImpl::max_slots_per_register * PRegisterImpl::number_of_registers;
1924+
int slots_of_predicate_registers = PRegister::number_of_registers * PRegister::max_slots_per_register;
19251925
if (reg < slots_of_int_registers + slots_of_float_registers + slots_of_predicate_registers) {
19261926
return rc_predicate;
19271927
}
@@ -3368,7 +3368,7 @@ encode %{
33683368
} else {
33693369
relocInfo::relocType rtype = $src->constant_reloc();
33703370
if (rtype == relocInfo::oop_type) {
3371-
__ movoop(dst_reg, (jobject)con, /*immediate*/true);
3371+
__ movoop(dst_reg, (jobject)con);
33723372
} else if (rtype == relocInfo::metadata_type) {
33733373
__ mov_metadata(dst_reg, (Metadata*)con);
33743374
} else {

0 commit comments

Comments
 (0)