Skip to content

Commit fd4ed7d

Browse files
authored
Merge branch 'openjdk:master' into backport-sendaoYan-89c5659a-master
2 parents 0315300 + 567e648 commit fd4ed7d

File tree

172 files changed

+15655
-10700
lines changed

Some content is hidden

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

172 files changed

+15655
-10700
lines changed

make/autoconf/basic_tools.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
378378
379379
# Check if it's a GNU date compatible version
380380
AC_MSG_CHECKING([if date is a GNU compatible version])
381-
check_date=`$DATE --version 2>&1 | $GREP "GNU\|BusyBox"`
381+
check_date=`$DATE --version 2>&1 | $GREP "GNU\|BusyBox\|uutils"`
382382
if test "x$check_date" != x; then
383383
AC_MSG_RESULT([yes])
384384
IS_GNU_DATE=yes

make/autoconf/boot-jdk.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,9 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
444444
# Force en-US environment
445445
UTIL_ADD_JVM_ARG_IF_OK([-Duser.language=en -Duser.country=US],boot_jdk_jvmargs,[$JAVA])
446446
447+
UTIL_ADD_JVM_ARG_IF_OK([-Xlog:all=off:stdout],boot_jdk_jvmargs,[$JAVA])
448+
UTIL_ADD_JVM_ARG_IF_OK([-Xlog:all=warning:stderr],boot_jdk_jvmargs,[$JAVA])
449+
447450
if test "x$BOOTJDK_USE_LOCAL_CDS" = xtrue; then
448451
# Use our own CDS archive
449452
UTIL_ADD_JVM_ARG_IF_OK([$boot_jdk_cds_args -Xshare:auto],boot_jdk_jvmargs,[$JAVA])

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3401,7 +3401,7 @@ encode %{
34013401
}
34023402
%}
34033403

3404-
/// mov envcodings
3404+
// mov encodings
34053405

34063406
enc_class aarch64_enc_movw_imm(iRegI dst, immI src) %{
34073407
C2_MacroAssembler _masm(&cbuf);

src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,3 +1892,15 @@ void InterpreterMacroAssembler::load_resolved_indy_entry(Register cache, Registe
18921892
add(cache, cache, Array<ResolvedIndyEntry>::base_offset_in_bytes());
18931893
lea(cache, Address(cache, index));
18941894
}
1895+
1896+
#ifdef ASSERT
1897+
void InterpreterMacroAssembler::verify_field_offset(Register reg) {
1898+
// Verify the field offset is not in the header, implicitly checks for 0
1899+
Label L;
1900+
subs(zr, reg, static_cast<int>(sizeof(markWord) + (UseCompressedClassPointers ? sizeof(narrowKlass) : sizeof(Klass*))));
1901+
br(Assembler::GE, L);
1902+
stop("bad field offset");
1903+
bind(L);
1904+
}
1905+
#endif
1906+

src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ class InterpreterMacroAssembler: public MacroAssembler {
321321
}
322322

323323
void load_resolved_indy_entry(Register cache, Register index);
324+
325+
void verify_field_offset(Register reg) NOT_DEBUG_RETURN;
324326
};
325327

326328
#endif // CPU_AARCH64_INTERP_MASM_AARCH64_HPP

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5913,7 +5913,7 @@ void MacroAssembler::fill_words(Register base, Register cnt, Register value)
59135913
// - sun/nio/cs/ISO_8859_1$Encoder.implEncodeISOArray
59145914
// return the number of characters copied.
59155915
// - java/lang/StringUTF16.compress
5916-
// return zero (0) if copy fails, otherwise 'len'.
5916+
// return index of non-latin1 character if copy fails, otherwise 'len'.
59175917
//
59185918
// This version always returns the number of characters copied, and does not
59195919
// clobber the 'len' register. A successful copy will complete with the post-
@@ -6130,15 +6130,15 @@ address MacroAssembler::byte_array_inflate(Register src, Register dst, Register
61306130
}
61316131

61326132
// Compress char[] array to byte[].
6133+
// Intrinsic for java.lang.StringUTF16.compress(char[] src, int srcOff, byte[] dst, int dstOff, int len)
6134+
// Return the array length if every element in array can be encoded,
6135+
// otherwise, the index of first non-latin1 (> 0xff) character.
61336136
void MacroAssembler::char_array_compress(Register src, Register dst, Register len,
61346137
Register res,
61356138
FloatRegister tmp0, FloatRegister tmp1,
61366139
FloatRegister tmp2, FloatRegister tmp3,
61376140
FloatRegister tmp4, FloatRegister tmp5) {
61386141
encode_iso_array(src, dst, len, res, false, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5);
6139-
// Adjust result: res == len ? len : 0
6140-
cmp(len, res);
6141-
csel(res, res, zr, EQ);
61426142
}
61436143

61446144
// java.math.round(double a)

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg,
166166
Register temp_reg, bool load_bc_into_bc_reg/*=true*/,
167167
int byte_no)
168168
{
169+
assert_different_registers(bc_reg, temp_reg);
169170
if (!RewriteBytecodes) return;
170171
Label L_patch_done;
171172

@@ -223,8 +224,12 @@ void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg,
223224
__ bind(L_okay);
224225
#endif
225226

226-
// patch bytecode
227-
__ strb(bc_reg, at_bcp(0));
227+
// Patch bytecode with release store to coordinate with ConstantPoolCacheEntry loads
228+
// in fast bytecode codelets. The fast bytecode codelets have a memory barrier that gains
229+
// the needed ordering, together with control dependency on entering the fast codelet
230+
// itself.
231+
__ lea(temp_reg, at_bcp(0));
232+
__ stlrb(bc_reg, temp_reg);
228233
__ bind(L_patch_done);
229234
}
230235

@@ -2982,6 +2987,7 @@ void TemplateTable::fast_storefield(TosState state)
29822987

29832988
// replace index with field offset from cache entry
29842989
__ ldr(r1, Address(r2, in_bytes(base + ConstantPoolCacheEntry::f2_offset())));
2990+
__ verify_field_offset(r1);
29852991

29862992
{
29872993
Label notVolatile;
@@ -3075,6 +3081,8 @@ void TemplateTable::fast_accessfield(TosState state)
30753081

30763082
__ ldr(r1, Address(r2, in_bytes(ConstantPoolCache::base_offset() +
30773083
ConstantPoolCacheEntry::f2_offset())));
3084+
__ verify_field_offset(r1);
3085+
30783086
__ ldrw(r3, Address(r2, in_bytes(ConstantPoolCache::base_offset() +
30793087
ConstantPoolCacheEntry::flags_offset())));
30803088

@@ -3142,8 +3150,13 @@ void TemplateTable::fast_xaccess(TosState state)
31423150
__ ldr(r0, aaddress(0));
31433151
// access constant pool cache
31443152
__ get_cache_and_index_at_bcp(r2, r3, 2);
3153+
3154+
// Must prevent reordering of the following cp cache loads with bytecode load
3155+
__ membar(MacroAssembler::LoadLoad);
3156+
31453157
__ ldr(r1, Address(r2, in_bytes(ConstantPoolCache::base_offset() +
31463158
ConstantPoolCacheEntry::f2_offset())));
3159+
__ verify_field_offset(r1);
31473160

31483161
// 8179954: We need to make sure that the code generated for
31493162
// volatile accesses forms a sequentially-consistent set of

src/hotspot/cpu/ppc/ppc.ad

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12799,16 +12799,8 @@ instruct string_compress(rarg1RegP src, rarg2RegP dst, iRegIsrc len, iRegIdst re
1279912799
ins_cost(300);
1280012800
format %{ "String Compress $src,$dst,$len -> $result \t// KILL $tmp1, $tmp2, $tmp3, $tmp4, $tmp5" %}
1280112801
ins_encode %{
12802-
Label Lskip, Ldone;
12803-
__ li($result$$Register, 0);
12804-
__ string_compress_16($src$$Register, $dst$$Register, $len$$Register, $tmp1$$Register,
12805-
$tmp2$$Register, $tmp3$$Register, $tmp4$$Register, $tmp5$$Register, Ldone);
12806-
__ rldicl_($tmp1$$Register, $len$$Register, 0, 64-3); // Remaining characters.
12807-
__ beq(CCR0, Lskip);
12808-
__ string_compress($src$$Register, $dst$$Register, $tmp1$$Register, $tmp2$$Register, Ldone);
12809-
__ bind(Lskip);
12810-
__ mr($result$$Register, $len$$Register);
12811-
__ bind(Ldone);
12802+
__ encode_iso_array($src$$Register, $dst$$Register, $len$$Register, $tmp1$$Register, $tmp2$$Register,
12803+
$tmp3$$Register, $tmp4$$Register, $tmp5$$Register, $result$$Register, false);
1281212804
%}
1281312805
ins_pipe(pipe_class_default);
1281412806
%}

src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,22 +1768,20 @@ void C2_MacroAssembler::byte_array_inflate_v(Register src, Register dst, Registe
17681768
}
17691769

17701770
// Compress char[] array to byte[].
1771-
// result: the array length if every element in array can be encoded; 0, otherwise.
1771+
// Intrinsic for java.lang.StringUTF16.compress(char[] src, int srcOff, byte[] dst, int dstOff, int len)
1772+
// result: the array length if every element in array can be encoded,
1773+
// otherwise, the index of first non-latin1 (> 0xff) character.
17721774
void C2_MacroAssembler::char_array_compress_v(Register src, Register dst, Register len,
17731775
Register result, Register tmp) {
1774-
Label done;
17751776
encode_iso_array_v(src, dst, len, result, tmp, false);
1776-
beqz(len, done);
1777-
mv(result, zr);
1778-
bind(done);
17791777
}
17801778

17811779
// Intrinsic for
17821780
//
17831781
// - sun/nio/cs/ISO_8859_1$Encoder.implEncodeISOArray
17841782
// return the number of characters copied.
17851783
// - java/lang/StringUTF16.compress
1786-
// return zero (0) if copy fails, otherwise 'len'.
1784+
// return index of non-latin1 character if copy fails, otherwise 'len'.
17871785
//
17881786
// This version always returns the number of characters copied. A successful
17891787
// copy will complete with the post-condition: 'res' == 'len', while an

src/hotspot/cpu/riscv/interp_masm_riscv.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,6 +2011,15 @@ void InterpreterMacroAssembler::get_method_counters(Register method,
20112011
}
20122012

20132013
#ifdef ASSERT
2014+
void InterpreterMacroAssembler::verify_field_offset(Register reg) {
2015+
// Verify the field offset is not in the header, implicitly checks for 0
2016+
Label L;
2017+
mv(t0, static_cast<int>(sizeof(markWord) + (UseCompressedClassPointers ? sizeof(narrowKlass) : sizeof(Klass*))));
2018+
bge(reg, t0, L);
2019+
stop("bad field offset");
2020+
bind(L);
2021+
}
2022+
20142023
void InterpreterMacroAssembler::verify_access_flags(Register access_flags, uint32_t flag,
20152024
const char* msg, bool stop_by_hit) {
20162025
Label L;

0 commit comments

Comments
 (0)