mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-13 09:23:20 +00:00
Merge remote-tracking branch 'origin/master' into counted-loop-refactor
This commit is contained in:
commit
7783d60948
1
.github/workflows/build-alpine-linux.yml
vendored
1
.github/workflows/build-alpine-linux.yml
vendored
@ -96,6 +96,7 @@ jobs:
|
||||
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
|
||||
--with-zlib=system
|
||||
--with-jmod-compress=zip-1
|
||||
--with-external-symbols-in-bundles=none
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
|
||||
1
.github/workflows/build-cross-compile.yml
vendored
1
.github/workflows/build-cross-compile.yml
vendored
@ -179,6 +179,7 @@ jobs:
|
||||
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
|
||||
--with-sysroot=sysroot
|
||||
--with-jmod-compress=zip-1
|
||||
--with-external-symbols-in-bundles=none
|
||||
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 }}
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
|
||||
1
.github/workflows/build-linux.yml
vendored
1
.github/workflows/build-linux.yml
vendored
@ -143,6 +143,7 @@ jobs:
|
||||
--with-gtest=${{ steps.gtest.outputs.path }}
|
||||
--with-zlib=system
|
||||
--with-jmod-compress=zip-1
|
||||
--with-external-symbols-in-bundles=none
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
|
||||
1
.github/workflows/build-macos.yml
vendored
1
.github/workflows/build-macos.yml
vendored
@ -110,6 +110,7 @@ jobs:
|
||||
--with-gtest=${{ steps.gtest.outputs.path }}
|
||||
--with-zlib=system
|
||||
--with-jmod-compress=zip-1
|
||||
--with-external-symbols-in-bundles=none
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
|
||||
1
.github/workflows/build-windows.yml
vendored
1
.github/workflows/build-windows.yml
vendored
@ -134,6 +134,7 @@ jobs:
|
||||
--with-gtest=${{ steps.gtest.outputs.path }}
|
||||
--with-msvc-toolset-version=${{ inputs.msvc-toolset-version }}
|
||||
--with-jmod-compress=zip-1
|
||||
--with-external-symbols-in-bundles=none
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
|
||||
@ -54,21 +54,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
|
||||
NAME := jdwp, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -DJDWP_LOGGING $(ICONV_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc_eventFilter.c := unused-variable, \
|
||||
DISABLED_WARNINGS_gcc_SDE.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_threadControl.c := unused-but-set-variable \
|
||||
unused-variable, \
|
||||
DISABLED_WARNINGS_gcc_utf_util.c := unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_clang_error_messages.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_eventFilter.c := unused-variable, \
|
||||
DISABLED_WARNINGS_clang_EventRequestImpl.c := self-assign, \
|
||||
DISABLED_WARNINGS_clang_inStream.c := sometimes-uninitialized, \
|
||||
DISABLED_WARNINGS_clang_log_messages.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_SDE.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_threadControl.c := unused-but-set-variable \
|
||||
unused-variable, \
|
||||
DISABLED_WARNINGS_clang_utf_util.c := unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_microsoft_debugInit.c := 5287, \
|
||||
LDFLAGS := $(ICONV_LDFLAGS), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include \
|
||||
|
||||
@ -6259,14 +6259,10 @@ void MacroAssembler::fill_words(Register base, Register cnt, Register value)
|
||||
|
||||
// Intrinsic for
|
||||
//
|
||||
// - sun.nio.cs.ISO_8859_1.Encoder#encodeISOArray0(byte[] sa, int sp, byte[] da, int dp, int len)
|
||||
// Encodes char[] to byte[] in ISO-8859-1
|
||||
//
|
||||
// - java.lang.StringCoding#encodeISOArray0(byte[] sa, int sp, byte[] da, int dp, int len)
|
||||
// Encodes byte[] (containing UTF-16) to byte[] in ISO-8859-1
|
||||
//
|
||||
// - java.lang.StringCoding#encodeAsciiArray0(char[] sa, int sp, byte[] da, int dp, int len)
|
||||
// Encodes char[] to byte[] in ASCII
|
||||
// - sun/nio/cs/ISO_8859_1$Encoder.implEncodeISOArray
|
||||
// return the number of characters copied.
|
||||
// - java/lang/StringUTF16.compress
|
||||
// return index of non-latin1 character if copy fails, otherwise 'len'.
|
||||
//
|
||||
// This version always returns the number of characters copied, and does not
|
||||
// clobber the 'len' register. A successful copy will complete with the post-
|
||||
|
||||
@ -2813,14 +2813,10 @@ void C2_MacroAssembler::char_array_compress_v(Register src, Register dst, Regist
|
||||
|
||||
// Intrinsic for
|
||||
//
|
||||
// - sun.nio.cs.ISO_8859_1.Encoder#encodeISOArray0(byte[] sa, int sp, byte[] da, int dp, int len)
|
||||
// Encodes char[] to byte[] in ISO-8859-1
|
||||
//
|
||||
// - java.lang.StringCoding#encodeISOArray0(byte[] sa, int sp, byte[] da, int dp, int len)
|
||||
// Encodes byte[] (containing UTF-16) to byte[] in ISO-8859-1
|
||||
//
|
||||
// - java.lang.StringCoding#encodeAsciiArray0(char[] sa, int sp, byte[] da, int dp, int len)
|
||||
// Encodes char[] to byte[] in ASCII
|
||||
// - sun/nio/cs/ISO_8859_1$Encoder.implEncodeISOArray
|
||||
// return the number of characters copied.
|
||||
// - java/lang/StringUTF16.compress
|
||||
// return index of non-latin1 character if copy fails, otherwise 'len'.
|
||||
//
|
||||
// This version always returns the number of characters copied. A successful
|
||||
// copy will complete with the post-condition: 'res' == 'len', while an
|
||||
|
||||
@ -114,12 +114,12 @@ source %{
|
||||
case Op_VectorCastHF2F:
|
||||
case Op_VectorCastF2HF:
|
||||
case Op_AddVHF:
|
||||
case Op_SubVHF:
|
||||
case Op_MulVHF:
|
||||
case Op_DivVHF:
|
||||
case Op_MaxVHF:
|
||||
case Op_MinVHF:
|
||||
case Op_MulVHF:
|
||||
case Op_SqrtVHF:
|
||||
case Op_SubVHF:
|
||||
return UseZvfh;
|
||||
case Op_FmaVHF:
|
||||
return UseZvfh && UseFMA;
|
||||
@ -147,13 +147,28 @@ source %{
|
||||
if (!UseRVV) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (opcode) {
|
||||
case Op_SelectFromTwoVector:
|
||||
// There is no masked version of selectFrom two vector, i.e. selectFrom(av, bv, mask) in vector API.
|
||||
return false;
|
||||
// Currently, the masked versions of the following 8 Float16 operations are disabled.
|
||||
// When the support for Float16 vector classes is added in VectorAPI and the masked
|
||||
// Float16 IR can be generated, these masked operations will be enabled and relevant
|
||||
// backend support added.
|
||||
case Op_AddVHF:
|
||||
case Op_SubVHF:
|
||||
case Op_MulVHF:
|
||||
case Op_DivVHF:
|
||||
case Op_MaxVHF:
|
||||
case Op_MinVHF:
|
||||
case Op_SqrtVHF:
|
||||
case Op_FmaVHF:
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return match_rule_supported_vector(opcode, vlen, bt);
|
||||
}
|
||||
|
||||
|
||||
@ -6251,46 +6251,32 @@ void MacroAssembler::evpbroadcast(BasicType type, XMMRegister dst, Register src,
|
||||
}
|
||||
}
|
||||
|
||||
// Encode given char[]/byte[] to byte[] in ISO_8859_1 or ASCII
|
||||
//
|
||||
// @IntrinsicCandidate
|
||||
// int sun.nio.cs.ISO_8859_1.Encoder#encodeISOArray0(
|
||||
// char[] sa, int sp, byte[] da, int dp, int len) {
|
||||
// int i = 0;
|
||||
// for (; i < len; i++) {
|
||||
// char c = sa[sp++];
|
||||
// if (c > '\u00FF')
|
||||
// break;
|
||||
// da[dp++] = (byte) c;
|
||||
// }
|
||||
// return i;
|
||||
// }
|
||||
//
|
||||
// @IntrinsicCandidate
|
||||
// int java.lang.StringCoding.encodeISOArray0(
|
||||
// byte[] sa, int sp, byte[] da, int dp, int len) {
|
||||
// int i = 0;
|
||||
// for (; i < len; i++) {
|
||||
// char c = StringUTF16.getChar(sa, sp++);
|
||||
// if (c > '\u00FF')
|
||||
// break;
|
||||
// da[dp++] = (byte) c;
|
||||
// }
|
||||
// return i;
|
||||
// }
|
||||
//
|
||||
// @IntrinsicCandidate
|
||||
// int java.lang.StringCoding.encodeAsciiArray0(
|
||||
// char[] sa, int sp, byte[] da, int dp, int len) {
|
||||
// int i = 0;
|
||||
// for (; i < len; i++) {
|
||||
// char c = sa[sp++];
|
||||
// if (c >= '\u0080')
|
||||
// break;
|
||||
// da[dp++] = (byte) c;
|
||||
// }
|
||||
// return i;
|
||||
// }
|
||||
// encode char[] to byte[] in ISO_8859_1 or ASCII
|
||||
//@IntrinsicCandidate
|
||||
//private static int implEncodeISOArray(byte[] sa, int sp,
|
||||
//byte[] da, int dp, int len) {
|
||||
// int i = 0;
|
||||
// for (; i < len; i++) {
|
||||
// char c = StringUTF16.getChar(sa, sp++);
|
||||
// if (c > '\u00FF')
|
||||
// break;
|
||||
// da[dp++] = (byte)c;
|
||||
// }
|
||||
// return i;
|
||||
//}
|
||||
//
|
||||
//@IntrinsicCandidate
|
||||
//private static int implEncodeAsciiArray(char[] sa, int sp,
|
||||
// byte[] da, int dp, int len) {
|
||||
// int i = 0;
|
||||
// for (; i < len; i++) {
|
||||
// char c = sa[sp++];
|
||||
// if (c >= '\u0080')
|
||||
// break;
|
||||
// da[dp++] = (byte)c;
|
||||
// }
|
||||
// return i;
|
||||
//}
|
||||
void MacroAssembler::encode_iso_array(Register src, Register dst, Register len,
|
||||
XMMRegister tmp1Reg, XMMRegister tmp2Reg,
|
||||
XMMRegister tmp3Reg, XMMRegister tmp4Reg,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2011, 2026, 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
|
||||
@ -2633,17 +2633,19 @@ bool Matcher::supports_vector_calling_convention(void) {
|
||||
return EnableVectorSupport;
|
||||
}
|
||||
|
||||
static bool is_ndd_demotable_opr1(const MachNode* mdef) {
|
||||
return ((mdef->flags() & Node::PD::Flag_ndd_demotable_opr1) != 0);
|
||||
}
|
||||
|
||||
static bool is_ndd_demotable_opr2(const MachNode* mdef) {
|
||||
return ((mdef->flags() & Node::PD::Flag_ndd_demotable_opr2) != 0);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
static bool is_ndd_demotable(const MachNode* mdef) {
|
||||
return ((mdef->flags() & Node::PD::Flag_ndd_demotable) != 0);
|
||||
}
|
||||
|
||||
static bool is_ndd_demotable_commutative(const MachNode* mdef) {
|
||||
return ((mdef->flags() & Node::PD::Flag_ndd_demotable_commutative) != 0);
|
||||
}
|
||||
|
||||
static bool is_demotion_candidate(const MachNode* mdef) {
|
||||
return (is_ndd_demotable(mdef) || is_ndd_demotable_commutative(mdef));
|
||||
return (is_ndd_demotable_opr1(mdef) || is_ndd_demotable_opr2(mdef));
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Matcher::is_register_biasing_candidate(const MachNode* mdef,
|
||||
int oper_index) {
|
||||
@ -2653,8 +2655,8 @@ bool Matcher::is_register_biasing_candidate(const MachNode* mdef,
|
||||
|
||||
if (mdef->num_opnds() <= oper_index || mdef->operand_index(oper_index) < 0 ||
|
||||
mdef->in(mdef->operand_index(oper_index)) == nullptr) {
|
||||
assert(oper_index != 1 || !is_demotion_candidate(mdef), "%s", mdef->Name());
|
||||
assert(oper_index != 2 || !is_ndd_demotable_commutative(mdef), "%s", mdef->Name());
|
||||
assert(oper_index != 1 || !is_ndd_demotable_opr1(mdef), "%s", mdef->Name());
|
||||
assert(oper_index != 2 || !is_ndd_demotable_opr2(mdef), "%s", mdef->Name());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2662,14 +2664,13 @@ bool Matcher::is_register_biasing_candidate(const MachNode* mdef,
|
||||
// address computation. Biasing def towards any address component will not
|
||||
// result in NDD demotion by assembler.
|
||||
if (mdef->operand_num_edges(oper_index) != 1) {
|
||||
assert(!is_ndd_demotable(mdef), "%s", mdef->Name());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Demotion candidate must be register mask compatible with definition.
|
||||
const RegMask& oper_mask = mdef->in_RegMask(mdef->operand_index(oper_index));
|
||||
if (!oper_mask.overlap(mdef->out_RegMask())) {
|
||||
assert(!is_demotion_candidate(mdef), "%s", mdef->Name());
|
||||
assert(!is_ndd_demotable(mdef), "%s", mdef->Name());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2681,12 +2682,12 @@ bool Matcher::is_register_biasing_candidate(const MachNode* mdef,
|
||||
// EVEX prefix with shorter REX/REX2 encoding. Demotion candidates
|
||||
// are decorated with a special flag by instruction selector.
|
||||
case 1:
|
||||
return is_demotion_candidate(mdef);
|
||||
return is_ndd_demotable_opr1(mdef);
|
||||
|
||||
// Definition operand of commutative operation can be biased towards second
|
||||
// operand.
|
||||
case 2:
|
||||
return is_ndd_demotable_commutative(mdef);
|
||||
return is_ndd_demotable_opr2(mdef);
|
||||
|
||||
// Current scheme only selects up to two biasing candidates
|
||||
default:
|
||||
@ -2888,9 +2889,9 @@ public:
|
||||
Flag_clears_zero_flag = Node::_last_flag << 9,
|
||||
Flag_clears_overflow_flag = Node::_last_flag << 10,
|
||||
Flag_clears_sign_flag = Node::_last_flag << 11,
|
||||
Flag_ndd_demotable = Node::_last_flag << 12,
|
||||
Flag_ndd_demotable_commutative = Node::_last_flag << 13,
|
||||
_last_flag = Flag_ndd_demotable_commutative
|
||||
Flag_ndd_demotable_opr1 = Node::_last_flag << 12,
|
||||
Flag_ndd_demotable_opr2 = Node::_last_flag << 13,
|
||||
_last_flag = Flag_ndd_demotable_opr2
|
||||
};
|
||||
};
|
||||
|
||||
@ -9872,7 +9873,7 @@ instruct addI_rReg_ndd(rRegI dst, rRegI src1, rRegI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AddI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
format %{ "eaddl $dst, $src1, $src2\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -9900,7 +9901,7 @@ instruct addI_rReg_rReg_imm_ndd(rRegI dst, rRegI src1, immI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AddI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eaddl $dst, $src1, $src2\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -9943,7 +9944,7 @@ instruct addI_rReg_rReg_mem_ndd(rRegI dst, rRegI src1, memory src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AddI src1 (LoadI src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(150);
|
||||
format %{ "eaddl $dst, $src1, $src2\t# int ndd" %}
|
||||
@ -10000,7 +10001,7 @@ instruct incI_rReg_ndd(rRegI dst, rRegI src, immI_1 val, rFlagsReg cr)
|
||||
predicate(UseAPX && UseIncDec);
|
||||
match(Set dst (AddI src val));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eincl $dst, $src\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -10055,7 +10056,7 @@ instruct decI_rReg_ndd(rRegI dst, rRegI src, immI_M1 val, rFlagsReg cr)
|
||||
predicate(UseAPX && UseIncDec);
|
||||
match(Set dst (AddI src val));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "edecl $dst, $src\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -10162,7 +10163,7 @@ instruct addL_rReg_ndd(rRegL dst, rRegL src1, rRegL src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AddL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
format %{ "eaddq $dst, $src1, $src2\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -10190,7 +10191,7 @@ instruct addL_rReg_rReg_imm_ndd(rRegL dst, rRegL src1, immL32 src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AddL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eaddq $dst, $src1, $src2\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -10233,7 +10234,7 @@ instruct addL_rReg_rReg_mem_ndd(rRegL dst, rRegL src1, memory src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AddL src1 (LoadL src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(150);
|
||||
format %{ "eaddq $dst, $src1, $src2\t# long ndd" %}
|
||||
@ -10289,7 +10290,7 @@ instruct incL_rReg_ndd(rRegL dst, rRegI src, immL1 val, rFlagsReg cr)
|
||||
predicate(UseAPX && UseIncDec);
|
||||
match(Set dst (AddL src val));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eincq $dst, $src\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -10344,7 +10345,7 @@ instruct decL_rReg_ndd(rRegL dst, rRegL src, immL_M1 val, rFlagsReg cr)
|
||||
predicate(UseAPX && UseIncDec);
|
||||
match(Set dst (AddL src val));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "edecq $dst, $src\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -11059,7 +11060,7 @@ instruct subI_rReg_ndd(rRegI dst, rRegI src1, rRegI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (SubI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "esubl $dst, $src1, $src2\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -11073,7 +11074,7 @@ instruct subI_rReg_rReg_imm_ndd(rRegI dst, rRegI src1, immI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (SubI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "esubl $dst, $src1, $src2\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -11116,7 +11117,7 @@ instruct subI_rReg_rReg_mem_ndd(rRegI dst, rRegI src1, memory src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (SubI src1 (LoadI src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
ins_cost(150);
|
||||
format %{ "esubl $dst, $src1, $src2\t# int ndd" %}
|
||||
@ -11174,7 +11175,7 @@ instruct subL_rReg_ndd(rRegL dst, rRegL src1, rRegL src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (SubL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "esubq $dst, $src1, $src2\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -11188,7 +11189,7 @@ instruct subL_rReg_rReg_imm_ndd(rRegL dst, rRegL src1, immL32 src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (SubL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "esubq $dst, $src1, $src2\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -11231,7 +11232,7 @@ instruct subL_rReg_rReg_mem_ndd(rRegL dst, rRegL src1, memory src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (SubL src1 (LoadL src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_carry_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
ins_cost(150);
|
||||
format %{ "esubq $dst, $src1, $src2\t# long ndd" %}
|
||||
@ -11303,7 +11304,7 @@ instruct negI_rReg_ndd(rRegI dst, rRegI src, immI_0 zero, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (SubI zero src));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
format %{ "enegl $dst, $src\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -11331,7 +11332,7 @@ instruct negI_rReg_2_ndd(rRegI dst, rRegI src, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (NegI src));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "enegl $dst, $src\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -11372,7 +11373,7 @@ instruct negL_rReg_ndd(rRegL dst, rRegL src, immL0 zero, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (SubL zero src));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
format %{ "enegq $dst, $src\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -11400,7 +11401,7 @@ instruct negL_rReg_2_ndd(rRegL dst, rRegL src, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (NegL src));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_overflow_flag, PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "enegq $dst, $src\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -11445,7 +11446,7 @@ instruct mulI_rReg_ndd(rRegI dst, rRegI src1, rRegI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (MulI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(300);
|
||||
format %{ "eimull $dst, $src1, $src2\t# int ndd" %}
|
||||
@ -11487,7 +11488,7 @@ instruct mulI_rReg_rReg_mem_ndd(rRegI dst, rRegI src1, memory src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (MulI src1 (LoadI src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(350);
|
||||
format %{ "eimull $dst, $src1, $src2\t# int ndd" %}
|
||||
@ -11539,7 +11540,7 @@ instruct mulL_rReg_ndd(rRegL dst, rRegL src1, rRegL src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (MulL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(300);
|
||||
format %{ "eimulq $dst, $src1, $src2\t# long ndd" %}
|
||||
@ -11581,7 +11582,7 @@ instruct mulL_rReg_rReg_mem_ndd(rRegL dst, rRegL src1, memory src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (MulL src1 (LoadL src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(350);
|
||||
format %{ "eimulq $dst, $src1, $src2 \t# long" %}
|
||||
@ -11856,7 +11857,7 @@ instruct salI_rReg_immI2_ndd(rRegI dst, rRegI src, immI2 shift, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (LShiftI src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "esall $dst, $src, $shift\t# int(ndd)" %}
|
||||
ins_encode %{
|
||||
@ -11885,7 +11886,7 @@ instruct salI_rReg_imm_ndd(rRegI dst, rRegI src, immI8 shift, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (LShiftI src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "esall $dst, $src, $shift\t# int (ndd)" %}
|
||||
ins_encode %{
|
||||
@ -11992,7 +11993,7 @@ instruct sarI_rReg_imm_ndd(rRegI dst, rRegI src, immI8 shift, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (RShiftI src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "esarl $dst, $src, $shift\t# int (ndd)" %}
|
||||
ins_encode %{
|
||||
@ -12099,7 +12100,7 @@ instruct shrI_rReg_imm_ndd(rRegI dst, rRegI src, immI8 shift, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (URShiftI src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eshrl $dst, $src, $shift\t # int (ndd)" %}
|
||||
ins_encode %{
|
||||
@ -12207,7 +12208,7 @@ instruct salL_rReg_immI2_ndd(rRegL dst, rRegL src, immI2 shift, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (LShiftL src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "esalq $dst, $src, $shift\t# long (ndd)" %}
|
||||
ins_encode %{
|
||||
@ -12236,7 +12237,7 @@ instruct salL_rReg_imm_ndd(rRegL dst, rRegL src, immI8 shift, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (LShiftL src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "esalq $dst, $src, $shift\t# long (ndd)" %}
|
||||
ins_encode %{
|
||||
@ -12343,7 +12344,7 @@ instruct sarL_rReg_imm_ndd(rRegL dst, rRegL src, immI shift, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (RShiftL src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "esarq $dst, $src, $shift\t# long (ndd)" %}
|
||||
ins_encode %{
|
||||
@ -12450,7 +12451,7 @@ instruct shrL_rReg_imm_ndd(rRegL dst, rRegL src, immI8 shift, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (URShiftL src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eshrq $dst, $src, $shift\t# long (ndd)" %}
|
||||
ins_encode %{
|
||||
@ -12622,7 +12623,7 @@ instruct rolI_rReg_Var_ndd(rRegI dst, rRegI src, rcx_RegI shift, rFlagsReg cr)
|
||||
predicate(UseAPX && n->bottom_type()->basic_type() == T_INT);
|
||||
match(Set dst (RotateLeft src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eroll $dst, $src, $shift\t# rotate left (int ndd)" %}
|
||||
ins_encode %{
|
||||
@ -12687,7 +12688,7 @@ instruct rorI_rReg_Var_ndd(rRegI dst, rRegI src, rcx_RegI shift, rFlagsReg cr)
|
||||
predicate(UseAPX && n->bottom_type()->basic_type() == T_INT);
|
||||
match(Set dst (RotateRight src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "erorl $dst, $src, $shift\t# rotate right(int ndd)" %}
|
||||
ins_encode %{
|
||||
@ -12754,7 +12755,7 @@ instruct rolL_rReg_Var_ndd(rRegL dst, rRegL src, rcx_RegI shift, rFlagsReg cr)
|
||||
predicate(UseAPX && n->bottom_type()->basic_type() == T_LONG);
|
||||
match(Set dst (RotateLeft src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "erolq $dst, $src, $shift\t# rotate left(long ndd)" %}
|
||||
ins_encode %{
|
||||
@ -12819,7 +12820,7 @@ instruct rorL_rReg_Var_ndd(rRegL dst, rRegL src, rcx_RegI shift, rFlagsReg cr)
|
||||
predicate(UseAPX && n->bottom_type()->basic_type() == T_LONG);
|
||||
match(Set dst (RotateRight src shift));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "erorq $dst, $src, $shift\t# rotate right(long ndd)" %}
|
||||
ins_encode %{
|
||||
@ -12897,7 +12898,7 @@ instruct andI_rReg_ndd(rRegI dst, rRegI src1, rRegI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AndI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
format %{ "eandl $dst, $src1, $src2\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -12990,7 +12991,7 @@ instruct andI_rReg_rReg_imm_ndd(rRegI dst, rRegI src1, immI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AndI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eandl $dst, $src1, $src2\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -13034,7 +13035,7 @@ instruct andI_rReg_rReg_mem_ndd(rRegI dst, rRegI src1, memory src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AndI src1 (LoadI src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(150);
|
||||
format %{ "eandl $dst, $src1, $src2\t# int ndd" %}
|
||||
@ -13234,7 +13235,7 @@ instruct orI_rReg_ndd(rRegI dst, rRegI src1, rRegI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (OrI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
format %{ "eorl $dst, $src1, $src2\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -13263,7 +13264,7 @@ instruct orI_rReg_rReg_imm_ndd(rRegI dst, rRegI src1, immI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (OrI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eorl $dst, $src1, $src2\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -13277,7 +13278,7 @@ instruct orI_rReg_imm_rReg_ndd(rRegI dst, immI src1, rRegI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (OrI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eorl $dst, $src2, $src1\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -13321,7 +13322,7 @@ instruct orI_rReg_rReg_mem_ndd(rRegI dst, rRegI src1, memory src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (OrI src1 (LoadI src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(150);
|
||||
format %{ "eorl $dst, $src1, $src2\t# int ndd" %}
|
||||
@ -13397,7 +13398,7 @@ instruct xorI_rReg_ndd(rRegI dst, rRegI src1, rRegI src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (XorI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
format %{ "exorl $dst, $src1, $src2\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -13423,7 +13424,7 @@ instruct xorI_rReg_im1_ndd(rRegI dst, rRegI src, immI_M1 imm)
|
||||
%{
|
||||
match(Set dst (XorI src imm));
|
||||
predicate(UseAPX);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "enotl $dst, $src" %}
|
||||
ins_encode %{
|
||||
@ -13454,7 +13455,7 @@ instruct xorI_rReg_rReg_imm_ndd(rRegI dst, rRegI src1, immI src2, rFlagsReg cr)
|
||||
predicate(UseAPX && n->in(2)->bottom_type()->is_int()->get_con() != -1);
|
||||
match(Set dst (XorI src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "exorl $dst, $src1, $src2\t# int ndd" %}
|
||||
ins_encode %{
|
||||
@ -13500,7 +13501,7 @@ instruct xorI_rReg_rReg_mem_ndd(rRegI dst, rRegI src1, memory src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (XorI src1 (LoadI src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(150);
|
||||
format %{ "exorl $dst, $src1, $src2\t# int ndd" %}
|
||||
@ -13579,7 +13580,7 @@ instruct andL_rReg_ndd(rRegL dst, rRegL src1, rRegL src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AndL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
format %{ "eandq $dst, $src1, $src2\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -13635,7 +13636,7 @@ instruct andL_rReg_rReg_imm_ndd(rRegL dst, rRegL src1, immL32 src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AndL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eandq $dst, $src1, $src2\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -13679,7 +13680,7 @@ instruct andL_rReg_rReg_mem_ndd(rRegL dst, rRegL src1, memory src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (AndL src1 (LoadL src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(150);
|
||||
format %{ "eandq $dst, $src1, $src2\t# long ndd" %}
|
||||
@ -13882,7 +13883,7 @@ instruct orL_rReg_ndd(rRegL dst, rRegL src1, rRegL src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (OrL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
format %{ "eorq $dst, $src1, $src2\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -13937,7 +13938,7 @@ instruct orL_rReg_rReg_imm_ndd(rRegL dst, rRegL src1, immL32 src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (OrL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eorq $dst, $src1, $src2\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -13951,7 +13952,7 @@ instruct orL_rReg_imm_rReg_ndd(rRegL dst, immL32 src1, rRegL src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (OrL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "eorq $dst, $src2, $src1\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -13996,7 +13997,7 @@ instruct orL_rReg_rReg_mem_ndd(rRegL dst, rRegL src1, memory src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (OrL src1 (LoadL src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(150);
|
||||
format %{ "eorq $dst, $src1, $src2\t# long ndd" %}
|
||||
@ -14075,7 +14076,7 @@ instruct xorL_rReg_ndd(rRegL dst, rRegL src1, rRegL src2, rFlagsReg cr)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (XorL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
format %{ "exorq $dst, $src1, $src2\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -14101,7 +14102,7 @@ instruct xorL_rReg_im1_ndd(rRegL dst,rRegL src, immL_M1 imm)
|
||||
%{
|
||||
predicate(UseAPX);
|
||||
match(Set dst (XorL src imm));
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "enotq $dst, $src" %}
|
||||
ins_encode %{
|
||||
@ -14132,7 +14133,7 @@ instruct xorL_rReg_rReg_imm(rRegL dst, rRegL src1, immL32 src2, rFlagsReg cr)
|
||||
predicate(UseAPX && n->in(2)->bottom_type()->is_long()->get_con() != -1L);
|
||||
match(Set dst (XorL src1 src2));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
format %{ "exorq $dst, $src1, $src2\t# long ndd" %}
|
||||
ins_encode %{
|
||||
@ -14178,7 +14179,7 @@ instruct xorL_rReg_rReg_mem_ndd(rRegL dst, rRegL src1, memory src2, rFlagsReg cr
|
||||
predicate(UseAPX);
|
||||
match(Set dst (XorL src1 (LoadL src2)));
|
||||
effect(KILL cr);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_commutative);
|
||||
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1, PD::Flag_ndd_demotable_opr2);
|
||||
|
||||
ins_cost(150);
|
||||
format %{ "exorq $dst, $src1, $src2\t# long ndd" %}
|
||||
@ -16633,7 +16634,7 @@ instruct minI_rReg_ndd(rRegI dst, rRegI src1, rRegI src2)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (MinI src1 src2));
|
||||
effect(DEF dst, USE src1, USE src2);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
ins_cost(200);
|
||||
expand %{
|
||||
@ -16685,7 +16686,7 @@ instruct maxI_rReg_ndd(rRegI dst, rRegI src1, rRegI src2)
|
||||
predicate(UseAPX);
|
||||
match(Set dst (MaxI src1 src2));
|
||||
effect(DEF dst, USE src1, USE src2);
|
||||
flag(PD::Flag_ndd_demotable);
|
||||
flag(PD::Flag_ndd_demotable_opr1);
|
||||
|
||||
ins_cost(200);
|
||||
expand %{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2026, 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
|
||||
@ -884,7 +884,6 @@ class LinearScanStatistic : public StackObj {
|
||||
counter_throw,
|
||||
counter_unwind,
|
||||
counter_typecheck,
|
||||
counter_fpu_stack,
|
||||
counter_misc_inst,
|
||||
counter_other_inst,
|
||||
blank_line_2,
|
||||
|
||||
@ -415,18 +415,18 @@ class methodHandle;
|
||||
\
|
||||
do_class(java_lang_StringCoding, "java/lang/StringCoding") \
|
||||
do_intrinsic(_countPositives, java_lang_StringCoding, countPositives_name, countPositives_signature, F_S) \
|
||||
do_name( countPositives_name, "countPositives0") \
|
||||
do_name( countPositives_name, "countPositives") \
|
||||
do_signature(countPositives_signature, "([BII)I") \
|
||||
\
|
||||
do_class(sun_nio_cs_iso8859_1_Encoder, "sun/nio/cs/ISO_8859_1$Encoder") \
|
||||
do_intrinsic(_encodeISOArray, sun_nio_cs_iso8859_1_Encoder, encodeISOArray_name, encodeISOArray_signature, F_S) \
|
||||
do_name( encodeISOArray_name, "encodeISOArray0") \
|
||||
do_name( encodeISOArray_name, "implEncodeISOArray") \
|
||||
do_signature(encodeISOArray_signature, "([CI[BII)I") \
|
||||
\
|
||||
do_intrinsic(_encodeByteISOArray, java_lang_StringCoding, encodeISOArray_name, indexOfI_signature, F_S) \
|
||||
\
|
||||
do_intrinsic(_encodeAsciiArray, java_lang_StringCoding, encodeAsciiArray_name, encodeISOArray_signature, F_S) \
|
||||
do_name( encodeAsciiArray_name, "encodeAsciiArray0") \
|
||||
do_name( encodeAsciiArray_name, "implEncodeAsciiArray") \
|
||||
\
|
||||
do_class(java_math_BigInteger, "java/math/BigInteger") \
|
||||
do_intrinsic(_multiplyToLen, java_math_BigInteger, multiplyToLen_name, multiplyToLen_signature, F_S) \
|
||||
|
||||
36
src/hotspot/share/metaprogramming/dependentAlwaysFalse.hpp
Normal file
36
src/hotspot/share/metaprogramming/dependentAlwaysFalse.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2025, 2026, 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_METAPROGRAMMING_DEPENDENTALWAYSFALSE_HPP
|
||||
#define SHARE_METAPROGRAMMING_DEPENDENTALWAYSFALSE_HPP
|
||||
|
||||
// This provides a workaround for static_assert(false) in discarded or
|
||||
// otherwise uninstantiated places. Instead use
|
||||
// static_assert(DependentAlwaysFalse<T>, "...")
|
||||
// See http://wg21.link/p2593r1. Some, but not all, compiler versions we're
|
||||
// using have implemented that change as a DR:
|
||||
// https://cplusplus.github.io/CWG/issues/2518.html
|
||||
template<typename T> inline constexpr bool DependentAlwaysFalse = false;
|
||||
|
||||
#endif // SHARE_METAPROGRAMMING_DEPENDENTALWAYSFALSE_HPP
|
||||
@ -675,9 +675,6 @@
|
||||
product(bool, PrintIntrinsics, false, DIAGNOSTIC, \
|
||||
"prints attempted and successful inlining of intrinsics") \
|
||||
\
|
||||
develop(bool, VerifyIntrinsicChecks, false, \
|
||||
"Verify in intrinsic that Java level checks work as expected") \
|
||||
\
|
||||
develop(bool, StressReflectiveCode, false, \
|
||||
"Use inexact types at allocations, etc., to test reflection") \
|
||||
\
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2026, 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
|
||||
@ -418,7 +418,8 @@ bool LateInlineMHCallGenerator::do_late_inline_check(Compile* C, JVMState* jvms)
|
||||
C->inline_printer()->record(cg->method(), call_node()->jvms(), InliningResult::FAILURE,
|
||||
"late method handle call resolution");
|
||||
}
|
||||
assert(!cg->is_late_inline() || cg->is_mh_late_inline() || AlwaysIncrementalInline || StressIncrementalInlining, "we're doing late inlining");
|
||||
assert(!cg->is_late_inline() || cg->is_mh_late_inline() || cg->is_virtual_late_inline() ||
|
||||
AlwaysIncrementalInline || StressIncrementalInlining, "we're doing late inlining");
|
||||
_inline_cg = cg;
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@ -940,11 +940,7 @@ inline Node* LibraryCallKit::generate_limit_guard(Node* offset,
|
||||
}
|
||||
|
||||
// Emit range checks for the given String.value byte array
|
||||
void LibraryCallKit::generate_string_range_check(Node* array,
|
||||
Node* offset,
|
||||
Node* count,
|
||||
bool char_count,
|
||||
bool halt_on_oob) {
|
||||
void LibraryCallKit::generate_string_range_check(Node* array, Node* offset, Node* count, bool char_count) {
|
||||
if (stopped()) {
|
||||
return; // already stopped
|
||||
}
|
||||
@ -962,17 +958,10 @@ void LibraryCallKit::generate_string_range_check(Node* array,
|
||||
generate_limit_guard(offset, count, load_array_length(array), bailout);
|
||||
|
||||
if (bailout->req() > 1) {
|
||||
if (halt_on_oob) {
|
||||
bailout = _gvn.transform(bailout)->as_Region();
|
||||
Node* frame = _gvn.transform(new ParmNode(C->start(), TypeFunc::FramePtr));
|
||||
Node* halt = _gvn.transform(new HaltNode(bailout, frame, "unexpected guard failure in intrinsic"));
|
||||
C->root()->add_req(halt);
|
||||
} else {
|
||||
PreserveJVMState pjvms(this);
|
||||
set_control(_gvn.transform(bailout));
|
||||
uncommon_trap(Deoptimization::Reason_intrinsic,
|
||||
Deoptimization::Action_maybe_recompile);
|
||||
}
|
||||
PreserveJVMState pjvms(this);
|
||||
set_control(_gvn.transform(bailout));
|
||||
uncommon_trap(Deoptimization::Reason_intrinsic,
|
||||
Deoptimization::Action_maybe_recompile);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1130,7 +1119,6 @@ bool LibraryCallKit::inline_array_equals(StrIntrinsicNode::ArgEnc ae) {
|
||||
|
||||
|
||||
//------------------------------inline_countPositives------------------------------
|
||||
// int java.lang.StringCoding#countPositives0(byte[] ba, int off, int len)
|
||||
bool LibraryCallKit::inline_countPositives() {
|
||||
if (too_many_traps(Deoptimization::Reason_intrinsic)) {
|
||||
return false;
|
||||
@ -1142,14 +1130,13 @@ bool LibraryCallKit::inline_countPositives() {
|
||||
Node* offset = argument(1);
|
||||
Node* len = argument(2);
|
||||
|
||||
if (VerifyIntrinsicChecks) {
|
||||
ba = must_be_not_null(ba, true);
|
||||
generate_string_range_check(ba, offset, len, false, true);
|
||||
if (stopped()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
ba = must_be_not_null(ba, true);
|
||||
|
||||
// Range checks
|
||||
generate_string_range_check(ba, offset, len, false);
|
||||
if (stopped()) {
|
||||
return true;
|
||||
}
|
||||
Node* ba_start = array_element_address(ba, offset, T_BYTE);
|
||||
Node* result = new CountPositivesNode(control(), memory(TypeAryPtr::BYTES), ba_start, len);
|
||||
set_result(_gvn.transform(result));
|
||||
@ -6184,9 +6171,6 @@ CallStaticJavaNode* LibraryCallKit::get_uncommon_trap_from_success_proj(Node* no
|
||||
}
|
||||
|
||||
//-------------inline_encodeISOArray-----------------------------------
|
||||
// int sun.nio.cs.ISO_8859_1.Encoder#encodeISOArray0(byte[] sa, int sp, byte[] da, int dp, int len)
|
||||
// int java.lang.StringCoding#encodeISOArray0(byte[] sa, int sp, byte[] da, int dp, int len)
|
||||
// int java.lang.StringCoding#encodeAsciiArray0(char[] sa, int sp, byte[] da, int dp, int len)
|
||||
// encode char[] to byte[] in ISO_8859_1 or ASCII
|
||||
bool LibraryCallKit::inline_encodeISOArray(bool ascii) {
|
||||
assert(callee()->signature()->size() == 5, "encodeISOArray has 5 parameters");
|
||||
@ -6197,14 +6181,8 @@ bool LibraryCallKit::inline_encodeISOArray(bool ascii) {
|
||||
Node *dst_offset = argument(3);
|
||||
Node *length = argument(4);
|
||||
|
||||
// Cast source & target arrays to not-null
|
||||
if (VerifyIntrinsicChecks) {
|
||||
src = must_be_not_null(src, true);
|
||||
dst = must_be_not_null(dst, true);
|
||||
if (stopped()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
src = must_be_not_null(src, true);
|
||||
dst = must_be_not_null(dst, true);
|
||||
|
||||
const TypeAryPtr* src_type = src->Value(&_gvn)->isa_aryptr();
|
||||
const TypeAryPtr* dst_type = dst->Value(&_gvn)->isa_aryptr();
|
||||
@ -6221,15 +6199,6 @@ bool LibraryCallKit::inline_encodeISOArray(bool ascii) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check source & target bounds
|
||||
if (VerifyIntrinsicChecks) {
|
||||
generate_string_range_check(src, src_offset, length, src_elem == T_BYTE, true);
|
||||
generate_string_range_check(dst, dst_offset, length, false, true);
|
||||
if (stopped()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Node* src_start = array_element_address(src, src_offset, T_CHAR);
|
||||
Node* dst_start = array_element_address(dst, dst_offset, dst_elem);
|
||||
// 'src_start' points to src array + scaled offset
|
||||
|
||||
@ -163,8 +163,7 @@ class LibraryCallKit : public GraphKit {
|
||||
Node* array_length,
|
||||
RegionNode* region);
|
||||
void generate_string_range_check(Node* array, Node* offset,
|
||||
Node* length, bool char_count,
|
||||
bool halt_on_oob = false);
|
||||
Node* length, bool char_count);
|
||||
Node* current_thread_helper(Node* &tls_output, ByteSize handle_offset,
|
||||
bool is_immutable);
|
||||
Node* generate_current_thread(Node* &tls_output);
|
||||
|
||||
@ -187,7 +187,10 @@ VStatus VLoopAnalyzer::setup_submodules_helper() {
|
||||
return body_status;
|
||||
}
|
||||
|
||||
_memory_slices.find_memory_slices();
|
||||
VStatus slices_status = _memory_slices.find_memory_slices();
|
||||
if (!slices_status.is_success()) {
|
||||
return slices_status;
|
||||
}
|
||||
|
||||
// If there is no memory slice detected, it means there is no store.
|
||||
// If there is no reduction and no store, then we give up, because
|
||||
@ -207,9 +210,11 @@ VStatus VLoopAnalyzer::setup_submodules_helper() {
|
||||
}
|
||||
|
||||
// There are 2 kinds of slices:
|
||||
// - No memory phi: only loads. All have the same input memory state from before the loop.
|
||||
// - No memory phi: only loads.
|
||||
// - Usually, all loads have the same input memory state from before the loop.
|
||||
// - Only rarely this is not the case, and we just bail out for now.
|
||||
// - With memory phi. Chain of memory operations inside the loop.
|
||||
void VLoopMemorySlices::find_memory_slices() {
|
||||
VStatus VLoopMemorySlices::find_memory_slices() {
|
||||
Compile* C = _vloop.phase()->C;
|
||||
// We iterate over the body, which is topologically sorted. Hence, if there is a phi
|
||||
// in a slice, we will find it first, and the loads and stores afterwards.
|
||||
@ -228,8 +233,15 @@ void VLoopMemorySlices::find_memory_slices() {
|
||||
PhiNode* head = _heads.at(alias_idx);
|
||||
if (head == nullptr) {
|
||||
// We did not find a phi on this slice yet -> must be a slice with only loads.
|
||||
assert(_inputs.at(alias_idx) == nullptr || _inputs.at(alias_idx) == load->in(1),
|
||||
"not yet touched or the same input");
|
||||
// For now, we can only handle slices with a single memory input before the loop,
|
||||
// so if we find multiple, we bail out of auto vectorization. If this becomes
|
||||
// too restrictive in the fututure, we could consider tracking multiple inputs.
|
||||
// Different memory inputs can for example happen if one load has its memory state
|
||||
// optimized, and the other load fails to have it optimized, for example because
|
||||
// it does not end up on the IGVN worklist any more.
|
||||
if (_inputs.at(alias_idx) != nullptr && _inputs.at(alias_idx) != load->in(1)) {
|
||||
return VStatus::make_failure(FAILURE_DIFFERENT_MEMORY_INPUT);
|
||||
}
|
||||
_inputs.at_put(alias_idx, load->in(1));
|
||||
} // else: the load belongs to a slice with a phi that already set heads and inputs.
|
||||
#ifdef ASSERT
|
||||
@ -243,6 +255,7 @@ void VLoopMemorySlices::find_memory_slices() {
|
||||
}
|
||||
}
|
||||
NOT_PRODUCT( if (_vloop.is_trace_memory_slices()) { print(); } )
|
||||
return VStatus::make_success();
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, Arm Limited. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -504,6 +504,8 @@ private:
|
||||
//
|
||||
class VLoopMemorySlices : public StackObj {
|
||||
private:
|
||||
static constexpr char const* FAILURE_DIFFERENT_MEMORY_INPUT = "Load only slice has multiple memory inputs";
|
||||
|
||||
const VLoop& _vloop;
|
||||
const VLoopBody& _body;
|
||||
|
||||
@ -521,7 +523,7 @@ public:
|
||||
const GrowableArray<Node*>& inputs() const { return _inputs; }
|
||||
const GrowableArray<PhiNode*>& heads() const { return _heads; }
|
||||
|
||||
void find_memory_slices();
|
||||
VStatus find_memory_slices();
|
||||
void get_slice_in_reverse_order(PhiNode* head, MemNode* tail, GrowableArray<MemNode*>& slice) const;
|
||||
bool same_memory_slice(MemNode* m1, MemNode* m2) const;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2025, 2026, 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
|
||||
@ -26,6 +26,7 @@
|
||||
#define SHARE_RUNTIME_ATOMIC_HPP
|
||||
|
||||
#include "cppstdlib/type_traits.hpp"
|
||||
#include "metaprogramming/dependentAlwaysFalse.hpp"
|
||||
#include "metaprogramming/primitiveConversions.hpp"
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, 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
|
||||
@ -809,6 +809,7 @@ const int ObjectAlignmentInBytes = 8;
|
||||
\
|
||||
develop(uintx, PreallocatedOutOfMemoryErrorCount, 4, \
|
||||
"Number of OutOfMemoryErrors preallocated with backtrace") \
|
||||
range(0, 1024) \
|
||||
\
|
||||
product(bool, UseXMMForArrayCopy, false, \
|
||||
"Use SSE2 MOVQ instruction for Arraycopy") \
|
||||
|
||||
@ -3362,7 +3362,7 @@ JRT_LEAF(intptr_t*, SharedRuntime::OSR_migration_begin( JavaThread *current) )
|
||||
RegisterMap::WalkContinuation::skip);
|
||||
frame sender = fr.sender(&map);
|
||||
if (sender.is_interpreted_frame()) {
|
||||
current->push_cont_fastpath(sender.sp());
|
||||
current->push_cont_fastpath(sender.unextended_sp());
|
||||
}
|
||||
|
||||
return buf;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, 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
|
||||
@ -70,7 +70,7 @@ class ConcurrentHashTable : public CHeapObj<MT> {
|
||||
class Node {
|
||||
private:
|
||||
DEBUG_ONLY(size_t _saved_hash);
|
||||
Node * volatile _next;
|
||||
Atomic<Node*> _next;
|
||||
VALUE _value;
|
||||
public:
|
||||
Node(const VALUE& value, Node* next = nullptr)
|
||||
@ -80,8 +80,8 @@ class ConcurrentHashTable : public CHeapObj<MT> {
|
||||
}
|
||||
|
||||
Node* next() const;
|
||||
void set_next(Node* node) { _next = node; }
|
||||
Node* const volatile * next_ptr() { return &_next; }
|
||||
void set_next(Node* node) { _next.store_relaxed(node); }
|
||||
const Atomic<Node*>* next_ptr() const { return &_next; }
|
||||
#ifdef ASSERT
|
||||
size_t saved_hash() const { return _saved_hash; }
|
||||
void set_saved_hash(size_t hash) { _saved_hash = hash; }
|
||||
@ -123,7 +123,7 @@ class ConcurrentHashTable : public CHeapObj<MT> {
|
||||
// unlocked -> locked -> redirect
|
||||
// Locked state only applies to an updater.
|
||||
// Reader only check for redirect.
|
||||
Node * volatile _first;
|
||||
Atomic<Node*> _first;
|
||||
|
||||
static const uintptr_t STATE_LOCK_BIT = 0x1;
|
||||
static const uintptr_t STATE_REDIRECT_BIT = 0x2;
|
||||
@ -157,20 +157,25 @@ class ConcurrentHashTable : public CHeapObj<MT> {
|
||||
// A bucket is only one pointer with the embedded state.
|
||||
Bucket() : _first(nullptr) {};
|
||||
|
||||
NONCOPYABLE(Bucket);
|
||||
|
||||
// Copy bucket's first entry to this.
|
||||
void assign(const Bucket& bucket);
|
||||
|
||||
// Get the first pointer unmasked.
|
||||
Node* first() const;
|
||||
|
||||
// Get a pointer to the const first pointer. Do not deference this
|
||||
// pointer, the pointer pointed to _may_ contain an embedded state. Such
|
||||
// pointer should only be used as input to release_assign_node_ptr.
|
||||
Node* const volatile * first_ptr() { return &_first; }
|
||||
const Atomic<Node*>* first_ptr() const { return &_first; }
|
||||
|
||||
// This is the only place where a pointer to a Node pointer that potentially
|
||||
// is _first should be changed. Otherwise we destroy the embedded state. We
|
||||
// only give out pointer to const Node pointer to avoid accidental
|
||||
// assignment, thus here we must cast const part away. Method is not static
|
||||
// due to an assert.
|
||||
void release_assign_node_ptr(Node* const volatile * dst, Node* node) const;
|
||||
void release_assign_node_ptr(const Atomic<Node*>* dst, Node* node) const;
|
||||
|
||||
// This method assigns this buckets last Node next ptr to input Node.
|
||||
void release_assign_last_node_next(Node* node);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, 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
|
||||
@ -63,7 +63,7 @@ inline typename ConcurrentHashTable<CONFIG, MT>::Node*
|
||||
ConcurrentHashTable<CONFIG, MT>::
|
||||
Node::next() const
|
||||
{
|
||||
return AtomicAccess::load_acquire(&_next);
|
||||
return _next.load_acquire();
|
||||
}
|
||||
|
||||
// Bucket
|
||||
@ -72,19 +72,26 @@ inline typename ConcurrentHashTable<CONFIG, MT>::Node*
|
||||
ConcurrentHashTable<CONFIG, MT>::
|
||||
Bucket::first_raw() const
|
||||
{
|
||||
return AtomicAccess::load_acquire(&_first);
|
||||
return _first.load_acquire();
|
||||
}
|
||||
|
||||
template <typename CONFIG, MemTag MT>
|
||||
inline void ConcurrentHashTable<CONFIG, MT>::
|
||||
Bucket::release_assign_node_ptr(
|
||||
typename ConcurrentHashTable<CONFIG, MT>::Node* const volatile * dst,
|
||||
const Atomic<typename ConcurrentHashTable<CONFIG, MT>::Node*>* dst,
|
||||
typename ConcurrentHashTable<CONFIG, MT>::Node* node) const
|
||||
{
|
||||
// Due to this assert this methods is not static.
|
||||
assert(is_locked(), "Must be locked.");
|
||||
Node** tmp = (Node**)dst;
|
||||
AtomicAccess::release_store(tmp, clear_set_state(node, *dst));
|
||||
Atomic<Node*>* tmp = const_cast<Atomic<Node*>*>(dst);
|
||||
tmp->release_store(clear_set_state(node, dst->load_relaxed()));
|
||||
}
|
||||
|
||||
template <typename CONFIG, MemTag MT>
|
||||
inline void ConcurrentHashTable<CONFIG, MT>::
|
||||
Bucket::assign(const Bucket& bucket)
|
||||
{
|
||||
_first.store_relaxed(bucket._first.load_relaxed());
|
||||
}
|
||||
|
||||
template <typename CONFIG, MemTag MT>
|
||||
@ -93,7 +100,7 @@ ConcurrentHashTable<CONFIG, MT>::
|
||||
Bucket::first() const
|
||||
{
|
||||
// We strip the states bit before returning the ptr.
|
||||
return clear_state(AtomicAccess::load_acquire(&_first));
|
||||
return clear_state(_first.load_acquire());
|
||||
}
|
||||
|
||||
template <typename CONFIG, MemTag MT>
|
||||
@ -134,9 +141,9 @@ inline void ConcurrentHashTable<CONFIG, MT>::
|
||||
typename ConcurrentHashTable<CONFIG, MT>::Node* node)
|
||||
{
|
||||
assert(is_locked(), "Must be locked.");
|
||||
Node* const volatile * ret = first_ptr();
|
||||
while (clear_state(*ret) != nullptr) {
|
||||
ret = clear_state(*ret)->next_ptr();
|
||||
const Atomic<Node*>* ret = first_ptr();
|
||||
while (clear_state(ret->load_relaxed()) != nullptr) {
|
||||
ret = clear_state(ret->load_relaxed())->next_ptr();
|
||||
}
|
||||
release_assign_node_ptr(ret, node);
|
||||
}
|
||||
@ -150,7 +157,7 @@ inline bool ConcurrentHashTable<CONFIG, MT>::
|
||||
if (is_locked()) {
|
||||
return false;
|
||||
}
|
||||
if (AtomicAccess::cmpxchg(&_first, expect, node) == expect) {
|
||||
if (_first.compare_exchange(expect, node) == expect) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -165,7 +172,7 @@ inline bool ConcurrentHashTable<CONFIG, MT>::
|
||||
}
|
||||
// We will expect a clean first pointer.
|
||||
Node* tmp = first();
|
||||
if (AtomicAccess::cmpxchg(&_first, tmp, set_state(tmp, STATE_LOCK_BIT)) == tmp) {
|
||||
if (_first.compare_exchange(tmp, set_state(tmp, STATE_LOCK_BIT)) == tmp) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -178,7 +185,7 @@ inline void ConcurrentHashTable<CONFIG, MT>::
|
||||
assert(is_locked(), "Must be locked.");
|
||||
assert(!have_redirect(),
|
||||
"Unlocking a bucket after it has reached terminal state.");
|
||||
AtomicAccess::release_store(&_first, clear_state(first()));
|
||||
_first.release_store(clear_state(first()));
|
||||
}
|
||||
|
||||
template <typename CONFIG, MemTag MT>
|
||||
@ -186,7 +193,7 @@ inline void ConcurrentHashTable<CONFIG, MT>::
|
||||
Bucket::redirect()
|
||||
{
|
||||
assert(is_locked(), "Must be locked.");
|
||||
AtomicAccess::release_store(&_first, set_state(_first, STATE_REDIRECT_BIT));
|
||||
_first.release_store(set_state(_first.load_relaxed(), STATE_REDIRECT_BIT));
|
||||
}
|
||||
|
||||
// InternalTable
|
||||
@ -413,8 +420,8 @@ inline void ConcurrentHashTable<CONFIG, MT>::
|
||||
bucket->lock();
|
||||
|
||||
size_t odd_index = even_index + _table->_size;
|
||||
_new_table->get_buckets()[even_index] = *bucket;
|
||||
_new_table->get_buckets()[odd_index] = *bucket;
|
||||
_new_table->get_buckets()[even_index].assign(*bucket);
|
||||
_new_table->get_buckets()[odd_index].assign(*bucket);
|
||||
|
||||
// Moves lockers go to new table, where they will wait until unlock() below.
|
||||
bucket->redirect(); /* Must release stores above */
|
||||
@ -445,7 +452,7 @@ inline bool ConcurrentHashTable<CONFIG, MT>::
|
||||
{
|
||||
Bucket* bucket = get_bucket_locked(thread, lookup_f.get_hash());
|
||||
assert(bucket->is_locked(), "Must be locked.");
|
||||
Node* const volatile * rem_n_prev = bucket->first_ptr();
|
||||
const Atomic<Node*>* rem_n_prev = bucket->first_ptr();
|
||||
Node* rem_n = bucket->first();
|
||||
while (rem_n != nullptr) {
|
||||
if (lookup_f.equals(rem_n->value())) {
|
||||
@ -534,7 +541,7 @@ inline void ConcurrentHashTable<CONFIG, MT>::
|
||||
|
||||
size_t dels = 0;
|
||||
Node* ndel[StackBufferSize];
|
||||
Node* const volatile * rem_n_prev = bucket->first_ptr();
|
||||
const Atomic<Node*>* rem_n_prev = bucket->first_ptr();
|
||||
Node* rem_n = bucket->first();
|
||||
while (rem_n != nullptr) {
|
||||
if (lookup_f.is_dead(rem_n->value())) {
|
||||
@ -643,8 +650,8 @@ inline bool ConcurrentHashTable<CONFIG, MT>::
|
||||
return false;
|
||||
}
|
||||
Node* delete_me = nullptr;
|
||||
Node* const volatile * even = new_table->get_bucket(even_index)->first_ptr();
|
||||
Node* const volatile * odd = new_table->get_bucket(odd_index)->first_ptr();
|
||||
const Atomic<Node*>* even = new_table->get_bucket(even_index)->first_ptr();
|
||||
const Atomic<Node*>* odd = new_table->get_bucket(odd_index)->first_ptr();
|
||||
while (aux != nullptr) {
|
||||
bool dead_hash = false;
|
||||
size_t aux_hash = CONFIG::get_hash(*aux->value(), &dead_hash);
|
||||
@ -742,11 +749,11 @@ inline void ConcurrentHashTable<CONFIG, MT>::
|
||||
b_old_even->lock();
|
||||
b_old_odd->lock();
|
||||
|
||||
_new_table->get_buckets()[bucket_it] = *b_old_even;
|
||||
_new_table->get_buckets()[bucket_it].assign(*b_old_even);
|
||||
|
||||
// Put chains together.
|
||||
_new_table->get_bucket(bucket_it)->
|
||||
release_assign_last_node_next(*(b_old_odd->first_ptr()));
|
||||
release_assign_last_node_next(b_old_odd->first_ptr()->load_relaxed());
|
||||
|
||||
b_old_even->redirect();
|
||||
b_old_odd->redirect();
|
||||
@ -981,7 +988,7 @@ inline size_t ConcurrentHashTable<CONFIG, MT>::
|
||||
size_t num_del, Node** ndel, GrowableArrayCHeap<Node*, MT>& extra)
|
||||
{
|
||||
size_t dels = 0;
|
||||
Node* const volatile * rem_n_prev = bucket->first_ptr();
|
||||
const Atomic<Node*>* rem_n_prev = bucket->first_ptr();
|
||||
Node* rem_n = bucket->first();
|
||||
while (rem_n != nullptr) {
|
||||
if (eval_f(rem_n->value())) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, 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
|
||||
@ -1374,14 +1374,6 @@ template<typename K> int primitive_compare(const K& k0, const K& k1) {
|
||||
template<typename T>
|
||||
std::add_rvalue_reference_t<T> declval() noexcept;
|
||||
|
||||
// This provides a workaround for static_assert(false) in discarded or
|
||||
// otherwise uninstantiated places. Instead use
|
||||
// static_assert(DependentAlwaysFalse<T>, "...")
|
||||
// See http://wg21.link/p2593r1. Some, but not all, compiler versions we're
|
||||
// using have implemented that change as a DR:
|
||||
// https://cplusplus.github.io/CWG/issues/2518.html
|
||||
template<typename T> inline constexpr bool DependentAlwaysFalse = false;
|
||||
|
||||
// Quickly test to make sure IEEE-754 subnormal numbers are correctly
|
||||
// handled.
|
||||
bool IEEE_subnormal_handling_OK();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2026, 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
|
||||
@ -25,6 +25,7 @@
|
||||
#ifndef SHARE_UTILITIES_LOCKFREESTACK_HPP
|
||||
#define SHARE_UTILITIES_LOCKFREESTACK_HPP
|
||||
|
||||
#include "metaprogramming/dependentAlwaysFalse.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
|
||||
@ -1111,7 +1111,7 @@ public final class String
|
||||
int sp = 0;
|
||||
int sl = len;
|
||||
while (sp < sl) {
|
||||
int ret = StringCoding.encodeISOArray(val, sp, dst, dp, len);
|
||||
int ret = StringCoding.implEncodeISOArray(val, sp, dst, dp, len);
|
||||
sp = sp + ret;
|
||||
dp = dp + ret;
|
||||
if (ret != len) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2024, Alibaba Group Holding Limited. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -26,11 +26,8 @@
|
||||
|
||||
package java.lang;
|
||||
|
||||
import jdk.internal.util.Preconditions;
|
||||
import jdk.internal.vm.annotation.IntrinsicCandidate;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* Utility class for string encoding and decoding.
|
||||
*/
|
||||
@ -41,7 +38,7 @@ class StringCoding {
|
||||
/**
|
||||
* Count the number of leading non-zero ascii chars in the range.
|
||||
*/
|
||||
static int countNonZeroAscii(String s) {
|
||||
public static int countNonZeroAscii(String s) {
|
||||
byte[] value = s.value();
|
||||
if (s.isLatin1()) {
|
||||
return countNonZeroAsciiLatin1(value, 0, value.length);
|
||||
@ -53,7 +50,7 @@ class StringCoding {
|
||||
/**
|
||||
* Count the number of non-zero ascii chars in the range.
|
||||
*/
|
||||
private static int countNonZeroAsciiLatin1(byte[] ba, int off, int len) {
|
||||
public static int countNonZeroAsciiLatin1(byte[] ba, int off, int len) {
|
||||
int limit = off + len;
|
||||
for (int i = off; i < limit; i++) {
|
||||
if (ba[i] <= 0) {
|
||||
@ -66,7 +63,7 @@ class StringCoding {
|
||||
/**
|
||||
* Count the number of leading non-zero ascii chars in the range.
|
||||
*/
|
||||
private static int countNonZeroAsciiUTF16(byte[] ba, int off, int strlen) {
|
||||
public static int countNonZeroAsciiUTF16(byte[] ba, int off, int strlen) {
|
||||
int limit = off + strlen;
|
||||
for (int i = off; i < limit; i++) {
|
||||
char c = StringUTF16.charAt(ba, i);
|
||||
@ -77,7 +74,7 @@ class StringCoding {
|
||||
return strlen;
|
||||
}
|
||||
|
||||
static boolean hasNegatives(byte[] ba, int off, int len) {
|
||||
public static boolean hasNegatives(byte[] ba, int off, int len) {
|
||||
return countPositives(ba, off, len) != len;
|
||||
}
|
||||
|
||||
@ -88,24 +85,9 @@ class StringCoding {
|
||||
* bytes in the range. If there are negative bytes, the implementation must return
|
||||
* a value that is less than or equal to the index of the first negative byte
|
||||
* in the range.
|
||||
*
|
||||
* @param ba a byte array
|
||||
* @param off the index of the first byte to start reading from
|
||||
* @param len the total number of bytes to read
|
||||
* @throws NullPointerException if {@code ba} is null
|
||||
* @throws ArrayIndexOutOfBoundsException if the provided sub-range is
|
||||
* {@linkplain Preconditions#checkFromIndexSize(int, int, int, BiFunction) out of bounds}
|
||||
*/
|
||||
static int countPositives(byte[] ba, int off, int len) {
|
||||
Preconditions.checkFromIndexSize(
|
||||
off, len,
|
||||
ba.length, // Implicit null check on `ba`
|
||||
Preconditions.AIOOBE_FORMATTER);
|
||||
return countPositives0(ba, off, len);
|
||||
}
|
||||
|
||||
@IntrinsicCandidate
|
||||
private static int countPositives0(byte[] ba, int off, int len) {
|
||||
public static int countPositives(byte[] ba, int off, int len) {
|
||||
int limit = off + len;
|
||||
for (int i = off; i < limit; i++) {
|
||||
if (ba[i] < 0) {
|
||||
@ -115,37 +97,9 @@ class StringCoding {
|
||||
return len;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes as many ISO-8859-1 codepoints as possible from the source byte
|
||||
* array containing characters encoded in UTF-16, into the destination byte
|
||||
* array, assuming that the encoding is ISO-8859-1 compatible.
|
||||
*
|
||||
* @param sa the source byte array containing characters encoded in UTF-16
|
||||
* @param sp the index of the <em>character (not byte!)</em> from the source array to start reading from
|
||||
* @param da the target byte array
|
||||
* @param dp the index of the target array to start writing to
|
||||
* @param len the maximum number of <em>characters (not bytes!)</em> to be encoded
|
||||
* @return the total number of <em>characters (not bytes!)</em> successfully encoded
|
||||
* @throws NullPointerException if any of the provided arrays is null
|
||||
*/
|
||||
static int encodeISOArray(byte[] sa, int sp,
|
||||
byte[] da, int dp, int len) {
|
||||
// This method should tolerate invalid arguments, matching the lenient behavior of the VM intrinsic.
|
||||
// Hence, using operator expressions instead of `Preconditions`, which throw on failure.
|
||||
int sl;
|
||||
if ((sp | dp | len) < 0 ||
|
||||
// Halving the length of `sa` to obtain the number of characters:
|
||||
sp >= (sl = sa.length >>> 1) || // Implicit null check on `sa`
|
||||
dp >= da.length) { // Implicit null check on `da`
|
||||
return 0;
|
||||
}
|
||||
int minLen = Math.min(len, Math.min(sl - sp, da.length - dp));
|
||||
return encodeISOArray0(sa, sp, da, dp, minLen);
|
||||
}
|
||||
|
||||
@IntrinsicCandidate
|
||||
private static int encodeISOArray0(byte[] sa, int sp,
|
||||
byte[] da, int dp, int len) {
|
||||
public static int implEncodeISOArray(byte[] sa, int sp,
|
||||
byte[] da, int dp, int len) {
|
||||
int i = 0;
|
||||
for (; i < len; i++) {
|
||||
char c = StringUTF16.getChar(sa, sp++);
|
||||
@ -156,35 +110,10 @@ class StringCoding {
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes as many ASCII codepoints as possible from the source
|
||||
* character array into the destination byte array, assuming that
|
||||
* the encoding is ASCII compatible.
|
||||
*
|
||||
* @param sa the source character array
|
||||
* @param sp the index of the source array to start reading from
|
||||
* @param da the target byte array
|
||||
* @param dp the index of the target array to start writing to
|
||||
* @param len the maximum number of characters to be encoded
|
||||
* @return the total number of characters successfully encoded
|
||||
* @throws NullPointerException if any of the provided arrays is null
|
||||
*/
|
||||
static int encodeAsciiArray(char[] sa, int sp,
|
||||
byte[] da, int dp, int len) {
|
||||
// This method should tolerate invalid arguments, matching the lenient behavior of the VM intrinsic.
|
||||
// Hence, using operator expressions instead of `Preconditions`, which throw on failure.
|
||||
if ((sp | dp | len) < 0 ||
|
||||
sp >= sa.length || // Implicit null check on `sa`
|
||||
dp >= da.length) { // Implicit null check on `da`
|
||||
return 0;
|
||||
}
|
||||
int minLen = Math.min(len, Math.min(sa.length - sp, da.length - dp));
|
||||
return encodeAsciiArray0(sa, sp, da, dp, minLen);
|
||||
}
|
||||
|
||||
@IntrinsicCandidate
|
||||
static int encodeAsciiArray0(char[] sa, int sp,
|
||||
byte[] da, int dp, int len) {
|
||||
public static int implEncodeAsciiArray(char[] sa, int sp,
|
||||
byte[] da, int dp, int len)
|
||||
{
|
||||
int i = 0;
|
||||
for (; i < len; i++) {
|
||||
char c = sa[sp++];
|
||||
|
||||
@ -55,6 +55,7 @@ import java.util.Properties;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Stream;
|
||||
@ -2176,8 +2177,8 @@ public final class System {
|
||||
return String.decodeASCII(src, srcOff, dst, dstOff, len);
|
||||
}
|
||||
|
||||
public int encodeASCII(char[] sa, int sp, byte[] da, int dp, int len) {
|
||||
return StringCoding.encodeAsciiArray(sa, sp, da, dp, len);
|
||||
public int uncheckedEncodeASCII(char[] src, int srcOff, byte[] dst, int dstOff, int len) {
|
||||
return StringCoding.implEncodeAsciiArray(src, srcOff, dst, dstOff, len);
|
||||
}
|
||||
|
||||
public InputStream initialSystemIn() {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, 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
|
||||
@ -89,15 +89,19 @@ final class VirtualThread extends BaseVirtualThread {
|
||||
*
|
||||
* RUNNING -> PARKING // Thread parking with LockSupport.park
|
||||
* PARKING -> PARKED // cont.yield successful, parked indefinitely
|
||||
* PARKING -> PINNED // cont.yield failed, parked indefinitely on carrier
|
||||
* PARKED -> UNPARKED // unparked, may be scheduled to continue
|
||||
* PINNED -> RUNNING // unparked, continue execution on same carrier
|
||||
* UNPARKED -> RUNNING // continue execution after park
|
||||
*
|
||||
* PARKING -> RUNNING // cont.yield failed, need to park on carrier
|
||||
* RUNNING -> PINNED // park on carrier
|
||||
* PINNED -> RUNNING // unparked, continue execution on same carrier
|
||||
*
|
||||
* RUNNING -> TIMED_PARKING // Thread parking with LockSupport.parkNanos
|
||||
* TIMED_PARKING -> TIMED_PARKED // cont.yield successful, timed-parked
|
||||
* TIMED_PARKING -> TIMED_PINNED // cont.yield failed, timed-parked on carrier
|
||||
* TIMED_PARKED -> UNPARKED // unparked, may be scheduled to continue
|
||||
*
|
||||
* TIMED_PARKING -> RUNNING // cont.yield failed, need to park on carrier
|
||||
* RUNNING -> TIMED_PINNED // park on carrier
|
||||
* TIMED_PINNED -> RUNNING // unparked, continue execution on same carrier
|
||||
*
|
||||
* RUNNING -> BLOCKING // blocking on monitor enter
|
||||
@ -108,7 +112,7 @@ final class VirtualThread extends BaseVirtualThread {
|
||||
* RUNNING -> WAITING // transitional state during wait on monitor
|
||||
* WAITING -> WAIT // waiting on monitor
|
||||
* WAIT -> BLOCKED // notified, waiting to be unblocked by monitor owner
|
||||
* WAIT -> UNBLOCKED // timed-out/interrupted
|
||||
* WAIT -> UNBLOCKED // interrupted
|
||||
*
|
||||
* RUNNING -> TIMED_WAITING // transition state during timed-waiting on monitor
|
||||
* TIMED_WAITING -> TIMED_WAIT // timed-waiting on monitor
|
||||
@ -856,16 +860,20 @@ final class VirtualThread extends BaseVirtualThread {
|
||||
* Re-enables this virtual thread for scheduling. If this virtual thread is parked
|
||||
* then its task is scheduled to continue, otherwise its next call to {@code park} or
|
||||
* {@linkplain #parkNanos(long) parkNanos} is guaranteed not to block.
|
||||
* @param lazySubmit to use lazySubmit if possible
|
||||
* @throws RejectedExecutionException if the scheduler cannot accept a task
|
||||
*/
|
||||
@Override
|
||||
void unpark() {
|
||||
private void unpark(boolean lazySubmit) {
|
||||
if (!getAndSetParkPermit(true) && currentThread() != this) {
|
||||
int s = state();
|
||||
|
||||
// unparked while parked
|
||||
if ((s == PARKED || s == TIMED_PARKED) && compareAndSetState(s, UNPARKED)) {
|
||||
submitRunContinuation();
|
||||
if (lazySubmit) {
|
||||
lazySubmitRunContinuation();
|
||||
} else {
|
||||
submitRunContinuation();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -888,6 +896,11 @@ final class VirtualThread extends BaseVirtualThread {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void unpark() {
|
||||
unpark(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked by unblocker thread to unblock this virtual thread.
|
||||
*/
|
||||
@ -904,11 +917,7 @@ final class VirtualThread extends BaseVirtualThread {
|
||||
*/
|
||||
private void parkTimeoutExpired() {
|
||||
assert !VirtualThread.currentThread().isVirtual();
|
||||
if (!getAndSetParkPermit(true)
|
||||
&& (state() == TIMED_PARKED)
|
||||
&& compareAndSetState(TIMED_PARKED, UNPARKED)) {
|
||||
lazySubmitRunContinuation();
|
||||
}
|
||||
unpark(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2026, 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
|
||||
@ -1081,10 +1081,9 @@ public sealed interface StructuredTaskScope<T, R>
|
||||
* does not throw then the {@code Joiner}'s {@code result()} method is invoked to
|
||||
* get the result or throw.
|
||||
*
|
||||
* <p> This method may only be invoked by the scope owner. Once the result or
|
||||
* exception outcome is obtained, this method may not be invoked again. The only
|
||||
* case where the method may be called again is where {@code InterruptedException}
|
||||
* is thrown while waiting.
|
||||
* <p> This method may only be invoked by the scope owner. It may only be invoked once
|
||||
* to get the result, exception or timeout outcome, unless the previous invocation
|
||||
* resulted in an {@code InterruptedException} being thrown.
|
||||
*
|
||||
* @return the result
|
||||
* @throws WrongThreadException if the current thread is not the scope owner
|
||||
@ -1093,8 +1092,11 @@ public sealed interface StructuredTaskScope<T, R>
|
||||
* exception from {@link Joiner#result() Joiner.result()} as the cause
|
||||
* @throws TimeoutException if a timeout is set, the timeout expires before or while
|
||||
* waiting, and {@link Joiner#onTimeout() Joiner.onTimeout()} throws this exception
|
||||
* @throws InterruptedException if interrupted while waiting
|
||||
* @throws InterruptedException if the current thread is interrupted before or
|
||||
* while waiting. The current thread's interrupted status is cleared when this
|
||||
* exception is thrown.
|
||||
* @since 25
|
||||
* @see Thread##thread-interruption Thread Interruption
|
||||
*/
|
||||
R join() throws InterruptedException;
|
||||
|
||||
|
||||
@ -448,19 +448,15 @@ public interface JavaLangAccess {
|
||||
PrintStream initialSystemErr();
|
||||
|
||||
/**
|
||||
* Encodes as many ASCII codepoints as possible from the source
|
||||
* character array into the destination byte array, assuming that
|
||||
* the encoding is ASCII compatible.
|
||||
* Encodes as many ASCII codepoints as possible from the source array into
|
||||
* the destination byte array, assuming that the encoding is ASCII
|
||||
* compatible.
|
||||
* <p>
|
||||
* <b>WARNING: This method does not perform any bound checks.</b>
|
||||
*
|
||||
* @param sa the source character array
|
||||
* @param sp the index of the source array to start reading from
|
||||
* @param da the target byte array
|
||||
* @param dp the index of the target array to start writing to
|
||||
* @param len the total number of characters to be encoded
|
||||
* @return the total number of characters successfully encoded
|
||||
* @throws NullPointerException if any of the provided arrays is null
|
||||
* @return the number of bytes successfully encoded, or 0 if none
|
||||
*/
|
||||
int encodeASCII(char[] sa, int sp, byte[] da, int dp, int len);
|
||||
int uncheckedEncodeASCII(char[] src, int srcOff, byte[] dst, int dstOff, int len);
|
||||
|
||||
/**
|
||||
* Set the cause of Throwable
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2026, 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
|
||||
@ -220,14 +220,6 @@ public class BasicImageReader implements AutoCloseable {
|
||||
return slice(buffer, offset, size).order(byteOrder).asIntBuffer();
|
||||
}
|
||||
|
||||
public static void releaseByteBuffer(ByteBuffer buffer) {
|
||||
Objects.requireNonNull(buffer);
|
||||
|
||||
if (!MAP_ALL) {
|
||||
ImageBufferCache.releaseBuffer(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@ -362,13 +354,15 @@ public class BasicImageReader implements AutoCloseable {
|
||||
if (offset < 0 || Integer.MAX_VALUE <= offset) {
|
||||
throw new IndexOutOfBoundsException("Bad offset: " + offset);
|
||||
}
|
||||
int checkedOffset = (int) offset;
|
||||
|
||||
if (size < 0 || Integer.MAX_VALUE <= size) {
|
||||
throw new IndexOutOfBoundsException("Bad size: " + size);
|
||||
throw new IllegalArgumentException("Bad size: " + size);
|
||||
}
|
||||
int checkedSize = (int) size;
|
||||
|
||||
if (MAP_ALL) {
|
||||
ByteBuffer buffer = slice(memoryMap, (int)offset, (int)size);
|
||||
ByteBuffer buffer = slice(memoryMap, checkedOffset, checkedSize);
|
||||
buffer.order(ByteOrder.BIG_ENDIAN);
|
||||
|
||||
return buffer;
|
||||
@ -376,21 +370,18 @@ public class BasicImageReader implements AutoCloseable {
|
||||
if (channel == null) {
|
||||
throw new InternalError("Image file channel not open");
|
||||
}
|
||||
|
||||
ByteBuffer buffer = ImageBufferCache.getBuffer(size);
|
||||
ByteBuffer buffer = ByteBuffer.allocate(checkedSize);
|
||||
int read;
|
||||
try {
|
||||
read = channel.read(buffer, offset);
|
||||
read = channel.read(buffer, checkedOffset);
|
||||
buffer.rewind();
|
||||
} catch (IOException ex) {
|
||||
ImageBufferCache.releaseBuffer(buffer);
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
if (read != size) {
|
||||
ImageBufferCache.releaseBuffer(buffer);
|
||||
if (read != checkedSize) {
|
||||
throw new RuntimeException("Short read: " + read +
|
||||
" instead of " + size + " bytes");
|
||||
" instead of " + checkedSize + " bytes");
|
||||
}
|
||||
|
||||
return buffer;
|
||||
@ -406,17 +397,12 @@ public class BasicImageReader implements AutoCloseable {
|
||||
|
||||
public byte[] getResource(ImageLocation loc) {
|
||||
ByteBuffer buffer = getResourceBuffer(loc);
|
||||
|
||||
if (buffer != null) {
|
||||
byte[] bytes = getBufferBytes(buffer);
|
||||
ImageBufferCache.releaseBuffer(buffer);
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
return null;
|
||||
return buffer != null ? getBufferBytes(buffer) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content of jimage location in a newly allocated byte buffer.
|
||||
*/
|
||||
public ByteBuffer getResourceBuffer(ImageLocation loc) {
|
||||
Objects.requireNonNull(loc);
|
||||
long offset = loc.getContentOffset() + indexSize;
|
||||
@ -437,10 +423,8 @@ public class BasicImageReader implements AutoCloseable {
|
||||
return readBuffer(offset, uncompressedSize);
|
||||
} else {
|
||||
ByteBuffer buffer = readBuffer(offset, compressedSize);
|
||||
|
||||
if (buffer != null) {
|
||||
byte[] bytesIn = getBufferBytes(buffer);
|
||||
ImageBufferCache.releaseBuffer(buffer);
|
||||
byte[] bytesOut;
|
||||
|
||||
try {
|
||||
|
||||
@ -1,158 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2016, 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 jdk.internal.jimage;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @implNote This class needs to maintain JDK 8 source compatibility.
|
||||
*
|
||||
* It is used internally in the JDK to implement jimage/jrtfs access,
|
||||
* but also compiled and delivered as part of the jrt-fs.jar to support access
|
||||
* to the jimage file provided by the shipped JDK by tools running on JDK 8.
|
||||
*/
|
||||
class ImageBufferCache {
|
||||
private static final int MAX_CACHED_BUFFERS = 3;
|
||||
private static final int LARGE_BUFFER = 0x10000;
|
||||
|
||||
/*
|
||||
* We used to have a class BufferReference extending from WeakReference<ByteBuffer>.
|
||||
* BufferReference class had an instance field called "capacity". This field was
|
||||
* used to make DECREASING_CAPACITY_NULLS_LAST comparator stable in the presence
|
||||
* of GC clearing the WeakReference concurrently.
|
||||
*
|
||||
* But this scheme results in metaspace leak. The thread local is alive till the
|
||||
* the thread is alive. And so ImageBufferCache$BufferReference class was kept alive.
|
||||
* Because this class and ImageBufferCache$BufferReference are all loaded by a URL
|
||||
* class loader from jrt-fs.jar, the class loader and so all the classes loaded by it
|
||||
* were alive!
|
||||
*
|
||||
* Solution is to avoid using a URL loader loaded class type with thread local. All we
|
||||
* need is a pair of WeakReference<ByteBuffer>, Integer (saved capacity for stability
|
||||
* of comparator). We use Map.Entry as pair implementation. With this, all types used
|
||||
* with thread local are bootstrap types and so no metaspace leak.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private static final ThreadLocal<Map.Entry<WeakReference<ByteBuffer>, Integer>[]> CACHE =
|
||||
new ThreadLocal<Map.Entry<WeakReference<ByteBuffer>, Integer>[]>() {
|
||||
@Override
|
||||
protected Map.Entry<WeakReference<ByteBuffer>, Integer>[] initialValue() {
|
||||
// 1 extra slot to simplify logic of releaseBuffer()
|
||||
return (Map.Entry<WeakReference<ByteBuffer>, Integer>[])new Map.Entry<?,?>[MAX_CACHED_BUFFERS + 1];
|
||||
}
|
||||
};
|
||||
|
||||
private static ByteBuffer allocateBuffer(long size) {
|
||||
return ByteBuffer.allocateDirect((int)((size + 0xFFF) & ~0xFFF));
|
||||
}
|
||||
|
||||
static ByteBuffer getBuffer(long size) {
|
||||
if (size < 0 || Integer.MAX_VALUE < size) {
|
||||
throw new IndexOutOfBoundsException("size");
|
||||
}
|
||||
|
||||
ByteBuffer result = null;
|
||||
|
||||
if (size > LARGE_BUFFER) {
|
||||
result = allocateBuffer(size);
|
||||
} else {
|
||||
Map.Entry<WeakReference<ByteBuffer>, Integer>[] cache = CACHE.get();
|
||||
|
||||
// buffers are ordered by decreasing capacity
|
||||
// cache[MAX_CACHED_BUFFERS] is always null
|
||||
for (int i = MAX_CACHED_BUFFERS - 1; i >= 0; i--) {
|
||||
Map.Entry<WeakReference<ByteBuffer>, Integer> reference = cache[i];
|
||||
|
||||
if (reference != null) {
|
||||
ByteBuffer buffer = getByteBuffer(reference);
|
||||
|
||||
if (buffer != null && size <= buffer.capacity()) {
|
||||
cache[i] = null;
|
||||
result = buffer;
|
||||
result.rewind();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result == null) {
|
||||
result = allocateBuffer(size);
|
||||
}
|
||||
}
|
||||
|
||||
result.limit((int)size);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void releaseBuffer(ByteBuffer buffer) {
|
||||
if (buffer.capacity() > LARGE_BUFFER) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map.Entry<WeakReference<ByteBuffer>, Integer>[] cache = CACHE.get();
|
||||
|
||||
// expunge cleared BufferRef(s)
|
||||
for (int i = 0; i < MAX_CACHED_BUFFERS; i++) {
|
||||
Map.Entry<WeakReference<ByteBuffer>, Integer> reference = cache[i];
|
||||
if (reference != null && getByteBuffer(reference) == null) {
|
||||
cache[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
// insert buffer back with new BufferRef wrapping it
|
||||
cache[MAX_CACHED_BUFFERS] = newCacheEntry(buffer);
|
||||
Arrays.sort(cache, DECREASING_CAPACITY_NULLS_LAST);
|
||||
// squeeze the smallest one out
|
||||
cache[MAX_CACHED_BUFFERS] = null;
|
||||
}
|
||||
|
||||
private static Map.Entry<WeakReference<ByteBuffer>, Integer> newCacheEntry(ByteBuffer bb) {
|
||||
return new AbstractMap.SimpleEntry<WeakReference<ByteBuffer>, Integer>(
|
||||
new WeakReference<ByteBuffer>(bb), bb.capacity());
|
||||
}
|
||||
|
||||
private static int getCapacity(Map.Entry<WeakReference<ByteBuffer>, Integer> e) {
|
||||
return e == null? 0 : e.getValue();
|
||||
}
|
||||
|
||||
private static ByteBuffer getByteBuffer(Map.Entry<WeakReference<ByteBuffer>, Integer> e) {
|
||||
return e == null? null : e.getKey().get();
|
||||
}
|
||||
|
||||
private static Comparator<Map.Entry<WeakReference<ByteBuffer>, Integer>> DECREASING_CAPACITY_NULLS_LAST =
|
||||
new Comparator<Map.Entry<WeakReference<ByteBuffer>, Integer>>() {
|
||||
@Override
|
||||
public int compare(Map.Entry<WeakReference<ByteBuffer>, Integer> br1,
|
||||
Map.Entry<WeakReference<ByteBuffer>, Integer> br2) {
|
||||
return Integer.compare(getCapacity(br1), getCapacity(br2));
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2026, 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
|
||||
@ -190,20 +190,7 @@ public final class ImageReader implements AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Releases a (possibly cached) {@link ByteBuffer} obtained via
|
||||
* {@link #getResourceBuffer(Node)}.
|
||||
*
|
||||
* <p>Note that no testing is performed to check whether the buffer about
|
||||
* to be released actually came from a call to {@code getResourceBuffer()}.
|
||||
*/
|
||||
public static void releaseByteBuffer(ByteBuffer buffer) {
|
||||
BasicImageReader.releaseByteBuffer(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content of a resource node in a possibly cached byte buffer.
|
||||
* Callers of this method must call {@link #releaseByteBuffer(ByteBuffer)}
|
||||
* when they are finished with it.
|
||||
* Returns the content of a resource node in a newly allocated byte buffer.
|
||||
*/
|
||||
public ByteBuffer getResourceBuffer(Node node) {
|
||||
requireOpen();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2026, 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
|
||||
@ -467,12 +467,6 @@ public final class SystemModuleFinders {
|
||||
.map(reader::getResourceBuffer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release(ByteBuffer bb) {
|
||||
Objects.requireNonNull(bb);
|
||||
ImageReader.releaseByteBuffer(bb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> list() throws IOException {
|
||||
if (closed)
|
||||
|
||||
@ -445,7 +445,7 @@ class CESU_8 extends Unicode
|
||||
int dl = dst.arrayOffset() + dst.limit();
|
||||
|
||||
// Handle ASCII-only prefix
|
||||
int n = JLA.encodeASCII(sa, sp, da, dp, Math.min(sl - sp, dl - dp));
|
||||
int n = JLA.uncheckedEncodeASCII(sa, sp, da, dp, Math.min(sl - sp, dl - dp));
|
||||
sp += n;
|
||||
dp += n;
|
||||
|
||||
|
||||
@ -600,7 +600,7 @@ public class DoubleByte {
|
||||
|
||||
try {
|
||||
if (isASCIICompatible) {
|
||||
int n = JLA.encodeASCII(sa, sp, da, dp, Math.min(dl - dp, sl - sp));
|
||||
int n = JLA.uncheckedEncodeASCII(sa, sp, da, dp, Math.min(dl - dp, sl - sp));
|
||||
sp += n;
|
||||
dp += n;
|
||||
}
|
||||
|
||||
@ -35,6 +35,7 @@ import java.util.Objects;
|
||||
|
||||
import jdk.internal.access.JavaLangAccess;
|
||||
import jdk.internal.access.SharedSecrets;
|
||||
import jdk.internal.util.Preconditions;
|
||||
import jdk.internal.vm.annotation.IntrinsicCandidate;
|
||||
|
||||
public class ISO_8859_1
|
||||
@ -141,34 +142,20 @@ public class ISO_8859_1
|
||||
|
||||
private final Surrogate.Parser sgp = new Surrogate.Parser();
|
||||
|
||||
/**
|
||||
* Encodes as many ISO-8859-1 codepoints as possible from the source
|
||||
* character array into the destination byte array, assuming that
|
||||
* the encoding is ISO-8859-1 compatible.
|
||||
*
|
||||
* @param sa the source character array
|
||||
* @param sp the index of the source array to start reading from
|
||||
* @param da the target byte array
|
||||
* @param dp the index of the target array to start writing to
|
||||
* @param len the maximum number of characters to be encoded
|
||||
* @return the total number of characters successfully encoded
|
||||
* @throws NullPointerException if any of the provided arrays is null
|
||||
*/
|
||||
// Method possible replaced with a compiler intrinsic.
|
||||
private static int encodeISOArray(char[] sa, int sp,
|
||||
byte[] da, int dp, int len) {
|
||||
// This method should tolerate invalid arguments, matching the lenient behavior of the VM intrinsic.
|
||||
// Hence, using operator expressions instead of `Preconditions`, which throw on failure.
|
||||
if ((sp | dp | len) < 0 ||
|
||||
sp >= sa.length || // Implicit null check on `sa`
|
||||
dp >= da.length) { // Implicit null check on `da`
|
||||
if (len <= 0) {
|
||||
return 0;
|
||||
}
|
||||
int minLen = Math.min(len, Math.min(sa.length - sp, da.length - dp));
|
||||
return encodeISOArray0(sa, sp, da, dp, minLen);
|
||||
encodeISOArrayCheck(sa, sp, da, dp, len);
|
||||
return implEncodeISOArray(sa, sp, da, dp, len);
|
||||
}
|
||||
|
||||
@IntrinsicCandidate
|
||||
private static int encodeISOArray0(char[] sa, int sp, byte[] da, int dp, int len) {
|
||||
private static int implEncodeISOArray(char[] sa, int sp,
|
||||
byte[] da, int dp, int len)
|
||||
{
|
||||
int i = 0;
|
||||
for (; i < len; i++) {
|
||||
char c = sa[sp++];
|
||||
@ -179,6 +166,17 @@ public class ISO_8859_1
|
||||
return i;
|
||||
}
|
||||
|
||||
private static void encodeISOArrayCheck(char[] sa, int sp,
|
||||
byte[] da, int dp, int len) {
|
||||
Objects.requireNonNull(sa);
|
||||
Objects.requireNonNull(da);
|
||||
Preconditions.checkIndex(sp, sa.length, Preconditions.AIOOBE_FORMATTER);
|
||||
Preconditions.checkIndex(dp, da.length, Preconditions.AIOOBE_FORMATTER);
|
||||
|
||||
Preconditions.checkIndex(sp + len - 1, sa.length, Preconditions.AIOOBE_FORMATTER);
|
||||
Preconditions.checkIndex(dp + len - 1, da.length, Preconditions.AIOOBE_FORMATTER);
|
||||
}
|
||||
|
||||
private CoderResult encodeArrayLoop(CharBuffer src,
|
||||
ByteBuffer dst)
|
||||
{
|
||||
|
||||
@ -217,7 +217,7 @@ public class SingleByte
|
||||
int len = Math.min(dl - dp, sl - sp);
|
||||
|
||||
if (isASCIICompatible) {
|
||||
int n = JLA.encodeASCII(sa, sp, da, dp, len);
|
||||
int n = JLA.uncheckedEncodeASCII(sa, sp, da, dp, len);
|
||||
sp += n;
|
||||
dp += n;
|
||||
len -= n;
|
||||
|
||||
@ -159,7 +159,7 @@ public class US_ASCII
|
||||
assert (dp <= dl);
|
||||
dp = (dp <= dl ? dp : dl);
|
||||
|
||||
int n = JLA.encodeASCII(sa, sp, da, dp, Math.min(sl - sp, dl - dp));
|
||||
int n = JLA.uncheckedEncodeASCII(sa, sp, da, dp, Math.min(sl - sp, dl - dp));
|
||||
sp += n;
|
||||
dp += n;
|
||||
|
||||
|
||||
@ -452,7 +452,7 @@ public final class UTF_8 extends Unicode {
|
||||
int dl = dst.arrayOffset() + dst.limit();
|
||||
|
||||
// Handle ASCII-only prefix
|
||||
int n = JLA.encodeASCII(sa, sp, da, dp, Math.min(sl - sp, dl - dp));
|
||||
int n = JLA.uncheckedEncodeASCII(sa, sp, da, dp, Math.min(sl - sp, dl - dp));
|
||||
sp += n;
|
||||
dp += n;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, 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
|
||||
@ -32,6 +32,7 @@ import java.util.Arrays;
|
||||
|
||||
import jdk.internal.access.SharedSecrets;
|
||||
import jdk.internal.io.JdkConsoleImpl;
|
||||
import jdk.internal.misc.VM;
|
||||
|
||||
/**
|
||||
* A utility class for reading passwords
|
||||
@ -65,7 +66,9 @@ public class Password {
|
||||
}
|
||||
consoleBytes = ConsoleHolder.convertToBytes(consoleEntered);
|
||||
in = new ByteArrayInputStream(consoleBytes);
|
||||
} else if (System.in.available() == 0) {
|
||||
} else if (in == System.in && VM.isBooted()
|
||||
&& System.in.available() == 0) {
|
||||
// Warn if reading password from System.in but it's empty.
|
||||
// This may be running in an IDE Run Window or in JShell,
|
||||
// which acts like an interactive console and echoes the
|
||||
// entered password. In this case, print a warning that
|
||||
@ -73,6 +76,7 @@ public class Password {
|
||||
// it's more likely the input comes from a pipe, such as
|
||||
// "echo password |" or "cat password_file |" where input
|
||||
// will be silently consumed without echoing to the screen.
|
||||
// Warn only if VM is booted and ResourcesMgr is available.
|
||||
System.err.print(ResourcesMgr.getString
|
||||
("warning.input.may.be.visible.on.screen"));
|
||||
}
|
||||
|
||||
@ -59,6 +59,9 @@ public class Pem {
|
||||
// Pattern matching for stripping whitespace.
|
||||
private static final Pattern STRIP_WHITESPACE_PATTERN;
|
||||
|
||||
// Pattern matching for inserting line breaks.
|
||||
private static final Pattern LINE_WRAP_64_PATTERN;
|
||||
|
||||
// Lazy initialized PBES2 OID value
|
||||
private static ObjectIdentifier PBES2OID;
|
||||
|
||||
@ -72,6 +75,7 @@ public class Pem {
|
||||
PBE_PATTERN = Pattern.compile("^PBEWith.*And.*",
|
||||
Pattern.CASE_INSENSITIVE);
|
||||
STRIP_WHITESPACE_PATTERN = Pattern.compile("\\s+");
|
||||
LINE_WRAP_64_PATTERN = Pattern.compile("(.{64})");
|
||||
}
|
||||
|
||||
public static final String CERTIFICATE = "CERTIFICATE";
|
||||
@ -359,7 +363,7 @@ public class Pem {
|
||||
* @return PEM in a string
|
||||
*/
|
||||
public static String pemEncoded(PEM pem) {
|
||||
String p = pem.content().replaceAll("(.{64})", "$1\r\n");
|
||||
String p = LINE_WRAP_64_PATTERN.matcher(pem.content()).replaceAll("$1\r\n");
|
||||
return pemEncoded(pem.type(), p);
|
||||
}
|
||||
|
||||
|
||||
@ -21,4 +21,4 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
tzdata2025b
|
||||
tzdata2025c
|
||||
|
||||
@ -27,9 +27,9 @@
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
# This file is by no means authoritative; if you think you know better,
|
||||
# go ahead and edit the file (and please send any changes to
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
# go ahead and edit the file, and please send any changes to
|
||||
# the public mailing list tz@iana.org for general use in the future.
|
||||
# For more, please see the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2018-05-27):
|
||||
#
|
||||
@ -138,8 +138,9 @@ Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2:00u # Praia
|
||||
-1:00 - %z
|
||||
|
||||
# Chad
|
||||
# Fort-Lamy was renamed to N’Djamena on 1973-04-06.
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone Africa/Ndjamena 1:00:12 - LMT 1912 Jan 1 # N'Djamena
|
||||
Zone Africa/Ndjamena 1:00:12 - LMT 1912 Jan 1 # Fort-Lamy
|
||||
1:00 - WAT 1979 Oct 14
|
||||
1:00 1:00 WAST 1980 Mar 8
|
||||
1:00 - WAT
|
||||
|
||||
@ -26,13 +26,10 @@
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
# From Paul Eggert (1999-11-15):
|
||||
# To keep things manageable, we list only locations occupied year-round; see
|
||||
# COMNAP - Stations and Bases
|
||||
# http://www.comnap.aq/comnap/comnap.nsf/P/Stations/
|
||||
# and
|
||||
# Summary of the Peri-Antarctic Islands (1998-07-23)
|
||||
# http://www.spri.cam.ac.uk/bob/periant.htm
|
||||
# From Paul Eggert (2025-08-16):
|
||||
# To keep things manageable, list only locations occupied year-round; see
|
||||
# Antarctic Facilities Information
|
||||
# https://www.comnap.aq/antarctic-facilities-information
|
||||
# for information.
|
||||
# Unless otherwise specified, we have no time zone information.
|
||||
|
||||
@ -167,6 +164,7 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13
|
||||
# China - year-round bases
|
||||
# Great Wall, King George Island, -6213-05858, since 1985-02-20
|
||||
# Zhongshan, Larsemann Hills, Prydz Bay, -6922+07623, since 1989-02-26
|
||||
# Qinling, Inexpressible I, Terra Nova Bay, -7456+16343, since 2024-02-07
|
||||
|
||||
# France - year-round bases (also see "France & Italy")
|
||||
#
|
||||
|
||||
@ -27,9 +27,9 @@
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
# This file is by no means authoritative; if you think you know better,
|
||||
# go ahead and edit the file (and please send any changes to
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
# go ahead and edit the file, and please send any changes to
|
||||
# the public mailing list tz@iana.org for general use in the future.
|
||||
# For more, please see the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2019-07-11):
|
||||
#
|
||||
|
||||
@ -960,9 +960,9 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
|
||||
# NOTES
|
||||
|
||||
# This file is by no means authoritative; if you think you know better,
|
||||
# go ahead and edit the file (and please send any changes to
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
# go ahead and edit the file, and please send any changes to
|
||||
# the public mailing list tz@iana.org for general use in the future.
|
||||
# For more, please see the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2018-11-18):
|
||||
#
|
||||
@ -2011,6 +2011,7 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
|
||||
# From Paul Eggert (2018-11-19):
|
||||
# The 1921-01-15 introduction of standard time is in Shanks; it is also in
|
||||
# "Standard Time Throughout the World", US National Bureau of Standards (1935),
|
||||
# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular406.pdf
|
||||
# page 3, which does not give the UT offset. In response to a comment by
|
||||
# Phake Nick I set the Nauru time of occupation by Japan to
|
||||
# 1942-08-29/1945-09-08 by using dates from:
|
||||
@ -2078,9 +2079,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
|
||||
# https://webspace.science.uu.nl/~gent0113/idl/idl_alaska_samoa.htm
|
||||
|
||||
# Although Shanks & Pottenger says they both switched to UT -11:30
|
||||
# in 1911, and to -11 in 1950. many earlier sources give -11
|
||||
# in 1911, and to -11 in 1950, many earlier sources give -11
|
||||
# for American Samoa, e.g., the US National Bureau of Standards
|
||||
# circular "Standard Time Throughout the World", 1932.
|
||||
# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular399.pdf
|
||||
# Assume American Samoa switched to -11 in 1911, not 1950,
|
||||
# and that after 1950 they agreed until (western) Samoa skipped a
|
||||
# day in 2011. Assume also that the Samoas follow the US and New
|
||||
|
||||
@ -27,9 +27,9 @@
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
# This file is by no means authoritative; if you think you know better,
|
||||
# go ahead and edit the file (and please send any changes to
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
# go ahead and edit the file, and please send any changes to
|
||||
# the public mailing list tz@iana.org for general use in the future.
|
||||
# For more, please see the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2017-02-10):
|
||||
#
|
||||
@ -65,7 +65,7 @@
|
||||
# <https://www.jstor.org/stable/1774359>. He writes:
|
||||
# "It is requested that corrections and additions to these tables
|
||||
# may be sent to Mr. John Milne, Royal Geographical Society,
|
||||
# Savile Row, London." Nowadays please email them to tz@iana.org.
|
||||
# Savile Row, London." Nowadays please see the file CONTRIBUTING.
|
||||
#
|
||||
# Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
|
||||
# This Russian-language source was consulted by Vladimir Karpinsky; see
|
||||
@ -77,7 +77,7 @@
|
||||
# Десятая гос. тип., 1919.
|
||||
# http://resolver.gpntb.ru/purl?docushare/dsweb/Get/Resource-2011/Byalokoz__E.L.__Novyy__schet__vremeni__v__techenie__sutok__izd__2(1).pdf
|
||||
#
|
||||
# Brazil's Divisão Serviço da Hora (DSHO),
|
||||
# Brazil's Divisão de Serviços da Hora (DISHO)
|
||||
# History of Summer Time
|
||||
# <http://pcdsh01.on.br/HISTHV.htm>
|
||||
# (1998-09-21, in Portuguese)
|
||||
@ -937,7 +937,7 @@ Rule Belgium 1922 1927 - Oct Sat>=1 23:00s 0 -
|
||||
Rule Belgium 1923 only - Apr 21 23:00s 1:00 S
|
||||
Rule Belgium 1924 only - Mar 29 23:00s 1:00 S
|
||||
Rule Belgium 1925 only - Apr 4 23:00s 1:00 S
|
||||
# DSH writes that a royal decree of 1926-02-22 specified the Sun following 3rd
|
||||
# DISHO writes that a royal decree of 1926-02-22 specified the Sun following 3rd
|
||||
# Sat in Apr (except if it's Easter, in which case it's one Sunday earlier),
|
||||
# to Sun following 1st Sat in Oct, and that a royal decree of 1928-09-15
|
||||
# changed the transition times to 02:00 GMT.
|
||||
@ -1333,6 +1333,13 @@ Zone Europe/Helsinki 1:39:49 - LMT 1878 May 31
|
||||
# France
|
||||
# Monaco
|
||||
|
||||
# From Robert H. van Gent (2025-07-21):
|
||||
# The most recent issue of the Annuaire [par le Bureau des Longitudes]
|
||||
# on Gallica (2021) ... lists information for France
|
||||
# https://gallica.bnf.fr/ark:/12148/bpt6k9127672b/f52.item
|
||||
# From Paul Eggert (2025-07-21):
|
||||
# Go with the 2020 Annuaire (published 2021) except as noted below.
|
||||
|
||||
# From Ciro Discepolo (2000-12-20):
|
||||
#
|
||||
# Henri Le Corre, Régimes horaires pour le monde entier, Éditions
|
||||
@ -1394,7 +1401,6 @@ Zone Europe/Helsinki 1:39:49 - LMT 1878 May 31
|
||||
# problems in Algiers, Monaco and Tunis.
|
||||
|
||||
#
|
||||
# Shank & Pottenger seem to use '24:00' ambiguously; resolve it with Whitman.
|
||||
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
|
||||
Rule France 1916 only - Jun 14 23:00s 1:00 S
|
||||
Rule France 1916 1919 - Oct Sun>=1 23:00s 0 -
|
||||
@ -1406,9 +1412,25 @@ Rule France 1920 only - Oct 23 23:00s 0 -
|
||||
Rule France 1921 only - Mar 14 23:00s 1:00 S
|
||||
Rule France 1921 only - Oct 25 23:00s 0 -
|
||||
Rule France 1922 only - Mar 25 23:00s 1:00 S
|
||||
# DSH writes that a law of 1923-05-24 specified 3rd Sat in Apr at 23:00 to 1st
|
||||
# Sat in Oct at 24:00; and that in 1930, because of Easter, the transitions
|
||||
# were Apr 12 and Oct 5. Go with Shanks & Pottenger.
|
||||
# From Robert H. van Gent (2025-07-22):
|
||||
# There is a curious history behind the erroneous date for the start of
|
||||
# daylight saving in France in 1923 as listed in the current issues of
|
||||
# the Annuaire du Bureau des Longitudes. [See:]
|
||||
# https://lists.iana.org/hyperkitty/list/tz@iana.org/message/MYQEJMSXO2AIEZ3UIXZKMTTAIPY7KNT2/
|
||||
# From Brian Inglis (2025-07-23):
|
||||
# Légifrance JORF No. 0073 du 15 mars 1922
|
||||
# https://www.legifrance.gouv.fr/jorf/jo/id/JORFCONT000000008324
|
||||
# Légifrance JORF No. 0139 du 25 mai 1923
|
||||
# https://www.legifrance.gouv.fr/jorf/jo/id/JORFCONT000000008416
|
||||
# From Paul Eggert (2025-07-23):
|
||||
# The latter specifies March's last Saturday at 23:00 to October's first
|
||||
# Saturday at 24:00, except that if neighboring allies agree the dates
|
||||
# can be moved to April's third Saturday and September's third Saturday.
|
||||
# Apparently spring 1923 was tricky. DISHO writes that in 1930,
|
||||
# because of Easter, the transitions were Apr 12 and Oct 5.
|
||||
# Use the 2020 Annuaire dates, except for spring 1923 where
|
||||
# Shanks & Pottenger's May 26 matches the dates given in the 1924 and
|
||||
# 1961-2001 issues of the Annuaire.
|
||||
Rule France 1922 1938 - Oct Sat>=1 23:00s 0 -
|
||||
Rule France 1923 only - May 26 23:00s 1:00 S
|
||||
Rule France 1924 only - Mar 29 23:00s 1:00 S
|
||||
@ -2119,12 +2141,10 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880
|
||||
# all clocks therefore having to be advanced or set back correspondingly ...
|
||||
|
||||
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
|
||||
# From Tim Parenti (2024-07-01), per Paul Eggert (1999-01-30):
|
||||
# DSH writes in their history that Decreto 1469 of 1915-03-30 established
|
||||
# summer time and that, "despite" this, the change to the clocks was not done
|
||||
# every year, depending on what Spain did, because of railroad schedules.
|
||||
# In fact, that decree had nothing to do with DST; rather, it regulated the
|
||||
# sending of time signals. But we do see linkage to Spain in the 1920s below.
|
||||
# From Tim Parenti (2024-07-01):
|
||||
# Decreto 1469 of 1915-03-30 ... had nothing to do with DST;
|
||||
# rather it regulated the sending of time signals.
|
||||
# But we do see linkage to Spain in the 1920s below.
|
||||
# https://dre.pt/dr/detalhe/decreto/1469-1915-285721
|
||||
# https://dre.pt/application/conteudo/285721
|
||||
#
|
||||
|
||||
@ -26,22 +26,22 @@
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
#
|
||||
# From Paul Eggert (2023-09-06):
|
||||
# From Paul Eggert (2025-07-01):
|
||||
# This file contains a table of two-letter country codes. Columns are
|
||||
# separated by a single tab. Lines beginning with '#' are comments.
|
||||
# separated by a single tab. Lines beginning with ‘#’ are comments.
|
||||
# All text uses UTF-8 encoding. The columns of the table are as follows:
|
||||
#
|
||||
# 1. ISO 3166-1 alpha-2 country code, current as of
|
||||
# ISO/TC 46 N1108 (2023-04-05). See: ISO/TC 46 Documents
|
||||
# ISO/TC 46 N1127 (2024-02-29). See: ISO/TC 46 Documents
|
||||
# https://www.iso.org/committee/48750.html?view=documents
|
||||
# 2. The usual English name for the coded region. This sometimes
|
||||
# departs from ISO-listed names, sometimes so that sorted subsets
|
||||
# of names are useful (e.g., "Samoa (American)" and "Samoa
|
||||
# (western)" rather than "American Samoa" and "Samoa"),
|
||||
# of names are useful (e.g., “Samoa (American)” and “Samoa
|
||||
# (western)” rather than “American Samoa” and “Samoa”),
|
||||
# sometimes to avoid confusion among non-experts (e.g.,
|
||||
# "Czech Republic" and "Turkey" rather than "Czechia" and "Türkiye"),
|
||||
# and sometimes to omit needless detail or churn (e.g., "Netherlands"
|
||||
# rather than "Netherlands (the)" or "Netherlands (Kingdom of the)").
|
||||
# “Czech Republic” and “Turkey” rather than “Czechia” and “Türkiye”),
|
||||
# and sometimes to omit needless detail or churn (e.g., “Netherlands”
|
||||
# rather than “Netherlands (the)” or “Netherlands (Kingdom of the)”).
|
||||
#
|
||||
# The table is sorted by country code.
|
||||
#
|
||||
@ -94,7 +94,7 @@ CD Congo (Dem. Rep.)
|
||||
CF Central African Rep.
|
||||
CG Congo (Rep.)
|
||||
CH Switzerland
|
||||
CI Côte d'Ivoire
|
||||
CI Côte d’Ivoire
|
||||
CK Cook Islands
|
||||
CL Chile
|
||||
CM Cameroon
|
||||
|
||||
@ -28,7 +28,8 @@
|
||||
# This file is generated automatically from the data in the public-domain
|
||||
# NIST/IERS format leap-seconds.list file, which can be copied from
|
||||
# <https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list>
|
||||
# or, in a variant with different comments, from
|
||||
# or via a less-secure protocol and with different comments and
|
||||
# less volatile last-modified and expiration timestamps, from
|
||||
# <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>.
|
||||
# For more about leap-seconds.list, please see
|
||||
# The NTP Timescale and Leap Seconds
|
||||
@ -92,11 +93,17 @@ Leap 2016 Dec 31 23:59:60 + S
|
||||
# Any additional leap seconds will come after this.
|
||||
# This Expires line is commented out for now,
|
||||
# so that pre-2020a zic implementations do not reject this file.
|
||||
#Expires 2025 Dec 28 00:00:00
|
||||
#Expires 2026 Jun 28 00:00:00
|
||||
|
||||
# POSIX timestamps for the data in this file:
|
||||
#updated 1736208000 (2025-01-07 00:00:00 UTC)
|
||||
#expires 1766880000 (2025-12-28 00:00:00 UTC)
|
||||
# Here are POSIX timestamps for the data in this file.
|
||||
# "#updated" gives the last time the leap seconds data changed
|
||||
# or, if this file was derived from the IERS leap-seconds.list,
|
||||
# the last time that file changed in any way.
|
||||
# "#expires" gives the first time this file might be wrong;
|
||||
# if this file was derived from the IERS leap-seconds.list,
|
||||
# this is typically a bit less than one year after "updated".
|
||||
#updated 1751846400 (2025-07-07 00:00:00 UTC)
|
||||
#expires 1782604800 (2026-06-28 00:00:00 UTC)
|
||||
|
||||
# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat)
|
||||
# File expires on 28 December 2025
|
||||
# File expires on 28 June 2026
|
||||
|
||||
@ -29,9 +29,9 @@
|
||||
# also includes Central America and the Caribbean
|
||||
|
||||
# This file is by no means authoritative; if you think you know better,
|
||||
# go ahead and edit the file (and please send any changes to
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
# go ahead and edit the file, and please send any changes to
|
||||
# the public mailing list tz@iana.org for general use in the future.
|
||||
# For more, please see the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (1999-03-22):
|
||||
# A reliable and entertaining source about time zones is
|
||||
@ -1241,6 +1241,16 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
|
||||
# _Los Angeles Times_ (1998-11-10), A1, A10; it cites
|
||||
# Jimmy Skaggs, _The Great Guano Rush_ (1994).
|
||||
|
||||
# From Rob van Gent (2025-07-23):
|
||||
# Another useful source for historical time zone information appears to be
|
||||
# a series of circulars with the title "Standard Time Throughout the World"
|
||||
# issued between 1925 and 1950 by the U.S. Bureau of Standards.
|
||||
# I found the following issues online:
|
||||
# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular280.pdf (1925)
|
||||
# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular399.pdf (1932)
|
||||
# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular406.pdf (1935)
|
||||
# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular496.pdf (1950)
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
@ -2457,12 +2467,35 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
|
||||
# on the same dates or with a difference of one day.
|
||||
# So it may be easier to implement these changes as DST with rule CA
|
||||
# during this whole period.
|
||||
|
||||
# From Alois Treindl (2025-07-29):
|
||||
# I did a quick newspaper archive research on https://hndm.iib.unam.mx/
|
||||
# and found that Periódico Oficial del Estado de Baja California Norte
|
||||
# (1973-04-20) states clearly that DST was observed from last Sunday
|
||||
# in April to last Sunday in October.... I have a few more data from the
|
||||
# official bulletin for DST begin or end in Baja California 1964 1967 1969
|
||||
# 1972 1973 (already sent) 1974 1975 1976 I do not know whether it is safe to
|
||||
# assume that it also applied in the years where I did not yet find proof.
|
||||
# The 1974 end of DST contains a reference to an Acuerdo of 1973-dec-20 which
|
||||
# I could not find.... One might assume that Baja California, which followed
|
||||
# US-CA in all these other yours, did the same.
|
||||
#
|
||||
# From Paul Eggert (2024-08-18):
|
||||
# For now, maintain the slightly-different history for Baja California,
|
||||
# From Paul Eggert (2025-08-04):
|
||||
# Assume that Tijuana agreed with San Diego from 1953 through 1996,
|
||||
# as this agrees with Alois Treindl's data and with Shanks.
|
||||
# For now, keep the slightly-different 1948/1952 history for Baja California,
|
||||
# as we have no information on whether 1948/1952 clocks in Tijuana followed
|
||||
# the decrees or followed San Diego.
|
||||
|
||||
# From Mark Schapiro, writing in The Nation (2002-10-28):
|
||||
# https://www.thenation.com/article/archive/sowing-disaster/
|
||||
# When Mexican clocks were turned back for daylight saving time in the spring,
|
||||
# the Zapotecs refused to make the adjustment, insisting that they live in
|
||||
# "God's time," not in what they derisively call "Fox time," referring to
|
||||
# President Vicente Fox in far-off Mexico City.
|
||||
# From Paul Eggert (2025-08-04):
|
||||
# Unfortunately we have no data to track this informal practice.
|
||||
|
||||
# From Alan Perry (1996-02-15):
|
||||
# A guy from our Mexico subsidiary finally found the Presidential Decree
|
||||
# outlining the timezone changes in Mexico.
|
||||
@ -2728,7 +2761,7 @@ Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 7:00u
|
||||
# Chihuahua (near US border - western side)
|
||||
# This includes the municipios of Janos, Ascensión, Juárez, Guadalupe, and
|
||||
# Práxedis G Guerrero.
|
||||
# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf
|
||||
# https://gaceta.diputados.gob.mx/PDF/65/2022/nov/20221124-VII.pdf
|
||||
Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u
|
||||
-7:00 - MST 1927 Jun 10
|
||||
-6:00 - CST 1930 Nov 15
|
||||
@ -2743,7 +2776,7 @@ Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u
|
||||
# Chihuahua (near US border - eastern side)
|
||||
# This includes the municipios of Coyame del Sotol, Ojinaga, and Manuel
|
||||
# Benavides.
|
||||
# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf
|
||||
# https://gaceta.diputados.gob.mx/PDF/65/2022/nov/20221124-VII.pdf
|
||||
Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u
|
||||
-7:00 - MST 1927 Jun 10
|
||||
-6:00 - CST 1930 Nov 15
|
||||
@ -2840,9 +2873,7 @@ Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 7:00u
|
||||
-8:00 1:00 PDT 1951 Sep 30 2:00
|
||||
-8:00 - PST 1952 Apr 27 2:00
|
||||
-8:00 1:00 PDT 1952 Sep 28 2:00
|
||||
-8:00 - PST 1954
|
||||
-8:00 CA P%sT 1961
|
||||
-8:00 - PST 1976
|
||||
-8:00 CA P%sT 1967
|
||||
-8:00 US P%sT 1996
|
||||
-8:00 Mexico P%sT 2001
|
||||
-8:00 US P%sT 2002 Feb 20
|
||||
|
||||
@ -27,9 +27,9 @@
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
# This file is by no means authoritative; if you think you know better,
|
||||
# go ahead and edit the file (and please send any changes to
|
||||
# tz@iana.org for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
# go ahead and edit the file, and please send any changes to
|
||||
# the public mailing list tz@iana.org for general use in the future.
|
||||
# For more, please see the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2016-12-05):
|
||||
#
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2026, 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
|
||||
@ -98,7 +98,8 @@ class UnixFileAttributes
|
||||
path, flag, attrs);
|
||||
if (errno == 0)
|
||||
return attrs;
|
||||
else if (errno == UnixConstants.ENOENT)
|
||||
else if (errno == UnixConstants.ENOENT ||
|
||||
errno == UnixConstants.ENOTDIR)
|
||||
return null;
|
||||
else
|
||||
throw new UnixException(errno);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2026, 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
|
||||
@ -62,19 +62,18 @@ import java.awt.geom.AffineTransform;
|
||||
* @see java.awt.Graphics2D#getFontRenderContext()
|
||||
* @see java.awt.font.LineMetrics
|
||||
*/
|
||||
|
||||
public class FontRenderContext {
|
||||
private transient AffineTransform tx;
|
||||
private transient Object aaHintValue;
|
||||
private transient Object fmHintValue;
|
||||
private transient boolean defaulting;
|
||||
private final transient AffineTransform tx;
|
||||
private final transient Object aaHintValue;
|
||||
private final transient Object fmHintValue;
|
||||
private final transient boolean defaulting;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code FontRenderContext}
|
||||
* object.
|
||||
*
|
||||
*/
|
||||
protected FontRenderContext() {
|
||||
tx = null;
|
||||
aaHintValue = VALUE_TEXT_ANTIALIAS_DEFAULT;
|
||||
fmHintValue = VALUE_FRACTIONALMETRICS_DEFAULT;
|
||||
defaulting = true;
|
||||
@ -105,6 +104,8 @@ public class FontRenderContext {
|
||||
boolean usesFractionalMetrics) {
|
||||
if (tx != null && !tx.isIdentity()) {
|
||||
this.tx = new AffineTransform(tx);
|
||||
} else {
|
||||
this.tx = null;
|
||||
}
|
||||
if (isAntiAliased) {
|
||||
aaHintValue = VALUE_TEXT_ANTIALIAS_ON;
|
||||
@ -116,6 +117,7 @@ public class FontRenderContext {
|
||||
} else {
|
||||
fmHintValue = VALUE_FRACTIONALMETRICS_OFF;
|
||||
}
|
||||
defaulting = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,6 +147,8 @@ public class FontRenderContext {
|
||||
public FontRenderContext(AffineTransform tx, Object aaHint, Object fmHint){
|
||||
if (tx != null && !tx.isIdentity()) {
|
||||
this.tx = new AffineTransform(tx);
|
||||
} else {
|
||||
this.tx = null;
|
||||
}
|
||||
try {
|
||||
if (KEY_TEXT_ANTIALIASING.isCompatibleValue(aaHint)) {
|
||||
@ -164,6 +168,7 @@ public class FontRenderContext {
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException("FM hint:" +fmHint);
|
||||
}
|
||||
defaulting = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2026, 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
|
||||
@ -396,10 +396,7 @@ final class TextLine {
|
||||
BufferedImage.TYPE_INT_ARGB);
|
||||
|
||||
Graphics2D g2d = im.createGraphics();
|
||||
g2d.setColor(Color.WHITE);
|
||||
g2d.fillRect(0, 0, im.getWidth(), im.getHeight());
|
||||
|
||||
g2d.setColor(Color.BLACK);
|
||||
g2d.setColor(Color.WHITE); // white over transparent black bg
|
||||
draw(g2d, rx + MARGIN - bounds.x, ry + MARGIN - bounds.y);
|
||||
|
||||
result = computePixelBounds(im);
|
||||
@ -428,7 +425,7 @@ final class TextLine {
|
||||
loop: while (++t < h) {
|
||||
im.getRGB(0, t, buf.length, 1, buf, 0, w); // w ignored
|
||||
for (int i = 0; i < buf.length; i++) {
|
||||
if (buf[i] != -1) {
|
||||
if (buf[i] != 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
@ -441,7 +438,7 @@ final class TextLine {
|
||||
loop: while (--b > t) {
|
||||
im.getRGB(0, b, buf.length, 1, buf, 0, w); // w ignored
|
||||
for (int i = 0; i < buf.length; ++i) {
|
||||
if (buf[i] != -1) {
|
||||
if (buf[i] != 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
@ -454,7 +451,7 @@ final class TextLine {
|
||||
loop: while (++l < r) {
|
||||
for (int i = t; i < b; ++i) {
|
||||
int v = im.getRGB(l, i);
|
||||
if (v != -1) {
|
||||
if (v != 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
@ -466,7 +463,7 @@ final class TextLine {
|
||||
loop: while (--r > l) {
|
||||
for (int i = t; i < b; ++i) {
|
||||
int v = im.getRGB(r, i);
|
||||
if (v != -1) {
|
||||
if (v != 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
|
||||
@ -309,7 +309,7 @@ public class EUC_JP
|
||||
|
||||
try {
|
||||
if (enc0201.isASCIICompatible()) {
|
||||
int n = JLA.encodeASCII(sa, sp, da, dp, Math.min(dl - dp, sl - sp));
|
||||
int n = JLA.uncheckedEncodeASCII(sa, sp, da, dp, Math.min(dl - dp, sl - sp));
|
||||
sp += n;
|
||||
dp += n;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@ -84,12 +84,10 @@ readAndSetFilters(JNIEnv *env, PacketInputStream *in, HandlerNode *node,
|
||||
}
|
||||
|
||||
case JDWP_REQUEST_MODIFIER(LocationOnly): {
|
||||
jbyte tag;
|
||||
jclass clazz;
|
||||
jmethodID method;
|
||||
jlocation location;
|
||||
tag = inStream_readByte(in); /* not currently used */
|
||||
tag = tag; /* To shut up lint */
|
||||
(void)inStream_readByte(in); /* not currently used */
|
||||
if ( (serror = inStream_error(in)) != JDWP_ERROR(NONE) )
|
||||
break;
|
||||
clazz = inStream_readClassRef(env, in);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -718,19 +718,6 @@ private jboolean isValid(void);
|
||||
lineTable[lti].jplsLineInc));
|
||||
}
|
||||
|
||||
private int fileTableIndex(int sti, int fileId) {
|
||||
int i;
|
||||
int fileIndexStart = stratumTable[sti].fileIndex;
|
||||
/* one past end */
|
||||
int fileIndexEnd = stratumTable[sti+1].fileIndex;
|
||||
for (i = fileIndexStart; i < fileIndexEnd; ++i) {
|
||||
if (fileTable[i].fileId == fileId) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private jboolean isValid(void) {
|
||||
return sourceMapIsValid;
|
||||
}
|
||||
|
||||
@ -181,11 +181,11 @@ DEF_Agent_OnLoad(JavaVM *vm, char *options, void *reserved)
|
||||
vmInitialized = JNI_FALSE;
|
||||
gdata->vmDead = JNI_FALSE;
|
||||
|
||||
jvmtiCompileTimeMajorVersion = ( JVMTI_VERSION & JVMTI_VERSION_MASK_MAJOR )
|
||||
jvmtiCompileTimeMajorVersion = ((unsigned)JVMTI_VERSION & JVMTI_VERSION_MASK_MAJOR)
|
||||
>> JVMTI_VERSION_SHIFT_MAJOR;
|
||||
jvmtiCompileTimeMinorVersion = ( JVMTI_VERSION & JVMTI_VERSION_MASK_MINOR )
|
||||
jvmtiCompileTimeMinorVersion = ((unsigned)JVMTI_VERSION & JVMTI_VERSION_MASK_MINOR)
|
||||
>> JVMTI_VERSION_SHIFT_MINOR;
|
||||
jvmtiCompileTimeMicroVersion = ( JVMTI_VERSION & JVMTI_VERSION_MASK_MICRO )
|
||||
jvmtiCompileTimeMicroVersion = ((unsigned)JVMTI_VERSION & JVMTI_VERSION_MASK_MICRO)
|
||||
>> JVMTI_VERSION_SHIFT_MICRO;
|
||||
|
||||
/* Get the JVMTI Env, IMPORTANT: Do this first! For jvmtiAllocate(). */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -61,6 +61,8 @@
|
||||
* NOTE: This function is at the lowest level of the call tree.
|
||||
* Do not use the ERROR* macros here.
|
||||
*/
|
||||
|
||||
ATTRIBUTE_PRINTF(4, 0)
|
||||
static void
|
||||
vprint_message(FILE *fp, const char *prefix, const char *suffix,
|
||||
const char *format, va_list ap)
|
||||
@ -84,6 +86,7 @@ vprint_message(FILE *fp, const char *prefix, const char *suffix,
|
||||
* NOTE: This function is at the lowest level of the call tree.
|
||||
* Do not use the ERROR* macros here.
|
||||
*/
|
||||
ATTRIBUTE_PRINTF(4, 5)
|
||||
void
|
||||
print_message(FILE *fp, const char *prefix, const char *suffix,
|
||||
const char *format, ...)
|
||||
@ -96,6 +99,7 @@ print_message(FILE *fp, const char *prefix, const char *suffix,
|
||||
}
|
||||
|
||||
/* Generate error message */
|
||||
ATTRIBUTE_PRINTF(1, 2)
|
||||
void
|
||||
error_message(const char *format, ...)
|
||||
{
|
||||
@ -110,6 +114,7 @@ error_message(const char *format, ...)
|
||||
}
|
||||
|
||||
/* Print plain message to stdout. */
|
||||
ATTRIBUTE_PRINTF(1, 2)
|
||||
void
|
||||
tty_message(const char *format, ...)
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -976,7 +976,6 @@ eventFilter_setSourceNameMatchFilter(HandlerNode *node,
|
||||
|
||||
jvmtiError eventFilter_setPlatformThreadsOnlyFilter(HandlerNode *node, jint index)
|
||||
{
|
||||
PlatformThreadsFilter *filter = &FILTER(node, index).u.PlatformThreadsOnly;
|
||||
if (index >= FILTER_COUNT(node)) {
|
||||
return AGENT_ERROR_ILLEGAL_ARGUMENT;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@ -470,6 +470,7 @@ inStream_readValue(PacketInputStream *stream)
|
||||
break;
|
||||
default:
|
||||
stream->error = JDWP_ERROR(INVALID_TAG);
|
||||
value.j = 0L; // to make compiler happy
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -155,6 +155,7 @@ standard_logging_format(FILE *fp,
|
||||
}
|
||||
|
||||
/* End a log entry */
|
||||
ATTRIBUTE_PRINTF(1, 2)
|
||||
void
|
||||
log_message_end(const char *format, ...)
|
||||
{
|
||||
|
||||
@ -2667,12 +2667,16 @@ threadControl_setEventMode(jvmtiEventMode mode, EventIndex ei, jthread thread)
|
||||
|
||||
/*
|
||||
* Returns the current thread.
|
||||
* Returns NULL on error (JVMTI_ERROR_WRONG_PHASE, JVMTI_ERROR_UNATTACHED_THREAD).
|
||||
*/
|
||||
jthread
|
||||
threadControl_currentThread(void)
|
||||
{
|
||||
jthread thread = NULL;
|
||||
jvmtiError error = JVMTI_FUNC_PTR(gdata->jvmti,GetCurrentThread)(gdata->jvmti, &thread);
|
||||
if (error != JVMTI_ERROR_NONE) {
|
||||
return NULL;
|
||||
}
|
||||
return thread;
|
||||
}
|
||||
|
||||
@ -2700,11 +2704,9 @@ threadControl_getFrameGeneration(jthread thread)
|
||||
jthread *
|
||||
threadControl_allVThreads(jint *numVThreads)
|
||||
{
|
||||
JNIEnv *env;
|
||||
ThreadNode *node;
|
||||
jthread* vthreads;
|
||||
|
||||
env = getEnv();
|
||||
debugMonitorEnter(threadLock);
|
||||
*numVThreads = numRunningVThreads;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@ -173,7 +173,7 @@ int JNICALL utf8mToUtf8sLength(jbyte *string, int length) {
|
||||
|
||||
newLength = 0;
|
||||
for ( i = 0 ; i < length ; i++ ) {
|
||||
unsigned byte1, byte2, byte3, byte4, byte5, byte6;
|
||||
unsigned byte1, byte2, byte4, byte5, byte6;
|
||||
|
||||
byte1 = (unsigned char)string[i];
|
||||
if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
|
||||
@ -196,7 +196,7 @@ int JNICALL utf8mToUtf8sLength(jbyte *string, int length) {
|
||||
break; /* Error condition */
|
||||
}
|
||||
byte2 = (unsigned char)string[++i];
|
||||
byte3 = (unsigned char)string[++i];
|
||||
++i; // byte3 is not used
|
||||
newLength += 3;
|
||||
/* Possible process a second 3byte encoding */
|
||||
if ( (i+3) < length && byte1 == 0xED && (byte2 & 0xF0) == 0xA0 ) {
|
||||
|
||||
@ -59,6 +59,14 @@
|
||||
#include "error_messages.h"
|
||||
#include "debugInit.h"
|
||||
|
||||
/* To handle "format string is not a string literal" warning. */
|
||||
#if !defined(_MSC_VER)
|
||||
#define ATTRIBUTE_PRINTF(fmt_pos_num, vargs_pos_num) \
|
||||
__attribute__((format(printf, fmt_pos_num, vargs_pos_num)))
|
||||
#else
|
||||
#define ATTRIBUTE_PRINTF(fmt_pos_num, vargs_pos_num)
|
||||
#endif
|
||||
|
||||
/* Definition of a CommonRef tracked by the backend for the frontend */
|
||||
typedef struct RefNode {
|
||||
jlong seqNum; /* ID of reference, also key for hash table */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
# Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 2026, 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
|
||||
@ -70,6 +70,7 @@ Developers are responsible for updating their custom runtime images.
|
||||
and zip-9 provides the best compression. Default is zip-6.
|
||||
|
||||
: Deprecated values to be removed in a future release:
|
||||
|
||||
- `0`: No compression. Use zip-0 instead.
|
||||
- `1`: Constant string sharing
|
||||
- `2`: ZIP. Use zip-6 instead.
|
||||
@ -182,6 +183,7 @@ Description
|
||||
and zip-9 provides the best compression. Default is zip-6.
|
||||
|
||||
: Deprecated values to be removed in a future release:
|
||||
|
||||
- Level 0: No compression. Use zip-0 instead.
|
||||
- Level 1: Constant string sharing
|
||||
- Level 2: ZIP. Use zip-6 instead.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2025, 2026, 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
|
||||
@ -40,6 +40,7 @@ import javax.naming.ldap.Rdn;
|
||||
import javax.security.auth.x500.X500Principal;
|
||||
import jdk.jpackage.internal.MacCertificateUtils.CertificateHash;
|
||||
import jdk.jpackage.internal.model.ConfigException;
|
||||
import jdk.jpackage.internal.model.JPackageException;
|
||||
import jdk.jpackage.internal.model.SigningIdentity;
|
||||
|
||||
final class SigningIdentityBuilder {
|
||||
@ -147,11 +148,9 @@ final class SigningIdentityBuilder {
|
||||
Objects.requireNonNull(keychain);
|
||||
switch (certs.size()) {
|
||||
case 0 -> {
|
||||
var errMsg = I18N.format("error.cert.not.found", certificateSelector.signingIdentities().getFirst(),
|
||||
keychain.map(Keychain::name).orElse(""));
|
||||
Log.error(I18N.format("message.error-header", errMsg));
|
||||
throw I18N.buildConfigException("error.explicit-sign-no-cert")
|
||||
.advice("error.explicit-sign-no-cert.advice").create();
|
||||
throw new JPackageException(I18N.format("error.cert.not.found",
|
||||
certificateSelector.signingIdentities().getFirst(),
|
||||
keychain.map(Keychain::name).orElse("")));
|
||||
}
|
||||
case 1 -> {
|
||||
return certs.getFirst();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 2026, 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
|
||||
@ -24,8 +24,6 @@
|
||||
#
|
||||
#
|
||||
error.invalid-cfbundle-version.advice=Set a compatible 'app-version' value. Valid versions are one to three integers separated by dots.
|
||||
error.explicit-sign-no-cert=Signature explicitly requested but no signing certificate found
|
||||
error.explicit-sign-no-cert.advice=Specify a valid mac-signing-key-user-name and mac-signing-keychain
|
||||
error.certificate.expired=Certificate expired {0}
|
||||
error.cert.not.found=No certificate found matching [{0}] using keychain [{1}]
|
||||
error.multiple.certs.found=Multiple certificates matching name [{0}] found in keychain [{1}]
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -23,20 +24,21 @@
|
||||
*/
|
||||
|
||||
#include "cds/archiveUtils.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "unittest.hpp"
|
||||
|
||||
class TestArchiveWorkerTask : public ArchiveWorkerTask {
|
||||
private:
|
||||
volatile int _sum;
|
||||
int _max;
|
||||
Atomic<int> _sum;
|
||||
Atomic<int> _max;
|
||||
public:
|
||||
TestArchiveWorkerTask() : ArchiveWorkerTask("Test"), _sum(0), _max(0) {}
|
||||
void work(int chunk, int max_chunks) override {
|
||||
AtomicAccess::add(&_sum, chunk);
|
||||
AtomicAccess::store(&_max, max_chunks);
|
||||
_sum.add_then_fetch(chunk);
|
||||
_max.store_relaxed(max_chunks);
|
||||
}
|
||||
int sum() { return AtomicAccess::load(&_sum); }
|
||||
int max() { return AtomicAccess::load(&_max); }
|
||||
int sum() { return _sum.load_relaxed(); }
|
||||
int max() { return _max.load_relaxed(); }
|
||||
};
|
||||
|
||||
// Test a repeated cycle of workers init/shutdown without task works.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2026, 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
|
||||
@ -22,9 +22,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "cppstdlib/new.hpp"
|
||||
#include "gc/g1/g1BatchedTask.hpp"
|
||||
#include "gc/shared/workerThread.hpp"
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "unittest.hpp"
|
||||
|
||||
class G1BatchedTaskWorkers : AllStatic {
|
||||
@ -49,26 +50,26 @@ WorkerThreads* G1BatchedTaskWorkers::_workers = nullptr;
|
||||
|
||||
class G1TestSubTask : public G1AbstractSubTask {
|
||||
mutable uint _phase;
|
||||
volatile uint _num_do_work; // Amount of do_work() has been called.
|
||||
Atomic<uint> _num_do_work; // Amount of do_work() has been called.
|
||||
|
||||
void check_and_inc_phase(uint expected) const {
|
||||
ASSERT_EQ(_phase, expected);
|
||||
_phase++;
|
||||
}
|
||||
|
||||
bool volatile* _do_work_called_by;
|
||||
Atomic<bool>* _do_work_called_by;
|
||||
|
||||
protected:
|
||||
uint _max_workers;
|
||||
|
||||
void do_work_called(uint worker_id) {
|
||||
AtomicAccess::inc(&_num_do_work);
|
||||
bool orig_value = AtomicAccess::cmpxchg(&_do_work_called_by[worker_id], false, true);
|
||||
_num_do_work.add_then_fetch(1u);
|
||||
bool orig_value = _do_work_called_by[worker_id].compare_exchange(false, true);
|
||||
ASSERT_EQ(orig_value, false);
|
||||
}
|
||||
|
||||
void verify_do_work_called_by(uint num_workers) {
|
||||
ASSERT_EQ(AtomicAccess::load(&_num_do_work), num_workers);
|
||||
ASSERT_EQ(_num_do_work.load_relaxed(), num_workers);
|
||||
// Do not need to check the _do_work_called_by array. The count is already verified
|
||||
// by above statement, and we already check that a given flag is only set once.
|
||||
}
|
||||
@ -86,7 +87,7 @@ public:
|
||||
|
||||
~G1TestSubTask() {
|
||||
check_and_inc_phase(3);
|
||||
FREE_C_HEAP_ARRAY(bool, _do_work_called_by);
|
||||
FREE_C_HEAP_ARRAY(Atomic<bool>, _do_work_called_by);
|
||||
}
|
||||
|
||||
double worker_cost() const override {
|
||||
@ -100,9 +101,9 @@ public:
|
||||
assert(max_workers >= 1, "must be");
|
||||
check_and_inc_phase(2);
|
||||
|
||||
_do_work_called_by = NEW_C_HEAP_ARRAY(bool, max_workers, mtInternal);
|
||||
_do_work_called_by = NEW_C_HEAP_ARRAY(Atomic<bool>, max_workers, mtInternal);
|
||||
for (uint i = 0; i < max_workers; i++) {
|
||||
_do_work_called_by[i] = false;
|
||||
::new (&_do_work_called_by[i]) Atomic<bool>{false};
|
||||
}
|
||||
_max_workers = max_workers;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2026, 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
|
||||
@ -30,6 +30,7 @@
|
||||
#include "gc/shared/workerThread.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "unittest.hpp"
|
||||
#include "utilities/powerOfTwo.hpp"
|
||||
|
||||
@ -385,8 +386,8 @@ void G1CardSetTest::cardset_basic_test() {
|
||||
class G1CardSetMtTestTask : public WorkerTask {
|
||||
G1CardSet* _card_set;
|
||||
|
||||
size_t _added;
|
||||
size_t _found;
|
||||
Atomic<size_t> _added;
|
||||
Atomic<size_t> _found;
|
||||
|
||||
public:
|
||||
G1CardSetMtTestTask(G1CardSet* card_set) :
|
||||
@ -413,12 +414,12 @@ public:
|
||||
found++;
|
||||
}
|
||||
}
|
||||
AtomicAccess::add(&_added, added);
|
||||
AtomicAccess::add(&_found, found);
|
||||
_added.add_then_fetch(added);
|
||||
_found.add_then_fetch(found);
|
||||
}
|
||||
|
||||
size_t added() const { return _added; }
|
||||
size_t found() const { return _found; }
|
||||
size_t added() const { return _added.load_relaxed(); }
|
||||
size_t found() const { return _found.load_relaxed(); }
|
||||
};
|
||||
|
||||
void G1CardSetTest::cardset_mt_test() {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2026, 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
|
||||
@ -26,7 +26,7 @@
|
||||
#include "gc/g1/g1RegionToSpaceMapper.hpp"
|
||||
#include "gc/shared/workerThread.hpp"
|
||||
#include "memory/memoryReserver.hpp"
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "unittest.hpp"
|
||||
|
||||
@ -51,7 +51,7 @@ WorkerThreads* G1MapperWorkers::_workers = nullptr;
|
||||
|
||||
class G1TestCommitUncommit : public WorkerTask {
|
||||
G1RegionToSpaceMapper* _mapper;
|
||||
uint _claim_id;
|
||||
Atomic<uint> _claim_id;
|
||||
public:
|
||||
G1TestCommitUncommit(G1RegionToSpaceMapper* mapper) :
|
||||
WorkerTask("Stress mapper"),
|
||||
@ -59,7 +59,7 @@ public:
|
||||
_claim_id(0) { }
|
||||
|
||||
void work(uint worker_id) {
|
||||
uint index = AtomicAccess::fetch_then_add(&_claim_id, 1u);
|
||||
uint index = _claim_id.fetch_then_add(1u);
|
||||
|
||||
for (int i = 0; i < 100000; i++) {
|
||||
// Stress commit and uncommit of a single region. The same
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, 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
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
#include "gc/shared/bufferNode.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/semaphore.inline.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
@ -116,16 +116,16 @@ public:
|
||||
class BufferNode::TestSupport::AllocatorThread : public JavaTestThread {
|
||||
BufferNode::Allocator* _allocator;
|
||||
CompletedList* _cbl;
|
||||
volatile size_t* _total_allocations;
|
||||
volatile bool* _continue_running;
|
||||
Atomic<size_t>* _total_allocations;
|
||||
Atomic<bool>* _continue_running;
|
||||
size_t _allocations;
|
||||
|
||||
public:
|
||||
AllocatorThread(Semaphore* post,
|
||||
BufferNode::Allocator* allocator,
|
||||
CompletedList* cbl,
|
||||
volatile size_t* total_allocations,
|
||||
volatile bool* continue_running) :
|
||||
Atomic<size_t>* total_allocations,
|
||||
Atomic<bool>* continue_running) :
|
||||
JavaTestThread(post),
|
||||
_allocator(allocator),
|
||||
_cbl(cbl),
|
||||
@ -135,14 +135,14 @@ public:
|
||||
{}
|
||||
|
||||
virtual void main_run() {
|
||||
while (AtomicAccess::load_acquire(_continue_running)) {
|
||||
while (_continue_running->load_acquire()) {
|
||||
BufferNode* node = _allocator->allocate();
|
||||
_cbl->push(node);
|
||||
++_allocations;
|
||||
ThreadBlockInVM tbiv(this); // Safepoint check.
|
||||
}
|
||||
tty->print_cr("allocations: %zu", _allocations);
|
||||
AtomicAccess::add(_total_allocations, _allocations);
|
||||
_total_allocations->add_then_fetch(_allocations);
|
||||
}
|
||||
};
|
||||
|
||||
@ -151,13 +151,13 @@ public:
|
||||
class BufferNode::TestSupport::ProcessorThread : public JavaTestThread {
|
||||
BufferNode::Allocator* _allocator;
|
||||
CompletedList* _cbl;
|
||||
volatile bool* _continue_running;
|
||||
Atomic<bool>* _continue_running;
|
||||
|
||||
public:
|
||||
ProcessorThread(Semaphore* post,
|
||||
BufferNode::Allocator* allocator,
|
||||
CompletedList* cbl,
|
||||
volatile bool* continue_running) :
|
||||
Atomic<bool>* continue_running) :
|
||||
JavaTestThread(post),
|
||||
_allocator(allocator),
|
||||
_cbl(cbl),
|
||||
@ -172,7 +172,7 @@ public:
|
||||
_allocator->release(node);
|
||||
} else if (shutdown_requested) {
|
||||
return;
|
||||
} else if (!AtomicAccess::load_acquire(_continue_running)) {
|
||||
} else if (!_continue_running->load_acquire()) {
|
||||
// To avoid a race that could leave buffers in the list after this
|
||||
// thread has shut down, continue processing until the list is empty
|
||||
// *after* the shut down request has been received.
|
||||
@ -193,9 +193,9 @@ static void run_test(BufferNode::Allocator* allocator, CompletedList* cbl) {
|
||||
constexpr uint milliseconds_to_run = 1000;
|
||||
|
||||
Semaphore post;
|
||||
volatile size_t total_allocations = 0;
|
||||
volatile bool allocator_running = true;
|
||||
volatile bool processor_running = true;
|
||||
Atomic<size_t> total_allocations{0};
|
||||
Atomic<bool> allocator_running{true};
|
||||
Atomic<bool> processor_running{true};
|
||||
|
||||
ProcessorThread* proc_threads[num_processor_threads] = {};
|
||||
for (uint i = 0; i < num_processor_threads; ++i) {
|
||||
@ -222,18 +222,18 @@ static void run_test(BufferNode::Allocator* allocator, CompletedList* cbl) {
|
||||
ThreadInVMfromNative invm(this_thread);
|
||||
this_thread->sleep(milliseconds_to_run);
|
||||
}
|
||||
AtomicAccess::release_store(&allocator_running, false);
|
||||
allocator_running.release_store(false);
|
||||
for (uint i = 0; i < num_allocator_threads; ++i) {
|
||||
ThreadInVMfromNative invm(this_thread);
|
||||
post.wait_with_safepoint_check(this_thread);
|
||||
}
|
||||
AtomicAccess::release_store(&processor_running, false);
|
||||
processor_running.release_store(false);
|
||||
for (uint i = 0; i < num_processor_threads; ++i) {
|
||||
ThreadInVMfromNative invm(this_thread);
|
||||
post.wait_with_safepoint_check(this_thread);
|
||||
}
|
||||
ASSERT_TRUE(BufferNode::TestSupport::try_transfer_pending(allocator));
|
||||
tty->print_cr("total allocations: %zu", total_allocations);
|
||||
tty->print_cr("total allocations: %zu", total_allocations.load_relaxed());
|
||||
tty->print_cr("allocator free count: %zu", allocator->free_count());
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2024, 2025, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2024, 2026, 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
|
||||
@ -32,7 +32,6 @@ TEST_VM(CompressedKlass, basics) {
|
||||
if (!UseCompressedClassPointers) {
|
||||
return;
|
||||
}
|
||||
ASSERT_LE((address)0, CompressedKlassPointers::base());
|
||||
ASSERT_LE(CompressedKlassPointers::base(), CompressedKlassPointers::klass_range_start());
|
||||
ASSERT_LT(CompressedKlassPointers::klass_range_start(), CompressedKlassPointers::klass_range_end());
|
||||
ASSERT_LE(CompressedKlassPointers::klass_range_end(), CompressedKlassPointers::encoding_range_end());
|
||||
@ -50,7 +49,7 @@ TEST_VM(CompressedKlass, basics) {
|
||||
ASSERT_EQ(CompressedKlassPointers::encoding_range_end() - CompressedKlassPointers::base(), (ptrdiff_t)expected_size);
|
||||
}
|
||||
#else
|
||||
ASSERT_EQ(CompressedKlassPointers::base(), (address)0);
|
||||
ASSERT_EQ(CompressedKlassPointers::base(), nullptr);
|
||||
ASSERT_EQ(CompressedKlassPointers::encoding_range_end(), (address)(UINT_MAX));
|
||||
#endif // _LP64
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, 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
|
||||
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "gc/shared/workerThread.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/mutex.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "runtime/semaphore.hpp"
|
||||
@ -1169,12 +1170,12 @@ TEST_VM(ConcurrentHashTable, concurrent_mt_bulk_delete) {
|
||||
class CHTParallelScanTask: public WorkerTask {
|
||||
TestTable* _cht;
|
||||
TestTable::ScanTask* _scan_task;
|
||||
size_t *_total_scanned;
|
||||
Atomic<size_t>* _total_scanned;
|
||||
|
||||
public:
|
||||
CHTParallelScanTask(TestTable* cht,
|
||||
TestTable::ScanTask* bc,
|
||||
size_t *total_scanned) :
|
||||
Atomic<size_t>* total_scanned) :
|
||||
WorkerTask("CHT Parallel Scan"),
|
||||
_cht(cht),
|
||||
_scan_task(bc),
|
||||
@ -1184,7 +1185,7 @@ public:
|
||||
void work(uint worker_id) {
|
||||
ChtCountScan par_scan;
|
||||
_scan_task->do_safepoint_scan(par_scan);
|
||||
AtomicAccess::add(_total_scanned, par_scan._count);
|
||||
_total_scanned->add_then_fetch(par_scan._count);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1217,13 +1218,14 @@ public:
|
||||
{}
|
||||
|
||||
void doit() {
|
||||
size_t total_scanned = 0;
|
||||
Atomic<size_t> total_scanned{0};
|
||||
TestTable::ScanTask scan_task(_cht, 64);
|
||||
|
||||
CHTParallelScanTask task(_cht, &scan_task, &total_scanned);
|
||||
CHTWorkers::run_task(&task);
|
||||
|
||||
EXPECT_TRUE(total_scanned == (size_t)_num_items) << " Should scan all inserted items: " << total_scanned;
|
||||
EXPECT_TRUE(total_scanned.load_relaxed() == (size_t)_num_items)
|
||||
<< " Should scan all inserted items: " << total_scanned.load_relaxed();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, 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
|
||||
@ -21,7 +21,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "utilities/globalCounter.inline.hpp"
|
||||
#include "utilities/spinYield.hpp"
|
||||
@ -39,8 +39,8 @@ enum NestedTestState {
|
||||
};
|
||||
|
||||
class RCUNestedThread : public JavaTestThread {
|
||||
volatile NestedTestState _state;
|
||||
volatile bool _proceed;
|
||||
Atomic<NestedTestState> _state;
|
||||
Atomic<bool> _proceed;
|
||||
|
||||
protected:
|
||||
RCUNestedThread(Semaphore* post) :
|
||||
@ -52,21 +52,21 @@ protected:
|
||||
~RCUNestedThread() {}
|
||||
|
||||
void set_state(NestedTestState new_state) {
|
||||
AtomicAccess::release_store(&_state, new_state);
|
||||
_state.release_store(new_state);
|
||||
}
|
||||
|
||||
void wait_with_state(NestedTestState new_state) {
|
||||
SpinYield spinner;
|
||||
AtomicAccess::release_store(&_state, new_state);
|
||||
while (!AtomicAccess::load_acquire(&_proceed)) {
|
||||
_state.release_store(new_state);
|
||||
while (!_proceed.load_acquire()) {
|
||||
spinner.wait();
|
||||
}
|
||||
AtomicAccess::release_store(&_proceed, false);
|
||||
_proceed.release_store(false);
|
||||
}
|
||||
|
||||
public:
|
||||
NestedTestState state() const {
|
||||
return AtomicAccess::load_acquire(&_state);
|
||||
return _state.load_acquire();
|
||||
}
|
||||
|
||||
void wait_for_state(NestedTestState goal) {
|
||||
@ -77,7 +77,7 @@ public:
|
||||
}
|
||||
|
||||
void proceed() {
|
||||
AtomicAccess::release_store(&_proceed, true);
|
||||
_proceed.release_store(true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, 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
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
@ -36,16 +36,16 @@
|
||||
|
||||
class SingleWriterSynchronizerTestReader : public JavaTestThread {
|
||||
SingleWriterSynchronizer* _synchronizer;
|
||||
volatile uintx* _synchronized_value;
|
||||
volatile int* _continue_running;
|
||||
Atomic<uintx>* _synchronized_value;
|
||||
Atomic<int>* _continue_running;
|
||||
|
||||
static const uint reader_iterations = 10;
|
||||
|
||||
public:
|
||||
SingleWriterSynchronizerTestReader(Semaphore* post,
|
||||
SingleWriterSynchronizer* synchronizer,
|
||||
volatile uintx* synchronized_value,
|
||||
volatile int* continue_running) :
|
||||
Atomic<uintx>* synchronized_value,
|
||||
Atomic<int>* continue_running) :
|
||||
JavaTestThread(post),
|
||||
_synchronizer(synchronizer),
|
||||
_synchronized_value(synchronized_value),
|
||||
@ -55,14 +55,14 @@ public:
|
||||
virtual void main_run() {
|
||||
size_t iterations = 0;
|
||||
size_t values_changed = 0;
|
||||
while (AtomicAccess::load_acquire(_continue_running) != 0) {
|
||||
while (_continue_running->load_acquire() != 0) {
|
||||
{ ThreadBlockInVM tbiv(this); } // Safepoint check outside critical section.
|
||||
++iterations;
|
||||
SingleWriterSynchronizer::CriticalSection cs(_synchronizer);
|
||||
uintx value = AtomicAccess::load_acquire(_synchronized_value);
|
||||
uintx value = _synchronized_value->load_acquire();
|
||||
uintx new_value = value;
|
||||
for (uint i = 0; i < reader_iterations; ++i) {
|
||||
new_value = AtomicAccess::load_acquire(_synchronized_value);
|
||||
new_value = _synchronized_value->load_acquire();
|
||||
// A reader can see either the value it first read after
|
||||
// entering the critical section, or that value + 1. No other
|
||||
// values are possible.
|
||||
@ -81,14 +81,14 @@ public:
|
||||
|
||||
class SingleWriterSynchronizerTestWriter : public JavaTestThread {
|
||||
SingleWriterSynchronizer* _synchronizer;
|
||||
volatile uintx* _synchronized_value;
|
||||
volatile int* _continue_running;
|
||||
Atomic<uintx>* _synchronized_value;
|
||||
Atomic<int>* _continue_running;
|
||||
|
||||
public:
|
||||
SingleWriterSynchronizerTestWriter(Semaphore* post,
|
||||
SingleWriterSynchronizer* synchronizer,
|
||||
volatile uintx* synchronized_value,
|
||||
volatile int* continue_running) :
|
||||
Atomic<uintx>* synchronized_value,
|
||||
Atomic<int>* continue_running) :
|
||||
JavaTestThread(post),
|
||||
_synchronizer(synchronizer),
|
||||
_synchronized_value(synchronized_value),
|
||||
@ -96,12 +96,12 @@ public:
|
||||
{}
|
||||
|
||||
virtual void main_run() {
|
||||
while (AtomicAccess::load_acquire(_continue_running) != 0) {
|
||||
++*_synchronized_value;
|
||||
while (_continue_running->load_acquire() != 0) {
|
||||
_synchronized_value->add_then_fetch(1u, memory_order_relaxed);
|
||||
_synchronizer->synchronize();
|
||||
{ ThreadBlockInVM tbiv(this); } // Safepoint check.
|
||||
}
|
||||
tty->print_cr("writer iterations: %zu", *_synchronized_value);
|
||||
tty->print_cr("writer iterations: %zu", _synchronized_value->load_relaxed());
|
||||
}
|
||||
};
|
||||
|
||||
@ -111,8 +111,8 @@ const uint milliseconds_to_run = 1000;
|
||||
TEST_VM(TestSingleWriterSynchronizer, stress) {
|
||||
Semaphore post;
|
||||
SingleWriterSynchronizer synchronizer;
|
||||
volatile uintx synchronized_value = 0;
|
||||
volatile int continue_running = 1;
|
||||
Atomic<uintx> synchronized_value{0};
|
||||
Atomic<int> continue_running{1};
|
||||
|
||||
JavaTestThread* readers[nreaders] = {};
|
||||
for (uint i = 0; i < nreaders; ++i) {
|
||||
@ -137,7 +137,7 @@ TEST_VM(TestSingleWriterSynchronizer, stress) {
|
||||
ThreadInVMfromNative invm(cur);
|
||||
cur->sleep(milliseconds_to_run);
|
||||
}
|
||||
continue_running = 0;
|
||||
continue_running.store_relaxed(0);
|
||||
for (uint i = 0; i < nreaders + 1; ++i) {
|
||||
post.wait();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2026, 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
|
||||
@ -21,23 +21,23 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/orderAccess.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "utilities/spinYield.hpp"
|
||||
#include "utilities/waitBarrier.hpp"
|
||||
#include "threadHelper.inline.hpp"
|
||||
|
||||
static volatile int wait_tag = 0;
|
||||
static volatile int valid_value = 0;
|
||||
static Atomic<int> wait_tag{0};
|
||||
static Atomic<int> valid_value{0};
|
||||
|
||||
template <typename WaitBarrierImpl>
|
||||
class WBThread : public JavaTestThread {
|
||||
public:
|
||||
static volatile bool _exit;
|
||||
static Atomic<bool> _exit;
|
||||
WaitBarrierType<WaitBarrierImpl>* _wait_barrier;
|
||||
Semaphore* _wrt_start;
|
||||
volatile int _on_barrier;
|
||||
Atomic<int> _on_barrier;
|
||||
|
||||
WBThread(Semaphore* post, WaitBarrierType<WaitBarrierImpl>* wb, Semaphore* wrt_start)
|
||||
: JavaTestThread(post), _wait_barrier(wb), _wrt_start(wrt_start) {};
|
||||
@ -46,12 +46,12 @@ public:
|
||||
_wrt_start->signal();
|
||||
int vv, tag;
|
||||
// Similar to how a JavaThread would stop in a safepoint.
|
||||
while (!_exit) {
|
||||
while (!_exit.load_relaxed()) {
|
||||
// Load the published tag.
|
||||
tag = AtomicAccess::load_acquire(&wait_tag);
|
||||
tag = wait_tag.load_acquire();
|
||||
// Publish the tag this thread is going to wait for.
|
||||
AtomicAccess::release_store(&_on_barrier, tag);
|
||||
if (_on_barrier == 0) {
|
||||
_on_barrier.release_store(tag);
|
||||
if (_on_barrier.load_relaxed() == 0) {
|
||||
SpinPause();
|
||||
continue;
|
||||
}
|
||||
@ -59,15 +59,15 @@ public:
|
||||
// Wait until we are woken.
|
||||
_wait_barrier->wait(tag);
|
||||
// Verify that we do not see an invalid value.
|
||||
vv = AtomicAccess::load_acquire(&valid_value);
|
||||
vv = valid_value.load_acquire();
|
||||
ASSERT_EQ((vv & 0x1), 0);
|
||||
AtomicAccess::release_store(&_on_barrier, 0);
|
||||
_on_barrier.release_store(0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <typename WaitBarrierImpl>
|
||||
volatile bool WBThread<WaitBarrierImpl>::_exit = false;
|
||||
Atomic<bool> WBThread<WaitBarrierImpl>::_exit{false};
|
||||
|
||||
template <typename WaitBarrierImpl>
|
||||
class WBArmerThread : public JavaTestThread {
|
||||
@ -103,35 +103,35 @@ public:
|
||||
// Arm next tag.
|
||||
wb.arm(next_tag);
|
||||
// Publish tag.
|
||||
AtomicAccess::release_store_fence(&wait_tag, next_tag);
|
||||
wait_tag.release_store_fence(next_tag);
|
||||
|
||||
// Wait until threads picked up new tag.
|
||||
while (reader1->_on_barrier != wait_tag ||
|
||||
reader2->_on_barrier != wait_tag ||
|
||||
reader3->_on_barrier != wait_tag ||
|
||||
reader4->_on_barrier != wait_tag) {
|
||||
while (reader1->_on_barrier.load_relaxed() != wait_tag.load_relaxed() ||
|
||||
reader2->_on_barrier.load_relaxed() != wait_tag.load_relaxed() ||
|
||||
reader3->_on_barrier.load_relaxed() != wait_tag.load_relaxed() ||
|
||||
reader4->_on_barrier.load_relaxed() != wait_tag.load_relaxed()) {
|
||||
SpinPause();
|
||||
}
|
||||
|
||||
// Set an invalid value.
|
||||
AtomicAccess::release_store(&valid_value, valid_value + 1); // odd
|
||||
valid_value.release_store(valid_value.load_relaxed() + 1); // odd
|
||||
os::naked_yield();
|
||||
// Set a valid value.
|
||||
AtomicAccess::release_store(&valid_value, valid_value + 1); // even
|
||||
valid_value.release_store(valid_value.load_relaxed() + 1); // even
|
||||
// Publish inactive tag.
|
||||
AtomicAccess::release_store_fence(&wait_tag, 0); // Stores in WB must not float up.
|
||||
wait_tag.release_store_fence(0); // Stores in WB must not float up.
|
||||
wb.disarm();
|
||||
|
||||
// Wait until threads done valid_value verification.
|
||||
while (reader1->_on_barrier != 0 ||
|
||||
reader2->_on_barrier != 0 ||
|
||||
reader3->_on_barrier != 0 ||
|
||||
reader4->_on_barrier != 0) {
|
||||
while (reader1->_on_barrier.load_relaxed() != 0 ||
|
||||
reader2->_on_barrier.load_relaxed() != 0 ||
|
||||
reader3->_on_barrier.load_relaxed() != 0 ||
|
||||
reader4->_on_barrier.load_relaxed() != 0) {
|
||||
SpinPause();
|
||||
}
|
||||
++next_tag;
|
||||
}
|
||||
WBThread<WaitBarrierImpl>::_exit = true;
|
||||
WBThread<WaitBarrierImpl>::_exit.store_relaxed(true);
|
||||
for (int i = 0; i < NUMBER_OF_READERS; i++) {
|
||||
post.wait();
|
||||
}
|
||||
@ -139,13 +139,13 @@ public:
|
||||
};
|
||||
|
||||
TEST_VM(WaitBarrier, default_wb) {
|
||||
WBThread<WaitBarrierDefault>::_exit = false;
|
||||
WBThread<WaitBarrierDefault>::_exit.store_relaxed(false);
|
||||
mt_test_doer<WBArmerThread<WaitBarrierDefault> >();
|
||||
}
|
||||
|
||||
#if defined(LINUX)
|
||||
TEST_VM(WaitBarrier, generic_wb) {
|
||||
WBThread<GenericWaitBarrier>::_exit = false;
|
||||
WBThread<GenericWaitBarrier>::_exit.store_relaxed(false);
|
||||
mt_test_doer<WBArmerThread<GenericWaitBarrier> >();
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2026, 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
|
||||
@ -132,13 +132,6 @@ tier1_loom_serviceability = \
|
||||
hotspot_loom = \
|
||||
:tier1_loom
|
||||
|
||||
serviceability_ttf_virtual = \
|
||||
serviceability/ \
|
||||
-serviceability/jvmti/vthread \
|
||||
-serviceability/jvmti/thread \
|
||||
-serviceability/jvmti/events \
|
||||
-serviceability/jvmti/negative
|
||||
|
||||
tier1_common = \
|
||||
sources \
|
||||
sanity/BasicVMTest.java \
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 2026, 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8374518
|
||||
* @summary Sanity check the flag -XX:+CITime and -XX:+CountLinearScan
|
||||
* @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+CITime -XX:+CountLinearScan ${test.main.class}
|
||||
*/
|
||||
|
||||
package compiler.c1;
|
||||
|
||||
public class TestCITimeCountLinearScan {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello World!");
|
||||
}
|
||||
}
|
||||
@ -204,7 +204,11 @@ public class IntegerDivValueTests {
|
||||
|
||||
@Run(test = {"testIntConstantFolding", "testIntConstantFoldingSpecialCase"})
|
||||
public void checkIntConstants(RunInfo info) {
|
||||
Asserts.assertEquals(INT_CONST_1 / INT_CONST_2, testIntConstantFolding());
|
||||
if (INT_CONST_2 == 0) {
|
||||
Asserts.assertThrows(ArithmeticException.class, () -> testIntConstantFolding());
|
||||
} else {
|
||||
Asserts.assertEquals(INT_CONST_1 / INT_CONST_2, testIntConstantFolding());
|
||||
}
|
||||
Asserts.assertEquals(Integer.MIN_VALUE, testIntConstantFoldingSpecialCase());
|
||||
}
|
||||
|
||||
@ -441,7 +445,11 @@ public class IntegerDivValueTests {
|
||||
|
||||
@Run(test = {"testLongConstantFolding", "testLongConstantFoldingSpecialCase"})
|
||||
public void checkLongConstants(RunInfo infoLong) {
|
||||
Asserts.assertEquals(LONG_CONST_1 / LONG_CONST_2, testLongConstantFolding());
|
||||
if (LONG_CONST_2 == 0L) {
|
||||
Asserts.assertThrows(ArithmeticException.class, () -> testLongConstantFolding());
|
||||
} else {
|
||||
Asserts.assertEquals(LONG_CONST_1 / LONG_CONST_2, testLongConstantFolding());
|
||||
}
|
||||
Asserts.assertEquals(Long.MIN_VALUE, testLongConstantFoldingSpecialCase());
|
||||
}
|
||||
|
||||
|
||||
@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 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
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8361842
|
||||
* @summary Verify the effectiveness of the `VerifyIntrinsicChecks` VM flag
|
||||
* through (bypassing `StringCoding::encodeAsciiArray`, and) feeding
|
||||
* invalid input to an intrinsified `StringCoding::encodeAsciiArray0`
|
||||
* (note the `0` suffix!).
|
||||
* @library /compiler/patches
|
||||
* @library /test/lib
|
||||
* @build java.base/java.lang.Helper
|
||||
* @comment `vm.debug == true` is required since `VerifyIntrinsicChecks` is a
|
||||
* development flag
|
||||
* @requires vm.debug == true & vm.flavor == "server" & !vm.graal.enabled
|
||||
* @requires (os.arch != "riscv64" | (os.arch == "riscv64" & vm.cpu.features ~= ".*rvv.*"))
|
||||
* @run main/othervm compiler.intrinsics.TestVerifyIntrinsicChecks verify
|
||||
*/
|
||||
|
||||
package compiler.intrinsics;
|
||||
|
||||
import java.lang.Helper;
|
||||
import java.time.Instant;
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
|
||||
public final class TestVerifyIntrinsicChecks {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
switch (args[0]) {
|
||||
case "verify" -> {
|
||||
log("Starting JVM in a separate process to verify the crash");
|
||||
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
|
||||
"-Xcomp",
|
||||
"-XX:-TieredCompilation",
|
||||
"-XX:CompileCommand=inline,java.lang.StringCoding::encodeAsciiArray0",
|
||||
"-XX:+VerifyIntrinsicChecks",
|
||||
"--patch-module", "java.base=%s/java.base".formatted(System.getProperty("test.patch.path")),
|
||||
"compiler.intrinsics.TestVerifyIntrinsicChecks",
|
||||
"crash");
|
||||
outputAnalyzer.shouldContain("unexpected null in intrinsic");
|
||||
outputAnalyzer.shouldNotHaveExitValue(0);
|
||||
}
|
||||
case "crash" -> {
|
||||
log("Triggering the crash");
|
||||
warmUpIntrinsicMethod();
|
||||
violateIntrinsicMethodContract();
|
||||
}
|
||||
default -> throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
private static void warmUpIntrinsicMethod() {
|
||||
log("Warming up the intrinsic method");
|
||||
char[] sa = createAsciiChars(8192);
|
||||
byte[] sp = new byte[4096];
|
||||
for (int i = 0; i < 1_000; i++) {
|
||||
Helper.StringCodingEncodeAsciiArray0(sa, i, sp, 0, sp.length - i);
|
||||
}
|
||||
}
|
||||
|
||||
private static char[] createAsciiChars(int length) {
|
||||
char[] buffer = new char[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
buffer[i] = (char) (i % '\u0080');
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
private static void violateIntrinsicMethodContract() {
|
||||
log("Violating the intrinsic method contract (sa=null)");
|
||||
Helper.StringCodingEncodeAsciiArray0(null, 1, null, 1, 1);
|
||||
}
|
||||
|
||||
private synchronized static void log(String format, Object... args) {
|
||||
Object[] extendedArgs = new Object[2 + args.length];
|
||||
extendedArgs[0] = Instant.now();
|
||||
extendedArgs[1] = Thread.currentThread().getName();
|
||||
System.arraycopy(args, 0, extendedArgs, extendedArgs.length - args.length, args.length);
|
||||
String extendedFormat = "%%s [%%s] %s%%n".formatted(format);
|
||||
System.out.printf(extendedFormat, extendedArgs);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 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
|
||||
@ -32,7 +32,6 @@
|
||||
* @build java.base/java.lang.Helper
|
||||
* @run main compiler.intrinsics.string.TestCountPositives
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8281146 8318509
|
||||
@ -47,38 +46,17 @@
|
||||
* @run main/othervm/timeout=1200 -XX:UseAVX=3 compiler.intrinsics.string.TestCountPositives
|
||||
* @run main/othervm/timeout=1200 -XX:UseAVX=3 -XX:+UnlockDiagnosticVMOptions -XX:AVX3Threshold=0 compiler.intrinsics.string.TestCountPositives
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8281146
|
||||
* @summary Verify `StringCoding::countPositives` intrinsic Java wrapper checks
|
||||
* by enabling the ones in the VM intrinsic using
|
||||
* `-XX:+VerifyIntrinsicChecks`
|
||||
* @comment This does not check out-of-range conditions. The
|
||||
* `-XX:+VerifyIntrinsicChecks` version of this test simply ensures
|
||||
* that the VM intrinsic will produce no spurious errors.
|
||||
* @key randomness
|
||||
* @library /compiler/patches
|
||||
* @library /test/lib
|
||||
* @comment `vm.debug == true` is required since `VerifyIntrinsicChecks` is a
|
||||
* development flag
|
||||
* @requires vm.debug == true
|
||||
* @build java.base/java.lang.Helper
|
||||
* @run main/othervm
|
||||
* -XX:+VerifyIntrinsicChecks
|
||||
* compiler.intrinsics.string.TestCountPositives
|
||||
/**
|
||||
* This test was derived from compiler.intrinsics.string.TestHasNegatives
|
||||
*/
|
||||
|
||||
package compiler.intrinsics.string;
|
||||
|
||||
import java.lang.Helper;
|
||||
import java.util.Random;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import jdk.test.lib.Utils;
|
||||
|
||||
/**
|
||||
* This test was derived from {@link TestHasNegatives}.
|
||||
*/
|
||||
public class TestCountPositives {
|
||||
|
||||
private static byte[] bytes = new byte[4096 + 32];
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2021, 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
|
||||
@ -31,26 +31,6 @@
|
||||
* @run main/othervm/timeout=1200 --add-opens=java.base/sun.nio.cs=ALL-UNNAMED -Xbatch -Xmx256m compiler.intrinsics.string.TestEncodeIntrinsics
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6896617 8274242
|
||||
* @summary Verify `sun.nio.cs.ISO_8859_1.Encoder::encodeISOArray` intrinsic
|
||||
* Java wrapper checks by enabling the ones in the VM intrinsic using
|
||||
* `-XX:+VerifyIntrinsicChecks`
|
||||
* @comment This does not check out-of-range conditions. The
|
||||
* `-XX:+VerifyIntrinsicChecks` version of this test simply ensures
|
||||
* that the VM intrinsic will produce no spurious errors.
|
||||
* @key randomness
|
||||
* @library /test/lib
|
||||
* @comment `vm.debug == true` is required since `VerifyIntrinsicChecks` is a
|
||||
* development flag
|
||||
* @requires vm.debug == true
|
||||
* @run main/othervm/timeout=1200
|
||||
* -XX:+VerifyIntrinsicChecks
|
||||
* --add-opens=java.base/sun.nio.cs=ALL-UNNAMED -Xbatch -Xmx256m
|
||||
* compiler.intrinsics.string.TestEncodeIntrinsics
|
||||
*/
|
||||
|
||||
package compiler.intrinsics.string;
|
||||
|
||||
import jdk.test.lib.Utils;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 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
|
||||
@ -31,7 +31,6 @@
|
||||
* @build java.base/java.lang.Helper
|
||||
* @run main compiler.intrinsics.string.TestHasNegatives
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8054307 8318509
|
||||
@ -47,31 +46,11 @@
|
||||
* @run main/othervm/timeout=1200 -XX:UseAVX=3 -XX:+UnlockDiagnosticVMOptions -XX:AVX3Threshold=0 compiler.intrinsics.string.TestHasNegatives
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8054307
|
||||
* @summary Verify `StringCoding::hasNegatives` intrinsic Java wrapper checks
|
||||
* by enabling the ones in the VM intrinsic using
|
||||
* `-XX:+VerifyIntrinsicChecks`
|
||||
* @comment This does not check out-of-range conditions. The
|
||||
* `-XX:+VerifyIntrinsicChecks` version of this test simply ensures
|
||||
* that the VM intrinsic will produce no spurious errors.
|
||||
* @key randomness
|
||||
* @library /compiler/patches
|
||||
* @library /test/lib
|
||||
* @comment `vm.debug == true` is required since `VerifyIntrinsicChecks` is a
|
||||
* development flag
|
||||
* @requires vm.debug == true
|
||||
* @build java.base/java.lang.Helper
|
||||
* @run main/othervm
|
||||
* -XX:+VerifyIntrinsicChecks
|
||||
* compiler.intrinsics.string.TestHasNegatives
|
||||
*/
|
||||
|
||||
package compiler.intrinsics.string;
|
||||
|
||||
import java.lang.Helper;
|
||||
import java.util.Random;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import jdk.test.lib.Utils;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2025, 2026, 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
|
||||
@ -229,8 +229,8 @@ public final class Operations {
|
||||
// ------------ Float -------------
|
||||
ops.add(Expression.make(INTS, "Float.compare(", FLOATS, ", ", FLOATS, ")"));
|
||||
ops.add(Expression.make(INTS, "Float.floatToIntBits(", FLOATS, ")"));
|
||||
ops.add(Expression.make(INTS, "Float.floatToRawIntBits(", FLOATS, ")", WITH_NONDETERMINISTIC_RESULT));
|
||||
// Note: there are multiple NaN values with different bit representations.
|
||||
ops.add(Expression.make(INTS, "Float.floatToRawIntBits(", FLOATS, ")", WITH_NONDETERMINISTIC_RESULT));
|
||||
ops.add(Expression.make(FLOATS, "Float.float16ToFloat(", SHORTS, ")"));
|
||||
ops.add(Expression.make(FLOATS, "Float.intBitsToFloat(", INTS, ")"));
|
||||
ops.add(Expression.make(BOOLEANS, "Float.isFinite(", FLOATS, ")"));
|
||||
@ -297,7 +297,8 @@ public final class Operations {
|
||||
ops.add(Expression.make(FLOAT16, "Float16.copySign(", FLOAT16, ",", FLOAT16, ")"));
|
||||
ops.add(Expression.make(FLOAT16, "Float16.divide(", FLOAT16, ",", FLOAT16, ")"));
|
||||
ops.add(Expression.make(BOOLEANS, "", FLOAT16, ".equals(", FLOAT16, ")"));
|
||||
ops.add(Expression.make(SHORTS, "Float16.float16ToRawShortBits(", FLOAT16, ")"));
|
||||
// Note: there are multiple NaN values with different bit representations.
|
||||
ops.add(Expression.make(SHORTS, "Float16.float16ToRawShortBits(", FLOAT16, ")", WITH_NONDETERMINISTIC_RESULT));
|
||||
ops.add(Expression.make(SHORTS, "Float16.float16ToShortBits(", FLOAT16, ")"));
|
||||
ops.add(Expression.make(FLOAT16, "Float16.fma(", FLOAT16, ",", FLOAT16, ", ", FLOAT16, ")"));
|
||||
ops.add(Expression.make(INTS, "Float16.getExponent(", FLOAT16, ")"));
|
||||
|
||||
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 2026, 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=all-flags
|
||||
* @summary Test a case where we can have one memory slice that has only loads,
|
||||
* but the loads from the slice do not have all the same input memory
|
||||
* state from before the loop. This is rather rare but it can happen.
|
||||
* @bug 8373453
|
||||
* @run main/othervm
|
||||
* -XX:CompileCommand=compileonly,${test.main.class}::test
|
||||
* -Xbatch -XX:-TieredCompilation
|
||||
* ${test.main.class}
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=fewer-flags
|
||||
* @bug 8373453
|
||||
* @run main/othervm
|
||||
* -XX:CompileCommand=compileonly,${test.main.class}::test
|
||||
* ${test.main.class}
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=vanilla
|
||||
* @bug 8373453
|
||||
* @run main ${test.main.class}
|
||||
*/
|
||||
|
||||
package compiler.loopopts.superword;
|
||||
|
||||
public class TestLoadSliceWithMultipleMemoryInputStates {
|
||||
static void test() {
|
||||
// The relevant slice is the value field of the Byte Objects.
|
||||
Byte x = 1;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if ((i & 1) == 0) {
|
||||
// Not sure what this loop is needed for, but it is very sensitive,
|
||||
// I cannot even replace N with 32.
|
||||
int N = 32;
|
||||
for (int j = 0; j < N; j++) {
|
||||
if (j == 1) {
|
||||
x = (byte) x;
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < 32; j++) {
|
||||
// The call below has an effect on the memory state
|
||||
// If we optimize the Load for Byte::value, we can bypass
|
||||
// this call, since we know that Byte::value cannot be
|
||||
// modified during the call.
|
||||
Object o = 1;
|
||||
o.toString();
|
||||
|
||||
for (int k = 0; k < 32; k++) { // OSR around here
|
||||
// Loads of x byte field have different memory input states
|
||||
// This is because some loads can split their memory state
|
||||
// through a phi further up, and others are not put back on
|
||||
// the IGVN worklist and are thus not optimized and keep
|
||||
// the old memory state. Both are correct though.
|
||||
x = (byte) (x + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
for (int i = 0; i < 10_000; i++) {
|
||||
test();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -39,11 +39,6 @@ public class Helper {
|
||||
return StringCoding.countPositives(ba, off, len);
|
||||
}
|
||||
|
||||
@jdk.internal.vm.annotation.ForceInline
|
||||
public static int StringCodingEncodeAsciiArray0(char[] sa, int sp, byte[] da, int dp, int len) {
|
||||
return StringCoding.encodeAsciiArray0(sa, sp, da, dp, len);
|
||||
}
|
||||
|
||||
@jdk.internal.vm.annotation.ForceInline
|
||||
public static byte[] compressByte(byte[] src, int srcOff, int dstSize, int dstOff, int len) {
|
||||
byte[] dst = new byte[dstSize];
|
||||
|
||||
@ -66,17 +66,23 @@ public class ShareTmpDir {
|
||||
private static void test() throws Exception {
|
||||
File sharedtmpdir = new File("sharedtmpdir");
|
||||
File flag = new File(sharedtmpdir, "flag");
|
||||
File started = new File(sharedtmpdir, "started");
|
||||
File started1 = new File(sharedtmpdir, "started-1");
|
||||
File started2 = new File(sharedtmpdir, "started-2");
|
||||
sharedtmpdir.mkdir();
|
||||
flag.delete();
|
||||
started.delete();
|
||||
started1.delete();
|
||||
started2.delete();
|
||||
DockerRunOptions opts = new DockerRunOptions(imageName, "/jdk/bin/java", "WaitForFlagFile");
|
||||
Object lock = new Object();
|
||||
opts.addDockerOpts("--volume", Utils.TEST_CLASSES + ":/test-classes/");
|
||||
opts.addDockerOpts("--volume", sharedtmpdir.getAbsolutePath() + ":/tmp/");
|
||||
opts.addJavaOpts("-Xlog:os+container=trace", "-Xlog:perf+memops=debug", "-cp", "/test-classes/");
|
||||
|
||||
Thread t1 = new Thread() {
|
||||
public void run() {
|
||||
synchronized(lock) {
|
||||
opts.addClassOptions("1");
|
||||
}
|
||||
try { out1 = Common.run(opts); } catch (Exception e) { e.printStackTrace(); }
|
||||
}
|
||||
};
|
||||
@ -84,13 +90,16 @@ public class ShareTmpDir {
|
||||
|
||||
Thread t2 = new Thread() {
|
||||
public void run() {
|
||||
synchronized(lock) {
|
||||
opts.addClassOptions("2");
|
||||
}
|
||||
try { out2 = Common.run(opts); } catch (Exception e) { e.printStackTrace(); }
|
||||
}
|
||||
};
|
||||
t2.start();
|
||||
|
||||
while (!started.exists()) {
|
||||
System.out.println("Wait for at least one JVM to start");
|
||||
while (!started1.exists() || !started2.exists()) {
|
||||
System.out.println("Waiting for all two JVMs to start");
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 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
|
||||
@ -28,7 +28,7 @@ public class WaitForFlagFile {
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println("WaitForFlagFile: Entering");
|
||||
|
||||
File started = new File("/tmp/started");
|
||||
File started = new File("/tmp/started-" + args.length);
|
||||
FileOutputStream fout = new FileOutputStream(started);
|
||||
fout.close();
|
||||
|
||||
|
||||
@ -53,9 +53,9 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import jdk.test.lib.Asserts;
|
||||
import jdk.test.lib.Platform;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
import static jdk.test.lib.Asserts.*;
|
||||
import jdk.test.whitebox.WhiteBox;
|
||||
|
||||
public class TestCodeCacheUnloadDuringConcCycle {
|
||||
@ -70,9 +70,10 @@ public class TestCodeCacheUnloadDuringConcCycle {
|
||||
"-Xbootclasspath/a:.",
|
||||
"-Xlog:gc=trace,codecache",
|
||||
"-XX:+WhiteBoxAPI",
|
||||
"-XX:ReservedCodeCacheSize=8M",
|
||||
"-XX:ReservedCodeCacheSize=" + (Platform.is32bit() ? "4M" : "8M"),
|
||||
"-XX:StartAggressiveSweepingAt=50",
|
||||
"-XX:CompileCommand=compileonly,gc.g1.SomeClass::*",
|
||||
"-XX:CompileCommand=compileonly,gc.g1.Foo*::*",
|
||||
TestCodeCacheUnloadDuringConcCycleRunner.class.getName(),
|
||||
concPhase);
|
||||
return output;
|
||||
@ -140,7 +141,7 @@ class TestCodeCacheUnloadDuringConcCycleRunner {
|
||||
System.out.println("Compiled " + i + " classes");
|
||||
}
|
||||
i++;
|
||||
} while (i < 1000);
|
||||
} while (i < 200);
|
||||
System.out.println("Compilation done, compiled " + i + " classes");
|
||||
} catch (Throwable t) {
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, 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
|
||||
@ -38,6 +38,7 @@ import java.io.*;
|
||||
* SetBreakpoint().
|
||||
* COMMENTS
|
||||
*
|
||||
* @requires test.thread.factory == null
|
||||
* @library /test/lib
|
||||
*
|
||||
* @comment make sure breakpoint01 is compiled with full debug info
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, 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
|
||||
@ -42,6 +42,7 @@ import java.io.*;
|
||||
* COMMENTS
|
||||
* Fixed the 5031200 bug.
|
||||
*
|
||||
* @requires test.thread.factory == null
|
||||
* @library /test/lib
|
||||
* @compile classload01.java
|
||||
* @run main/othervm/native -agentlib:classload01 classload01
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, 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
|
||||
@ -37,6 +37,7 @@
|
||||
* Fixed according to the bug 4651181.
|
||||
* Ported from JVMDI.
|
||||
*
|
||||
* @requires test.thread.factory == null
|
||||
* @library /test/lib
|
||||
* @compile classprep01.java
|
||||
* @run main/othervm/native -agentlib:classprep01 classprep01
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, 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
|
||||
@ -37,6 +37,7 @@
|
||||
* The test reproduced the bug on winNT 1.0fcs-E build.
|
||||
* Ported from JVMDI test /nsk/regression/b4248826.
|
||||
*
|
||||
* @requires test.thread.factory == null
|
||||
* @library /test/lib
|
||||
* @compile mentry02.java
|
||||
* @run main/othervm/native -agentlib:mentry02 mentry02
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, 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
|
||||
@ -41,6 +41,7 @@ import jdk.test.lib.jvmti.DebugeeClass;
|
||||
* and save JNIEnv pointer now passed as argument.
|
||||
*
|
||||
* @requires vm.continuations
|
||||
* @requires test.thread.factory == null
|
||||
* @library /test/lib
|
||||
* @compile monitorwaited01.java
|
||||
* @run main/othervm/native -agentlib:monitorwaited01 monitorwaited01 platform
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user