Skip to content

Commit 8cf5679

Browse files
authored
Merge branch 'openjdk:master' into backport-mrserb-762423d6-master
2 parents 94d9ade + 5d35f53 commit 8cf5679

File tree

183 files changed

+4555
-2975
lines changed

Some content is hidden

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

183 files changed

+4555
-2975
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,6 @@ jobs:
293293
bootjdk-platform: linux-x64
294294
runs-on: ubuntu-22.04
295295

296-
test-macos-x64:
297-
name: macos-x64
298-
needs:
299-
- build-macos-x64
300-
uses: ./.github/workflows/test.yml
301-
with:
302-
platform: macos-x64
303-
bootjdk-platform: macos-x64
304-
runs-on: macos-13
305-
xcode-toolset-version: '14.3.1'
306-
307296
test-macos-aarch64:
308297
name: macos-aarch64
309298
needs:
@@ -325,46 +314,3 @@ jobs:
325314
bootjdk-platform: windows-x64
326315
runs-on: windows-2025
327316

328-
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
329-
remove-bundles:
330-
name: 'Remove bundle artifacts'
331-
runs-on: ubuntu-22.04
332-
if: always()
333-
needs:
334-
- build-linux-x64
335-
- build-linux-x86-hs
336-
- build-linux-x64-hs-nopch
337-
- build-linux-x64-hs-zero
338-
- build-linux-x64-hs-minimal
339-
- build-linux-x64-hs-optimized
340-
- build-linux-cross-compile
341-
- build-macos-x64
342-
- build-macos-aarch64
343-
- build-windows-x64
344-
- build-windows-aarch64
345-
- test-linux-x64
346-
- test-macos-x64
347-
- test-macos-aarch64
348-
- test-windows-x64
349-
350-
steps:
351-
- name: 'Remove bundle artifacts'
352-
run: |
353-
# Find and remove all bundle artifacts
354-
# See: https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28
355-
ALL_ARTIFACT_IDS="$(curl -sL \
356-
-H 'Accept: application/vnd.github+json' \
357-
-H 'Authorization: Bearer ${{ github.token }}' \
358-
-H 'X-GitHub-Api-Version: 2022-11-28' \
359-
'${{ github.api_url }}/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts?per_page=100')"
360-
BUNDLE_ARTIFACT_IDS="$(echo "$ALL_ARTIFACT_IDS" | jq -r -c '.artifacts | map(select(.name|startswith("bundles-"))) | .[].id')"
361-
for id in $BUNDLE_ARTIFACT_IDS; do
362-
echo "Removing $id"
363-
curl -sL \
364-
-X DELETE \
365-
-H 'Accept: application/vnd.github+json' \
366-
-H 'Authorization: Bearer ${{ github.token }}' \
367-
-H 'X-GitHub-Api-Version: 2022-11-28' \
368-
"${{ github.api_url }}/repos/${{ github.repository }}/actions/artifacts/$id" \
369-
|| echo "Failed to remove bundle"
370-
done

make/autoconf/flags-cflags.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
544544
TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced \
545545
-qalias=noansi -qstrict -qtls=default -qnortti -qnoeh -qignerrno -qstackprotect"
546546
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
547-
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -MP"
548-
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:wchar_t-"
547+
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:strictStrings -MP"
548+
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:strictStrings -Zc:wchar_t-"
549549
fi
550550
551551
# CFLAGS C language level for JDK sources (hotspot only uses C++)

make/hotspot/lib/JvmOverrideFiles.gmk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@ ifeq ($(TOOLCHAIN_TYPE), gcc)
3636
BUILD_LIBJVM_assembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized
3737
BUILD_LIBJVM_cardTableBarrierSetAssembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized
3838
BUILD_LIBJVM_interp_masm_x86.cpp_CXXFLAGS := -Wno-uninitialized
39+
BUILD_LIBJVM_ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp_CXXFLAGS := -Wno-nonnull
3940
ifeq ($(DEBUG_LEVEL), release)
4041
# Need extra inlining to collapse shared marking code into the hot marking loop
4142
BUILD_LIBJVM_shenandoahMark.cpp_CXXFLAGS := --param inline-unit-growth=1000

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

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

src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp

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

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

459467
// 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
@@ -146,7 +146,9 @@ void TemplateTable::patch_bytecode(Bytecodes::Code new_bc, Register Rnew_bc, Reg
146146
__ bind(L_fast_patch);
147147
}
148148

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

152154
__ bind(L_patch_done);
@@ -310,6 +312,7 @@ void TemplateTable::fast_aldc(bool wide) {
310312
// We are resolved if the resolved reference cache entry contains a
311313
// non-null object (CallSite, etc.)
312314
__ get_cache_index_at_bcp(R31, 1, index_size); // Load index.
315+
// Only rewritten during link time. So, no need for memory barriers for accessing resolved info.
313316
__ load_resolved_reference_at_index(R17_tos, R31, R11_scratch1, R12_scratch2, &is_null);
314317

315318
// Convert null sentinel to NULL
@@ -2309,7 +2312,7 @@ void TemplateTable::load_invoke_cp_cache_entry(int byte_no,
23092312
if (is_invokevfinal) {
23102313
assert(Ritable_index == noreg, "register not used");
23112314
// Already resolved.
2312-
__ get_cache_and_index_at_bcp(Rcache, 1);
2315+
__ get_cache_and_index_at_bcp(Rcache, 1, sizeof(u2), /* for_fast_bytecode */ true);
23132316
} else {
23142317
resolve_cache_and_index(byte_no, Rcache, /* temp */ Rmethod, is_invokedynamic ? sizeof(u4) : sizeof(u2));
23152318
}
@@ -3016,7 +3019,7 @@ void TemplateTable::fast_storefield(TosState state) {
30163019
const ConditionRegister CR_is_vol = CCR2; // Non-volatile condition register (survives runtime call in do_oop_store).
30173020

30183021
// Constant pool already resolved => Load flags and offset of field.
3019-
__ get_cache_and_index_at_bcp(Rcache, 1);
3022+
__ get_cache_and_index_at_bcp(Rcache, 1, sizeof(u2), /* for_fast_bytecode */ true);
30203023
jvmti_post_field_mod(Rcache, Rscratch, false /* not static */);
30213024
load_field_cp_cache_entry(noreg, Rcache, noreg, Roffset, Rflags, false); // Uses R11, R12
30223025

@@ -3097,7 +3100,7 @@ void TemplateTable::fast_accessfield(TosState state) {
30973100
// R12_scratch2 used by load_field_cp_cache_entry
30983101

30993102
// Constant pool already resolved. Get the field offset.
3100-
__ get_cache_and_index_at_bcp(Rcache, 1);
3103+
__ get_cache_and_index_at_bcp(Rcache, 1, sizeof(u2), /* for_fast_bytecode */ true);
31013104
load_field_cp_cache_entry(noreg, Rcache, noreg, Roffset, Rflags, false); // Uses R11, R12
31023105

31033106
// JVMTI support
@@ -3236,7 +3239,7 @@ void TemplateTable::fast_xaccess(TosState state) {
32363239
__ ld(Rclass_or_obj, 0, R18_locals);
32373240

32383241
// Constant pool already resolved. Get the field offset.
3239-
__ get_cache_and_index_at_bcp(Rcache, 2);
3242+
__ get_cache_and_index_at_bcp(Rcache, 2, sizeof(u2), /* for_fast_bytecode */ true);
32403243
load_field_cp_cache_entry(noreg, Rcache, noreg, Roffset, Rflags, false); // Uses R11, R12
32413244

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

src/hotspot/cpu/x86/assembler_x86.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7546,6 +7546,10 @@ void Assembler::evprolq(XMMRegister dst, XMMRegister src, int shift, int vector_
75467546
emit_int24(0x72, (0xC0 | encode), shift & 0xFF);
75477547
}
75487548

7549+
// Register is a class, but it would be assigned numerical value.
7550+
// "0" is assigned for xmm0. Thus we need to ignore -Wnonnull.
7551+
PRAGMA_DIAG_PUSH
7552+
PRAGMA_NONNULL_IGNORED
75497553
void Assembler::evprord(XMMRegister dst, XMMRegister src, int shift, int vector_len) {
75507554
assert(VM_Version::supports_evex(), "requires EVEX support");
75517555
assert(vector_len == Assembler::AVX_512bit || VM_Version::supports_avx512vl(), "requires VL support");
@@ -7563,6 +7567,7 @@ void Assembler::evprorq(XMMRegister dst, XMMRegister src, int shift, int vector_
75637567
int encode = vex_prefix_and_encode(xmm0->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
75647568
emit_int24(0x72, (0xC0 | encode), shift & 0xFF);
75657569
}
7570+
PRAGMA_DIAG_POP
75667571

75677572
void Assembler::evprolvd(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) {
75687573
assert(VM_Version::supports_evex(), "requires EVEX support");

src/hotspot/cpu/x86/c1_Runtime1_x86.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,11 @@ enum reg_save_layout {
318318
// expensive. The deopt blob is the only thing which needs to
319319
// describe FPU registers. In all other cases it should be sufficient
320320
// to simply save their current value.
321-
321+
//
322+
// Register is a class, but it would be assigned numerical value.
323+
// "0" is assigned for rax. Thus we need to ignore -Wnonnull.
324+
PRAGMA_DIAG_PUSH
325+
PRAGMA_NONNULL_IGNORED
322326
static OopMap* generate_oop_map(StubAssembler* sasm, int num_rt_args,
323327
bool save_fpu_registers = true) {
324328

@@ -418,6 +422,7 @@ static OopMap* generate_oop_map(StubAssembler* sasm, int num_rt_args,
418422

419423
return map;
420424
}
425+
PRAGMA_DIAG_POP
421426

422427
#define __ this->
423428

src/hotspot/cpu/x86/frame_x86.inline.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
230230

231231
// Compiled frames
232232

233+
// Register is a class, but it would be assigned numerical value.
234+
// "0" is assigned for rax. Thus we need to ignore -Wnonnull.
235+
PRAGMA_DIAG_PUSH
236+
PRAGMA_NONNULL_IGNORED
233237
inline oop frame::saved_oop_result(RegisterMap* map) const {
234238
oop* result_adr = (oop *)map->location(rax->as_VMReg());
235239
guarantee(result_adr != NULL, "bad register save location");
@@ -243,5 +247,6 @@ inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
243247

244248
*result_adr = obj;
245249
}
250+
PRAGMA_DIAG_POP
246251

247252
#endif // CPU_X86_FRAME_X86_INLINE_HPP

src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ class ZSaveLiveRegisters {
465465
_spill_offset += 8;
466466
}
467467

468+
// Register is a class, but it would be assigned numerical value.
469+
// "0" is assigned for rax. Thus we need to ignore -Wnonnull.
470+
PRAGMA_DIAG_PUSH
471+
PRAGMA_NONNULL_IGNORED
468472
void initialize(ZLoadBarrierStubC2* stub) {
469473
// Create mask of caller saved registers that need to
470474
// be saved/restored if live
@@ -540,6 +544,7 @@ class ZSaveLiveRegisters {
540544
// Stack pointer must be 16 bytes aligned for the call
541545
_spill_offset = _spill_size = align_up(xmm_spill_size + gp_spill_size + opmask_spill_size + arg_spill_size, 16);
542546
}
547+
PRAGMA_DIAG_POP
543548

544549
public:
545550
ZSaveLiveRegisters(MacroAssembler* masm, ZLoadBarrierStubC2* stub) :

0 commit comments

Comments
 (0)