Skip to content

Commit 505b13d

Browse files
authored
Merge pull request #2159 from SAP/pr-jdk-27+6
Merge to tag jdk-27+6
2 parents 7013a4d + 70ee280 commit 505b13d

File tree

355 files changed

+11066
-4785
lines changed

Some content is hidden

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

355 files changed

+11066
-4785
lines changed

make/hotspot/lib/CompileGtest.gmk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2026, 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
@@ -61,7 +61,8 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
6161
INCLUDE_FILES := gtest-all.cc gmock-all.cc, \
6262
DISABLED_WARNINGS_gcc := format-nonliteral maybe-uninitialized undef \
6363
unused-result zero-as-null-pointer-constant, \
64-
DISABLED_WARNINGS_clang := format-nonliteral undef unused-result, \
64+
DISABLED_WARNINGS_clang := format-nonliteral undef unused-result \
65+
zero-as-null-pointer-constant, \
6566
DISABLED_WARNINGS_microsoft := 4530, \
6667
DEFAULT_CFLAGS := false, \
6768
CFLAGS := $(JVM_CFLAGS) \

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
44
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
55
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -722,22 +722,20 @@ void SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm,
722722

723723
// Class initialization barrier for static methods
724724
entry_address[AdapterBlob::C2I_No_Clinit_Check] = nullptr;
725-
if (VM_Version::supports_fast_class_init_checks()) {
726-
Label L_skip_barrier;
725+
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
726+
Label L_skip_barrier;
727727

728-
{ // Bypass the barrier for non-static methods
729-
__ ldrh(rscratch1, Address(rmethod, Method::access_flags_offset()));
730-
__ andsw(zr, rscratch1, JVM_ACC_STATIC);
731-
__ br(Assembler::EQ, L_skip_barrier); // non-static
732-
}
728+
// Bypass the barrier for non-static methods
729+
__ ldrh(rscratch1, Address(rmethod, Method::access_flags_offset()));
730+
__ andsw(zr, rscratch1, JVM_ACC_STATIC);
731+
__ br(Assembler::EQ, L_skip_barrier); // non-static
733732

734-
__ load_method_holder(rscratch2, rmethod);
735-
__ clinit_barrier(rscratch2, rscratch1, &L_skip_barrier);
736-
__ far_jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub()));
733+
__ load_method_holder(rscratch2, rmethod);
734+
__ clinit_barrier(rscratch2, rscratch1, &L_skip_barrier);
735+
__ far_jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub()));
737736

738-
__ bind(L_skip_barrier);
739-
entry_address[AdapterBlob::C2I_No_Clinit_Check] = __ pc();
740-
}
737+
__ bind(L_skip_barrier);
738+
entry_address[AdapterBlob::C2I_No_Clinit_Check] = __ pc();
741739

742740
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
743741
bs->c2i_entry_barrier(masm);
@@ -1508,7 +1506,8 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
15081506
// SVC, HVC, or SMC. Make it a NOP.
15091507
__ nop();
15101508

1511-
if (VM_Version::supports_fast_class_init_checks() && method->needs_clinit_barrier()) {
1509+
if (method->needs_clinit_barrier()) {
1510+
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
15121511
Label L_skip_barrier;
15131512
__ mov_metadata(rscratch2, method->method_holder()); // InstanceKlass*
15141513
__ clinit_barrier(rscratch2, rscratch1, &L_skip_barrier);

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -2290,7 +2290,8 @@ void TemplateTable::resolve_cache_and_index_for_method(int byte_no,
22902290
__ subs(zr, temp, (int) code); // have we resolved this bytecode?
22912291

22922292
// Class initialization barrier for static methods
2293-
if (VM_Version::supports_fast_class_init_checks() && bytecode() == Bytecodes::_invokestatic) {
2293+
if (bytecode() == Bytecodes::_invokestatic) {
2294+
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
22942295
__ br(Assembler::NE, L_clinit_barrier_slow);
22952296
__ ldr(temp, Address(Rcache, in_bytes(ResolvedMethodEntry::method_offset())));
22962297
__ load_method_holder(temp, temp);
@@ -2340,8 +2341,8 @@ void TemplateTable::resolve_cache_and_index_for_field(int byte_no,
23402341
__ subs(zr, temp, (int) code); // have we resolved this bytecode?
23412342

23422343
// Class initialization barrier for static fields
2343-
if (VM_Version::supports_fast_class_init_checks() &&
2344-
(bytecode() == Bytecodes::_getstatic || bytecode() == Bytecodes::_putstatic)) {
2344+
if (bytecode() == Bytecodes::_getstatic || bytecode() == Bytecodes::_putstatic) {
2345+
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
23452346
const Register field_holder = temp;
23462347

23472348
__ br(Assembler::NE, L_clinit_barrier_slow);

src/hotspot/cpu/arm/frame_arm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2026, 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
@@ -356,10 +356,10 @@ frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
356356
bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
357357
assert(is_interpreted_frame(), "Not an interpreted frame");
358358
// These are reasonable sanity checks
359-
if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) {
359+
if (fp() == nullptr || (intptr_t(fp()) & (wordSize-1)) != 0) {
360360
return false;
361361
}
362-
if (sp() == 0 || (intptr_t(sp()) & (wordSize-1)) != 0) {
362+
if (sp() == nullptr || (intptr_t(sp()) & (wordSize-1)) != 0) {
363363
return false;
364364
}
365365
if (fp() + interpreter_frame_initial_sp_offset < sp()) {

src/hotspot/cpu/arm/nativeInst_arm_32.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2026, 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
@@ -172,7 +172,7 @@ void NativeMovConstReg::set_data(intptr_t x, address pc) {
172172

173173
address addr = oop_addr != nullptr ? (address)oop_addr : (address)metadata_addr;
174174

175-
if(pc == 0) {
175+
if (pc == nullptr) {
176176
offset = addr - instruction_address() - 8;
177177
} else {
178178
offset = addr - pc - 8;
@@ -228,7 +228,7 @@ void NativeMovConstReg::set_data(intptr_t x, address pc) {
228228

229229
void NativeMovConstReg::set_pc_relative_offset(address addr, address pc) {
230230
int offset;
231-
if (pc == 0) {
231+
if (pc == nullptr) {
232232
offset = addr - instruction_address() - 8;
233233
} else {
234234
offset = addr - pc - 8;

src/hotspot/cpu/arm/nativeInst_arm_32.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2026, 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
@@ -371,7 +371,7 @@ class NativeMovConstReg: public NativeInstruction {
371371
public:
372372

373373
intptr_t data() const;
374-
void set_data(intptr_t x, address pc = 0);
374+
void set_data(intptr_t x, address pc = nullptr);
375375
bool is_pc_relative() {
376376
return !is_movw();
377377
}

src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,11 @@ void InterpreterMacroAssembler::verify_method_data_pointer() {
11091109
lhz(R11_scratch1, in_bytes(DataLayout::bci_offset()), R28_mdx);
11101110
ld(R12_scratch2, in_bytes(Method::const_offset()), R19_method);
11111111
addi(R11_scratch1, R11_scratch1, in_bytes(ConstMethod::codes_offset()));
1112-
add(R11_scratch1, R12_scratch2, R12_scratch2);
1112+
add(R11_scratch1, R11_scratch1, R12_scratch2);
11131113
cmpd(CR0, R11_scratch1, R14_bcp);
11141114
beq(CR0, verify_continue);
11151115

1116-
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::verify_mdp ), R19_method, R14_bcp, R28_mdx);
1116+
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::verify_mdp), R19_method, R14_bcp, R28_mdx);
11171117

11181118
bind(verify_continue);
11191119
#endif

src/hotspot/cpu/ppc/macroAssembler_ppc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4535,7 +4535,7 @@ void MacroAssembler::push_cont_fastpath() {
45354535
Label done;
45364536
ld_ptr(R0, JavaThread::cont_fastpath_offset(), R16_thread);
45374537
cmpld(CR0, R1_SP, R0);
4538-
ble(CR0, done);
4538+
ble(CR0, done); // if (SP <= _cont_fastpath) goto done;
45394539
st_ptr(R1_SP, JavaThread::cont_fastpath_offset(), R16_thread);
45404540
bind(done);
45414541
}
@@ -4546,7 +4546,7 @@ void MacroAssembler::pop_cont_fastpath() {
45464546
Label done;
45474547
ld_ptr(R0, JavaThread::cont_fastpath_offset(), R16_thread);
45484548
cmpld(CR0, R1_SP, R0);
4549-
ble(CR0, done);
4549+
blt(CR0, done); // if (SP < _cont_fastpath) goto done;
45504550
li(R0, 0);
45514551
st_ptr(R0, JavaThread::cont_fastpath_offset(), R16_thread);
45524552
bind(done);

src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -1237,26 +1237,24 @@ void SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm,
12371237

12381238
// Class initialization barrier for static methods
12391239
entry_address[AdapterBlob::C2I_No_Clinit_Check] = nullptr;
1240-
if (VM_Version::supports_fast_class_init_checks()) {
1241-
Label L_skip_barrier;
1240+
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
1241+
Label L_skip_barrier;
12421242

1243-
{ // Bypass the barrier for non-static methods
1244-
__ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method);
1245-
__ andi_(R0, R0, JVM_ACC_STATIC);
1246-
__ beq(CR0, L_skip_barrier); // non-static
1247-
}
1243+
// Bypass the barrier for non-static methods
1244+
__ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method);
1245+
__ andi_(R0, R0, JVM_ACC_STATIC);
1246+
__ beq(CR0, L_skip_barrier); // non-static
12481247

1249-
Register klass = R11_scratch1;
1250-
__ load_method_holder(klass, R19_method);
1251-
__ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/);
1248+
Register klass = R11_scratch1;
1249+
__ load_method_holder(klass, R19_method);
1250+
__ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/);
12521251

1253-
__ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0);
1254-
__ mtctr(klass);
1255-
__ bctr();
1252+
__ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0);
1253+
__ mtctr(klass);
1254+
__ bctr();
12561255

1257-
__ bind(L_skip_barrier);
1258-
entry_address[AdapterBlob::C2I_No_Clinit_Check] = __ pc();
1259-
}
1256+
__ bind(L_skip_barrier);
1257+
entry_address[AdapterBlob::C2I_No_Clinit_Check] = __ pc();
12601258

12611259
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
12621260
bs->c2i_entry_barrier(masm, /* tmp register*/ ic_klass, /* tmp register*/ receiver_klass, /* tmp register*/ code);
@@ -2210,7 +2208,8 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
22102208
// --------------------------------------------------------------------------
22112209
vep_start_pc = (intptr_t)__ pc();
22122210

2213-
if (VM_Version::supports_fast_class_init_checks() && method->needs_clinit_barrier()) {
2211+
if (method->needs_clinit_barrier()) {
2212+
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
22142213
Label L_skip_barrier;
22152214
Register klass = r_temp_1;
22162215
// Notify OOP recorder (don't need the relocation)

src/hotspot/cpu/ppc/templateTable_ppc_64.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2026, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2013, 2025 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -2199,7 +2199,8 @@ void TemplateTable::resolve_cache_and_index_for_method(int byte_no, Register Rca
21992199
__ isync(); // Order load wrt. succeeding loads.
22002200

22012201
// Class initialization barrier for static methods
2202-
if (VM_Version::supports_fast_class_init_checks() && bytecode() == Bytecodes::_invokestatic) {
2202+
if (bytecode() == Bytecodes::_invokestatic) {
2203+
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
22032204
const Register method = Rscratch;
22042205
const Register klass = Rscratch;
22052206

@@ -2244,8 +2245,8 @@ void TemplateTable::resolve_cache_and_index_for_field(int byte_no, Register Rcac
22442245
__ isync(); // Order load wrt. succeeding loads.
22452246

22462247
// Class initialization barrier for static fields
2247-
if (VM_Version::supports_fast_class_init_checks() &&
2248-
(bytecode() == Bytecodes::_getstatic || bytecode() == Bytecodes::_putstatic)) {
2248+
if (bytecode() == Bytecodes::_getstatic || bytecode() == Bytecodes::_putstatic) {
2249+
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
22492250
const Register field_holder = R4_ARG2;
22502251

22512252
// InterpreterRuntime::resolve_get_put sets field_holder and finally release-stores put_code.

0 commit comments

Comments
 (0)