Skip to content

Commit 40c9e9c

Browse files
Merge tag 'jdk-24+7' into labsjdk/automation-7-18-2024-242
Added tag jdk-24+7 for changeset 21a6cf8
2 parents 32231c6 + 21a6cf8 commit 40c9e9c

File tree

264 files changed

+3978
-2192
lines changed

Some content is hidden

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

264 files changed

+3978
-2192
lines changed

make/Docs.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# This code is free software; you can redistribute it and/or modify it
@@ -714,7 +714,7 @@ SPEC_HEADER_BLOCK := \
714714
<div class="navbar"> \
715715
<div>$(HEADER_RIGHT_SIDE_INFO)</div> \
716716
<nav><ul><li><a href="PATH_TO_SPECS/../api/index.html">API</a> \
717-
<li><a href="PATH_TO_SPECS/index.html">OTHER SPECIFICATIONS \
717+
<li><a href="PATH_TO_SPECS/index.html">OTHER SPECIFICATIONS</a> \
718718
<li><a href="PATH_TO_SPECS/man/index.html">TOOL GUIDES</a></ul></nav> \
719719
</div> \
720720
</header>

make/InitSupport.gmk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ ifeq ($(HAS_SPEC),)
6363

6464
# The variable MAKEOVERRIDES contains variable assignments from the command
6565
# line, but in reverse order to what the user entered.
66-
# The '\#' <=> '\ 'dance is needed to keep values with space in them connected.
67-
COMMAND_LINE_VARIABLES := $(subst \#,\ , $(call reverse, $(subst \ ,\#,$(MAKEOVERRIDES))))
66+
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
67+
COMMAND_LINE_VARIABLES := $(subst §,\ , $(call reverse, $(subst \ ,§,$(MAKEOVERRIDES))))
6868

6969
# A list like FOO="val1" BAR="val2" containing all user-supplied make
7070
# variables that we should propagate.
71-
# The '\#' <=> '\ 'dance is needed to keep values with space in them connected.
72-
USER_MAKE_VARS := $(subst \#,\ , $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \
73-
$(subst \ ,\#,$(MAKEOVERRIDES))))
71+
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
72+
USER_MAKE_VARS := $(subst §,\ , $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \
73+
$(subst \ ,§,$(MAKEOVERRIDES))))
7474

7575
# Setup information about available configurations, if any.
7676
ifneq ($(CUSTOM_ROOT), )

make/hotspot/lib/JvmFeatures.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ ifneq ($(call check-jvm-feature, jvmti), true)
8484
jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
8585
jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
8686
jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
87-
jvmtiClassFileReconstituter.cpp jvmtiTagMapTable.cpp jvmtiAgent.cpp jvmtiAgentList.cpp
87+
jvmtiClassFileReconstituter.cpp jvmtiTagMapTable.cpp jvmtiAgent.cpp jvmtiAgentList.cpp jfrJvmtiAgent.cpp
8888
endif
8989

9090
ifneq ($(call check-jvm-feature, jvmci), true)

make/jdk/src/classes/build/tools/fixuppandoc/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2024, 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
@@ -638,7 +638,7 @@ void write(PrintWriter out) {
638638
index++;
639639
}
640640
boolean updateEndTd = false;
641-
Pattern styleAttr = Pattern.compile("(?<before>.*style=\")(?<style>[^\"]*)(?<after>\".*)");
641+
Pattern styleAttr = Pattern.compile("(?s)(?<before>.*style=\")(?<style>[^\"]*)(?<after>\".*)");
642642
for (Entry e : entries) {
643643
if (simple && e.column == maxIndex) {
644644
String attrs = e.html.substring(3, e.html.length() - 1);

make/jdk/src/classes/build/tools/taglet/SealedGraph.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2024, 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
@@ -107,7 +107,7 @@ public String toString(List<? extends DocTree> tags, Element element) {
107107
throw new RuntimeException(e);
108108
}
109109

110-
String simpleTypeName = element.getSimpleName().toString();
110+
String simpleTypeName = packagelessCanonicalName(typeElement).replace('.', '/');
111111
String imageFile = simpleTypeName + "-sealed-graph.svg";
112112
int thumbnailHeight = 100; // also appears in the stylesheet
113113
String hoverImage = "<span>"
@@ -315,14 +315,14 @@ private static Optional<String> packageName(TypeElement element) {
315315
case MEMBER -> packageName((TypeElement) element.getEnclosingElement());
316316
};
317317
}
318+
}
318319

319-
private static String packagelessCanonicalName(TypeElement element) {
320-
String result = element.getSimpleName().toString();
321-
while (element.getNestingKind() == NestingKind.MEMBER) {
322-
element = (TypeElement) element.getEnclosingElement();
323-
result = element.getSimpleName().toString() + '.' + result;
324-
}
325-
return result;
320+
private static String packagelessCanonicalName(TypeElement element) {
321+
String result = element.getSimpleName().toString();
322+
while (element.getNestingKind() == NestingKind.MEMBER) {
323+
element = (TypeElement) element.getEnclosingElement();
324+
result = element.getSimpleName().toString() + '.' + result;
326325
}
326+
return result;
327327
}
328328
}

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3360,7 +3360,7 @@ encode %{
33603360
}
33613361
%}
33623362

3363-
/// mov envcodings
3363+
// mov encodings
33643364

33653365
enc_class aarch64_enc_movw_imm(iRegI dst, immI src) %{
33663366
uint32_t con = (uint32_t)$src$$constant;

src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2024, 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
*
@@ -76,4 +76,6 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
7676

7777
#define USE_POINTERS_TO_REGISTER_IMPL_ARRAY
7878

79+
#define USE_TRAMPOLINE_STUB_FIX_OWNER
80+
7981
#endif // CPU_AARCH64_GLOBALDEFINITIONS_AARCH64_HPP

src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -51,13 +51,18 @@ void NativeInstruction::wrote(int offset) {
5151
}
5252

5353
address NativeCall::destination() const {
54-
address addr = (address)this;
55-
address destination = instruction_address() + displacement();
54+
address addr = instruction_address();
55+
address destination = addr + displacement();
56+
57+
// Performance optimization: no need to call find_blob() if it is a self-call
58+
if (destination == addr) {
59+
return destination;
60+
}
5661

5762
// Do we use a trampoline stub for this call?
5863
CodeBlob* cb = CodeCache::find_blob(addr);
59-
assert(cb && cb->is_nmethod(), "sanity");
60-
nmethod *nm = (nmethod *)cb;
64+
assert(cb != nullptr && cb->is_nmethod(), "nmethod expected");
65+
nmethod *nm = cb->as_nmethod();
6166
if (nm->stub_contains(destination) && is_NativeCallTrampolineStub_at(destination)) {
6267
// Yes we do, so get the destination from the trampoline stub.
6368
const address trampoline_stub_addr = destination;
@@ -72,12 +77,8 @@ address NativeCall::destination() const {
7277
// call instruction at all times.
7378
//
7479
// Used in the runtime linkage of calls; see class CompiledIC.
75-
//
76-
// Add parameter assert_lock to switch off assertion
77-
// during code generation, where no patching lock is needed.
78-
void NativeCall::set_destination_mt_safe(address dest, bool assert_lock) {
79-
assert(!assert_lock ||
80-
(Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) ||
80+
void NativeCall::set_destination_mt_safe(address dest) {
81+
assert((Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) ||
8182
CompiledICLocker::is_safe(addr_at(0)),
8283
"concurrent code patching");
8384

@@ -104,22 +105,18 @@ void NativeCall::set_destination_mt_safe(address dest, bool assert_lock) {
104105
}
105106

106107
address NativeCall::get_trampoline() {
107-
address call_addr = addr_at(0);
108+
address call_addr = instruction_address();
108109

109110
CodeBlob *code = CodeCache::find_blob(call_addr);
110-
assert(code != nullptr, "Could not find the containing code blob");
111+
assert(code != nullptr && code->is_nmethod(), "nmethod expected");
112+
nmethod* nm = code->as_nmethod();
111113

112-
address bl_destination
113-
= MacroAssembler::pd_call_destination(call_addr);
114-
if (code->contains(bl_destination) &&
114+
address bl_destination = call_addr + displacement();
115+
if (nm->stub_contains(bl_destination) &&
115116
is_NativeCallTrampolineStub_at(bl_destination))
116117
return bl_destination;
117118

118-
if (code->is_nmethod()) {
119-
return trampoline_stub_Relocation::get_trampoline_for(call_addr, (nmethod*)code);
120-
}
121-
122-
return nullptr;
119+
return trampoline_stub_Relocation::get_trampoline_for(call_addr, nm);
123120
}
124121

125122
// Inserts a native call instruction at a given pc

src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2108, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -174,6 +174,7 @@ class NativeCall: public NativeInstruction {
174174
int displacement() const { return (int_at(displacement_offset) << 6) >> 4; }
175175
address displacement_address() const { return addr_at(displacement_offset); }
176176
address return_address() const { return addr_at(return_address_offset); }
177+
address raw_destination() const { return instruction_address() + displacement(); }
177178
address destination() const;
178179

179180
void set_destination(address dest) {
@@ -213,9 +214,7 @@ class NativeCall: public NativeInstruction {
213214
//
214215
// Used in the runtime linkage of calls; see class CompiledIC.
215216
// (Cf. 4506997 and 4479829, where threads witnessed garbage displacements.)
216-
217-
// The parameter assert_lock disables the assertion during code generation.
218-
void set_destination_mt_safe(address dest, bool assert_lock = true);
217+
void set_destination_mt_safe(address dest);
219218

220219
address get_trampoline();
221220
#if INCLUDE_JVMCI

src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,12 @@ void Relocation::pd_set_data_value(address x, bool verify_only) {
6060

6161
address Relocation::pd_call_destination(address orig_addr) {
6262
assert(is_call(), "should be a call here");
63-
if (NativeCall::is_call_at(addr())) {
64-
address trampoline = nativeCall_at(addr())->get_trampoline();
65-
if (trampoline) {
66-
return nativeCallTrampolineStub_at(trampoline)->destination();
63+
if (orig_addr == nullptr) {
64+
if (NativeCall::is_call_at(addr())) {
65+
NativeCall* call = nativeCall_at(addr());
66+
return call->destination();
6767
}
68-
}
69-
if (orig_addr != nullptr) {
68+
} else {
7069
address new_addr = MacroAssembler::pd_call_destination(orig_addr);
7170
// If call is branch to self, don't try to relocate it, just leave it
7271
// as branch to self. This happens during code generation if the code
@@ -82,16 +81,26 @@ address Relocation::pd_call_destination(address orig_addr) {
8281
void Relocation::pd_set_call_destination(address x) {
8382
assert(is_call(), "should be a call here");
8483
if (NativeCall::is_call_at(addr())) {
85-
address trampoline = nativeCall_at(addr())->get_trampoline();
86-
if (trampoline) {
87-
nativeCall_at(addr())->set_destination_mt_safe(x, /* assert_lock */false);
88-
return;
89-
}
84+
NativeCall* call = nativeCall_at(addr());
85+
call->set_destination(x);
86+
} else {
87+
MacroAssembler::pd_patch_instruction(addr(), x);
9088
}
91-
MacroAssembler::pd_patch_instruction(addr(), x);
9289
assert(pd_call_destination(addr()) == x, "fail in reloc");
9390
}
9491

92+
void trampoline_stub_Relocation::pd_fix_owner_after_move() {
93+
NativeCall* call = nativeCall_at(owner());
94+
assert(call->raw_destination() == owner(), "destination should be empty");
95+
address trampoline = addr();
96+
address dest = nativeCallTrampolineStub_at(trampoline)->destination();
97+
if (!Assembler::reachable_from_branch_at(owner(), dest)) {
98+
dest = trampoline;
99+
}
100+
call->set_destination(dest);
101+
}
102+
103+
95104
address* Relocation::pd_address_in_code() {
96105
return (address*)(addr() + 8);
97106
}

0 commit comments

Comments
 (0)