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 May 17, 2023
2 parents 22b4029 + 69152c3 commit 979f814
Show file tree
Hide file tree
Showing 397 changed files with 9,953 additions and 8,787 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
- 'hs/tier1 gc'
- 'hs/tier1 runtime'
- 'hs/tier1 serviceability'
- 'lib-test/tier1'

include:
- test-name: 'jdk/tier1 part 1'
Expand Down Expand Up @@ -98,6 +99,10 @@ jobs:
test-suite: 'test/hotspot/jtreg/:tier1_serviceability'
debug-suffix: -debug

- test-name: 'lib-test/tier1'
test-suite: 'test/lib-test/:tier1'
debug-suffix: -debug

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
Expand Down
8 changes: 5 additions & 3 deletions make/Docs.gmk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 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
Expand Down Expand Up @@ -111,14 +111,16 @@ JAVADOC_OPTIONS := -use -keywords -notimestamp \
-encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
-splitIndex --system none -javafx --expand-requires transitive \
--enable-preview -source $(JDK_SOURCE_TARGET_VERSION) \
--override-methods=summary
--override-methods=summary \
--no-external-specs-page

# The reference options must stay stable to allow for comparisons across the
# development cycle.
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
-encoding ISO-8859-1 -breakiterator -splitIndex --system none \
--enable-preview -source $(JDK_SOURCE_TARGET_VERSION) \
-html5 -javafx --expand-requires transitive
-html5 -javafx --expand-requires transitive \
--no-external-specs-page

# Should we add DRAFT stamps to the generated javadoc?
ifeq ($(VERSION_IS_GA), true)
Expand Down
9 changes: 6 additions & 3 deletions make/autoconf/jvm-features.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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
Expand Down Expand Up @@ -253,8 +253,11 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_CDS],
AC_DEFUN_ONCE([JVM_FEATURES_CHECK_DTRACE],
[
JVM_FEATURES_CHECK_AVAILABILITY(dtrace, [
AC_MSG_CHECKING([for dtrace tool])
if test "x$DTRACE" != "x" && test -x "$DTRACE"; then
AC_MSG_CHECKING([for dtrace tool and platform support])
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xppc"; then
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU_ARCH])
AVAILABLE=false
elif test "x$DTRACE" != "x" && test -x "$DTRACE"; then
AC_MSG_RESULT([$DTRACE])
else
AC_MSG_RESULT([no])
Expand Down
10 changes: 8 additions & 2 deletions make/modules/java.base/gensrc/GensrcMisc.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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
Expand Down Expand Up @@ -50,8 +50,14 @@ $(eval $(call SetupTextFileProcessing, BUILD_VERSION_JAVA, \
@@VENDOR_URL_VM_BUG@@ => $(VENDOR_URL_VM_BUG), \
))

TARGETS += $(BUILD_VERSION_JAVA)
$(eval $(call SetupTextFileProcessing, BUILD_PLATFORMPROPERTIES_JAVA, \
SOURCE_FILES := $(TOPDIR)/src/java.base/share/classes/jdk/internal/util/OperatingSystemProps.java.template, \
OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/util/OperatingSystemProps.java, \
REPLACEMENTS := \
@@OPENJDK_TARGET_OS@@ => $(OPENJDK_TARGET_OS), \
))

TARGETS += $(BUILD_VERSION_JAVA) $(BUILD_PLATFORMPROPERTIES_JAVA)
################################################################################

ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
Expand Down
22 changes: 4 additions & 18 deletions src/hotspot/cpu/aarch64/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -2375,6 +2375,10 @@ const int Matcher::min_vector_size(const BasicType bt) {
return MIN2(size, max_size);
}

const int Matcher::superword_max_vector_size(const BasicType bt) {
return Matcher::max_vector_size(bt);
}

// Actual max scalable vector register length.
const int Matcher::scalable_vector_reg_size(const BasicType bt) {
return Matcher::max_vector_size(bt);
Expand Down Expand Up @@ -16569,25 +16573,7 @@ instruct branchLoopEnd(cmpOp cmp, rFlagsReg cr, label lbl)
ins_pipe(pipe_branch);
%}

// counted loop end branch near Unsigned
instruct branchLoopEndU(cmpOpU cmp, rFlagsRegU cr, label lbl)
%{
match(CountedLoopEnd cmp cr);

effect(USE lbl);

ins_cost(BRANCH_COST);
// short variant.
// ins_short_branch(1);
format %{ "b$cmp $lbl \t// counted loop end unsigned" %}

ins_encode(aarch64_enc_br_conU(cmp, lbl));

ins_pipe(pipe_branch);
%}

// counted loop end branch far
// counted loop end branch far unsigned
// TODO: fixme

// ============================================================================
Expand Down
43 changes: 40 additions & 3 deletions src/hotspot/cpu/aarch64/aarch64_vector.ad
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ source %{
return false;
}
break;
case Op_CompressBitsV:
case Op_ExpandBitsV:
if (UseSVE < 2 || !VM_Version::supports_svebitperm()) {
return false;
}
break;
default:
break;
}
Expand All @@ -240,6 +246,8 @@ source %{
case Op_MulReductionVF:
case Op_MulReductionVI:
case Op_MulReductionVL:
case Op_CompressBitsV:
case Op_ExpandBitsV:
return false;
// We use Op_LoadVectorMasked to implement the predicated Op_LoadVector.
// Hence we turn to check whether Op_LoadVectorMasked is supported. The
Expand Down Expand Up @@ -5305,18 +5313,19 @@ instruct vmaskcast_extend_sve(pReg dst, pReg src) %{
ins_pipe(pipe_slow);
%}

instruct vmaskcast_narrow_sve(pReg dst, pReg src) %{
instruct vmaskcast_narrow_sve(pReg dst, pReg src, pReg ptmp) %{
predicate(UseSVE > 0 &&
Matcher::vector_length_in_bytes(n) < Matcher::vector_length_in_bytes(n->in(1)));
match(Set dst (VectorMaskCast src));
format %{ "vmaskcast_narrow_sve $dst, $src" %}
effect(TEMP_DEF dst, TEMP ptmp);
format %{ "vmaskcast_narrow_sve $dst, $src\t# KILL $ptmp" %}
ins_encode %{
uint length_in_bytes_dst = Matcher::vector_length_in_bytes(this);
uint length_in_bytes_src = Matcher::vector_length_in_bytes(this, $src);
assert(length_in_bytes_dst * 2 == length_in_bytes_src ||
length_in_bytes_dst * 4 == length_in_bytes_src ||
length_in_bytes_dst * 8 == length_in_bytes_src, "invalid vector length");
__ sve_vmaskcast_narrow($dst$$PRegister, $src$$PRegister,
__ sve_vmaskcast_narrow($dst$$PRegister, $src$$PRegister, $ptmp$$PRegister,
length_in_bytes_dst, length_in_bytes_src);
%}
ins_pipe(pipe_slow);
Expand Down Expand Up @@ -6619,3 +6628,31 @@ instruct vsignum_gt128b(vReg dst, vReg src, vReg zero, vReg one, vReg tmp, pRegG
%}
ins_pipe(pipe_slow);
%}

// ---------------------------------- CompressBitsV --------------------------------

instruct vcompressBits(vReg dst, vReg src1, vReg src2) %{
match(Set dst (CompressBitsV src1 src2));
format %{ "vcompressBits $dst, $src1, $src2\t# vector (sve)" %}
ins_encode %{
BasicType bt = Matcher::vector_element_basic_type(this);
Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt);
__ sve_bext($dst$$FloatRegister, size,
$src1$$FloatRegister, $src2$$FloatRegister);
%}
ins_pipe(pipe_slow);
%}

// ----------------------------------- ExpandBitsV ---------------------------------

instruct vexpandBits(vReg dst, vReg src1, vReg src2) %{
match(Set dst (ExpandBitsV src1 src2));
format %{ "vexpandBits $dst, $src1, $src2\t# vector (sve)" %}
ins_encode %{
BasicType bt = Matcher::vector_element_basic_type(this);
Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt);
__ sve_bdep($dst$$FloatRegister, size,
$src1$$FloatRegister, $src2$$FloatRegister);
%}
ins_pipe(pipe_slow);
%}
37 changes: 34 additions & 3 deletions src/hotspot/cpu/aarch64/aarch64_vector_ad.m4
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ source %{
return false;
}
break;
case Op_CompressBitsV:
case Op_ExpandBitsV:
if (UseSVE < 2 || !VM_Version::supports_svebitperm()) {
return false;
}
break;
default:
break;
}
Expand All @@ -230,6 +236,8 @@ source %{
case Op_MulReductionVF:
case Op_MulReductionVI:
case Op_MulReductionVL:
case Op_CompressBitsV:
case Op_ExpandBitsV:
return false;
// We use Op_LoadVectorMasked to implement the predicated Op_LoadVector.
// Hence we turn to check whether Op_LoadVectorMasked is supported. The
Expand Down Expand Up @@ -3702,18 +3710,19 @@ instruct vmaskcast_extend_sve(pReg dst, pReg src) %{
ins_pipe(pipe_slow);
%}

instruct vmaskcast_narrow_sve(pReg dst, pReg src) %{
instruct vmaskcast_narrow_sve(pReg dst, pReg src, pReg ptmp) %{
predicate(UseSVE > 0 &&
Matcher::vector_length_in_bytes(n) < Matcher::vector_length_in_bytes(n->in(1)));
match(Set dst (VectorMaskCast src));
format %{ "vmaskcast_narrow_sve $dst, $src" %}
effect(TEMP_DEF dst, TEMP ptmp);
format %{ "vmaskcast_narrow_sve $dst, $src\t# KILL $ptmp" %}
ins_encode %{
uint length_in_bytes_dst = Matcher::vector_length_in_bytes(this);
uint length_in_bytes_src = Matcher::vector_length_in_bytes(this, $src);
assert(length_in_bytes_dst * 2 == length_in_bytes_src ||
length_in_bytes_dst * 4 == length_in_bytes_src ||
length_in_bytes_dst * 8 == length_in_bytes_src, "invalid vector length");
__ sve_vmaskcast_narrow($dst$$PRegister, $src$$PRegister,
__ sve_vmaskcast_narrow($dst$$PRegister, $src$$PRegister, $ptmp$$PRegister,
length_in_bytes_dst, length_in_bytes_src);
%}
ins_pipe(pipe_slow);
Expand Down Expand Up @@ -4950,3 +4959,25 @@ instruct vsignum_gt128b(vReg dst, vReg src, vReg zero, vReg one, vReg tmp, pRegG
%}
ins_pipe(pipe_slow);
%}

dnl
dnl BITPERM($1, $2, $3 )
dnl BITPERM(insn_name, op_name, insn)
define(`BITPERM', `
instruct $1(vReg dst, vReg src1, vReg src2) %{
match(Set dst ($2 src1 src2));
format %{ "$1 $dst, $src1, $src2\t# vector (sve)" %}
ins_encode %{
BasicType bt = Matcher::vector_element_basic_type(this);
Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt);
__ $3($dst$$FloatRegister, size,
$src1$$FloatRegister, $src2$$FloatRegister);
%}
ins_pipe(pipe_slow);
%}')dnl
dnl
// ---------------------------------- CompressBitsV --------------------------------
BITPERM(vcompressBits, CompressBitsV, sve_bext)

// ----------------------------------- ExpandBitsV ---------------------------------
BITPERM(vexpandBits, ExpandBitsV, sve_bdep)
24 changes: 17 additions & 7 deletions src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,18 +1289,28 @@ void C2_MacroAssembler::sve_vmaskcast_extend(PRegister dst, PRegister src,

// Narrow src predicate to dst predicate with the same lane count but
// smaller element size, e.g. 512Long -> 64Byte
void C2_MacroAssembler::sve_vmaskcast_narrow(PRegister dst, PRegister src,
void C2_MacroAssembler::sve_vmaskcast_narrow(PRegister dst, PRegister src, PRegister ptmp,
uint dst_element_length_in_bytes, uint src_element_length_in_bytes) {
// The insignificant bits in src predicate are expected to be zero.
// To ensure the higher order bits of the resultant narrowed vector are 0, an all-zero predicate is
// passed as the second argument. An example narrowing operation with a given mask would be -
// 128Long -> 64Int on a 128-bit machine i.e 2L -> 2I
// Mask (for 2 Longs) : TF
// Predicate register for the above mask (16 bits) : 00000001 00000000
// After narrowing (uzp1 dst.b, src.b, ptmp.b) : 0000 0000 0001 0000
// Which translates to mask for 2 integers as : TF (lower half is considered while upper half is 0)
assert_different_registers(src, ptmp);
assert_different_registers(dst, ptmp);
sve_pfalse(ptmp);
if (dst_element_length_in_bytes * 2 == src_element_length_in_bytes) {
sve_uzp1(dst, B, src, src);
sve_uzp1(dst, B, src, ptmp);
} else if (dst_element_length_in_bytes * 4 == src_element_length_in_bytes) {
sve_uzp1(dst, H, src, src);
sve_uzp1(dst, B, dst, dst);
sve_uzp1(dst, H, src, ptmp);
sve_uzp1(dst, B, dst, ptmp);
} else if (dst_element_length_in_bytes * 8 == src_element_length_in_bytes) {
sve_uzp1(dst, S, src, src);
sve_uzp1(dst, H, dst, dst);
sve_uzp1(dst, B, dst, dst);
sve_uzp1(dst, S, src, ptmp);
sve_uzp1(dst, H, dst, ptmp);
sve_uzp1(dst, B, dst, ptmp);
} else {
assert(false, "unsupported");
ShouldNotReachHere();
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
void sve_vmaskcast_extend(PRegister dst, PRegister src,
uint dst_element_length_in_bytes, uint src_element_lenght_in_bytes);

void sve_vmaskcast_narrow(PRegister dst, PRegister src,
void sve_vmaskcast_narrow(PRegister dst, PRegister src, PRegister ptmp,
uint dst_element_length_in_bytes, uint src_element_lenght_in_bytes);

// Vector reduction
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/cpu/aarch64/globals_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
// (see globals.hpp)

define_pd_global(bool, ImplicitNullChecks, true); // Generate code for implicit null checks
define_pd_global(bool, TrapBasedNullChecks, false);
define_pd_global(bool, TrapBasedNullChecks, false);
define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs past to check cast

define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_OR_JVMCI);

define_pd_global(uintx, CodeCacheSegmentSize, 64 COMPILER1_AND_COMPILER2_PRESENT(+64)); // Tiered compilation has large code-entry alignment.
define_pd_global(intx, CodeEntryAlignment, 64);
define_pd_global(intx, OptoLoopAlignment, 16);
Expand Down
11 changes: 11 additions & 0 deletions src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1833,3 +1833,14 @@ void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register t
bind(profile_continue);
}
}

void InterpreterMacroAssembler::load_resolved_indy_entry(Register cache, Register index) {
// Get index out of bytecode pointer, get_cache_entry_pointer_at_bcp
get_cache_index_at_bcp(index, 1, sizeof(u4));
// Get address of invokedynamic array
ldr(cache, Address(rcpool, in_bytes(ConstantPoolCache::invokedynamic_entries_offset())));
// Scale the index to be the entry index * sizeof(ResolvedInvokeDynamicInfo)
lsl(index, index, log2i_exact(sizeof(ResolvedIndyEntry)));
add(cache, cache, Array<ResolvedIndyEntry>::base_offset_in_bytes());
lea(cache, Address(cache, index));
}
2 changes: 2 additions & 0 deletions src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ class InterpreterMacroAssembler: public MacroAssembler {
set_last_Java_frame(esp, rfp, (address) pc(), rscratch1);
MacroAssembler::_call_Unimplemented(call_site);
}

void load_resolved_indy_entry(Register cache, Register index);
};

#endif // CPU_AARCH64_INTERP_MASM_AARCH64_HPP
17 changes: 11 additions & 6 deletions src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,26 +570,31 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
// caller, but with an uncorrected stack, causing delayed havoc.

if (VerifyAdapterCalls &&
(Interpreter::code() != NULL || StubRoutines::code1() != NULL)) {
(Interpreter::code() != NULL || StubRoutines::final_stubs_code() != NULL)) {
#if 0
// So, let's test for cascading c2i/i2c adapters right now.
// assert(Interpreter::contains($return_addr) ||
// StubRoutines::contains($return_addr),
// "i2c adapter must return to an interpreter frame");
__ block_comment("verify_i2c { ");
Label L_ok;
if (Interpreter::code() != NULL)
if (Interpreter::code() != NULL) {
range_check(masm, rax, r11,
Interpreter::code()->code_start(), Interpreter::code()->code_end(),
L_ok);
if (StubRoutines::code1() != NULL)
}
if (StubRoutines::initial_stubs_code() != NULL) {
range_check(masm, rax, r11,
StubRoutines::code1()->code_begin(), StubRoutines::code1()->code_end(),
StubRoutines::initial_stubs_code()->code_begin(),
StubRoutines::initial_stubs_code()->code_end(),
L_ok);
if (StubRoutines::code2() != NULL)
}
if (StubRoutines::final_stubs_code() != NULL) {
range_check(masm, rax, r11,
StubRoutines::code2()->code_begin(), StubRoutines::code2()->code_end(),
StubRoutines::final_stubs_code()->code_begin(),
StubRoutines::final_stubs_code()->code_end(),
L_ok);
}
const char* msg = "i2c adapter must return to an interpreter frame";
__ block_comment(msg);
__ stop(msg);
Expand Down
Loading

0 comments on commit 979f814

Please sign in to comment.