Skip to content

Commit d6ba8ff

Browse files
authored
Merge pull request #2224 from SAP/pr-jdk-27+19
Merge to tag jdk-27+19
2 parents c70080d + 2fe7ae9 commit d6ba8ff

566 files changed

Lines changed: 9093 additions & 3083 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: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ NashornProfile.txt
2424
/.gdbinit
2525
/.lldbinit
2626
**/core.[0-9]*
27-
*.rej
28-
*.orig
2927
test/benchmarks/**/target
3028
/src/hotspot/CMakeLists.txt
3129
/src/hotspot/compile_commands.json

make/Docs.gmk

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 1997, 2026, 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
@@ -93,19 +93,16 @@ JAVADOC_DISABLED_DOCLINT_WARNINGS := missing
9393
JAVADOC_DISABLED_DOCLINT_PACKAGES := org.w3c.* javax.smartcardio
9494

9595
# The initial set of options for javadoc
96-
# -XDaccessInternalAPI is a temporary workaround, see 8373909
9796
JAVADOC_OPTIONS := -use -keywords -notimestamp \
9897
-serialwarn -encoding utf-8 -docencoding utf-8 -breakiterator \
9998
-splitIndex --system none -javafx --expand-requires transitive \
100-
--override-methods=summary \
101-
-XDaccessInternalAPI
99+
--override-methods=summary
102100

103101
# The reference options must stay stable to allow for comparisons across the
104102
# development cycle.
105103
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
106104
-serialwarn -encoding utf-8 -breakiterator -splitIndex --system none \
107-
-html5 -javafx --expand-requires transitive \
108-
-XDaccessInternalAPI
105+
-html5 -javafx --expand-requires transitive
109106

110107
# Should we add DRAFT stamps to the generated javadoc?
111108
ifeq ($(VERSION_IS_GA), true)

make/RunTests.gmk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,9 @@ define SetupRunJtregTestBody
10201020
VM_OPTIONS := $$(JTREG_ALL_OPTIONS) ))
10211021
$$(call LogWarn, AOT_JDK_CACHE=$$($1_AOT_JDK_CACHE))
10221022
$1_JTREG_BASIC_OPTIONS += -vmoption:-XX:AOTCache="$$($1_AOT_JDK_CACHE)"
1023+
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
1024+
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-AotJdk.txt) \
1025+
))
10231026
endif
10241027

10251028

make/hotspot/lib/CompileGtest.gmk

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ else
4545
GTEST_COPY_DEBUG_SYMBOLS := false
4646
endif
4747

48+
GTEST_LIBJVM_CFLAGS := $(JVM_CFLAGS)
49+
# Decoder does not work with debuginfo of the gtest libjvm when sections are used,
50+
# so we get wrong file names. That's why we filter out the section flags.
51+
ifeq ($(ENABLE_LINKTIME_GC), true)
52+
ifeq ($(TOOLCHAIN_TYPE), gcc)
53+
GTEST_LIBJVM_CFLAGS := $(filter-out -ffunction-sections -fdata-sections, $(JVM_CFLAGS))
54+
endif
55+
endif
56+
4857
################################################################################
4958
## Build libgtest
5059
################################################################################
@@ -99,7 +108,7 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
99108
EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
100109
EXTRA_OBJECT_FILES := $(BUILD_LIBJVM_ALL_OBJS), \
101110
DEFAULT_CFLAGS := false, \
102-
CFLAGS := $(JVM_CFLAGS) \
111+
CFLAGS := $(GTEST_LIBJVM_CFLAGS) \
103112
-DHOTSPOT_GTEST \
104113
-I$(GTEST_FRAMEWORK_SRC)/googletest/include \
105114
-I$(GTEST_FRAMEWORK_SRC)/googlemock/include \

make/hotspot/lib/CompileJvm.gmk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
209209
DISABLED_WARNINGS_gcc_jvmtiTagMap.cpp := stringop-overflow, \
210210
DISABLED_WARNINGS_gcc_macroAssembler_ppc_sha.cpp := unused-const-variable, \
211211
DISABLED_WARNINGS_gcc_postaloc.cpp := address, \
212+
DISABLED_WARNINGS_gcc_safepointMechanism.cpp := stringop-overflow, \
213+
DISABLED_WARNINGS_gcc_shenandoahGenerationalHeap.cpp := stringop-overflow, \
212214
DISABLED_WARNINGS_gcc_shenandoahLock.cpp := stringop-overflow, \
213215
DISABLED_WARNINGS_gcc_stubGenerator_s390.cpp := unused-const-variable, \
214216
DISABLED_WARNINGS_gcc_synchronizer.cpp := stringop-overflow, \

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

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525

2626
package build.tools.taglet;
2727

28+
import java.net.URI;
2829
import java.util.EnumSet;
2930
import java.util.List;
3031
import java.util.Set;
3132
import java.util.regex.Matcher;
3233
import java.util.regex.Pattern;
3334
import java.util.stream.Collectors;
34-
import java.lang.reflect.Field;
3535

3636
import javax.lang.model.element.Element;
3737

@@ -141,6 +141,11 @@ public String getName() {
141141

142142
@Override
143143
public String toString(List<? extends DocTree> tags, Element elem) {
144+
throw new UnsupportedOperationException();
145+
}
146+
147+
// @Override - requires JDK-8373922 in build JDK
148+
public String toString(List<? extends DocTree> tags, Element elem, URI docRoot) {
144149

145150
if (tags.isEmpty())
146151
return "";
@@ -177,7 +182,7 @@ public String toString(List<? extends DocTree> tags, Element elem) {
177182
String preview = m.group("preview"); // null if no preview feature
178183
String chapter = m.group("chapter");
179184
String section = m.group("section");
180-
String rootParent = currentPath().replaceAll("[^/]+", "..");
185+
String rootParent = docRoot.resolve("..").toString();
181186

182187
String url = preview == null ?
183188
String.format("%1$s/specs/%2$s/%2$s-%3$s.html#%2$s-%3$s%4$s",
@@ -230,23 +235,6 @@ public String toString(List<? extends DocTree> tags, Element elem) {
230235
return sb.toString();
231236
}
232237

233-
private static ThreadLocal<String> CURRENT_PATH = null;
234-
235-
private String currentPath() {
236-
if (CURRENT_PATH == null) {
237-
try {
238-
Field f = Class.forName("jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter")
239-
.getField("CURRENT_PATH");
240-
@SuppressWarnings("unchecked")
241-
ThreadLocal<String> tl = (ThreadLocal<String>) f.get(null);
242-
CURRENT_PATH = tl;
243-
} catch (ReflectiveOperationException e) {
244-
throw new RuntimeException("Cannot determine current path", e);
245-
}
246-
}
247-
return CURRENT_PATH.get();
248-
}
249-
250238
private String expand(List<? extends DocTree> trees) {
251239
return (new SimpleDocTreeVisitor<StringBuilder, StringBuilder>() {
252240
public StringBuilder defaultAction(DocTree tree, StringBuilder sb) {

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

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232

3333
import javax.lang.model.element.*;
3434
import javax.lang.model.type.DeclaredType;
35+
import javax.lang.model.util.Elements;
3536
import java.io.IOException;
37+
import java.net.URI;
3638
import java.nio.file.Files;
3739
import java.nio.file.Path;
3840
import java.util.*;
@@ -78,16 +80,27 @@ public void init(DocletEnvironment env, Doclet doclet) {
7880

7981
@Override
8082
public String toString(List<? extends DocTree> tags, Element element) {
83+
throw new UnsupportedOperationException();
84+
}
85+
86+
// @Override - requires JDK-8373922 in build JDK
87+
public String toString(List<? extends DocTree> tags, Element element, URI docRoot) {
8188
if (sealedDotOutputDir == null || sealedDotOutputDir.isEmpty()) {
8289
return "";
8390
}
8491
if (docletEnvironment == null || !(element instanceof TypeElement typeElement)) {
8592
return "";
8693
}
8794

88-
ModuleElement module = docletEnvironment.getElementUtils().getModuleOf(element);
95+
Elements util = docletEnvironment.getElementUtils();
96+
ModuleElement module = util.getModuleOf(element);
97+
98+
// '.' in .DOT file name is converted to '/' in .SVG path, so we use '-' as separator for nested classes.
99+
// module_package.subpackage.Outer-Inner.dot => module/package/subpackage/Outer-Inner-sealed-graph.svg
89100
Path dotFile = Path.of(sealedDotOutputDir,
90-
module.getQualifiedName() + "_" + typeElement.getQualifiedName() + ".dot");
101+
module.getQualifiedName() + "_"
102+
+ util.getPackageOf(element).getQualifiedName() + "."
103+
+ packagelessCanonicalName(typeElement).replace(".", "-") + ".dot");
91104

92105
Set<String> exports = module.getDirectives().stream()
93106
.filter(ModuleElement.ExportsDirective.class::isInstance)
@@ -99,16 +112,16 @@ public String toString(List<? extends DocTree> tags, Element element) {
99112
.map(Objects::toString)
100113
.collect(Collectors.toUnmodifiableSet());
101114

102-
String dotContent = new Renderer().graph(typeElement, exports);
115+
String dotContent = new Renderer().graph(typeElement, exports, docRoot);
103116

104117
try {
105118
Files.writeString(dotFile, dotContent, WRITE, CREATE, TRUNCATE_EXISTING);
106119
} catch (IOException e) {
107120
throw new RuntimeException(e);
108121
}
109122

110-
String simpleTypeName = packagelessCanonicalName(typeElement).replace('.', '/');
111-
String imageFile = simpleTypeName + "-sealed-graph.svg";
123+
String simpleTypeName = packagelessCanonicalName(typeElement);
124+
String imageFile = simpleTypeName.replace(".", "-") + "-sealed-graph.svg";
112125
int thumbnailHeight = 100; // also appears in the stylesheet
113126
String hoverImage = "<span>"
114127
+ getImage(simpleTypeName, imageFile, -1, true)
@@ -137,12 +150,12 @@ private String getImage(String typeName, String file, int height, boolean useBor
137150
private final class Renderer {
138151

139152
// Generates a graph in DOT format
140-
String graph(TypeElement rootClass, Set<String> exports) {
153+
String graph(TypeElement rootClass, Set<String> exports, URI pathToRoot) {
141154
if (!isInPublicApi(rootClass, exports)) {
142155
// Alternatively we can return "" for the graph since there is no single root to render
143156
throw new IllegalArgumentException("Root not in public API: " + rootClass.getQualifiedName());
144157
}
145-
final State state = new State(rootClass);
158+
final State state = new State(pathToRoot);
146159
traverse(state, rootClass, exports);
147160
return state.render();
148161
}
@@ -168,7 +181,7 @@ private final class State {
168181
private static final String TOOLTIP = "tooltip";
169182
private static final String LINK = "href";
170183

171-
private final TypeElement rootNode;
184+
private final URI pathToRoot;
172185

173186
private final StringBuilder builder;
174187

@@ -193,8 +206,8 @@ public String valueString() {
193206
}
194207
}
195208

196-
public State(TypeElement rootNode) {
197-
this.rootNode = rootNode;
209+
public State(URI pathToRoot) {
210+
this.pathToRoot = pathToRoot;
198211
nodeStyleMap = new LinkedHashMap<>();
199212
builder = new StringBuilder()
200213
.append("digraph G {")
@@ -217,24 +230,15 @@ public void addNode(TypeElement node) {
217230
var styles = nodeStyleMap.computeIfAbsent(id(node), n -> new LinkedHashMap<>());
218231
styles.put(LABEL, new StyleItem.PlainString(node.getSimpleName().toString()));
219232
styles.put(TOOLTIP, new StyleItem.PlainString(node.getQualifiedName().toString()));
220-
styles.put(LINK, new StyleItem.PlainString(relativeLink(node)));
233+
styles.put(LINK, new StyleItem.PlainString(pathToRoot.resolve(relativeLink(node)).toString()));
221234
}
222235

223-
// A permitted class must be in the same package or in the same module.
224-
// This implies the module is always the same.
225236
private String relativeLink(TypeElement node) {
226237
var util = SealedGraph.this.docletEnvironment.getElementUtils();
227-
var nodePackage = util.getPackageOf(node);
228-
// Note: SVG files for nested types use the simple names of containing types as parent directories.
229-
// We therefore need to convert all dots in the qualified name to "../" below.
230-
var backNavigator = rootNode.getQualifiedName().toString().chars()
231-
.filter(c -> c == '.')
232-
.mapToObj(c -> "../")
233-
.collect(joining());
234-
var forwardNavigator = nodePackage.getQualifiedName().toString()
235-
.replace(".", "/");
236-
237-
return backNavigator + forwardNavigator + "/" + packagelessCanonicalName(node) + ".html";
238+
var path = util.getModuleOf(node).getQualifiedName().toString() + "/"
239+
+ util.getPackageOf(node).getQualifiedName().toString().replace(".", "/");
240+
241+
return path + "/" + packagelessCanonicalName(node) + ".html";
238242
}
239243

240244
public void addEdge(TypeElement node, TypeElement subNode) {
@@ -286,14 +290,6 @@ private String id(TypeElement node) {
286290
private String quotedId(TypeElement node) {
287291
return "\"" + id(node) + "\"";
288292
}
289-
290-
private String simpleName(String name) {
291-
int lastDot = name.lastIndexOf('.');
292-
return lastDot < 0
293-
? name
294-
: name.substring(lastDot);
295-
}
296-
297293
}
298294

299295
private static List<TypeElement> permittedSubclasses(TypeElement node, Set<String> exports) {

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

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 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
@@ -25,13 +25,13 @@
2525

2626
package build.tools.taglet;
2727

28+
import java.net.URI;
2829
import java.util.EnumSet;
2930
import java.util.List;
3031
import java.util.Set;
3132
import java.util.regex.Matcher;
3233
import java.util.regex.Pattern;
3334
import java.util.stream.Collectors;
34-
import java.lang.reflect.Field;
3535

3636
import javax.lang.model.element.Element;
3737

@@ -91,6 +91,11 @@ public String getName() {
9191

9292
@Override
9393
public String toString(List<? extends DocTree> tags, Element elem) {
94+
throw new UnsupportedOperationException();
95+
}
96+
97+
// @Override - requires JDK-8373922 in build JDK
98+
public String toString(List<? extends DocTree> tags, Element elem, URI docRoot) {
9499

95100
if (tags.isEmpty())
96101
return "";
@@ -118,7 +123,7 @@ public String toString(List<? extends DocTree> tags, Element elem) {
118123
if (label.isEmpty()) {
119124
label = name;
120125
}
121-
String rootParent = currentPath().replaceAll("[^/]+", "..");
126+
String rootParent = docRoot.resolve("..").toString();
122127

123128
String url = String.format("%s/%s/%s.html",
124129
rootParent, BASE_URL, name);
@@ -141,22 +146,4 @@ public String toString(List<? extends DocTree> tags, Element elem) {
141146

142147
return sb.toString();
143148
}
144-
145-
private static ThreadLocal<String> CURRENT_PATH = null;
146-
147-
private String currentPath() {
148-
if (CURRENT_PATH == null) {
149-
try {
150-
Field f = Class.forName("jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter")
151-
.getField("CURRENT_PATH");
152-
@SuppressWarnings("unchecked")
153-
ThreadLocal<String> tl = (ThreadLocal<String>) f.get(null);
154-
CURRENT_PATH = tl;
155-
} catch (ReflectiveOperationException e) {
156-
throw new RuntimeException("Cannot determine current path", e);
157-
}
158-
}
159-
return CURRENT_PATH.get();
160-
}
161-
162149
}

make/modules/java.desktop/lib/ClientLibraries.gmk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
395395
AccelGlyphCache.c, \
396396
CFLAGS := $(LIBFONTMANAGER_CFLAGS), \
397397
CXXFLAGS := $(LIBFONTMANAGER_CFLAGS), \
398+
CXXFLAGS_gcc := -fno-rtti -fno-exceptions, \
399+
CXXFLAGS_clang := -fno-rtti -fno-exceptions, \
398400
OPTIMIZATION := HIGHEST, \
399401
CFLAGS_windows = -DCC_NOEX, \
400402
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7708,10 +7708,11 @@ instruct bytes_reverse_unsigned_short(iRegINoSp dst, iRegIorL2I src) %{
77087708
match(Set dst (ReverseBytesUS src));
77097709

77107710
ins_cost(INSN_COST);
7711-
format %{ "rev16w $dst, $src" %}
7711+
format %{ "rev16w $dst, $src\t# $dst -> unsigned short" %}
77127712

77137713
ins_encode %{
77147714
__ rev16w(as_Register($dst$$reg), as_Register($src$$reg));
7715+
__ narrow_subword_type(as_Register($dst$$reg), T_CHAR);
77157716
%}
77167717

77177718
ins_pipe(ialu_reg);

0 commit comments

Comments
 (0)