Skip to content

Commit 9876945

Browse files
Merge branch 'master' into JDK-8333664
2 parents 8a4ff1f + 0cb355e commit 9876945

File tree

718 files changed

+20863
-7648
lines changed

Some content is hidden

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

718 files changed

+20863
-7648
lines changed

doc/building.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h2 id="operating-system-requirements">Operating System
376376
</tr>
377377
<tr class="odd">
378378
<td>macOS</td>
379-
<td>macOS 13.x (Ventura)</td>
379+
<td>macOS 14.x</td>
380380
</tr>
381381
<tr class="even">
382382
<td>Windows</td>
@@ -513,8 +513,8 @@ <h3 id="macos">macOS</h3>
513513
a continuously updated machine running macOS. See the section on <a
514514
href="#apple-xcode">Apple Xcode</a> on some strategies to deal with
515515
this.</p>
516-
<p>It is recommended that you use at least macOS 13 (Ventura) and Xcode
517-
14, but earlier versions may also work.</p>
516+
<p>It is recommended that you use at least macOS 14 and Xcode 15.4, but
517+
earlier versions may also work.</p>
518518
<p>The standard macOS environment contains the basic tooling needed to
519519
build, but for external libraries a package manager is recommended. The
520520
JDK uses <a href="https://brew.sh/">homebrew</a> in the examples, but
@@ -590,7 +590,7 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler
590590
</tr>
591591
<tr class="even">
592592
<td>macOS</td>
593-
<td>Apple Xcode 14.3.1 (using clang 14.0.3)</td>
593+
<td>Apple Xcode 15.4 (using clang 15.0.0)</td>
594594
</tr>
595595
<tr class="odd">
596596
<td>Windows</td>

doc/building.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ time of writing.
175175
| ----------------- | ---------------------------------- |
176176
| Linux/x64 | Oracle Enterprise Linux 6.4 / 8.x |
177177
| Linux/aarch64 | Oracle Enterprise Linux 7.6 / 8.x |
178-
| macOS | macOS 13.x (Ventura) |
178+
| macOS | macOS 14.x |
179179
| Windows | Windows Server 2016 |
180180

181181
The double version numbers for Linux are due to the hybrid model used at
@@ -327,7 +327,7 @@ difficult for a project such as the JDK to keep pace with a continuously
327327
updated machine running macOS. See the section on [Apple Xcode](#apple-xcode)
328328
on some strategies to deal with this.
329329

330-
It is recommended that you use at least macOS 13 (Ventura) and Xcode 14, but
330+
It is recommended that you use at least macOS 14 and Xcode 15.4, but
331331
earlier versions may also work.
332332

333333
The standard macOS environment contains the basic tooling needed to build, but
@@ -393,7 +393,7 @@ issues.
393393
| Operating system | Toolchain version |
394394
| ------------------ | -------------------------------------------- |
395395
| Linux | gcc 14.2.0 |
396-
| macOS | Apple Xcode 14.3.1 (using clang 14.0.3) |
396+
| macOS | Apple Xcode 15.4 (using clang 15.0.0) |
397397
| Windows | Microsoft Visual Studio 2022 version 17.13.2 |
398398

399399
All compilers are expected to be able to handle the C11 language standard for

make/conf/jib-profiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ var getJibProfilesDependencies = function (input, common) {
10891089

10901090
var devkit_platform_revisions = {
10911091
linux_x64: "gcc14.2.0-OL6.4+1.0",
1092-
macosx: "Xcode14.3.1+1.0",
1092+
macosx: "Xcode15.4+1.0",
10931093
windows_x64: "VS2022-17.13.2+1.0",
10941094
linux_aarch64: "gcc14.2.0-OL7.6+1.0",
10951095
linux_arm: "gcc8.2.0-Fedora27+1.0",

make/devkit/createAutoconfBundle.sh

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -e
22
#
3-
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
44
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
#
66
# This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,21 @@
2424
# questions.
2525
#
2626

27-
# Create a bundle in the current directory, containing what's needed to run
27+
# Create a bundle in OpenJDK build folder, containing what's needed to run
2828
# the 'autoconf' program by the OpenJDK build. To override TARGET_PLATFORM
2929
# just set the variable before running this script.
3030

31+
# This script fetches sources from network so make sure your proxy is setup appropriately.
32+
33+
# colored print to highlight some of the logs
34+
function print_log()
35+
{
36+
Color_Cyan='\033[1;36m' # Cyan
37+
Color_Off='\033[0m' # Reset color
38+
printf "${Color_Cyan}> $1${Color_Off}\n"
39+
}
40+
41+
3142
# Autoconf depends on m4, so download and build that first.
3243
AUTOCONF_VERSION=2.69
3344
M4_VERSION=1.4.18
@@ -58,11 +69,12 @@ MODULE_NAME=autoconf-$TARGET_PLATFORM-$AUTOCONF_VERSION+$PACKAGE_VERSION
5869
BUNDLE_NAME=$MODULE_NAME.tar.gz
5970

6071
SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
61-
OUTPUT_ROOT="${SCRIPT_DIR}/../../build/autoconf"
72+
BASEDIR="$(cd "$SCRIPT_DIR/../.." > /dev/null && pwd)"
73+
OUTPUT_ROOT="$BASEDIR/build/autoconf"
6274

63-
cd $OUTPUT_ROOT
6475
IMAGE_DIR=$OUTPUT_ROOT/$MODULE_NAME
6576
mkdir -p $IMAGE_DIR/usr
77+
cd $OUTPUT_ROOT
6678

6779
# Download and build m4
6880

@@ -76,7 +88,7 @@ elif test "x$TARGET_PLATFORM" = xcygwin_x86; then
7688
cp /usr/bin/m4 $IMAGE_DIR/usr/bin
7789
elif test "x$TARGET_PLATFORM" = xlinux_x64; then
7890
M4_VERSION=1.4.13-5
79-
wget http://yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/m4-$M4_VERSION.el6.x86_64.rpm
91+
wget https://yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/m4-$M4_VERSION.el6.x86_64.rpm
8092
cd $IMAGE_DIR
8193
rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.x86_64.rpm | cpio -d -i
8294
elif test "x$TARGET_PLATFORM" = xlinux_x86; then
@@ -85,27 +97,38 @@ elif test "x$TARGET_PLATFORM" = xlinux_x86; then
8597
cd $IMAGE_DIR
8698
rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.i686.rpm | cpio -d -i
8799
else
100+
print_log "m4: download"
88101
wget https://ftp.gnu.org/gnu/m4/m4-$M4_VERSION.tar.gz
89-
tar xzf m4-$M4_VERSION.tar.gz
102+
tar -xzf m4-$M4_VERSION.tar.gz
90103
cd m4-$M4_VERSION
104+
print_log "m4: configure"
91105
./configure --prefix=$IMAGE_DIR/usr CFLAGS="-w -Wno-everything"
106+
print_log "m4: make"
92107
make
108+
print_log "m4: make install"
93109
make install
94110
cd ..
95111
fi
96112

97113
# Download and build autoconf
98114

115+
print_log "autoconf: download"
99116
wget https://ftp.gnu.org/gnu/autoconf/autoconf-$AUTOCONF_VERSION.tar.gz
100-
tar xzf autoconf-$AUTOCONF_VERSION.tar.gz
117+
tar -xzf autoconf-$AUTOCONF_VERSION.tar.gz
101118
cd autoconf-$AUTOCONF_VERSION
119+
print_log "autoconf: configure"
102120
./configure --prefix=$IMAGE_DIR/usr M4=$IMAGE_DIR/usr/bin/m4
121+
print_log "autoconf: make"
103122
make
123+
print_log "autoconf: make install"
104124
make install
105125
cd ..
106126

127+
# The resulting scripts from installation folder use absolute paths to reference other files within installation folder
128+
print_log "replace absolue paths from installation files with a relative ."
107129
perl -pi -e "s!$IMAGE_DIR/!./!" $IMAGE_DIR/usr/bin/auto* $IMAGE_DIR/usr/share/autoconf/autom4te.cfg
108130

131+
print_log "creating $IMAGE_DIR/autoconf wrapper script"
109132
cat > $IMAGE_DIR/autoconf << EOF
110133
#!/bin/bash
111134
# Get an absolute path to this script
@@ -123,6 +146,9 @@ PREPEND_INCLUDE="--prepend-include \$this_script_dir/usr/share/autoconf"
123146
124147
exec \$this_script_dir/usr/bin/autoconf \$PREPEND_INCLUDE "\$@"
125148
EOF
149+
126150
chmod +x $IMAGE_DIR/autoconf
151+
152+
print_log "archiving $IMAGE_DIR directory as $OUTPUT_ROOT/$BUNDLE_NAME"
127153
cd $IMAGE_DIR
128154
tar -cvzf $OUTPUT_ROOT/$BUNDLE_NAME *

make/hotspot/lib/JvmFeatures.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ endif
125125
ifneq ($(call check-jvm-feature, cds), true)
126126
JVM_CFLAGS_FEATURES += -DINCLUDE_CDS=0
127127
JVM_EXCLUDE_FILES += \
128+
aotCodeCache.cpp \
128129
classLoaderDataShared.cpp \
129130
classLoaderExt.cpp \
130131
systemDictionaryShared.cpp

make/jdk/src/classes/build/tools/classlist/HelloClasslist.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
*/
3232
package build.tools.classlist;
3333

34-
import java.lang.foreign.FunctionDescriptor;
35-
import java.lang.foreign.Linker;
3634
import java.lang.invoke.MethodHandle;
3735
import java.lang.invoke.MethodHandles;
3836
import java.lang.invoke.MethodType;
@@ -174,10 +172,6 @@ record B(int b) { }
174172
// an inconsistency in the classlist between builds (see JDK-8295951).
175173
// To avoid the problem, load the class explicitly.
176174
Class<?> striped64Class = Class.forName("java.util.concurrent.atomic.Striped64$Cell");
177-
178-
// Initialize FFM linkers
179-
var signature = FunctionDescriptor.ofVoid();
180-
Linker.nativeLinker().downcallHandle(signature);
181175
}
182176

183177
public HelloClasslist() {}

src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static char* reserve_at_eor_compatible_address(size_t size, bool aslr) {
7070
const uint64_t immediate = ((uint64_t)immediates[index]) << 32;
7171
assert(immediate > 0 && Assembler::operand_valid_for_logical_immediate(/*is32*/false, immediate),
7272
"Invalid immediate %d " UINT64_FORMAT, index, immediate);
73-
result = os::attempt_reserve_memory_at((char*)immediate, size, false);
73+
result = os::attempt_reserve_memory_at((char*)immediate, size, mtNone);
7474
if (result == nullptr) {
7575
log_trace(metaspace, map)("Failed to attach at " UINT64_FORMAT_X, immediate);
7676
}
@@ -114,7 +114,7 @@ char* CompressedKlassPointers::reserve_address_space_for_compressed_classes(size
114114
if (result == nullptr) {
115115
constexpr size_t alignment = nth_bit(32);
116116
log_debug(metaspace, map)("Trying to reserve at a 32-bit-aligned address");
117-
result = os::reserve_memory_aligned(size, alignment, false);
117+
result = os::reserve_memory_aligned(size, alignment, mtNone);
118118
}
119119

120120
return result;

src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -46,7 +46,7 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
4646
#define DEFAULT_CACHE_LINE_SIZE 64
4747

4848
// The default padding size for data structures to avoid false sharing.
49-
#define DEFAULT_PADDING_SIZE DEFAULT_CACHE_LINE_SIZE
49+
#define DEFAULT_PADDING_SIZE (2*DEFAULT_CACHE_LINE_SIZE)
5050

5151
// According to the ARMv8 ARM, "Concurrent modification and execution
5252
// of instructions can lead to the resulting instruction performing

src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ bool CodeInstaller::pd_relocate(address pc, jint mark) {
180180
case POLL_RETURN_FAR:
181181
_instructions->relocate(pc, relocInfo::poll_return_type);
182182
return true;
183+
#if INCLUDE_ZGC
183184
case Z_BARRIER_RELOCATION_FORMAT_LOAD_GOOD_BEFORE_TB_X:
184185
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatLoadGoodBeforeTbX);
185186
return true;
@@ -192,6 +193,7 @@ bool CodeInstaller::pd_relocate(address pc, jint mark) {
192193
case Z_BARRIER_RELOCATION_FORMAT_STORE_BAD_BEFORE_MOV:
193194
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatStoreBadBeforeMov);
194195
return true;
196+
#endif
195197

196198
}
197199
return false;

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,9 @@ void MacroAssembler::set_last_Java_frame(Register last_java_sp,
675675
}
676676

677677
static inline bool target_needs_far_branch(address addr) {
678+
if (AOTCodeCache::is_on_for_dump()) {
679+
return true;
680+
}
678681
// codecache size <= 128M
679682
if (!MacroAssembler::far_branches()) {
680683
return false;
@@ -859,6 +862,9 @@ void MacroAssembler::call_VM_helper(Register oop_result, address entry_point, in
859862

860863
// Check the entry target is always reachable from any branch.
861864
static bool is_always_within_branch_range(Address entry) {
865+
if (AOTCodeCache::is_on_for_dump()) {
866+
return false;
867+
}
862868
const address target = entry.target();
863869

864870
if (!CodeCache::contains(target)) {
@@ -2154,7 +2160,7 @@ void MacroAssembler::call_VM_leaf_base(address entry_point,
21542160

21552161
stp(rscratch1, rmethod, Address(pre(sp, -2 * wordSize)));
21562162

2157-
mov(rscratch1, entry_point);
2163+
mov(rscratch1, RuntimeAddress(entry_point));
21582164
blr(rscratch1);
21592165
if (retaddr)
21602166
bind(*retaddr);
@@ -3231,9 +3237,13 @@ void MacroAssembler::resolve_global_jobject(Register value, Register tmp1, Regis
32313237
}
32323238

32333239
void MacroAssembler::stop(const char* msg) {
3234-
BLOCK_COMMENT(msg);
3240+
// Skip AOT caching C strings in scratch buffer.
3241+
const char* str = (code_section()->scratch_emit()) ? msg : AOTCodeCache::add_C_string(msg);
3242+
BLOCK_COMMENT(str);
3243+
// load msg into r0 so we can access it from the signal handler
3244+
// ExternalAddress enables saving and restoring via the code cache
3245+
lea(c_rarg0, ExternalAddress((address) str));
32353246
dcps1(0xdeae);
3236-
emit_int64((uintptr_t)msg);
32373247
}
32383248

32393249
void MacroAssembler::unimplemented(const char* what) {

0 commit comments

Comments
 (0)