Skip to content

Commit c83c22e

Browse files
committed
Merge branch 'master' into jdk-8336881-metrics-systemd-slice
2 parents ceffcfc + 1f45797 commit c83c22e

File tree

1,046 files changed

+24144
-17936
lines changed

Some content is hidden

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

1,046 files changed

+24144
-17936
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -325,17 +325,6 @@ jobs:
325325
bootjdk-platform: linux-x64
326326
runs-on: ubuntu-22.04
327327

328-
test-macos-x64:
329-
name: macos-x64
330-
needs:
331-
- build-macos-x64
332-
uses: ./.github/workflows/test.yml
333-
with:
334-
platform: macos-x64
335-
bootjdk-platform: macos-x64
336-
runs-on: macos-13
337-
xcode-toolset-version: '14.3.1'
338-
339328
test-macos-aarch64:
340329
name: macos-aarch64
341330
needs:

.jcheck/conf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jbs=JDK
44
version=25
55

66
[checks]
7-
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
7+
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists,copyright
88
warning=issuestitle,binary
99

1010
[repository]
@@ -34,3 +34,8 @@ pattern=^([124-8][0-9]{6}): (\S.*)$
3434

3535
[checks "problemlists"]
3636
dirs=test/jdk|test/langtools|test/lib-test|test/hotspot/jtreg|test/jaxp
37+
38+
[checks "copyright"]
39+
files=^(?!LICENSE|license\.txt|.*\.bin|.*\.gif|.*\.jpg|.*\.png|.*\.icon|.*\.tiff|.*\.dat|.*\.patch|.*\.wav|.*\.class|.*-header|.*\.jar|).*
40+
oracle_locator=.*Copyright \(c\)(.*)Oracle and/or its affiliates\. All rights reserved\.
41+
oracle_validator=.*Copyright \(c\) (\d{4})(?:, (\d{4}))?, Oracle and/or its affiliates\. All rights reserved\.

doc/hotspot-unit-tests.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ <h3 id="error-messages">Error messages</h3>
245245
<p>All GoogleTest asserts print compared expressions and their values,
246246
so there is no need to have them in error messages. Asserts print only
247247
compared values, they do not print any of interim variables, e.g.
248-
<code>ASSERT_TRUE((val1 == val2 &amp;&amp; isFail(foo(8)) || i == 18)</code>
248+
<code>ASSERT_TRUE((val1 == val2 &amp;&amp; isFail(foo(8))) || i == 18)</code>
249249
prints only one value. If you use some complex predicates, please
250250
consider <code>EXPECT_PRED*</code> or <code>EXPECT_FORMAT_PRED</code>
251251
assertions family, they check that a predicate returns true/success and

doc/hotspot-unit-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Provide informative, but not too verbose error messages.
172172
All GoogleTest asserts print compared expressions and their values, so
173173
there is no need to have them in error messages. Asserts print only
174174
compared values, they do not print any of interim variables, e.g.
175-
`ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)` prints only
175+
`ASSERT_TRUE((val1 == val2 && isFail(foo(8))) || i == 18)` prints only
176176
one value. If you use some complex predicates, please consider
177177
`EXPECT_PRED*` or `EXPECT_FORMAT_PRED` assertions family, they check that
178178
a predicate returns true/success and print out all parameters values.

make/Main.gmk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,10 @@ endif
13101310
################################################################################
13111311

13121312
# all-images builds all our deliverables as images.
1313-
all-images: product-images static-jdk-image test-image all-docs-images
1313+
all-images: product-images test-image all-docs-images
1314+
ifeq ($(call isTargetOs, linux macosx windows), true)
1315+
all-images: static-jdk-image
1316+
endif
13141317

13151318
# all-bundles packages all our deliverables as tar.gz bundles.
13161319
all-bundles: product-bundles test-bundles docs-bundles static-libs-bundles

make/autoconf/flags-cflags.m4

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
237237
# Additional warnings that are not activated by -Wall and -Wextra
238238
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wreturn-type -Wsign-compare \
239239
-Wtrampolines -Wundef -Wunused-const-variable=1 -Wunused-function \
240-
-Wunused-result -Wunused-value"
240+
-Wunused-result -Wunused-value -Wtype-limits -Wuninitialized"
241241
WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
242242
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
243243
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
@@ -754,10 +754,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
754754
fi
755755
756756
if test "x$TOOLCHAIN_TYPE" = xgcc; then
757-
FLAGS_SETUP_GCC6_COMPILER_FLAGS($1, $3)
758-
$1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}"
759-
760-
$1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
757+
# This flag is required since GCC 6 as undefined behavior in OpenJDK code
758+
# runs afoul of the more aggressive versions of this optimization.
759+
$1_TOOLCHAIN_CFLAGS="-fno-lifetime-dse"
761760
fi
762761
763762
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
@@ -831,6 +830,22 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
831830
832831
FLAGS_SETUP_BRANCH_PROTECTION
833832
833+
if test "x$FLAGS_CPU" = xriscv64; then
834+
AC_MSG_CHECKING([if RVV/vector sigcontext supported])
835+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <linux/ptrace.h>],
836+
[
837+
return (int)sizeof(struct __riscv_v_ext_state);
838+
])],
839+
[
840+
AC_MSG_RESULT([yes])
841+
],
842+
[
843+
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -DNO_RVV_SIGCONTEXT"
844+
AC_MSG_RESULT([no])
845+
]
846+
)
847+
fi
848+
834849
# EXPORT to API
835850
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
836851
$TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \
@@ -919,20 +934,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
919934
AC_SUBST($2SVE_CFLAGS)
920935
])
921936

922-
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
923-
# Arguments:
924-
# $1 - Prefix for each variable defined.
925-
# $2 - Prefix for compiler variables (either BUILD_ or nothing).
926-
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
927-
[
928-
# This flag is required for GCC 6 builds as undefined behavior in OpenJDK code
929-
# runs afoul of the more aggressive versions of this optimization.
930-
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
931-
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG],
932-
PREFIX: $2, IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
933-
$1_GCC6_CFLAGS="${NO_LIFETIME_DSE_CFLAG}"
934-
])
935-
936937
AC_DEFUN_ONCE([FLAGS_SETUP_BRANCH_PROTECTION],
937938
[
938939
# Is branch protection available?

make/conf/jib-profiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ var getJibProfilesProfiles = function (input, common, data) {
780780
target_os: input.build_os,
781781
target_cpu: input.build_cpu,
782782
dependencies: [
783-
"boot_jdk", "devkit", "graphviz", "pandoc", buildJdkDep,
783+
"autoconf", "boot_jdk", "devkit", "graphviz", "pandoc", buildJdkDep,
784784
],
785785
configure_args: concat(
786786
"--enable-full-docs",

make/hotspot/lib/CompileJvm.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ CFLAGS_VM_VERSION := \
9090
# Disabled warnings
9191

9292
DISABLED_WARNINGS_gcc := array-bounds comment delete-non-virtual-dtor \
93-
empty-body implicit-fallthrough int-in-bool-context \
93+
empty-body format-zero-length implicit-fallthrough int-in-bool-context \
9494
maybe-uninitialized missing-field-initializers \
9595
shift-negative-value unknown-pragmas unused-but-set-variable \
9696
unused-local-typedefs unused-variable

make/jdk/src/classes/build/tools/depend/Depend.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 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
@@ -446,7 +446,7 @@ public Void visitType(TypeElement e, Void p) {
446446
}
447447

448448
@Override
449-
public Void visitRecordComponent(@SuppressWarnings("preview")RecordComponentElement e, Void p) {
449+
public Void visitRecordComponent(RecordComponentElement e, Void p) {
450450
update(e.getSimpleName());
451451
visit(e.asType());
452452
return null;

make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ public class CreateSymbols {
228228
/**Create sig files for ct.sym reading the classes description from the directory that contains
229229
* {@code ctDescriptionFile}, using the file as a recipe to create the sigfiles.
230230
*/
231-
@SuppressWarnings("unchecked")
232231
public void createSymbols(String ctDescriptionFileExtra, String ctDescriptionFile, String ctSymLocation,
233232
long timestamp, String currentVersion, String preReleaseTag, String moduleClasses,
234233
String includedModulesFile) throws IOException {
@@ -4634,7 +4633,6 @@ private static AnnotationDescription parseAnnotation(String value, int[] valuePo
46344633
/**Create sig files for ct.sym reading the classes description from the directory that contains
46354634
* {@code ctDescriptionFile}, using the file as a recipe to create the sigfiles.
46364635
*/
4637-
@SuppressWarnings("unchecked")
46384636
public void createJavadocData(String ctDescriptionFileExtra, String ctDescriptionFile,
46394637
String targetDir, int startVersion) throws IOException {
46404638
LoadDescriptions data = load(ctDescriptionFileExtra != null ? Paths.get(ctDescriptionFileExtra)

make/langtools/tools/propertiesparser/gen/ClassGenerator.java

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import java.util.Collections;
4949
import java.util.List;
5050
import java.util.Map;
51+
import java.util.Map.Entry;
5152
import java.util.Properties;
5253
import java.util.Set;
5354
import java.util.TreeMap;
@@ -87,9 +88,12 @@ enum StubKind {
8788
FACTORY_METHOD_DECL("factory.decl.method"),
8889
FACTORY_METHOD_ARG("factory.decl.method.arg"),
8990
FACTORY_METHOD_BODY("factory.decl.method.body"),
91+
FACTORY_METHOD_BODY_LINT("factory.decl.method.body.lint"),
9092
FACTORY_FIELD("factory.decl.field"),
93+
FACTORY_FIELD_LINT("factory.decl.field.lint"),
9194
WILDCARDS_EXTENDS("wildcards.extends"),
92-
SUPPRESS_WARNINGS("suppress.warnings");
95+
SUPPRESS_WARNINGS("suppress.warnings"),
96+
LINT_CATEGORY("lint.category");
9397

9498
/** stub key (as it appears in the property file) */
9599
String key;
@@ -114,6 +118,7 @@ String format(Object... args) {
114118
enum FactoryKind {
115119
ERR("err", "Error", "Errors"),
116120
WARN("warn", "Warning", "Warnings"),
121+
LINT_WARN("warn", "LintWarning", "LintWarnings"),
117122
NOTE("note", "Note", "Notes"),
118123
MISC("misc", "Fragment", "Fragments"),
119124
OTHER(null, null, null);
@@ -136,13 +141,24 @@ enum FactoryKind {
136141
/**
137142
* Utility method for parsing a factory kind from a resource key prefix.
138143
*/
139-
static FactoryKind parseFrom(String prefix) {
144+
static FactoryKind of(Entry<String, Message> messageEntry) {
145+
String prefix = messageEntry.getKey().split("\\.")[1];
146+
FactoryKind selected = null;
140147
for (FactoryKind k : FactoryKind.values()) {
141148
if (k.prefix == null || k.prefix.equals(prefix)) {
142-
return k;
149+
selected = k;
150+
break;
143151
}
144152
}
145-
return null;
153+
if (selected == WARN) {
154+
for (MessageLine line : messageEntry.getValue().getLines(false)) {
155+
if (line.isLint()) {
156+
selected = LINT_WARN;
157+
break;
158+
}
159+
}
160+
}
161+
return selected;
146162
}
147163
}
148164

@@ -155,7 +171,7 @@ public void generateFactory(MessageFile messageFile, File outDir) {
155171
messageFile.messages.entrySet().stream()
156172
.collect(
157173
Collectors.groupingBy(
158-
e -> FactoryKind.parseFrom(e.getKey().split("\\.")[1]),
174+
FactoryKind::of,
159175
TreeMap::new,
160176
toList()));
161177
//generate nested classes
@@ -165,7 +181,7 @@ public void generateFactory(MessageFile messageFile, File outDir) {
165181
if (entry.getKey() == FactoryKind.OTHER) continue;
166182
//emit members
167183
String members = entry.getValue().stream()
168-
.flatMap(e -> generateFactoryMethodsAndFields(e.getKey(), e.getValue()).stream())
184+
.flatMap(e -> generateFactoryMethodsAndFields(entry.getKey(), e.getKey(), e.getValue()).stream())
169185
.collect(Collectors.joining("\n\n"));
170186
//emit nested class
171187
String factoryDecl =
@@ -230,22 +246,35 @@ List<String> generateImports(Set<String> importedTypes) {
230246
/**
231247
* Generate a list of factory methods/fields to be added to a given factory nested class.
232248
*/
233-
List<String> generateFactoryMethodsAndFields(String key, Message msg) {
249+
List<String> generateFactoryMethodsAndFields(FactoryKind k, String key, Message msg) {
234250
MessageInfo msgInfo = msg.getMessageInfo();
235251
List<MessageLine> lines = msg.getLines(false);
236252
String javadoc = lines.stream()
237253
.filter(ml -> !ml.isInfo() && !ml.isEmptyOrComment())
238254
.map(ml -> ml.text)
239255
.collect(Collectors.joining("\n *"));
240256
String[] keyParts = key.split("\\.");
241-
FactoryKind k = FactoryKind.parseFrom(keyParts[1]);
257+
String lintCategory = lines.stream()
258+
.filter(MessageLine::isLint)
259+
.map(MessageLine::lintCategory)
260+
.findFirst().orElse(null);
261+
//System.out.println("category for " + key + " = " + lintCategory);
242262
String factoryName = factoryName(key);
243263
if (msgInfo.getTypes().isEmpty()) {
244264
//generate field
245-
String factoryField = StubKind.FACTORY_FIELD.format(k.keyClazz, factoryName,
246-
"\"" + keyParts[0] + "\"",
247-
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
248-
javadoc);
265+
String factoryField;
266+
if (lintCategory == null) {
267+
factoryField = StubKind.FACTORY_FIELD.format(k.keyClazz, factoryName,
268+
"\"" + keyParts[0] + "\"",
269+
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
270+
javadoc);
271+
} else {
272+
factoryField = StubKind.FACTORY_FIELD_LINT.format(k.keyClazz, factoryName,
273+
StubKind.LINT_CATEGORY.format("\"" + lintCategory + "\""),
274+
"\"" + keyParts[0] + "\"",
275+
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
276+
javadoc);
277+
}
249278
return Collections.singletonList(factoryField);
250279
} else {
251280
//generate method
@@ -255,12 +284,22 @@ List<String> generateFactoryMethodsAndFields(String key, Message msg) {
255284
List<String> argNames = argNames(types.size());
256285
String suppressionString = needsSuppressWarnings(msgTypes) ?
257286
StubKind.SUPPRESS_WARNINGS.format() : "";
287+
String methodBody;
288+
if (lintCategory == null) {
289+
methodBody = StubKind.FACTORY_METHOD_BODY.format(k.keyClazz,
290+
"\"" + keyParts[0] + "\"",
291+
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
292+
argNames.stream().collect(Collectors.joining(", ")));
293+
} else {
294+
methodBody = StubKind.FACTORY_METHOD_BODY_LINT.format(k.keyClazz,
295+
StubKind.LINT_CATEGORY.format("\"" + lintCategory + "\""),
296+
"\"" + keyParts[0] + "\"",
297+
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
298+
argNames.stream().collect(Collectors.joining(", ")));
299+
}
258300
String factoryMethod = StubKind.FACTORY_METHOD_DECL.format(suppressionString, k.keyClazz,
259301
factoryName, argDecls(types, argNames).stream().collect(Collectors.joining(", ")),
260-
indent(StubKind.FACTORY_METHOD_BODY.format(k.keyClazz,
261-
"\"" + keyParts[0] + "\"",
262-
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
263-
argNames.stream().collect(Collectors.joining(", "))), 1),
302+
indent(methodBody, 1),
264303
javadoc);
265304
factoryMethods.add(factoryMethod);
266305
}

make/langtools/tools/propertiesparser/parser/Message.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public final class Message {
4949
public MessageInfo getMessageInfo() {
5050
if (messageInfo == null) {
5151
MessageLine l = firstLine.prev;
52+
if (l != null && l.isLint()) {
53+
l = l.prev;
54+
}
5255
if (l != null && l.isInfo())
5356
messageInfo = new MessageInfo(l.text);
5457
else
@@ -71,7 +74,7 @@ public List<MessageLine> getLines(boolean includeAllPrecedingComments) {
7174
while (l.text.isEmpty())
7275
l = l.next;
7376
} else {
74-
if (l.prev != null && l.prev.isInfo())
77+
if (l.prev != null && (l.prev.isInfo() || l.prev.isLint()))
7578
l = l.prev;
7679
}
7780

make/langtools/tools/propertiesparser/parser/MessageLine.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
package propertiesparser.parser;
2727

28+
import java.util.regex.Matcher;
2829
import java.util.regex.Pattern;
2930

3031
/**
@@ -37,6 +38,7 @@ public class MessageLine {
3738
static final Pattern typePattern = Pattern.compile("[-\\\\'A-Z\\.a-z ]+( \\([-A-Za-z 0-9]+\\))?");
3839
static final Pattern infoPattern = Pattern.compile(String.format("# ([0-9]+: %s, )*[0-9]+: %s",
3940
typePattern.pattern(), typePattern.pattern()));
41+
static final Pattern lintPattern = Pattern.compile("# lint: ([a-z\\-]+)");
4042

4143
public String text;
4244
MessageLine prev;
@@ -54,6 +56,19 @@ public boolean isInfo() {
5456
return infoPattern.matcher(text).matches();
5557
}
5658

59+
public boolean isLint() {
60+
return lintPattern.matcher(text).matches();
61+
}
62+
63+
public String lintCategory() {
64+
Matcher matcher = lintPattern.matcher(text);
65+
if (matcher.matches()) {
66+
return matcher.group(1);
67+
} else {
68+
return null;
69+
}
70+
}
71+
5772
boolean hasContinuation() {
5873
return (next != null) && text.endsWith("\\");
5974
}

0 commit comments

Comments
 (0)