Skip to content

Commit 9323b86

Browse files
authored
Merge pull request #2197 from SAP/pr-jdk-27+12
Merge to tag jdk-27+12
2 parents 6fc49ee + 6c7c0db commit 9323b86

658 files changed

Lines changed: 16622 additions & 10010 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ NashornProfile.txt
1616
**/JTreport/**
1717
**/JTwork/**
1818
/src/utils/LogCompilation/target/
19+
/src/utils/LogCompilation/logc.jar
1920
/.project/
2021
/.settings/
2122
/compile_commands.json

make/PreInit.gmk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2012, 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
@@ -66,7 +66,8 @@ CALLED_SPEC_TARGETS := $(filter-out $(ALL_GLOBAL_TARGETS), $(CALLED_TARGETS))
6666
ifeq ($(CALLED_SPEC_TARGETS), )
6767
SKIP_SPEC := true
6868
endif
69-
ifeq ($(findstring p, $(MAKEFLAGS))$(findstring q, $(MAKEFLAGS)), pq)
69+
MFLAGS_SINGLE := $(filter-out --%, $(MFLAGS))
70+
ifeq ($(findstring p, $(MFLAGS_SINGLE))$(findstring q, $(MFLAGS_SINGLE)), pq)
7071
SKIP_SPEC := true
7172
endif
7273

make/autoconf/lib-bundled.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ AC_DEFUN_ONCE([LIB_SETUP_ZLIB],
267267
LIBZ_LIBS=""
268268
if test "x$USE_EXTERNAL_LIBZ" = "xfalse"; then
269269
LIBZ_CFLAGS="$LIBZ_CFLAGS -I$TOPDIR/src/java.base/share/native/libzip/zlib"
270-
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
271-
LIBZ_CFLAGS="$LIBZ_CFLAGS -DHAVE_UNISTD_H"
270+
if test "x$OPENJDK_TARGET_OS" = xmacosx -o "x$OPENJDK_TARGET_OS" = xaix -o "x$OPENJDK_TARGET_OS" = xlinux; then
271+
LIBZ_CFLAGS="$LIBZ_CFLAGS -DHAVE_UNISTD_H=1 -DHAVE_STDARG_H=1"
272272
fi
273273
else
274274
LIBZ_LIBS="-lz"

make/hotspot/lib/CompileGtest.gmk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
6363
unused-result zero-as-null-pointer-constant, \
6464
DISABLED_WARNINGS_clang := format-nonliteral undef unused-result \
6565
zero-as-null-pointer-constant, \
66+
$(comment Disable deprecated-declarations warnings to workaround) \
67+
$(comment clang18+glibc12 bug https://github.com/llvm/llvm-project/issues/76515) \
68+
$(comment until the clang bug has been fixed) \
69+
DISABLED_WARNINGS_clang_gtest-all.cc := deprecated-declarations, \
6670
DISABLED_WARNINGS_microsoft := 4530, \
6771
DEFAULT_CFLAGS := false, \
6872
CFLAGS := $(JVM_CFLAGS) \

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3403,11 +3403,13 @@ encode %{
34033403
} else if (rtype == relocInfo::metadata_type) {
34043404
__ mov_metadata(dst_reg, (Metadata*)con);
34053405
} else {
3406-
assert(rtype == relocInfo::none, "unexpected reloc type");
3406+
assert(rtype == relocInfo::none || rtype == relocInfo::external_word_type, "unexpected reloc type");
3407+
// load fake address constants using a normal move
34073408
if (! __ is_valid_AArch64_address(con) ||
34083409
con < (address)(uintptr_t)os::vm_page_size()) {
34093410
__ mov(dst_reg, con);
34103411
} else {
3412+
// no reloc so just use adrp and add
34113413
uint64_t offset;
34123414
__ adrp(dst_reg, con, offset);
34133415
__ add(dst_reg, dst_reg, offset);
@@ -4535,6 +4537,18 @@ operand immP_1()
45354537
interface(CONST_INTER);
45364538
%}
45374539

4540+
// AOT Runtime Constants Address
4541+
operand immAOTRuntimeConstantsAddress()
4542+
%{
4543+
// Check if the address is in the range of AOT Runtime Constants
4544+
predicate(AOTRuntimeConstants::contains((address)(n->get_ptr())));
4545+
match(ConP);
4546+
4547+
op_cost(0);
4548+
format %{ %}
4549+
interface(CONST_INTER);
4550+
%}
4551+
45384552
// Float and Double operands
45394553
// Double Immediate
45404554
operand immD()
@@ -6898,6 +6912,20 @@ instruct loadConP1(iRegPNoSp dst, immP_1 con)
68986912
ins_pipe(ialu_imm);
68996913
%}
69006914

6915+
instruct loadAOTRCAddress(iRegPNoSp dst, immAOTRuntimeConstantsAddress con)
6916+
%{
6917+
match(Set dst con);
6918+
6919+
ins_cost(INSN_COST);
6920+
format %{ "adr $dst, $con\t# AOT Runtime Constants Address" %}
6921+
6922+
ins_encode %{
6923+
__ load_aotrc_address($dst$$Register, (address)$con$$constant);
6924+
%}
6925+
6926+
ins_pipe(ialu_imm);
6927+
%}
6928+
69016929
// Load Narrow Pointer Constant
69026930

69036931
instruct loadConN(iRegNNoSp dst, immN con)

src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "c1/c1_ValueStack.hpp"
3434
#include "ci/ciArrayKlass.hpp"
3535
#include "ci/ciInstance.hpp"
36+
#include "code/aotCodeCache.hpp"
3637
#include "code/compiledIC.hpp"
3738
#include "gc/shared/collectedHeap.hpp"
3839
#include "gc/shared/gc_globals.hpp"
@@ -532,6 +533,15 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod
532533

533534
case T_LONG: {
534535
assert(patch_code == lir_patch_none, "no patching handled here");
536+
#if INCLUDE_CDS
537+
if (AOTCodeCache::is_on_for_dump()) {
538+
address b = c->as_pointer();
539+
if (AOTRuntimeConstants::contains(b)) {
540+
__ load_aotrc_address(dest->as_register_lo(), b);
541+
break;
542+
}
543+
}
544+
#endif
535545
__ mov(dest->as_register_lo(), (intptr_t)c->as_jlong());
536546
break;
537547
}

src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424

2525
#include "asm/macroAssembler.inline.hpp"
26+
#include "code/aotCodeCache.hpp"
2627
#include "gc/g1/g1BarrierSet.hpp"
2728
#include "gc/g1/g1BarrierSetAssembler.hpp"
2829
#include "gc/g1/g1BarrierSetRuntime.hpp"
@@ -243,9 +244,25 @@ static void generate_post_barrier(MacroAssembler* masm,
243244
assert_different_registers(store_addr, new_val, thread, tmp1, tmp2, noreg, rscratch1);
244245

245246
// Does store cross heap regions?
246-
__ eor(tmp1, store_addr, new_val); // tmp1 := store address ^ new value
247-
__ lsr(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes)
248-
__ cbz(tmp1, done);
247+
#if INCLUDE_CDS
248+
// AOT code needs to load the barrier grain shift from the aot
249+
// runtime constants area in the code cache otherwise we can compile
250+
// it as an immediate operand
251+
if (AOTCodeCache::is_on_for_dump()) {
252+
address grain_shift_address = (address)AOTRuntimeConstants::grain_shift_address();
253+
__ eor(tmp1, store_addr, new_val);
254+
__ lea(tmp2, ExternalAddress(grain_shift_address));
255+
__ ldrb(tmp2, tmp2);
256+
__ lsrv(tmp1, tmp1, tmp2);
257+
__ cbz(tmp1, done);
258+
} else
259+
#endif
260+
{
261+
__ eor(tmp1, store_addr, new_val); // tmp1 := store address ^ new value
262+
__ lsr(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes)
263+
__ cbz(tmp1, done);
264+
}
265+
249266
// Crosses regions, storing null?
250267
if (new_val_may_be_null) {
251268
__ cbz(new_val, done);

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5754,13 +5754,35 @@ void MacroAssembler::adrp(Register reg1, const Address &dest, uint64_t &byte_off
57545754
}
57555755

57565756
void MacroAssembler::load_byte_map_base(Register reg) {
5757+
#if INCLUDE_CDS
5758+
if (AOTCodeCache::is_on_for_dump()) {
5759+
address byte_map_base_adr = AOTRuntimeConstants::card_table_base_address();
5760+
lea(reg, ExternalAddress(byte_map_base_adr));
5761+
ldr(reg, Address(reg));
5762+
return;
5763+
}
5764+
#endif
57575765
CardTableBarrierSet* ctbs = CardTableBarrierSet::barrier_set();
57585766

57595767
// Strictly speaking the card table base isn't an address at all, and it might
57605768
// even be negative. It is thus materialised as a constant.
57615769
mov(reg, (uint64_t)ctbs->card_table_base_const());
57625770
}
57635771

5772+
void MacroAssembler::load_aotrc_address(Register reg, address a) {
5773+
#if INCLUDE_CDS
5774+
assert(AOTRuntimeConstants::contains(a), "address out of range for data area");
5775+
if (AOTCodeCache::is_on_for_dump()) {
5776+
// all aotrc field addresses should be registered in the AOTCodeCache address table
5777+
lea(reg, ExternalAddress(a));
5778+
} else {
5779+
mov(reg, (uint64_t)a);
5780+
}
5781+
#else
5782+
ShouldNotReachHere();
5783+
#endif
5784+
}
5785+
57645786
void MacroAssembler::build_frame(int framesize) {
57655787
assert(framesize >= 2 * wordSize, "framesize must include space for FP/LR");
57665788
assert(framesize % (2*wordSize) == 0, "must preserve 2*wordSize alignment");

src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,9 @@ class MacroAssembler: public Assembler {
14761476
// Load the base of the cardtable byte map into reg.
14771477
void load_byte_map_base(Register reg);
14781478

1479+
// Load a constant address in the AOT Runtime Constants area
1480+
void load_aotrc_address(Register reg, address a);
1481+
14791482
// Prolog generator routines to support switch between x86 code and
14801483
// generated ARM code
14811484

src/hotspot/cpu/aarch64/vm_version_aarch64.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ void VM_Version::initialize() {
446446
FLAG_SET_DEFAULT(BlockZeroingLowLimit, 4 * VM_Version::zva_length());
447447
}
448448
} else if (UseBlockZeroing) {
449-
warning("DC ZVA is not available on this CPU");
449+
if (!FLAG_IS_DEFAULT(UseBlockZeroing)) {
450+
warning("DC ZVA is not available on this CPU");
451+
}
450452
FLAG_SET_DEFAULT(UseBlockZeroing, false);
451453
}
452454

0 commit comments

Comments
 (0)