Skip to content

Commit ee2b41a

Browse files
authored
Merge branch 'master' into goetz_backport_8367021
2 parents fbaec13 + 2adf8cf commit ee2b41a

File tree

2,394 files changed

+17652
-13302
lines changed

Some content is hidden

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

2,394 files changed

+17652
-13302
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ jobs:
237237
uses: ./.github/workflows/build-macos.yml
238238
with:
239239
platform: macos-x64
240-
runs-on: 'macos-13'
241-
xcode-toolset-version: '14.3.1'
240+
runs-on: 'macos-15-intel'
241+
xcode-toolset-version: '16.4'
242242
configure-arguments: ${{ github.event.inputs.configure-arguments }}
243243
make-arguments: ${{ github.event.inputs.make-arguments }}
244244
if: needs.prepare.outputs.macos-x64 == 'true'
@@ -249,8 +249,8 @@ jobs:
249249
uses: ./.github/workflows/build-macos.yml
250250
with:
251251
platform: macos-aarch64
252-
runs-on: 'macos-14'
253-
xcode-toolset-version: '15.4'
252+
runs-on: 'macos-15'
253+
xcode-toolset-version: '16.4'
254254
configure-arguments: ${{ github.event.inputs.configure-arguments }}
255255
make-arguments: ${{ github.event.inputs.make-arguments }}
256256
if: needs.prepare.outputs.macos-aarch64 == 'true'
@@ -311,17 +311,6 @@ jobs:
311311
bootjdk-platform: linux-x64
312312
runs-on: ubuntu-22.04
313313

314-
test-macos-x64:
315-
name: macos-x64
316-
needs:
317-
- build-macos-x64
318-
uses: ./.github/workflows/test.yml
319-
with:
320-
platform: macos-x64
321-
bootjdk-platform: macos-x64
322-
runs-on: macos-13
323-
xcode-toolset-version: '14.3.1'
324-
325314
test-macos-aarch64:
326315
name: macos-aarch64
327316
needs:
@@ -330,8 +319,8 @@ jobs:
330319
with:
331320
platform: macos-aarch64
332321
bootjdk-platform: macos-aarch64
333-
runs-on: macos-14
334-
xcode-toolset-version: '15.4'
322+
runs-on: macos-15
323+
xcode-toolset-version: '16.4'
335324

336325
test-windows-x64:
337326
name: windows-x64

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/flags-cflags.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
625625
TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced -fno-exceptions \
626626
-qalias=noansi -qstrict -qtls=default -qnortti -qnoeh -qignerrno -qstackprotect"
627627
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
628-
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -MP"
629-
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:wchar_t-"
628+
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:throwingNew -permissive- -MP"
629+
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:throwingNew -permissive- -Zc:wchar_t-"
630630
fi
631631
632632
# CFLAGS C language level for JDK sources (hotspot only uses C++)

make/ide/netbeans/langtools/build.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
3+
Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved.
44
55
Redistribution and use in source and binary forms, with or without
66
modification, are permitted provided that the following conditions
@@ -242,7 +242,7 @@
242242
</nbjpdastart>
243243
<property
244244
name="@{jpda.jvmargs.property}"
245-
value="-Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,address=${jpda.address}"
245+
value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"
246246
/>
247247
</sequential>
248248
</macrodef>

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/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/interp_masm_ppc.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ class InterpreterMacroAssembler: public MacroAssembler {
126126

127127
void get_cache_index_at_bcp(Register Rdst, int bcp_offset, size_t index_size);
128128

129-
void get_cache_and_index_at_bcp(Register cache, int bcp_offset, size_t index_size = sizeof(u2));
129+
void get_cache_and_index_at_bcp(Register cache, int bcp_offset, size_t index_size = sizeof(u2),
130+
bool for_fast_bytecode = false);
130131
void load_resolved_indy_entry(Register cache, Register index);
131132

132133
void get_u4(Register Rdst, Register Rsrc, int offset, signedOrNot is_signed);

src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,18 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_of
451451
}
452452

453453
void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, int bcp_offset,
454-
size_t index_size) {
454+
size_t index_size, bool for_fast_bytecode) {
455455
get_cache_index_at_bcp(cache, bcp_offset, index_size);
456456
sldi(cache, cache, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord));
457457
add(cache, R27_constPoolCache, cache);
458+
459+
if (for_fast_bytecode) {
460+
// Prevent speculative loading from ConstantPoolCacheEntry as it can miss the info written by another thread.
461+
// TemplateTable::patch_bytecode uses release-store.
462+
// We reached here via control dependency (Bytecode dispatch has used the rewritten Bytecode).
463+
// So, we can use control-isync based ordering.
464+
isync();
465+
}
458466
}
459467

460468
// Load 4-byte signed or unsigned integer in Java format (that is, big-endian format)

src/hotspot/cpu/ppc/templateTable_ppc_64.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ void TemplateTable::patch_bytecode(Bytecodes::Code new_bc, Register Rnew_bc, Reg
147147
__ bind(L_fast_patch);
148148
}
149149

150-
// Patch bytecode.
150+
// Patch bytecode with release store to coordinate with ConstantPoolCacheEntry
151+
// loads in fast bytecode codelets.
152+
__ release();
151153
__ stb(Rnew_bc, 0, R14_bcp);
152154

153155
__ bind(L_patch_done);
@@ -311,6 +313,7 @@ void TemplateTable::fast_aldc(LdcType type) {
311313
// We are resolved if the resolved reference cache entry contains a
312314
// non-null object (CallSite, etc.)
313315
__ get_cache_index_at_bcp(R31, 1, index_size); // Load index.
316+
// Only rewritten during link time. So, no need for memory barriers for accessing resolved info.
314317
__ load_resolved_reference_at_index(R17_tos, R31, R11_scratch1, R12_scratch2, &is_null);
315318

316319
// Convert null sentinel to null
@@ -2377,7 +2380,7 @@ void TemplateTable::load_invoke_cp_cache_entry(int byte_no,
23772380
if (is_invokevfinal) {
23782381
assert(Ritable_index == noreg, "register not used");
23792382
// Already resolved.
2380-
__ get_cache_and_index_at_bcp(Rcache, 1);
2383+
__ get_cache_and_index_at_bcp(Rcache, 1, sizeof(u2), /* for_fast_bytecode */ true);
23812384
} else {
23822385
resolve_cache_and_index(byte_no, Rcache, /* temp */ Rmethod, sizeof(u2));
23832386
}
@@ -3084,7 +3087,7 @@ void TemplateTable::fast_storefield(TosState state) {
30843087
const ConditionRegister CR_is_vol = CCR2; // Non-volatile condition register (survives runtime call in do_oop_store).
30853088

30863089
// Constant pool already resolved => Load flags and offset of field.
3087-
__ get_cache_and_index_at_bcp(Rcache, 1);
3090+
__ get_cache_and_index_at_bcp(Rcache, 1, sizeof(u2), /* for_fast_bytecode */ true);
30883091
jvmti_post_field_mod(Rcache, Rscratch, false /* not static */);
30893092
load_field_cp_cache_entry(noreg, Rcache, noreg, Roffset, Rflags, false); // Uses R11, R12
30903093

@@ -3165,7 +3168,7 @@ void TemplateTable::fast_accessfield(TosState state) {
31653168
// R12_scratch2 used by load_field_cp_cache_entry
31663169

31673170
// Constant pool already resolved. Get the field offset.
3168-
__ get_cache_and_index_at_bcp(Rcache, 1);
3171+
__ get_cache_and_index_at_bcp(Rcache, 1, sizeof(u2), /* for_fast_bytecode */ true);
31693172
load_field_cp_cache_entry(noreg, Rcache, noreg, Roffset, Rflags, false); // Uses R11, R12
31703173

31713174
// JVMTI support
@@ -3304,7 +3307,7 @@ void TemplateTable::fast_xaccess(TosState state) {
33043307
__ ld(Rclass_or_obj, 0, R18_locals);
33053308

33063309
// Constant pool already resolved. Get the field offset.
3307-
__ get_cache_and_index_at_bcp(Rcache, 2);
3310+
__ get_cache_and_index_at_bcp(Rcache, 2, sizeof(u2), /* for_fast_bytecode */ true);
33083311
load_field_cp_cache_entry(noreg, Rcache, noreg, Roffset, Rflags, false); // Uses R11, R12
33093312

33103313
// JVMTI support not needed, since we switch back to single bytecode as soon as debugger attaches.

0 commit comments

Comments
 (0)