Skip to content

Commit 990b191

Browse files
committed
Merge
2 parents b1b5090 + 8ff2928 commit 990b191

File tree

320 files changed

+8693
-2997
lines changed

Some content is hidden

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

320 files changed

+8693
-2997
lines changed

.jcheck/conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[general]
22
project=jdk
33
jbs=JDK
4-
version=20
4+
version=21
55

66
[checks]
77
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists

make/ZipSource.gmk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@ include JavaCompilation.gmk
3131
include Modules.gmk
3232

3333
SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src
34+
$(if $(filter $(TOPDIR)/%, $(SUPPORT_OUTPUTDIR)), $(eval SRC_ZIP_BASE := $(TOPDIR)), $(eval SRC_ZIP_BASE := $(SUPPORT_OUTPUTDIR)))
3435

3536
# Hook to include the corresponding custom file, if present.
3637
$(eval $(call IncludeCustomExtension, ZipSource.gmk))
@@ -45,10 +46,10 @@ ALL_MODULES := $(FindAllModules)
4546
# again to create src.zip.
4647
$(foreach m, $(ALL_MODULES), \
4748
$(foreach d, $(call FindModuleSrcDirs, $m), \
48-
$(eval $d_TARGET := $(SRC_ZIP_WORK_DIR)/$(patsubst $(TOPDIR)/%,%,$d)/$m) \
49+
$(eval $d_TARGET := $(SRC_ZIP_WORK_DIR)/$(patsubst $(TOPDIR)/%,%,$(patsubst $(SUPPORT_OUTPUTDIR)/%,%,$d))/$m) \
4950
$(if $(SRC_GENERATED), , \
5051
$(eval $$($d_TARGET): $d ; \
51-
$$(if $(filter $(TOPDIR)/%, $d), $$(link-file-relative), $$(link-file-absolute)) \
52+
$$(if $(filter $(SRC_ZIP_BASE)/%, $d), $$(link-file-relative), $$(link-file-absolute)) \
5253
) \
5354
) \
5455
$(eval SRC_ZIP_SRCS += $$($d_TARGET)) \

make/common/MakeBase.gmk

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,17 +306,36 @@ endef
306306
# There are two versions, either creating a relative or an absolute link. Be
307307
# careful when using this on Windows since the symlink created is only valid in
308308
# the unix emulation environment.
309-
define link-file-relative
309+
# In msys2 we use mklink /J because its ln would perform a deep copy of the target.
310+
# This inhibits performance and can lead to issues with long paths. With mklink /J
311+
# relative linking does not work, so we handle the link as absolute path.
312+
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
313+
define link-file-relative
314+
$(call MakeTargetDir)
315+
$(RM) '$(call DecodeSpace, $@)'
316+
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
317+
endef
318+
else
319+
define link-file-relative
310320
$(call MakeTargetDir)
311321
$(RM) '$(call DecodeSpace, $@)'
312322
$(LN) -s '$(call DecodeSpace, $(call RelativePath, $<, $(@D)))' '$(call DecodeSpace, $@)'
313-
endef
323+
endef
324+
endif
314325

315-
define link-file-absolute
326+
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
327+
define link-file-absolute
328+
$(call MakeTargetDir)
329+
$(RM) '$(call DecodeSpace, $@)'
330+
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
331+
endef
332+
else
333+
define link-file-absolute
316334
$(call MakeTargetDir)
317335
$(RM) '$(call DecodeSpace, $@)'
318336
$(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
319-
endef
337+
endef
338+
endif
320339

321340
################################################################################
322341

make/conf/version-numbers.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
# Default version, product, and vendor information to use,
2727
# unless overridden by configure
2828

29-
DEFAULT_VERSION_FEATURE=20
29+
DEFAULT_VERSION_FEATURE=21
3030
DEFAULT_VERSION_INTERIM=0
3131
DEFAULT_VERSION_UPDATE=0
3232
DEFAULT_VERSION_PATCH=0
3333
DEFAULT_VERSION_EXTRA1=0
3434
DEFAULT_VERSION_EXTRA2=0
3535
DEFAULT_VERSION_EXTRA3=0
36-
DEFAULT_VERSION_DATE=2023-03-21
37-
DEFAULT_VERSION_CLASSFILE_MAJOR=64 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
36+
DEFAULT_VERSION_DATE=2023-09-19
37+
DEFAULT_VERSION_CLASSFILE_MAJOR=65 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
3838
DEFAULT_VERSION_CLASSFILE_MINOR=0
3939
DEFAULT_VERSION_DOCS_API_SINCE=11
40-
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="19 20"
41-
DEFAULT_JDK_SOURCE_TARGET_VERSION=20
40+
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="19 20 21"
41+
DEFAULT_JDK_SOURCE_TARGET_VERSION=21
4242
DEFAULT_PROMOTED_VERSION_PRE=ea

make/modules/jdk.sctp/Java.gmk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ endif
4444
ifeq ($(call isTargetOs, aix), true)
4545
EXCLUDE_FILES += $(SCTP_IMPL_CLASSES)
4646
endif
47+
48+
ifeq ($(call isTargetOsType, unix), true)
49+
ifeq ($(call isTargetOs, macosx aix), false)
50+
# This class is not needed on "unix" because SCTP in Java is supported for that platform
51+
EXCLUDE_FILES += $(TOPDIR)/src/jdk.sctp/share/classes/sun/nio/ch/sctp/UnsupportedUtil.java
52+
endif
53+
endif

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,8 +1796,9 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
17961796
Label* guard = &dummy_guard;
17971797
if (!Compile::current()->output()->in_scratch_emit_size()) {
17981798
// Use real labels from actual stub when not emitting code for the purpose of measuring its size
1799-
C2EntryBarrierStub* stub = Compile::current()->output()->entry_barrier_table()->add_entry_barrier();
1800-
slow_path = &stub->slow_path();
1799+
C2EntryBarrierStub* stub = new (Compile::current()->comp_arena()) C2EntryBarrierStub();
1800+
Compile::current()->output()->add_stub(stub);
1801+
slow_path = &stub->entry();
18011802
continuation = &stub->continuation();
18021803
guard = &stub->guard();
18031804
}
@@ -1879,7 +1880,9 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
18791880
Label dummy_label;
18801881
Label* code_stub = &dummy_label;
18811882
if (!C->output()->in_scratch_emit_size()) {
1882-
code_stub = &C->output()->safepoint_poll_table()->add_safepoint(__ offset());
1883+
C2SafepointPollStub* stub = new (C->comp_arena()) C2SafepointPollStub(__ offset());
1884+
C->output()->add_stub(stub);
1885+
code_stub = &stub->entry();
18831886
}
18841887
__ relocate(relocInfo::poll_return_type);
18851888
__ safepoint_poll(*code_stub, true /* at_return */, false /* acquire */, true /* in_nmethod */);

src/hotspot/cpu/aarch64/aarch64_vector.ad

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5869,67 +5869,62 @@ instruct vroundD(vReg dst, vReg src, immI rmode) %{
58695869

58705870
// anytrue
58715871

5872-
instruct vtest_anytrue_neon(iRegINoSp dst, vReg src1, vReg src2, vReg tmp, rFlagsReg cr) %{
5872+
instruct vtest_anytrue_neon(rFlagsReg cr, vReg src1, vReg src2, vReg tmp) %{
58735873
predicate(UseSVE == 0 &&
58745874
static_cast<const VectorTestNode*>(n)->get_predicate() == BoolTest::ne);
5875-
match(Set dst (VectorTest src1 src2 ));
5876-
effect(TEMP tmp, KILL cr);
5877-
format %{ "vtest_anytrue_neon $dst, $src1\t# KILL $tmp, cr" %}
5875+
match(Set cr (VectorTest src1 src2));
5876+
effect(TEMP tmp);
5877+
format %{ "vtest_anytrue_neon $src1\t# KILL $tmp" %}
58785878
ins_encode %{
58795879
// No need to use src2.
58805880
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src1);
58815881
assert(length_in_bytes == 8 || length_in_bytes == 16, "must be");
58825882
__ addv($tmp$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B, $src1$$FloatRegister);
5883-
__ umov($dst$$Register, $tmp$$FloatRegister, __ B, 0);
5884-
__ cmpw($dst$$Register, zr);
5885-
__ csetw($dst$$Register, Assembler::NE);
5883+
__ umov(rscratch1, $tmp$$FloatRegister, __ B, 0);
5884+
__ cmpw(rscratch1, zr);
58865885
%}
58875886
ins_pipe(pipe_slow);
58885887
%}
58895888

5890-
instruct vtest_anytrue_sve(iRegINoSp dst, pReg src1, pReg src2, rFlagsReg cr) %{
5889+
instruct vtest_anytrue_sve(rFlagsReg cr, pReg src1, pReg src2) %{
58915890
predicate(UseSVE > 0 &&
58925891
static_cast<const VectorTestNode*>(n)->get_predicate() == BoolTest::ne);
5893-
match(Set dst (VectorTest src1 src2));
5894-
effect(KILL cr);
5895-
format %{ "vtest_anytrue_sve $dst, $src1\t# KILL cr" %}
5892+
match(Set cr (VectorTest src1 src2));
5893+
format %{ "vtest_anytrue_sve $src1" %}
58965894
ins_encode %{
58975895
// "src2" is not used for sve.
58985896
__ sve_ptest(ptrue, $src1$$PRegister);
5899-
__ csetw($dst$$Register, Assembler::NE);
59005897
%}
59015898
ins_pipe(pipe_slow);
59025899
%}
59035900

59045901
// alltrue
59055902

5906-
instruct vtest_alltrue_neon(iRegINoSp dst, vReg src1, vReg src2, vReg tmp, rFlagsReg cr) %{
5903+
instruct vtest_alltrue_neon(rFlagsReg cr, vReg src1, vReg src2, vReg tmp) %{
59075904
predicate(UseSVE == 0 &&
59085905
static_cast<const VectorTestNode*>(n)->get_predicate() == BoolTest::overflow);
5909-
match(Set dst (VectorTest src1 src2));
5910-
effect(TEMP tmp, KILL cr);
5911-
format %{ "vtest_alltrue_neon $dst, $src1\t# KILL $tmp, cr" %}
5906+
match(Set cr (VectorTest src1 src2));
5907+
effect(TEMP tmp);
5908+
format %{ "vtest_alltrue_neon $src1\t# KILL $tmp" %}
59125909
ins_encode %{
59135910
// No need to use src2.
59145911
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src1);
59155912
assert(length_in_bytes == 8 || length_in_bytes == 16, "must be");
59165913
__ uminv($tmp$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B, $src1$$FloatRegister);
5917-
__ umov($dst$$Register, $tmp$$FloatRegister, __ B, 0);
5918-
__ cmpw($dst$$Register, 0xff);
5919-
__ csetw($dst$$Register, Assembler::EQ);
5914+
__ umov(rscratch1, $tmp$$FloatRegister, __ B, 0);
5915+
__ cmpw(rscratch1, 0xff);
59205916
%}
59215917
ins_pipe(pipe_slow);
59225918
%}
59235919

5924-
instruct vtest_alltrue_sve(iRegINoSp dst, pReg src1, pReg src2, pReg ptmp, rFlagsReg cr) %{
5920+
instruct vtest_alltrue_sve(rFlagsReg cr, pReg src1, pReg src2, pReg ptmp) %{
59255921
predicate(UseSVE > 0 &&
59265922
static_cast<const VectorTestNode*>(n)->get_predicate() == BoolTest::overflow);
5927-
match(Set dst (VectorTest src1 src2));
5928-
effect(TEMP ptmp, KILL cr);
5929-
format %{ "vtest_alltrue_sve $dst, $src1, $src2\t# KILL $ptmp, cr" %}
5923+
match(Set cr (VectorTest src1 src2));
5924+
effect(TEMP ptmp);
5925+
format %{ "vtest_alltrue_sve $src1, $src2\t# KILL $ptmp" %}
59305926
ins_encode %{
59315927
__ sve_eors($ptmp$$PRegister, ptrue, $src1$$PRegister, $src2$$PRegister);
5932-
__ csetw($dst$$Register, Assembler::EQ);
59335928
%}
59345929
ins_pipe(pipe_slow);
59355930
%}

src/hotspot/cpu/aarch64/aarch64_vector_ad.m4

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4241,67 +4241,62 @@ instruct vroundD(vReg dst, vReg src, immI rmode) %{
42414241

42424242
// anytrue
42434243

4244-
instruct vtest_anytrue_neon(iRegINoSp dst, vReg src1, vReg src2, vReg tmp, rFlagsReg cr) %{
4244+
instruct vtest_anytrue_neon(rFlagsReg cr, vReg src1, vReg src2, vReg tmp) %{
42454245
predicate(UseSVE == 0 &&
42464246
static_cast<const VectorTestNode*>(n)->get_predicate() == BoolTest::ne);
4247-
match(Set dst (VectorTest src1 src2 ));
4248-
effect(TEMP tmp, KILL cr);
4249-
format %{ "vtest_anytrue_neon $dst, $src1\t# KILL $tmp, cr" %}
4247+
match(Set cr (VectorTest src1 src2));
4248+
effect(TEMP tmp);
4249+
format %{ "vtest_anytrue_neon $src1\t# KILL $tmp" %}
42504250
ins_encode %{
42514251
// No need to use src2.
42524252
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src1);
42534253
assert(length_in_bytes == 8 || length_in_bytes == 16, "must be");
42544254
__ addv($tmp$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B, $src1$$FloatRegister);
4255-
__ umov($dst$$Register, $tmp$$FloatRegister, __ B, 0);
4256-
__ cmpw($dst$$Register, zr);
4257-
__ csetw($dst$$Register, Assembler::NE);
4255+
__ umov(rscratch1, $tmp$$FloatRegister, __ B, 0);
4256+
__ cmpw(rscratch1, zr);
42584257
%}
42594258
ins_pipe(pipe_slow);
42604259
%}
42614260

4262-
instruct vtest_anytrue_sve(iRegINoSp dst, pReg src1, pReg src2, rFlagsReg cr) %{
4261+
instruct vtest_anytrue_sve(rFlagsReg cr, pReg src1, pReg src2) %{
42634262
predicate(UseSVE > 0 &&
42644263
static_cast<const VectorTestNode*>(n)->get_predicate() == BoolTest::ne);
4265-
match(Set dst (VectorTest src1 src2));
4266-
effect(KILL cr);
4267-
format %{ "vtest_anytrue_sve $dst, $src1\t# KILL cr" %}
4264+
match(Set cr (VectorTest src1 src2));
4265+
format %{ "vtest_anytrue_sve $src1" %}
42684266
ins_encode %{
42694267
// "src2" is not used for sve.
42704268
__ sve_ptest(ptrue, $src1$$PRegister);
4271-
__ csetw($dst$$Register, Assembler::NE);
42724269
%}
42734270
ins_pipe(pipe_slow);
42744271
%}
42754272

42764273
// alltrue
42774274

4278-
instruct vtest_alltrue_neon(iRegINoSp dst, vReg src1, vReg src2, vReg tmp, rFlagsReg cr) %{
4275+
instruct vtest_alltrue_neon(rFlagsReg cr, vReg src1, vReg src2, vReg tmp) %{
42794276
predicate(UseSVE == 0 &&
42804277
static_cast<const VectorTestNode*>(n)->get_predicate() == BoolTest::overflow);
4281-
match(Set dst (VectorTest src1 src2));
4282-
effect(TEMP tmp, KILL cr);
4283-
format %{ "vtest_alltrue_neon $dst, $src1\t# KILL $tmp, cr" %}
4278+
match(Set cr (VectorTest src1 src2));
4279+
effect(TEMP tmp);
4280+
format %{ "vtest_alltrue_neon $src1\t# KILL $tmp" %}
42844281
ins_encode %{
42854282
// No need to use src2.
42864283
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src1);
42874284
assert(length_in_bytes == 8 || length_in_bytes == 16, "must be");
42884285
__ uminv($tmp$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B, $src1$$FloatRegister);
4289-
__ umov($dst$$Register, $tmp$$FloatRegister, __ B, 0);
4290-
__ cmpw($dst$$Register, 0xff);
4291-
__ csetw($dst$$Register, Assembler::EQ);
4286+
__ umov(rscratch1, $tmp$$FloatRegister, __ B, 0);
4287+
__ cmpw(rscratch1, 0xff);
42924288
%}
42934289
ins_pipe(pipe_slow);
42944290
%}
42954291

4296-
instruct vtest_alltrue_sve(iRegINoSp dst, pReg src1, pReg src2, pReg ptmp, rFlagsReg cr) %{
4292+
instruct vtest_alltrue_sve(rFlagsReg cr, pReg src1, pReg src2, pReg ptmp) %{
42974293
predicate(UseSVE > 0 &&
42984294
static_cast<const VectorTestNode*>(n)->get_predicate() == BoolTest::overflow);
4299-
match(Set dst (VectorTest src1 src2));
4300-
effect(TEMP ptmp, KILL cr);
4301-
format %{ "vtest_alltrue_sve $dst, $src1, $src2\t# KILL $ptmp, cr" %}
4295+
match(Set cr (VectorTest src1 src2));
4296+
effect(TEMP ptmp);
4297+
format %{ "vtest_alltrue_sve $src1, $src2\t# KILL $ptmp" %}
43024298
ins_encode %{
43034299
__ sve_eors($ptmp$$PRegister, ptrue, $src1$$PRegister, $src2$$PRegister);
4304-
__ csetw($dst$$Register, Assembler::EQ);
43054300
%}
43064301
ins_pipe(pipe_slow);
43074302
%}

src/hotspot/cpu/aarch64/c2_safepointPollStubTable_aarch64.cpp renamed to src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,24 +23,44 @@
2323
*/
2424

2525
#include "precompiled.hpp"
26-
#include "asm/macroAssembler.hpp"
27-
#include "opto/compile.hpp"
28-
#include "opto/node.hpp"
29-
#include "opto/output.hpp"
26+
#include "opto/c2_MacroAssembler.hpp"
27+
#include "opto/c2_CodeStubs.hpp"
3028
#include "runtime/sharedRuntime.hpp"
29+
#include "runtime/stubRoutines.hpp"
3130

3231
#define __ masm.
33-
void C2SafepointPollStubTable::emit_stub_impl(MacroAssembler& masm, C2SafepointPollStub* entry) const {
32+
33+
int C2SafepointPollStub::max_size() const {
34+
return 20;
35+
}
36+
37+
void C2SafepointPollStub::emit(C2_MacroAssembler& masm) {
3438
assert(SharedRuntime::polling_page_return_handler_blob() != NULL,
3539
"polling page return stub not created yet");
3640
address stub = SharedRuntime::polling_page_return_handler_blob()->entry_point();
3741

3842
RuntimeAddress callback_addr(stub);
3943

40-
__ bind(entry->_stub_label);
41-
InternalAddress safepoint_pc(masm.pc() - masm.offset() + entry->_safepoint_offset);
44+
__ bind(entry());
45+
InternalAddress safepoint_pc(masm.pc() - masm.offset() + _safepoint_offset);
4246
__ adr(rscratch1, safepoint_pc);
4347
__ str(rscratch1, Address(rthread, JavaThread::saved_exception_pc_offset()));
4448
__ far_jump(callback_addr);
4549
}
50+
51+
int C2EntryBarrierStub::max_size() const {
52+
return 24;
53+
}
54+
55+
void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) {
56+
__ bind(entry());
57+
__ movptr(rscratch1, (uintptr_t) StubRoutines::aarch64::method_entry_barrier());
58+
__ blr(rscratch1);
59+
__ b(continuation());
60+
61+
__ bind(guard());
62+
__ relocate(entry_guard_Relocation::spec());
63+
__ emit_int32(0); // nmethod guard value
64+
}
65+
4666
#undef __

src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,6 @@
4545

4646
typedef void (MacroAssembler::* chr_insn)(Register Rt, const Address &adr);
4747

48-
void C2_MacroAssembler::emit_entry_barrier_stub(C2EntryBarrierStub* stub) {
49-
bind(stub->slow_path());
50-
movptr(rscratch1, (uintptr_t) StubRoutines::aarch64::method_entry_barrier());
51-
blr(rscratch1);
52-
b(stub->continuation());
53-
54-
bind(stub->guard());
55-
relocate(entry_guard_Relocation::spec());
56-
emit_int32(0); // nmethod guard value
57-
}
58-
59-
int C2_MacroAssembler::entry_barrier_stub_size() {
60-
return 4 * 6;
61-
}
62-
6348
// Search for str1 in str2 and return index or -1
6449
void C2_MacroAssembler::string_indexof(Register str2, Register str1,
6550
Register cnt2, Register cnt1,

0 commit comments

Comments
 (0)