From 6287ae3707bac091b37cd5693ca77e2349a903ef Mon Sep 17 00:00:00 2001
From: KIRIYAMA Takuya
Date: Fri, 21 Jan 2022 13:36:29 +0000
Subject: [PATCH 001/339] 8277531: Print actual default stacksize on Windows
thread logging
Reviewed-by: dholmes, stuefe
---
src/hotspot/os/windows/os_windows.cpp | 2 +-
.../jtreg/runtime/logging/ThreadLoggingTest.java | 11 ++++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp
index 482c7615bc1..ed4ba3e1fc2 100644
--- a/src/hotspot/os/windows/os_windows.cpp
+++ b/src/hotspot/os/windows/os_windows.cpp
@@ -529,7 +529,7 @@ static unsigned __stdcall thread_native_entry(Thread* thread) {
res = 20115; // java thread
}
- log_info(os, thread)("Thread is alive (tid: " UINTX_FORMAT ").", os::current_thread_id());
+ log_info(os, thread)("Thread is alive (tid: " UINTX_FORMAT ", stacksize: " SIZE_FORMAT "k).", os::current_thread_id(), thread->stack_size() / 1024);
#ifdef USE_VECTORED_EXCEPTION_HANDLING
// Any exception is caught by the Vectored Exception Handler, so VM can
diff --git a/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java b/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java
index 82a189a92cb..d98fc455319 100644
--- a/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java
+++ b/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -24,7 +24,7 @@
/*
* @test
- * @bug 8149036 8150619
+ * @bug 8149036 8150619 8277531
* @summary os+thread output should contain logging calls for thread start stop attaches detaches
* @requires vm.flagless
* @library /test/lib
@@ -36,6 +36,7 @@
import java.io.File;
import java.util.Map;
+import jdk.test.lib.Platform;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
@@ -43,7 +44,11 @@ public class ThreadLoggingTest {
static void analyzeOutputForInfoLevel(OutputAnalyzer output) throws Exception {
output.shouldMatch("Thread .* started");
- output.shouldContain("Thread is alive");
+ if (Platform.isWindows()) {
+ output.shouldMatch("Thread is alive \\(tid: [0-9]+, stacksize: [0-9]+k\\)");
+ } else {
+ output.shouldContain("Thread is alive");
+ }
output.shouldContain("Thread finished");
output.shouldHaveExitValue(0);
}
--
GitLab
From 2920ce54874c404126d9fd6bfbebee5f3da27dae Mon Sep 17 00:00:00 2001
From: Yi-Fan Tsai
Date: Fri, 21 Jan 2022 18:09:17 +0000
Subject: [PATCH 002/339] 8278036: Saving rscratch1 is optional in
MacroAssembler::verify_heapbase
Reviewed-by: xliu, phh, coleenp
---
src/hotspot/cpu/x86/assembler_x86.hpp | 2 +-
src/hotspot/cpu/x86/macroAssembler_x86.cpp | 13 ++++++++++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp
index 5a7e595d029..2cfb1e29360 100644
--- a/src/hotspot/cpu/x86/assembler_x86.hpp
+++ b/src/hotspot/cpu/x86/assembler_x86.hpp
@@ -377,7 +377,7 @@ class AddressLiteral {
private:
address target() { return _target; }
- bool is_lval() { return _is_lval; }
+ bool is_lval() const { return _is_lval; }
relocInfo::relocType reloc() const { return _rspec.type(); }
const RelocationHolder& rspec() const { return _rspec; }
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp
index 52fa1730586..10a1cb4b6a1 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp
@@ -4651,12 +4651,19 @@ void MacroAssembler::verify_heapbase(const char* msg) {
assert (Universe::heap() != NULL, "java heap should be initialized");
if (CheckCompressedOops) {
Label ok;
- push(rscratch1); // cmpptr trashes rscratch1
- cmpptr(r12_heapbase, ExternalAddress((address)CompressedOops::ptrs_base_addr()));
+ const auto src2 = ExternalAddress((address)CompressedOops::ptrs_base_addr());
+ assert(!src2.is_lval(), "should not be lval");
+ const bool is_src2_reachable = reachable(src2);
+ if (!is_src2_reachable) {
+ push(rscratch1); // cmpptr trashes rscratch1
+ }
+ cmpptr(r12_heapbase, src2);
jcc(Assembler::equal, ok);
STOP(msg);
bind(ok);
- pop(rscratch1);
+ if (!is_src2_reachable) {
+ pop(rscratch1);
+ }
}
}
#endif
--
GitLab
From c1e4f3dd1b42474c9abc22c7b981a98f9c36e0d5 Mon Sep 17 00:00:00 2001
From: Joe Darcy
Date: Fri, 21 Jan 2022 18:55:25 +0000
Subject: [PATCH 003/339] 8279397: Update --release 18 symbol information for
JDK 18 build 32
Reviewed-by: iris, jlahoda
---
make/data/symbols/java.base-I.sym.txt | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/make/data/symbols/java.base-I.sym.txt b/make/data/symbols/java.base-I.sym.txt
index 35fe19bb6e5..bb60a7a3070 100644
--- a/make/data/symbols/java.base-I.sym.txt
+++ b/make/data/symbols/java.base-I.sym.txt
@@ -393,6 +393,16 @@ header extends java/util/AbstractSet implements java/util/Set,java/lang/Cloneabl
innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409
innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609
+class name java/util/Hashtable
+header extends java/util/Dictionary implements java/util/Map,java/lang/Cloneable,java/io/Serializable flags 21 signature Ljava/util/Dictionary;Ljava/util/Map;Ljava/lang/Cloneable;Ljava/io/Serializable;
+innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609
+innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409
+
+class name java/util/IdentityHashMap
+header extends java/util/AbstractMap implements java/util/Map,java/io/Serializable,java/lang/Cloneable flags 21 signature Ljava/util/AbstractMap;Ljava/util/Map;Ljava/io/Serializable;Ljava/lang/Cloneable;
+innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609
+innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409
+
class name java/util/Locale$IsoCountryCode
header extends java/lang/Enum nestHost java/util/Locale sealed true flags 4421 signature Ljava/lang/Enum;
innerclass innerClass java/util/Locale$IsoCountryCode outerClass java/util/Locale innerClassName IsoCountryCode flags 4409
--
GitLab
From 7d2ef9d984f96cd260dc233c4acf58669615227f Mon Sep 17 00:00:00 2001
From: Jonathan Gibbons
Date: Fri, 21 Jan 2022 23:18:37 +0000
Subject: [PATCH 004/339] 8279179: Update nroff pages in JDK 18 before RC
Reviewed-by: iris, mchung
---
src/java.base/share/man/java.1 | 9 +++++++++
src/java.base/share/man/keytool.1 | 12 +++++++++++-
src/jdk.jartool/share/man/jarsigner.1 | 15 ++++++++++++++-
3 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/src/java.base/share/man/java.1 b/src/java.base/share/man/java.1
index 3e17a506fa9..246d0080577 100644
--- a/src/java.base/share/man/java.1
+++ b/src/java.base/share/man/java.1
@@ -512,6 +512,15 @@ of the release.
.RS
.RE
.TP
+.B \f[CB]\-\-finalization=\f[R]\f[I]value\f[R]
+Controls whether the JVM performs finalization of objects.
+Valid values are "enabled" and "disabled".
+Finalization is enabled by default, so the value "enabled" does nothing.
+The value "disabled" disables finalization, so that no finalizers are
+invoked.
+.RS
+.RE
+.TP
.B \f[CB]\-\-module\-path\f[R] \f[I]modulepath\f[R]... or \f[CB]\-p\f[R] \f[I]modulepath\f[R]
A semicolon (\f[CB];\f[R]) separated list of directories in which each
directory is a directory of modules.
diff --git a/src/java.base/share/man/keytool.1 b/src/java.base/share/man/keytool.1
index 8250cf555b9..5b70729917c 100644
--- a/src/java.base/share/man/keytool.1
+++ b/src/java.base/share/man/keytool.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
+.\" Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@@ -70,6 +70,8 @@ keystore
\f[CB]\-storepasswd\f[R]: Changes the store password of a keystore
.IP \[bu] 2
\f[CB]\-showinfo\f[R]: Displays security\-related information
+.IP \[bu] 2
+\f[CB]\-version\f[R]: Prints the program version
.PP
See \f[B]Commands and Options\f[R] for a description of these commands
with their options.
@@ -219,6 +221,10 @@ they perform.
\f[B]Commands for Displaying Security\-related Information\f[R]:
.IP \[bu] 2
\f[CB]\-showinfo\f[R]
+.PP
+\f[B]Commands for Displaying Program Version\f[R]:
+.IP \[bu] 2
+\f[CB]\-version\f[R]
.SH COMMANDS FOR CREATING OR ADDING DATA TO THE KEYSTORE
.TP
.B \f[CB]\-gencert\f[R]
@@ -1314,6 +1320,10 @@ information.
The \f[CB]\-tls\f[R] option displays TLS configurations, such as the list
of enabled protocols and cipher suites.
.RE
+.SH COMMANDS FOR DISPLAYING PROGRAM VERSION
+.PP
+You can use \f[CB]\-version\f[R] to print the program version of
+\f[CB]keytool\f[R].
.SH COMMANDS FOR DISPLAYING HELP INFORMATION
.PP
You can use \f[CB]\-\-help\f[R] to display a list of \f[CB]keytool\f[R]
diff --git a/src/jdk.jartool/share/man/jarsigner.1 b/src/jdk.jartool/share/man/jarsigner.1
index a29dc0e714e..290d8de5fcf 100644
--- a/src/jdk.jartool/share/man/jarsigner.1
+++ b/src/jdk.jartool/share/man/jarsigner.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
+.\" Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@ jarsigner \- sign and verify Java Archive (JAR) files
.PP
\f[CB]jarsigner\f[R] \f[CB]\-verify\f[R] [\f[I]options\f[R]]
\f[I]jar\-file\f[R] [\f[I]alias\f[R] ...]
+.PP
+\f[CB]jarsigner\f[R] \f[CB]\-version\f[R]
.TP
.B \f[I]options\f[R]
The command\-line options.
@@ -69,6 +71,12 @@ The aliases are defined in the keystore specified by \f[CB]\-keystore\f[R]
or the default keystore.
.RS
.RE
+.TP
+.B \f[CB]\-version\f[R]
+The \f[CB]\-version\f[R] option prints the program version of
+\f[CB]jarsigner\f[R].
+.RS
+.RE
.SH DESCRIPTION
.PP
The \f[CB]jarsigner\f[R] tool has two purposes:
@@ -1079,6 +1087,11 @@ The property keys supported are "jarsigner.all" for all actions,
name(s) cannot be set in this file.
.RS
.RE
+.TP
+.B \f[CB]\-version\f[R]
+Prints the program version.
+.RS
+.RE
.SH DEPRECATED OPTIONS
.PP
The following \f[CB]jarsigner\f[R] options are deprecated as of JDK 9 and
--
GitLab
From b9ae77906e9c886ee239871b75c183c5ec7ae846 Mon Sep 17 00:00:00 2001
From: Calvin Cheung
Date: Fri, 21 Jan 2022 23:47:09 +0000
Subject: [PATCH 005/339] 8279675: CDS cannot handle non-existent JAR file in
bootclassapth
Reviewed-by: iklam, minqi
---
src/hotspot/share/cds/filemap.cpp | 22 ++++-
src/hotspot/share/cds/filemap.hpp | 1 +
.../runtime/cds/appcds/NonExistClasspath.java | 90 +++++++++++++++++--
.../cds/appcds/PrintSharedArchiveAndExit.java | 12 +--
.../OptimizeModuleHandlingTest.java | 12 ++-
5 files changed, 122 insertions(+), 15 deletions(-)
diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp
index 3a121e3b4ee..5bf1887cfce 100644
--- a/src/hotspot/share/cds/filemap.cpp
+++ b/src/hotspot/share/cds/filemap.cpp
@@ -767,6 +767,21 @@ int FileMapInfo::num_paths(const char* path) {
return npaths;
}
+// Returns true if a path within the paths exists and has non-zero size.
+bool FileMapInfo::check_paths_existence(const char* paths) {
+ ClasspathStream cp_stream(paths);
+ bool exist = false;
+ struct stat st;
+ while (cp_stream.has_next()) {
+ const char* path = cp_stream.get_next();
+ if (os::stat(path, &st) == 0 && st.st_size > 0) {
+ exist = true;
+ break;
+ }
+ }
+ return exist;
+}
+
GrowableArray* FileMapInfo::create_path_array(const char* paths) {
GrowableArray* path_array = new GrowableArray(10);
JavaThread* current = JavaThread::current();
@@ -850,7 +865,12 @@ bool FileMapInfo::validate_boot_class_paths() {
if (relaxed_check) {
return true; // ok, relaxed check, runtime has extra boot append path entries
} else {
- mismatch = true;
+ ResourceMark rm;
+ if (check_paths_existence(rp)) {
+ // If a path exists in the runtime boot paths, it is considered a mismatch
+ // since there's no boot path specified during dump time.
+ mismatch = true;
+ }
}
} else if (dp_len > 0 && rp != NULL) {
int num;
diff --git a/src/hotspot/share/cds/filemap.hpp b/src/hotspot/share/cds/filemap.hpp
index d29c240b192..ac2ad867f79 100644
--- a/src/hotspot/share/cds/filemap.hpp
+++ b/src/hotspot/share/cds/filemap.hpp
@@ -554,6 +554,7 @@ public:
void seek_to_position(size_t pos);
char* skip_first_path_entry(const char* path) NOT_CDS_RETURN_(NULL);
int num_paths(const char* path) NOT_CDS_RETURN_(0);
+ bool check_paths_existence(const char* paths) NOT_CDS_RETURN_(false);
GrowableArray* create_path_array(const char* path) NOT_CDS_RETURN_(NULL);
bool classpath_failure(const char* msg, const char* name) NOT_CDS_RETURN_(false);
bool check_paths(int shared_path_start_idx, int num_paths,
diff --git a/test/hotspot/jtreg/runtime/cds/appcds/NonExistClasspath.java b/test/hotspot/jtreg/runtime/cds/appcds/NonExistClasspath.java
index a08f1c5ff15..7f2af4bdcab 100644
--- a/test/hotspot/jtreg/runtime/cds/appcds/NonExistClasspath.java
+++ b/test/hotspot/jtreg/runtime/cds/appcds/NonExistClasspath.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,13 @@ import jdk.test.lib.cds.CDSTestUtils;
import jdk.test.lib.process.OutputAnalyzer;
public class NonExistClasspath {
+ static final String outDir = CDSTestUtils.getOutputDir();
+ static final String newFile = "non-exist.jar";
+ static final String nonExistPath = outDir + File.separator + newFile;
+ static final String emptyJarPath = outDir + File.separator + "empty.jar";
+ static final String errorMessage1 = "Unable to use shared archive";
+ static final String errorMessage2 = "shared class paths mismatch";
+
public static void main(String[] args) throws Exception {
String appJar = JarBuilder.getOrCreateHelloJar();
doTest(appJar, false);
@@ -47,13 +54,7 @@ public class NonExistClasspath {
}
static void doTest(String appJar, boolean bootcp) throws Exception {
- String outDir = CDSTestUtils.getOutputDir();
- String newFile = "non-exist.jar";
- String nonExistPath = outDir + File.separator + newFile;
- final String errorMessage1 = "Unable to use shared archive";
- final String errorMessage2 = "shared class paths mismatch";
final String errorMessage3 = (bootcp ? "BOOT" : "APP") + " classpath mismatch";
-
(new File(nonExistPath)).delete();
String classPath = nonExistPath + File.pathSeparator + appJar;
@@ -100,6 +101,81 @@ public class NonExistClasspath {
"-Xlog:class+path=trace",
"Hello"))
.assertAbnormalExit(errorMessage1, errorMessage2, errorMessage3);
+
+ if (bootcp) {
+ doMoreBCPTests(appJar, errorMessage3);
+ }
+ }
+
+ static void doMoreBCPTests(String appJar, String errorMessage3) throws Exception {
+
+ // Dump an archive with non-existent boot class path.
+ (new File(nonExistPath)).delete();
+ TestCommon.testDump("foobar", TestCommon.list("Hello"), make_args(true, nonExistPath, "-cp", appJar));
+
+ // Run with non-existent boot class path, test should pass.
+ TestCommon.run(make_args(true,
+ nonExistPath,
+ "-cp", appJar,
+ "-Xlog:class+path=trace",
+ "Hello"))
+ .assertNormalExit();
+
+ // Run with existent boot class path, test should fail.
+ TestCommon.run(make_args(true,
+ appJar,
+ "-cp", appJar,
+ "-Xlog:class+path=trace",
+ "Hello"))
+ .assertAbnormalExit(errorMessage1, errorMessage2, errorMessage3);
+
+ // Dump an archive with existent boot class path.
+ TestCommon.testDump("foobar", TestCommon.list("Hello"), make_args(true, appJar));
+
+ // Run with non-existent boot class path, test should fail.
+ TestCommon.run(make_args(true,
+ nonExistPath,
+ "-Xlog:class+path=trace",
+ "Hello"))
+ .assertAbnormalExit(errorMessage1, errorMessage2, errorMessage3);
+
+ // Run with existent boot class path, test should pass.
+ TestCommon.run(make_args(true,
+ appJar,
+ "-Xlog:class+path=trace",
+ "Hello"))
+ .assertNormalExit();
+
+ // Test with empty jar file.
+ (new File(emptyJarPath)).delete();
+ (new File(emptyJarPath)).createNewFile();
+
+ // Dump an archive with an empty jar in the boot class path.
+ TestCommon.testDump("foobar", TestCommon.list("Hello"), make_args(true, emptyJarPath, "-cp", appJar));
+
+ // Run with an empty jar in boot class path, test should pass.
+ TestCommon.run(make_args(true,
+ emptyJarPath,
+ "-cp", appJar,
+ "-Xlog:class+path=trace",
+ "Hello"))
+ .assertNormalExit();
+
+ // Run with non-existent boot class path, test should pass.
+ TestCommon.run(make_args(true,
+ nonExistPath,
+ "-cp", appJar,
+ "-Xlog:class+path=trace",
+ "Hello"))
+ .assertNormalExit();
+
+ // Run with existent boot class path, test should fail.
+ TestCommon.run(make_args(true,
+ appJar,
+ "-cp", appJar,
+ "-Xlog:class+path=trace",
+ "Hello"))
+ .assertAbnormalExit(errorMessage1, errorMessage2, errorMessage3);
}
static String[] make_args(boolean bootcp, String cp, String... suffix) {
diff --git a/test/hotspot/jtreg/runtime/cds/appcds/PrintSharedArchiveAndExit.java b/test/hotspot/jtreg/runtime/cds/appcds/PrintSharedArchiveAndExit.java
index fc34e932dc4..9a74dcb0d3b 100644
--- a/test/hotspot/jtreg/runtime/cds/appcds/PrintSharedArchiveAndExit.java
+++ b/test/hotspot/jtreg/runtime/cds/appcds/PrintSharedArchiveAndExit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,16 +87,16 @@ public class PrintSharedArchiveAndExit {
TestCommon.run("-cp", cp, "-XX:+PrintSharedArchiveAndExit", "Hello")
.ifNoMappingFailure(output -> check(output, 0, true, lastCheckMsg));
- log("Execution with simple errors -- with 'simple' errors like missing or modified\n" +
- "JAR files, the VM should try to continue to print the remaining information.\n" +
- "Use an invalid Boot CP -- all the JAR paths should be checked");
+ log("Non-existent boot cp should be ignored, test should pass.");
TestCommon.run(
"-cp", cp,
"-Xbootclasspath/a:foo.jar",
"-XX:+PrintSharedArchiveAndExit")
- .ifNoMappingFailure(output -> check(output, 1, true, lastCheckMsg, "[BOOT classpath mismatch, "));
+ .ifNoMappingFailure(output -> check(output, 0, true, lastCheckMsg));
- log("Use an App CP shorter than the one at dump time -- all the JAR paths should be checked");
+ log("Execution with simple errors -- with 'simple' errors like missing or modified\n" +
+ "JAR files, the VM should try to continue to print the remaining information.\n" +
+ "Use an App CP shorter than the one at dump time -- all the JAR paths should be checked");
TestCommon.run(
"-cp", ".",
"-XX:+PrintSharedArchiveAndExit")
diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java
index 189559a4661..eecc218a71a 100644
--- a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java
+++ b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -219,6 +219,16 @@ public class OptimizeModuleHandlingTest {
"-Xbootclasspath/a:", ".",
"--module-path", libsDir.toString(),
MAIN_CLASS)
+ .assertAbnormalExit(out -> {
+ out.shouldNotContain(CLASS_FOUND_MESSAGE)
+ .shouldContain(OPTIMIZE_DISABLED) // mapping info
+ .shouldContain("Error: Could not find or load main class .");
+ });
+ tty("11. run with CDS on, --module-path, with -Xbootclasspath/a:.");
+ TestCommon.run("-Xlog:cds",
+ "-Xbootclasspath/a:.",
+ "--module-path", libsDir.toString(),
+ MAIN_CLASS)
.assertAbnormalExit(out -> {
out.shouldNotContain(CLASS_FOUND_MESSAGE)
.shouldContain(OPTIMIZE_DISABLED) // mapping info
--
GitLab
From 54c9de26aba24ff5496f97dd6cb95075ab6b9777 Mon Sep 17 00:00:00 2001
From: Andrey Turbanov
Date: Sat, 22 Jan 2022 13:56:51 +0000
Subject: [PATCH 006/339] 8275918: Remove unused local variables in java.base
security code
Reviewed-by: weijun
---
.../macosx/classes/apple/security/KeychainStore.java | 2 --
.../classes/com/sun/crypto/provider/BlowfishCrypt.java | 4 ++--
.../classes/java/security/AccessControlContext.java | 1 -
.../share/classes/sun/security/pkcs10/PKCS10.java | 3 +--
.../share/classes/sun/security/rsa/RSAPSSSignature.java | 1 -
.../classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java | 2 +-
.../classes/sun/security/ssl/DHServerKeyExchange.java | 3 +--
.../classes/sun/security/ssl/SSLEngineInputRecord.java | 1 -
.../classes/sun/security/x509/CRLNumberExtension.java | 3 +--
.../sun/security/x509/DeltaCRLIndicatorExtension.java | 8 ++------
.../share/classes/sun/security/x509/GeneralSubtrees.java | 5 ++---
.../share/classes/sun/security/x509/X509CertInfo.java | 3 +--
.../share/classes/sun/security/x509/X509Key.java | 9 +++------
13 files changed, 14 insertions(+), 31 deletions(-)
diff --git a/src/java.base/macosx/classes/apple/security/KeychainStore.java b/src/java.base/macosx/classes/apple/security/KeychainStore.java
index cf97d4e04c0..688d280f838 100644
--- a/src/java.base/macosx/classes/apple/security/KeychainStore.java
+++ b/src/java.base/macosx/classes/apple/security/KeychainStore.java
@@ -945,7 +945,6 @@ public final class KeychainStore extends KeyStoreSpi {
byte[] safeContentsData;
ContentInfo safeContents;
DerInputStream sci;
- byte[] eAlgId = null;
sci = new DerInputStream(safeContentsArray[i].toByteArray());
safeContents = new ContentInfo(sci);
@@ -984,7 +983,6 @@ public final class KeychainStore extends KeyStoreSpi {
ObjectIdentifier bagId;
DerInputStream sbi;
DerValue bagValue;
- Object bagItem = null;
sbi = safeBags[i].toDerInputStream();
bagId = sbi.getOID();
diff --git a/src/java.base/share/classes/com/sun/crypto/provider/BlowfishCrypt.java b/src/java.base/share/classes/com/sun/crypto/provider/BlowfishCrypt.java
index f5483f7deff..5fde830e519 100644
--- a/src/java.base/share/classes/com/sun/crypto/provider/BlowfishCrypt.java
+++ b/src/java.base/share/classes/com/sun/crypto/provider/BlowfishCrypt.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@ final class BlowfishCrypt extends SymmetricCipher
throw new InvalidKeyException("Key too long (> 448 bits)");
}
// Step 1: Init P and then S arrays from pi bytes
- int i, j, count;
+ int i, j;
System.arraycopy(pi, 0, p, 0, 18);
System.arraycopy(pi, 18, s0, 0, 256);
diff --git a/src/java.base/share/classes/java/security/AccessControlContext.java b/src/java.base/share/classes/java/security/AccessControlContext.java
index a7f3641beda..1cb35d9bdfc 100644
--- a/src/java.base/share/classes/java/security/AccessControlContext.java
+++ b/src/java.base/share/classes/java/security/AccessControlContext.java
@@ -916,7 +916,6 @@ public final class AccessControlContext {
private boolean containsAllLimits(AccessControlContext that) {
boolean match = false;
- Permission thisPerm;
if (this.permissions == null && that.permissions == null)
return true;
diff --git a/src/java.base/share/classes/sun/security/pkcs10/PKCS10.java b/src/java.base/share/classes/sun/security/pkcs10/PKCS10.java
index 2a28f809888..05bb19fe1c1 100644
--- a/src/java.base/share/classes/sun/security/pkcs10/PKCS10.java
+++ b/src/java.base/share/classes/sun/security/pkcs10/PKCS10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -141,7 +141,6 @@ public class PKCS10 {
// Inner sequence: version, name, key, attributes
//
BigInteger serial;
- DerValue val;
serial = seq[0].data.getBigInteger();
if (!serial.equals(BigInteger.ZERO))
diff --git a/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java b/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java
index d523e0b8be1..15c143127fb 100644
--- a/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java
+++ b/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java
@@ -255,7 +255,6 @@ public class RSAPSSSignature extends SignatureSpi {
* internal signature parameters.
*/
private void isValid(RSAKey rsaKey) throws InvalidKeyException {
- AlgorithmParameterSpec keyParams = rsaKey.getParams();
// validate key parameters
if (!isCompatible(rsaKey.getParams(), this.sigParams)) {
throw new InvalidKeyException
diff --git a/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java b/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
index fbc9fda05fa..8ca5135fe85 100644
--- a/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
+++ b/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
@@ -141,7 +141,7 @@ public final class RSAPrivateCrtKeyImpl
BigInteger n, BigInteger e, BigInteger d,
BigInteger p, BigInteger q, BigInteger pe, BigInteger qe,
BigInteger coeff) throws InvalidKeyException {
- RSAPrivateKey key;
+
if ((e.signum() == 0) || (p.signum() == 0) ||
(q.signum() == 0) || (pe.signum() == 0) ||
(qe.signum() == 0) || (coeff.signum() == 0)) {
diff --git a/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java b/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java
index af64383457a..38e97073eb1 100644
--- a/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java
+++ b/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -444,7 +444,6 @@ final class DHServerKeyExchange {
*/
private void updateSignature(Signature sig, byte[] clntNonce,
byte[] svrNonce) throws SignatureException {
- int tmp;
sig.update(clntNonce);
sig.update(svrNonce);
diff --git a/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java b/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java
index 31abe94e9a1..938768aaf76 100644
--- a/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java
+++ b/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java
@@ -358,7 +358,6 @@ final class SSLEngineInputRecord extends InputRecord implements SSLRecord {
// The packet should be a complete record.
//
int srcPos = packet.position();
- int srcLim = packet.limit();
byte firstByte = packet.get(srcPos);
byte thirdByte = packet.get(srcPos + 2);
diff --git a/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java b/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java
index 9434e613441..244e9d5df9b 100644
--- a/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java
+++ b/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -199,7 +199,6 @@ implements CertAttrSet {
* @exception IOException on encoding errors.
*/
public void encode(OutputStream out) throws IOException {
- DerOutputStream tmp = new DerOutputStream();
encode(out, PKIXExtensions.CRLNumber_Id, true);
}
diff --git a/src/java.base/share/classes/sun/security/x509/DeltaCRLIndicatorExtension.java b/src/java.base/share/classes/sun/security/x509/DeltaCRLIndicatorExtension.java
index 10b5a9dc09e..5933758874a 100644
--- a/src/java.base/share/classes/sun/security/x509/DeltaCRLIndicatorExtension.java
+++ b/src/java.base/share/classes/sun/security/x509/DeltaCRLIndicatorExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,9 +28,6 @@ package sun.security.x509;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigInteger;
-import java.util.Enumeration;
-
-import sun.security.util.*;
/**
* Represents the Delta CRL Indicator Extension.
@@ -80,7 +77,7 @@ public class DeltaCRLIndicatorExtension extends CRLNumberExtension {
}
/**
- * Creates a delta CRL indictor extension with the BigInteger value .
+ * Creates a delta CRL indicator extension with the BigInteger value .
* The criticality is set to true.
*
* @param crlNum the value to be set for the extension.
@@ -110,7 +107,6 @@ public class DeltaCRLIndicatorExtension extends CRLNumberExtension {
* @exception IOException on encoding errors.
*/
public void encode(OutputStream out) throws IOException {
- DerOutputStream tmp = new DerOutputStream();
super.encode(out, PKIXExtensions.DeltaCRLIndicator_Id, true);
}
}
diff --git a/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java b/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java
index 8adafe20344..c47fc0c8245 100644
--- a/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java
+++ b/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@ public class GeneralSubtrees implements Cloneable {
/**
* Encode the GeneralSubtrees.
*
- * @param out the DerOutputStrean to encode this object to.
+ * @param out the DerOutputStream to encode this object to.
*/
public void encode(DerOutputStream out) throws IOException {
DerOutputStream seq = new DerOutputStream();
@@ -346,7 +346,6 @@ public class GeneralSubtrees implements Cloneable {
// same type in this.
for (int i = 0; i < size(); i++) {
GeneralNameInterface thisEntry = getGeneralNameInterface(i);
- boolean removeThisEntry = false;
// Step 3a: If the widest name of this type in other narrows
// thisEntry, remove thisEntry and add widest other to newThis.
diff --git a/src/java.base/share/classes/sun/security/x509/X509CertInfo.java b/src/java.base/share/classes/sun/security/x509/X509CertInfo.java
index 5fbc9a08f54..09a9ed29320 100644
--- a/src/java.base/share/classes/sun/security/x509/X509CertInfo.java
+++ b/src/java.base/share/classes/sun/security/x509/X509CertInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -729,7 +729,6 @@ public class X509CertInfo implements CertAttrSet {
"has no extensions");
}
SubjectAlternativeNameExtension subjectAltNameExt = null;
- SubjectAlternativeNameExtension extValue = null;
GeneralNames names = null;
try {
subjectAltNameExt = (SubjectAlternativeNameExtension)
diff --git a/src/java.base/share/classes/sun/security/x509/X509Key.java b/src/java.base/share/classes/sun/security/x509/X509Key.java
index faf7cfb927f..19979cb8e7e 100644
--- a/src/java.base/share/classes/sun/security/x509/X509Key.java
+++ b/src/java.base/share/classes/sun/security/x509/X509Key.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@ package sun.security.x509;
import java.io.*;
import java.util.Arrays;
-import java.util.Properties;
import java.security.Key;
import java.security.PublicKey;
import java.security.KeyFactory;
@@ -150,10 +149,10 @@ public class X509Key implements PublicKey {
* this kind of key, a subclass is returned. Otherwise, a generic
* X509Key object is returned.
*
- *
This mechanism gurantees that keys (and algorithms) may be
+ *
This mechanism guarantees that keys (and algorithms) may be
* freely manipulated and transferred, without risk of losing
* information. Also, when a key (or algorithm) needs some special
- * handling, that specific need can be accomodated.
+ * handling, that specific need can be accommodated.
*
* @param in the DER-encoded SubjectPublicKeyInfo value
* @exception IOException on data format errors
@@ -233,8 +232,6 @@ public class X509Key implements PublicKey {
*/
String classname = "";
try {
- Properties props;
- String keytype;
Provider sunProvider;
sunProvider = Security.getProvider("SUN");
--
GitLab
From 30cd47d42124540303e5f5dbbd509b58d8fb90a0 Mon Sep 17 00:00:00 2001
From: Jie Fu
Date: Mon, 24 Jan 2022 04:37:51 +0000
Subject: [PATCH 007/339] 8280499:
runtime/cds/appcds/TestDumpClassListSource.java fails on platforms without
AppCDS custom class loaders support
Reviewed-by: iklam
---
.../jtreg/runtime/cds/appcds/TestDumpClassListSource.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/hotspot/jtreg/runtime/cds/appcds/TestDumpClassListSource.java b/test/hotspot/jtreg/runtime/cds/appcds/TestDumpClassListSource.java
index 1b8d73a468d..647e44bc455 100644
--- a/test/hotspot/jtreg/runtime/cds/appcds/TestDumpClassListSource.java
+++ b/test/hotspot/jtreg/runtime/cds/appcds/TestDumpClassListSource.java
@@ -28,6 +28,7 @@
* @summary test dynamic dump meanwhile output loaded class list
* @bug 8279009 8275084
* @requires vm.cds
+ * @requires vm.cds.custom.loaders
* @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds
* @compile test-classes/Hello.java ClassSpecializerTestApp.java ClassListWithCustomClassNoSource.java
* @run main/othervm TestDumpClassListSource
--
GitLab
From 9bf6ffa19f1ea9efcadb3396d921305c9ec0b1d1 Mon Sep 17 00:00:00 2001
From: Xin Liu
Date: Mon, 24 Jan 2022 05:05:07 +0000
Subject: [PATCH 008/339] 8279124: VM does not handle SIGQUIT during
initialization
Reviewed-by: dholmes, stuefe
---
src/hotspot/os/posix/signals_posix.cpp | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/hotspot/os/posix/signals_posix.cpp b/src/hotspot/os/posix/signals_posix.cpp
index 2c020a79408..895c3cc09ae 100644
--- a/src/hotspot/os/posix/signals_posix.cpp
+++ b/src/hotspot/os/posix/signals_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -562,6 +562,11 @@ int JVM_HANDLE_XXX_SIGNAL(int sig, siginfo_t* info,
{
assert(info != NULL && ucVoid != NULL, "sanity");
+ if (sig == BREAK_SIGNAL) {
+ assert(!ReduceSignalUsage, "Should not happen with -Xrs/-XX:+ReduceSignalUsage");
+ return true; // ignore it
+ }
+
// Note: it's not uncommon that JNI code uses signal/sigset to install,
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
// or have a SIGILL handler when detecting CPU type). When that happens,
@@ -1197,7 +1202,7 @@ int os::get_signal_number(const char* signal_name) {
return -1;
}
-void set_signal_handler(int sig) {
+void set_signal_handler(int sig, bool do_check = true) {
// Check for overwrite.
struct sigaction oldAct;
sigaction(sig, (struct sigaction*)NULL, &oldAct);
@@ -1241,7 +1246,7 @@ void set_signal_handler(int sig) {
// Save handler setup for later checking
vm_handlers.set(sig, &sigAct);
- do_check_signal_periodically[sig] = true;
+ do_check_signal_periodically[sig] = do_check;
int ret = sigaction(sig, &sigAct, &oldAct);
assert(ret == 0, "check");
@@ -1279,7 +1284,12 @@ void install_signal_handlers() {
set_signal_handler(SIGFPE);
PPC64_ONLY(set_signal_handler(SIGTRAP);)
set_signal_handler(SIGXFSZ);
-
+ if (!ReduceSignalUsage) {
+ // This is just for early initialization phase. Intercepting the signal here reduces the risk
+ // that an attach client accidentally forces HotSpot to quit prematurely. We skip the periodic
+ // check because late initialization will overwrite it to UserHandler.
+ set_signal_handler(BREAK_SIGNAL, false);
+ }
#if defined(__APPLE__)
// lldb (gdb) installs both standard BSD signal handlers, and mach exception
// handlers. By replacing the existing task exception handler, we disable lldb's mach
--
GitLab
From d1569111d7077dd95b95aea6c42616f85d85e781 Mon Sep 17 00:00:00 2001
From: Aleksey Shipilev
Date: Mon, 24 Jan 2022 09:18:20 +0000
Subject: [PATCH 009/339] 8280459: Suspicious integer division in
Hashtable.readHashtable
Reviewed-by: rriggs, bpb
---
src/java.base/share/classes/java/util/Hashtable.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/java.base/share/classes/java/util/Hashtable.java b/src/java.base/share/classes/java/util/Hashtable.java
index 2b6f6e72540..5d722879bc0 100644
--- a/src/java.base/share/classes/java/util/Hashtable.java
+++ b/src/java.base/share/classes/java/util/Hashtable.java
@@ -1290,7 +1290,7 @@ public class Hashtable
// no larger than the clamped original length. Make the length
// odd if it's large enough, this helps distribute the entries.
// Guard against the length ending up zero, that's not valid.
- int length = (int)((elements + elements / 20) / lf) + 3;
+ int length = (int)(elements * 1.05f / lf) + 3;
if (length > elements && (length & 1) == 0)
length--;
length = Math.min(length, origlength);
--
GitLab
From ead9feccae75ab0491ce86a707f5056d88ac899a Mon Sep 17 00:00:00 2001
From: Julia Boes
Date: Mon, 24 Jan 2022 10:03:40 +0000
Subject: [PATCH 010/339] 8280441: Missing "classpath exception" in several
files from jdk.httpserver
Reviewed-by: alanb, dfuchs
---
.../classes/com/sun/net/httpserver/SimpleFileServer.java | 6 ++++--
.../sun/net/httpserver/simpleserver/FileServerHandler.java | 6 ++++--
.../classes/sun/net/httpserver/simpleserver/JWebServer.java | 6 ++++--
.../share/classes/sun/net/httpserver/simpleserver/Main.java | 6 ++++--
.../sun/net/httpserver/simpleserver/OutputFilter.java | 6 ++++--
.../net/httpserver/simpleserver/ResourceBundleHelper.java | 6 ++++--
.../net/httpserver/simpleserver/SimpleFileServerImpl.java | 6 ++++--
7 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java
index a08f48567c9..2952a40b142 100644
--- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java
+++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java
@@ -1,10 +1,12 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java
index b1b28446b4d..e0e9736cad4 100644
--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java
@@ -1,10 +1,12 @@
/*
- * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java
index 59f77abbae8..015d1b95244 100644
--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java
@@ -1,10 +1,12 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java
index 83441cdbc7f..30535c9296d 100644
--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java
@@ -1,10 +1,12 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/OutputFilter.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/OutputFilter.java
index bdbcf2361ee..0a4d901303e 100644
--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/OutputFilter.java
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/OutputFilter.java
@@ -1,10 +1,12 @@
/*
- * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/ResourceBundleHelper.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/ResourceBundleHelper.java
index 99349fe3474..690722bddb9 100644
--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/ResourceBundleHelper.java
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/ResourceBundleHelper.java
@@ -1,10 +1,12 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/SimpleFileServerImpl.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/SimpleFileServerImpl.java
index 852aae5a838..7e97d203b6c 100644
--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/SimpleFileServerImpl.java
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/SimpleFileServerImpl.java
@@ -1,10 +1,12 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
--
GitLab
From 0567a84d49fccda139388c22d1fc14e4aea6002b Mon Sep 17 00:00:00 2001
From: Jie Fu
Date: Mon, 24 Jan 2022 10:52:15 +0000
Subject: [PATCH 011/339] 8280457: Duplicate implementation of
dprecision_rounding and dstore_rounding
Reviewed-by: vlivanov, shade
---
.../share/gc/shared/c2/barrierSetC2.cpp | 4 ++--
src/hotspot/share/opto/graphKit.cpp | 20 +++----------------
src/hotspot/share/opto/graphKit.hpp | 5 +----
src/hotspot/share/opto/parse2.cpp | 10 +++++-----
4 files changed, 11 insertions(+), 28 deletions(-)
diff --git a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
index c89643a7881..a90565ef705 100644
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@ Node* BarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue& val) cons
GraphKit* kit = parse_access.kit();
if (access.type() == T_DOUBLE) {
- Node* new_val = kit->dstore_rounding(val.node());
+ Node* new_val = kit->dprecision_rounding(val.node());
val.set_node(new_val);
}
diff --git a/src/hotspot/share/opto/graphKit.cpp b/src/hotspot/share/opto/graphKit.cpp
index 8547f7fed90..da96ebd9169 100644
--- a/src/hotspot/share/opto/graphKit.cpp
+++ b/src/hotspot/share/opto/graphKit.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2350,9 +2350,9 @@ void GraphKit::round_double_arguments(ciMethod* dest_method) {
const Type *targ = tf->domain()->field_at(j + TypeFunc::Parms);
if (targ->basic_type() == T_DOUBLE) {
// If any parameters are doubles, they must be rounded before
- // the call, dstore_rounding does gvn.transform
+ // the call, dprecision_rounding does gvn.transform
Node *arg = argument(j);
- arg = dstore_rounding(arg);
+ arg = dprecision_rounding(arg);
set_argument(j, arg);
}
}
@@ -2387,20 +2387,6 @@ Node* GraphKit::dprecision_rounding(Node *n) {
return n;
}
-// rounding for non-strict double stores
-Node* GraphKit::dstore_rounding(Node* n) {
- if (Matcher::strict_fp_requires_explicit_rounding) {
-#ifdef IA32
- if (UseSSE < 2) {
- return _gvn.transform(new RoundDoubleNode(0, n));
- }
-#else
- Unimplemented();
-#endif // IA32
- }
- return n;
-}
-
//=============================================================================
// Generate a fast path/slow path idiom. Graph looks like:
// [foo] indicates that 'foo' is a parameter
diff --git a/src/hotspot/share/opto/graphKit.hpp b/src/hotspot/share/opto/graphKit.hpp
index d815e21956f..b2a85b84f03 100644
--- a/src/hotspot/share/opto/graphKit.hpp
+++ b/src/hotspot/share/opto/graphKit.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -790,9 +790,6 @@ class GraphKit : public Phase {
// rounding for strict double precision conformance
Node* dprecision_rounding(Node* n);
- // rounding for non-strict double stores
- Node* dstore_rounding(Node* n);
-
// Helper functions for fast/slow path codes
Node* opt_iff(Node* region, Node* iff);
Node* make_runtime_call(int flags,
diff --git a/src/hotspot/share/opto/parse2.cpp b/src/hotspot/share/opto/parse2.cpp
index 183994ecb0d..7ad08841476 100644
--- a/src/hotspot/share/opto/parse2.cpp
+++ b/src/hotspot/share/opto/parse2.cpp
@@ -2004,19 +2004,19 @@ void Parse::do_one_bytecode() {
// double stores
case Bytecodes::_dstore_0:
- set_pair_local( 0, dstore_rounding(pop_pair()) );
+ set_pair_local( 0, dprecision_rounding(pop_pair()) );
break;
case Bytecodes::_dstore_1:
- set_pair_local( 1, dstore_rounding(pop_pair()) );
+ set_pair_local( 1, dprecision_rounding(pop_pair()) );
break;
case Bytecodes::_dstore_2:
- set_pair_local( 2, dstore_rounding(pop_pair()) );
+ set_pair_local( 2, dprecision_rounding(pop_pair()) );
break;
case Bytecodes::_dstore_3:
- set_pair_local( 3, dstore_rounding(pop_pair()) );
+ set_pair_local( 3, dprecision_rounding(pop_pair()) );
break;
case Bytecodes::_dstore:
- set_pair_local( iter().get_index(), dstore_rounding(pop_pair()) );
+ set_pair_local( iter().get_index(), dprecision_rounding(pop_pair()) );
break;
case Bytecodes::_pop: dec_sp(1); break;
--
GitLab
From 7a0a6c95a53c6cb3340328d6543a97807320b740 Mon Sep 17 00:00:00 2001
From: Dmitry Markov
Date: Mon, 24 Jan 2022 10:55:13 +0000
Subject: [PATCH 012/339] 8274751: Drag And Drop hangs on Windows
Reviewed-by: aivanov, prr, serb
---
.../windows/native/libawt/windows/awt_DnDDS.cpp | 6 +++---
.../windows/native/libawt/windows/awt_DnDDT.cpp | 16 ++++++++--------
.../native/libawt/windows/awt_Toolkit.cpp | 9 +++++----
.../windows/native/libawt/windows/awt_Toolkit.h | 5 +++--
4 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/src/java.desktop/windows/native/libawt/windows/awt_DnDDS.cpp b/src/java.desktop/windows/native/libawt/windows/awt_DnDDS.cpp
index 0f9fb662bbf..8146d62c4a7 100644
--- a/src/java.desktop/windows/native/libawt/windows/awt_DnDDS.cpp
+++ b/src/java.desktop/windows/native/libawt/windows/awt_DnDDS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -267,13 +267,13 @@ void AwtDragSource::_DoDragDrop(void* param) {
dragSource->Signal();
AwtToolkit &toolkit = AwtToolkit::GetInstance();
- toolkit.isInDoDragDropLoop = TRUE;
+ toolkit.isDnDSourceActive = TRUE;
res = ::DoDragDrop(dragSource,
dragSource,
convertActionsToDROPEFFECT(dragSource->m_actions),
&effects
);
- toolkit.isInDoDragDropLoop = FALSE;
+ toolkit.isDnDSourceActive = FALSE;
if (effects == DROPEFFECT_NONE && dragSource->m_dwPerformedDropEffect != DROPEFFECT_NONE) {
effects = dragSource->m_dwPerformedDropEffect;
diff --git a/src/java.desktop/windows/native/libawt/windows/awt_DnDDT.cpp b/src/java.desktop/windows/native/libawt/windows/awt_DnDDT.cpp
index 126e7194f86..ed41af9d6bf 100644
--- a/src/java.desktop/windows/native/libawt/windows/awt_DnDDT.cpp
+++ b/src/java.desktop/windows/native/libawt/windows/awt_DnDDT.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -141,7 +141,7 @@ static void ScaleDown(POINT &cp, HWND m_window) {
HRESULT __stdcall AwtDropTarget::DragEnter(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) {
TRY;
- AwtToolkit::GetInstance().isInDoDragDropLoop = TRUE;
+ AwtToolkit::GetInstance().isDnDTargetActive = TRUE;
if (NULL != m_pIDropTargetHelper) {
m_pIDropTargetHelper->DragEnter(
m_window,
@@ -161,7 +161,7 @@ HRESULT __stdcall AwtDropTarget::DragEnter(IDataObject __RPC_FAR *pDataObj, DWOR
(IsLocalDnD() && !IsLocalDataObject(pDataObj)))
{
*pdwEffect = retEffect;
- AwtToolkit::GetInstance().isInDoDragDropLoop = FALSE;
+ AwtToolkit::GetInstance().isDnDTargetActive = FALSE;
return ret;
}
@@ -173,7 +173,7 @@ HRESULT __stdcall AwtDropTarget::DragEnter(IDataObject __RPC_FAR *pDataObj, DWOR
}
if (JNU_IsNull(env, m_dtcp) || !JNU_IsNull(env, safe_ExceptionOccurred(env))) {
- AwtToolkit::GetInstance().isInDoDragDropLoop = FALSE;
+ AwtToolkit::GetInstance().isDnDTargetActive = FALSE;
return ret;
}
@@ -200,12 +200,12 @@ HRESULT __stdcall AwtDropTarget::DragEnter(IDataObject __RPC_FAR *pDataObj, DWOR
env->ExceptionDescribe();
env->ExceptionClear();
actions = java_awt_dnd_DnDConstants_ACTION_NONE;
- AwtToolkit::GetInstance().isInDoDragDropLoop = FALSE;
+ AwtToolkit::GetInstance().isDnDTargetActive = FALSE;
}
} catch (std::bad_alloc&) {
retEffect = ::convertActionsToDROPEFFECT(actions);
*pdwEffect = retEffect;
- AwtToolkit::GetInstance().isInDoDragDropLoop = FALSE;
+ AwtToolkit::GetInstance().isDnDTargetActive = FALSE;
throw;
}
@@ -421,7 +421,7 @@ void AwtDropTarget::DropDone(jboolean success, jint action) {
m_dropSuccess = success;
m_dropActions = action;
AwtToolkit::GetInstance().QuitMessageLoop(AwtToolkit::EXIT_ENCLOSING_LOOP);
- AwtToolkit::GetInstance().isInDoDragDropLoop = FALSE;
+ AwtToolkit::GetInstance().isDnDTargetActive = FALSE;
}
/**
@@ -1136,7 +1136,7 @@ void AwtDropTarget::UnloadCache() {
void AwtDropTarget::DragCleanup(void) {
UnloadCache();
- AwtToolkit::GetInstance().isInDoDragDropLoop = FALSE;
+ AwtToolkit::GetInstance().isDnDTargetActive = FALSE;
}
BOOL AwtDropTarget::IsLocalDataObject(IDataObject __RPC_FAR *pDataObject) {
diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp
index 355d3207273..17e69d70b15 100644
--- a/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -344,7 +344,8 @@ AwtToolkit::AwtToolkit() {
m_waitEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);
m_inputMethodWaitEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);
- isInDoDragDropLoop = FALSE;
+ isDnDSourceActive = FALSE;
+ isDnDTargetActive = FALSE;
eventNumber = 0;
}
@@ -3012,7 +3013,7 @@ Java_sun_awt_windows_WToolkit_syncNativeQueue(JNIEnv *env, jobject self, jlong t
tk.PostMessage(WM_SYNC_WAIT, 0, 0);
for(long t = 2; t < timeout &&
WAIT_TIMEOUT == ::WaitForSingleObject(tk.m_waitEvent, 2); t+=2) {
- if (tk.isInDoDragDropLoop) {
+ if (tk.isDnDSourceActive || tk.isDnDTargetActive) {
break;
}
}
@@ -3216,7 +3217,7 @@ LRESULT AwtToolkit::InvokeInputMethodFunction(UINT msg, WPARAM wParam, LPARAM lP
* the IME completion.
*/
CriticalSection::Lock lock(m_inputMethodLock);
- if (isInDoDragDropLoop) {
+ if (isDnDSourceActive || isDnDTargetActive) {
SendMessage(msg, wParam, lParam);
::ResetEvent(m_inputMethodWaitEvent);
return m_inputMethodData;
diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.h b/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.h
index a148001842d..ff9baf6464a 100644
--- a/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.h
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -441,7 +441,8 @@ public:
HANDLE m_waitEvent;
volatile DWORD eventNumber;
- volatile BOOL isInDoDragDropLoop;
+ volatile BOOL isDnDSourceActive;
+ volatile BOOL isDnDTargetActive;
private:
HWND CreateToolkitWnd(LPCTSTR name);
--
GitLab
From f05ff996543d0239383d8b363fdbba15769c4aae Mon Sep 17 00:00:00 2001
From: Andrey Turbanov
Date: Mon, 24 Jan 2022 11:10:16 +0000
Subject: [PATCH 013/339] 8280174: Possible NPE in
Thread.dispatchUncaughtException
Reviewed-by: alanb
---
src/java.base/share/classes/java/lang/Thread.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java
index 797a7f9f82e..77e0bbc6129 100644
--- a/src/java.base/share/classes/java/lang/Thread.java
+++ b/src/java.base/share/classes/java/lang/Thread.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1976,8 +1976,8 @@ public class Thread implements Runnable {
* @return the uncaught exception handler for this thread
*/
public UncaughtExceptionHandler getUncaughtExceptionHandler() {
- return uncaughtExceptionHandler != null ?
- uncaughtExceptionHandler : group;
+ UncaughtExceptionHandler handler = this.uncaughtExceptionHandler;
+ return handler != null ? handler : group;
}
/**
--
GitLab
From afd2805ef2fe72aee04b84956dba5bb5c012ff3c Mon Sep 17 00:00:00 2001
From: Roman Kennke
Date: Mon, 24 Jan 2022 11:16:53 +0000
Subject: [PATCH 014/339] 8279534: Consolidate and remove oopDesc::klass_gap
methods
Reviewed-by: shade, dholmes
---
.../share/interpreter/zero/bytecodeInterpreter.cpp | 10 +++++-----
src/hotspot/share/oops/oop.hpp | 2 --
src/hotspot/share/oops/oop.inline.hpp | 8 --------
3 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp
index ee3648eaa61..4682c2b8129 100644
--- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp
+++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp
@@ -1943,12 +1943,12 @@ run:
Copy::fill_to_words(result + hdr_size, obj_size - hdr_size, 0);
}
- oop obj = cast_to_oop(result);
+ // Initialize header, mirrors MemAllocator.
+ oopDesc::set_mark(result, markWord::prototype());
+ oopDesc::set_klass_gap(result, 0);
+ oopDesc::release_set_klass(result, ik);
- // Initialize header
- obj->set_mark(markWord::prototype());
- obj->set_klass_gap(0);
- obj->set_klass(ik);
+ oop obj = cast_to_oop(result);
// Must prevent reordering of stores for object initialization
// with stores that publish the new object.
diff --git a/src/hotspot/share/oops/oop.hpp b/src/hotspot/share/oops/oop.hpp
index e7186b6a4ff..994bb677032 100644
--- a/src/hotspot/share/oops/oop.hpp
+++ b/src/hotspot/share/oops/oop.hpp
@@ -91,8 +91,6 @@ class oopDesc {
static inline void release_set_klass(HeapWord* mem, Klass* k);
// For klass field compression
- inline int klass_gap() const;
- inline void set_klass_gap(int z);
static inline void set_klass_gap(HeapWord* mem, int z);
// size of object header, aligned to platform wordSize
diff --git a/src/hotspot/share/oops/oop.inline.hpp b/src/hotspot/share/oops/oop.inline.hpp
index 371e97824f7..17ce5bed561 100644
--- a/src/hotspot/share/oops/oop.inline.hpp
+++ b/src/hotspot/share/oops/oop.inline.hpp
@@ -125,20 +125,12 @@ void oopDesc::release_set_klass(HeapWord* mem, Klass* k) {
}
}
-int oopDesc::klass_gap() const {
- return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes());
-}
-
void oopDesc::set_klass_gap(HeapWord* mem, int v) {
if (UseCompressedClassPointers) {
*(int*)(((char*)mem) + klass_gap_offset_in_bytes()) = v;
}
}
-void oopDesc::set_klass_gap(int v) {
- set_klass_gap((HeapWord*)this, v);
-}
-
bool oopDesc::is_a(Klass* k) const {
return klass()->is_subtype_of(k);
}
--
GitLab
From 4501ddda7f8e0eb9352a937030a62902bfaac647 Mon Sep 17 00:00:00 2001
From: Harold Seigel
Date: Mon, 24 Jan 2022 13:33:43 +0000
Subject: [PATCH 015/339] 8214733: runtime/8176717/TestInheritFD.java timed out
Reviewed-by: lmesnik, coleenp, dcubed
---
test/hotspot/jtreg/runtime/8176717/TestInheritFD.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java b/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java
index 04a739079f9..37c5280d236 100644
--- a/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java
+++ b/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -79,6 +79,7 @@ public class TestInheritFD {
public static final String RETAINS_FD = "VM RESULT => RETAINS FD";
public static final String EXIT = "VM RESULT => VM EXIT";
public static final String LOG_SUFFIX = ".strangelogsuffixthatcanbecheckedfor";
+ public static final String USER_DIR = System.getProperty("user.dir");
// first VM
public static void main(String[] args) throws Exception {
@@ -187,10 +188,10 @@ public class TestInheritFD {
static Collection outputContainingFilenames() {
long pid = ProcessHandle.current().pid();
-
String[] command = lsofCommand().orElseThrow(() -> new RuntimeException("lsof like command not found"));
- System.out.println("using command: " + command[0] + " " + command[1]);
- return run(command[0], command[1], "" + pid).collect(toList());
+ // Only search the directory in which the VM is running (user.dir property).
+ System.out.println("using command: " + command[0] + " -a +d " + USER_DIR + " " + command[1] + " " + pid);
+ return run(command[0], "-a", "+d", USER_DIR, command[1], "" + pid).collect(toList());
}
static boolean findOpenLogFile(Collection fileNames) {
--
GitLab
From 44db4794d29c6e0755a6dc0ea1346f48f918155b Mon Sep 17 00:00:00 2001
From: Zhengyu Gu
Date: Mon, 24 Jan 2022 13:34:37 +0000
Subject: [PATCH 016/339] 8280391: NMT: Correct NMT tag on CollectedHeap
Reviewed-by: kbarrett, tschatzl, mli
---
src/hotspot/share/gc/shared/collectedHeap.hpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/gc/shared/collectedHeap.hpp b/src/hotspot/share/gc/shared/collectedHeap.hpp
index 84e545abd29..89cca6777d6 100644
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -90,7 +90,7 @@ public:
// ShenandoahHeap
// ZCollectedHeap
//
-class CollectedHeap : public CHeapObj {
+class CollectedHeap : public CHeapObj {
friend class VMStructs;
friend class JVMCIVMStructs;
friend class IsGCActiveMark; // Block structured external access to _is_gc_active
--
GitLab
From 18c9cb07891cdd68c06385a28af16e3931b84317 Mon Sep 17 00:00:00 2001
From: Jan Lahoda
Date: Mon, 24 Jan 2022 13:52:16 +0000
Subject: [PATCH 017/339] 8280067: Incorrect code generated for unary - on char
operand
Reviewed-by: jlaskey, vromero
---
.../com/sun/tools/javac/jvm/Items.java | 4 +-
.../tools/javac/code/CharImmediateValue.java | 185 ++++++++++++++++++
2 files changed, 187 insertions(+), 2 deletions(-)
create mode 100644 test/langtools/tools/javac/code/CharImmediateValue.java
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Items.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Items.java
index 170cac2a111..c15287ad45e 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Items.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Items.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -669,7 +669,7 @@ public class Items {
} else {
switch (targetcode) {
case INTcode:
- if (Code.truncate(typecode) == INTcode)
+ if (Code.truncate(typecode) == INTcode && typecode != CHARcode)
return this;
else
return new ImmediateItem(
diff --git a/test/langtools/tools/javac/code/CharImmediateValue.java b/test/langtools/tools/javac/code/CharImmediateValue.java
new file mode 100644
index 00000000000..38745358be0
--- /dev/null
+++ b/test/langtools/tools/javac/code/CharImmediateValue.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8280067
+ * @summary Verify constant/immediate char values are correctly enhanced to ints when used in unary
+ * operators
+ * @library /tools/lib
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ * jdk.compiler/com.sun.tools.javac.code
+ * jdk.compiler/com.sun.tools.javac.comp
+ * jdk.compiler/com.sun.tools.javac.jvm
+ * jdk.compiler/com.sun.tools.javac.main
+ * jdk.compiler/com.sun.tools.javac.tree
+ * jdk.compiler/com.sun.tools.javac.util
+ * jdk.jdeps/com.sun.tools.classfile
+ * jdk.jdeps/com.sun.tools.javap
+ * @build toolbox.JarTask toolbox.JavacTask toolbox.JavapTask toolbox.ToolBox
+ * @compile CharImmediateValue.java
+ * @run main CharImmediateValue
+ */
+
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Objects;
+
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.Plugin;
+import com.sun.source.util.TaskEvent;
+import com.sun.source.util.TaskListener;
+
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.Instruction;
+import com.sun.tools.classfile.Opcode;
+
+import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
+import com.sun.tools.javac.tree.JCTree.JCIdent;
+import com.sun.tools.javac.tree.TreeScanner;
+
+import toolbox.JarTask;
+import toolbox.ToolBox;
+
+
+public class CharImmediateValue implements Plugin {
+ public static void main(String... args) throws Exception {
+ new CharImmediateValue().runSourceTest();
+ new CharImmediateValue().runReplacementTest();
+ }
+
+ void runSourceTest() throws Exception {
+ int param = 0;
+ Character var = (char) -(false ? (char) param : (char) 2);
+ }
+
+ void runReplacementTest() throws Exception {
+ ToolBox tb = new ToolBox();
+ Path pluginClasses = Path.of("plugin-classes");
+ tb.writeFile(pluginClasses.resolve("META-INF").resolve("services").resolve(Plugin.class.getName()),
+ CharImmediateValue.class.getName() + System.lineSeparator());
+ try (DirectoryStream ds = Files.newDirectoryStream(Path.of(ToolBox.testClasses))) {
+ for (Path p : ds) {
+ if (p.getFileName().toString().startsWith("CharImmediateValue") ||
+ p.getFileName().toString().endsWith(".class")) {
+ Files.copy(p, pluginClasses.resolve(p.getFileName()));
+ }
+ }
+ }
+
+ Path pluginJar = Path.of("plugin.jar");
+ new JarTask(tb, pluginJar)
+ .baseDir(pluginClasses)
+ .files(".")
+ .run();
+
+ Path src = Path.of("src");
+ tb.writeJavaFiles(src,
+ """
+ public class Test{
+ private static char replace; //this will be replace with a constant "1" after constant folding is done
+ public static String run() {
+ char c = (char) - replace;
+ if (c < 0) {
+ throw new AssertionError("Incorrect value!");
+ } else {
+ return Integer.toString(c);
+ }
+ }
+ }
+ """);
+ Path classes = Files.createDirectories(Path.of("classes"));
+
+ new toolbox.JavacTask(tb)
+ .classpath(pluginJar)
+ .options("-XDaccessInternalAPI")
+ .outdir(classes)
+ .files(tb.findJavaFiles(src))
+ .run()
+ .writeAll();
+
+ URLClassLoader cl = new URLClassLoader(new URL[] {classes.toUri().toURL()});
+
+ String actual = (String) cl.loadClass("Test")
+ .getMethod("run")
+ .invoke(null);
+ String expected = "65535";
+ if (!Objects.equals(actual, expected)) {
+ throw new AssertionError("expected: " + expected + "; but got: " + actual);
+ }
+
+ Path testClass = classes.resolve("Test.class");
+ ClassFile cf = ClassFile.read(testClass);
+ Code_attribute codeAttr =
+ (Code_attribute) cf.methods[1].attributes.get(Attribute.Code);
+ boolean seenCast = false;
+ for (Instruction i : codeAttr.getInstructions()) {
+ if (i.getOpcode() == Opcode.I2C) {
+ seenCast = true;
+ }
+ }
+ if (!seenCast) {
+ throw new AssertionError("Missing cast!");
+ }
+ }
+
+ // Plugin impl...
+
+ @Override
+ public String getName() { return "CharImmediateValue"; }
+
+ @Override
+ public void init(JavacTask task, String... args) {
+ task.addTaskListener(new TaskListener() {
+ @Override
+ public void started(TaskEvent e) {
+ if (e.getKind() == TaskEvent.Kind.GENERATE) {
+ convert((JCCompilationUnit) e.getCompilationUnit());
+ }
+ }
+ });
+ }
+
+ @Override
+ public boolean autoStart() {
+ return true;
+ }
+
+ private void convert(JCCompilationUnit toplevel) {
+ new TreeScanner() {
+ @Override
+ public void visitIdent(JCIdent tree) {
+ if (tree.name.contentEquals("replace")) {
+ tree.type = tree.type.constType(1);
+ }
+ super.visitIdent(tree);
+ }
+ }.scan(toplevel);
+ }
+
+}
--
GitLab
From d53d8bd7088c3dac0ca104aed919ad2dcb1cf6af Mon Sep 17 00:00:00 2001
From: Dmitry Kulikov
Date: Mon, 24 Jan 2022 14:07:14 +0000
Subject: [PATCH 018/339] 8279315: Add Git support to update_copyright_year.sh
script
Reviewed-by: erikj
---
make/scripts/update_copyright_year.sh | 94 +++++++++++++++++++++------
1 file changed, 75 insertions(+), 19 deletions(-)
diff --git a/make/scripts/update_copyright_year.sh b/make/scripts/update_copyright_year.sh
index 0f9ba80fc5a..a825486a941 100644
--- a/make/scripts/update_copyright_year.sh
+++ b/make/scripts/update_copyright_year.sh
@@ -1,7 +1,7 @@
#!/bin/bash -f
#
-# Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,27 +23,87 @@
# questions.
#
-# Script to update the Copyright YEAR range in Mercurial sources.
+# Script to update the Copyright YEAR range in Mercurial & Git sources.
# (Originally from xdono, Thanks!)
-awk=awk
+#------------------------------------------------------------
+copyright="Copyright (c)"
+company="Oracle"
+#------------------------------------------------------------
+
+awk="awk"
# Stop on any error
set -e
+# To allow total changes counting
+shopt -s lastpipe
+
+# Get an absolute path to this script, since that determines the top-level directory.
+this_script_dir=`dirname $0`
+this_script_dir=`cd $this_script_dir > /dev/null && pwd`
+
# Temp area
tmp=/tmp/`basename $0`.${USER}.$$
rm -f -r ${tmp}
mkdir -p ${tmp}
total=0
+# Default or supplied company name
+if [ "$3" != "" ] ; then
+ company="$3"
+fi
+
# This year or supplied year
-if [ "$1" != "" ] ; then
- year="$1"
+if [ "$2" != "" ] ; then
+ year="$2"
else
year=`date +%Y`
fi
+# VCS select
+vcs="$1"
+
+if [ -z "$vcs" ] ; then
+ git_found=false
+ hg_found=false
+
+ [ -d "${this_script_dir}/../../.git" ] && git_found=true
+ [ -d "${this_script_dir}/../../.hg" ] && hg_found=true
+
+ if [ "$git_found" == "true" ] && [ "$hg_found" == "false" ] ; then
+ vcs="git"
+ elif [ "$hg_found" == "true" ] && [ "$git_found" == "false" ] ; then
+ vcs="hg"
+ else
+ echo "Error: could not auto-detect version control system"
+ vcs=""
+ fi
+fi
+
+case "$vcs" in
+ "git")
+ echo "Using Git version control system"
+ vcs_status=(git ls-files -m)
+ vcs_list_changesets=(git log --no-merges --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
+ vcs_changeset_message=(git log -1 --pretty=tformat:"%B") # followed by ${changeset}
+ vcs_changeset_files=(git diff-tree --no-commit-id --name-only -r) # followed by ${changeset}
+ ;;
+
+ "hg")
+ echo "Using Mercurial version control system"
+ vcs_status=(hg status)
+ vcs_list_changesets=(hg log --no-merges -v -d "${year}-01-01 to ${year}-12-31" --template '{node}\n')
+ vcs_changeset_message=(hg log -l1 --template '{desc}\n' --rev) # followed by ${changeset}
+ vcs_changeset_files=(hg log -l1 -v --template '{files}\n' --rev) # followed by ${changeset}
+ ;;
+
+ *)
+ echo "Usage: `basename "$0"` [year [company]]"
+ exit 1
+ ;;
+esac
+
# Return true if it makes sense to edit this file
saneFileToCheck()
{
@@ -68,8 +128,6 @@ updateFile() # file
{
changed="false"
if [ `saneFileToCheck "$1"` = "true" ] ; then
- copyright="Copyright (c)"
- company="Oracle"
rm -f $1.OLD
mv $1 $1.OLD
cat $1.OLD | \
@@ -94,12 +152,10 @@ updateChangesetFiles() # changeset
count=0
files=${tmp}/files.$1
rm -f ${files}
- hg log -l1 --rev $1 -v --template '{files}\n' | expand \
+ "${vcs_changeset_files[@]}" "$1" | expand \
| ${awk} -F' ' '{for(i=1;i<=NF;i++)print $i}' \
> ${files}
if [ -f "${files}" -a -s "${files}" ] ; then
- copyright="Copyright (c)"
- company="Oracle"
fcount=`cat ${files}| wc -l`
for i in `cat ${files}` ; do
if [ `updateFile "${i}"` = "true" ] ; then
@@ -116,8 +172,8 @@ updateChangesetFiles() # changeset
printf " ERROR: No files changed in the changeset? Must be a mistake.\n"
set -x
ls -al ${files}
- hg log -l1 --rev $1 -v --template '{files}\n'
- hg log -l1 --rev $1 -v --template '{files}\n' | expand \
+ "${vcs_changeset_files[@]}" "$1"
+ "${vcs_changeset_files[@]}" "$1" | expand \
| ${awk} -F' ' '{for(i=1;i<=NF;i++)print $i}'
set +x
exit 1
@@ -126,16 +182,16 @@ updateChangesetFiles() # changeset
}
# Check if repository is clean
-previous=`hg status|wc -l`
+previous=`"${vcs_status[@]}"|wc -l`
if [ ${previous} -ne 0 ] ; then
echo "WARNING: This repository contains previously edited working set files."
- echo " hg status | wc -l = `hg status | wc -l`"
+ echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
fi
# Get all changesets this year
all_changesets=${tmp}/all_changesets
rm -f ${all_changesets}
-hg log --no-merges -v -d "${year}-01-01 to ${year}-12-31" --template '{node}\n' > ${all_changesets}
+"${vcs_list_changesets[@]}" > ${all_changesets}
# Check changeset to see if it is Copyright only changes, filter changesets
if [ -s ${all_changesets} ] ; then
@@ -146,7 +202,7 @@ if [ -s ${all_changesets} ] ; then
desc=${tmp}/desc.${changeset}
rm -f ${desc}
echo "------------------------------------------------"
- hg log -l1 --rev ${changeset} --template '{desc}\n' > ${desc}
+ "${vcs_changeset_message[@]}" "${changeset}" > ${desc}
printf "%d: %s\n%s\n" ${index} "${changeset}" "`cat ${desc}|head -1`"
if [ "${year}" = "2010" ] ; then
if cat ${desc} | fgrep -i "Added tag" > /dev/null ; then
@@ -175,18 +231,18 @@ if [ ${total} -gt 0 ] ; then
echo "---------------------------------------------"
echo "Updated the copyright year on a total of ${total} files."
if [ ${previous} -eq 0 ] ; then
- echo "This count should match the count of modified files in the repository: hg status -m"
+ echo "This count should match the count of modified files in the repository: ${vcs_status[*]}"
else
echo "WARNING: This repository contained previously edited working set files."
fi
- echo " hg status -m | wc -l = `hg status -m | wc -l`"
+ echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
else
echo "---------------------------------------------"
echo "No files were changed"
if [ ${previous} -ne 0 ] ; then
echo "WARNING: This repository contained previously edited working set files."
fi
- echo " hg status -m | wc -l = `hg status -m | wc -l`"
+ echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
fi
# Cleanup
--
GitLab
From 2b13341500cb9474f5fd6375b97d102ffb635b13 Mon Sep 17 00:00:00 2001
From: Angelos Bimpoudis
Date: Mon, 24 Jan 2022 15:09:17 +0000
Subject: [PATCH 019/339] 8036019: Insufficient alternatives listed in some
errors produced by the parser
Reviewed-by: vromero
---
.../sun/tools/javac/parser/JavacParser.java | 6 +--
.../tools/javac/resources/compiler.properties | 3 ++
test/langtools/tools/javac/T8036019.java | 46 +++++++++++++++++++
test/langtools/tools/javac/T8036019.out | 10 ++++
.../typeAnnotations/6967002/T6967002.out | 2 +-
.../AnnotationMissingElementValue.java | 28 +++++++++++
.../tools/javac/enum/EnumMembersOrder.out | 2 +-
.../tools/javac/parser/7157165/T7157165.out | 2 +-
.../parser/SingleCommaAnnotationValueFail.out | 2 +-
9 files changed, 94 insertions(+), 7 deletions(-)
create mode 100644 test/langtools/tools/javac/T8036019.java
create mode 100644 test/langtools/tools/javac/T8036019.out
create mode 100644 test/langtools/tools/javac/diags/examples/AnnotationMissingElementValue.java
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
index 4b508c4bdf0..b14673532bf 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
@@ -2035,7 +2035,7 @@ public class JavacParser implements Parser {
args.append(parseExpression());
}
}
- accept(RPAREN);
+ accept(RPAREN, tk -> Errors.Expected2(RPAREN, COMMA));
} else {
syntaxError(token.pos, Errors.Expected(LPAREN));
}
@@ -2123,7 +2123,7 @@ public class JavacParser implements Parser {
nextToken();
break;
default:
- args.append(syntaxError(token.pos, Errors.Expected(GT)));
+ args.append(syntaxError(token.pos, Errors.Expected2(GT, COMMA)));
break;
}
return args.toList();
@@ -3379,7 +3379,7 @@ public class JavacParser implements Parser {
buf.append(annotationValue());
}
}
- accept(RBRACE);
+ accept(RBRACE, tk -> Errors.AnnotationMissingElementValue);
return toP(F.at(pos).NewArray(null, List.nil(), buf.toList()));
default:
selectExprMode();
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
index ae2f1f8c6fc..fddd3e935e1 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
@@ -118,6 +118,9 @@ compiler.err.already.defined.static.single.import=\
compiler.err.already.defined.this.unit=\
{0} is already defined in this compilation unit
+compiler.err.annotation.missing.element.value=\
+ annotation is missing element value
+
# 0: type, 1: list of name
compiler.err.annotation.missing.default.value=\
annotation @{0} is missing a default value for the element ''{1}''
diff --git a/test/langtools/tools/javac/T8036019.java b/test/langtools/tools/javac/T8036019.java
new file mode 100644
index 00000000000..709b8abba46
--- /dev/null
+++ b/test/langtools/tools/javac/T8036019.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8036019
+ * @summary Insufficient alternatives listed in some errors produced by the parser
+ * @compile/fail/ref=T8036019.out -XDrawDiagnostics T8036019.java
+ */
+
+
+public class T8036019 {
+ enum E {
+ E(String value) { }
+ }
+
+ interface A {}
+ interface B {}
+ public class Foo {
+ Foo extends A|B> foo1 = null;
+ }
+
+ @SuppressWarnings({,0})
+ public class AV {
+ }
+}
diff --git a/test/langtools/tools/javac/T8036019.out b/test/langtools/tools/javac/T8036019.out
new file mode 100644
index 00000000000..2c874175793
--- /dev/null
+++ b/test/langtools/tools/javac/T8036019.out
@@ -0,0 +1,10 @@
+T8036019.java:34:17: compiler.err.expected2: ')', ','
+T8036019.java:34:23: compiler.err.expected3: ',', '}', ';'
+T8036019.java:34:25: compiler.err.enum.constant.expected
+T8036019.java:40:24: compiler.err.expected2: >, ','
+T8036019.java:40:26: compiler.err.expected: token.identifier
+T8036019.java:40:32: compiler.err.expected: token.identifier
+T8036019.java:43:25: compiler.err.annotation.missing.element.value
+T8036019.java:43:27: compiler.err.expected4: class, interface, enum, record
+T8036019.java:46:1: compiler.err.expected4: class, interface, enum, record
+9 errors
\ No newline at end of file
diff --git a/test/langtools/tools/javac/annotations/typeAnnotations/6967002/T6967002.out b/test/langtools/tools/javac/annotations/typeAnnotations/6967002/T6967002.out
index 86480c2bfa8..d9a3545d31d 100644
--- a/test/langtools/tools/javac/annotations/typeAnnotations/6967002/T6967002.out
+++ b/test/langtools/tools/javac/annotations/typeAnnotations/6967002/T6967002.out
@@ -1,2 +1,2 @@
-T6967002.java:10:22: compiler.err.expected: ')'
+T6967002.java:10:22: compiler.err.expected2: ')', ','
1 error
diff --git a/test/langtools/tools/javac/diags/examples/AnnotationMissingElementValue.java b/test/langtools/tools/javac/diags/examples/AnnotationMissingElementValue.java
new file mode 100644
index 00000000000..65f24aad316
--- /dev/null
+++ b/test/langtools/tools/javac/diags/examples/AnnotationMissingElementValue.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.annotation.missing.element.value
+
+@SuppressWarnings({,0})
+public class AV {
+}
diff --git a/test/langtools/tools/javac/enum/EnumMembersOrder.out b/test/langtools/tools/javac/enum/EnumMembersOrder.out
index b1e01860f34..94aff47aca8 100644
--- a/test/langtools/tools/javac/enum/EnumMembersOrder.out
+++ b/test/langtools/tools/javac/enum/EnumMembersOrder.out
@@ -1,4 +1,4 @@
-EnumMembersOrder.java:11:16: compiler.err.expected: ')'
+EnumMembersOrder.java:11:16: compiler.err.expected2: ')', ','
EnumMembersOrder.java:11:18: compiler.err.expected3: ',', '}', ';'
EnumMembersOrder.java:11:20: compiler.err.enum.constant.expected
3 errors
diff --git a/test/langtools/tools/javac/parser/7157165/T7157165.out b/test/langtools/tools/javac/parser/7157165/T7157165.out
index deb580df96c..7552381ba15 100644
--- a/test/langtools/tools/javac/parser/7157165/T7157165.out
+++ b/test/langtools/tools/javac/parser/7157165/T7157165.out
@@ -1,4 +1,4 @@
-T7157165.java:11:20: compiler.err.expected: >
+T7157165.java:11:20: compiler.err.expected2: >, ','
T7157165.java:11:22: compiler.err.expected: token.identifier
T7157165.java:11:28: compiler.err.expected: token.identifier
3 errors
diff --git a/test/langtools/tools/javac/parser/SingleCommaAnnotationValueFail.out b/test/langtools/tools/javac/parser/SingleCommaAnnotationValueFail.out
index 23d1082361b..05d27bc67df 100644
--- a/test/langtools/tools/javac/parser/SingleCommaAnnotationValueFail.out
+++ b/test/langtools/tools/javac/parser/SingleCommaAnnotationValueFail.out
@@ -1,3 +1,3 @@
-SingleCommaAnnotationValueFail.java:11:12: compiler.err.expected: '}'
+SingleCommaAnnotationValueFail.java:11:12: compiler.err.annotation.missing.element.value
SingleCommaAnnotationValueFail.java:11:14: compiler.err.expected4: class, interface, enum, record
2 errors
--
GitLab
From 4b329addf1aca4b5f67057b5c6852d283d0c8f49 Mon Sep 17 00:00:00 2001
From: Kim Barrett
Date: Mon, 24 Jan 2022 17:08:50 +0000
Subject: [PATCH 020/339] 8280496: Remove unused
G1PageBasedVirtualSpace::pretouch_internal
Reviewed-by: tschatzl, sjohanss, mli
---
src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp | 9 +--------
src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp | 5 +----
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
index 7a164e6461f..94f51c8fdd1 100644
--- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
+++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -178,13 +178,6 @@ char* G1PageBasedVirtualSpace::bounded_end_addr(size_t end_page) const {
return MIN2(_high_boundary, page_start(end_page));
}
-void G1PageBasedVirtualSpace::pretouch_internal(size_t start_page, size_t end_page) {
- guarantee(start_page < end_page,
- "Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page);
-
- os::pretouch_memory(page_start(start_page), bounded_end_addr(end_page), _page_size);
-}
-
bool G1PageBasedVirtualSpace::commit(size_t start_page, size_t size_in_pages) {
// We need to make sure to commit all pages covered by the given area.
guarantee(is_area_uncommitted(start_page, size_in_pages),
diff --git a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp
index 8b68ad60e56..0b97656c883 100644
--- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp
+++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,9 +87,6 @@ class G1PageBasedVirtualSpace {
// Uncommit the given memory range.
void uncommit_internal(size_t start_page, size_t end_page);
- // Pretouch the given memory range.
- void pretouch_internal(size_t start_page, size_t end_page);
-
// Returns the index of the page which contains the given address.
size_t addr_to_page_index(char* addr) const;
--
GitLab
From 1c7769d35b3a2aa4afe3125239dbfa1da5cfdeee Mon Sep 17 00:00:00 2001
From: Kim Barrett
Date: Mon, 24 Jan 2022 17:23:14 +0000
Subject: [PATCH 021/339] 8280437: Move G1BufferNodeList to gc/shared
Reviewed-by: sjohanss, iwalulya, mli
---
src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp | 10 +++++-----
src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp | 8 ++++----
src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp | 10 +++++-----
src/hotspot/share/gc/g1/g1RedirtyCardsQueue.hpp | 10 +++++-----
src/hotspot/share/gc/g1/g1RemSet.cpp | 5 +++--
.../bufferNodeList.cpp} | 12 ++++++------
.../bufferNodeList.hpp} | 15 +++++++--------
7 files changed, 35 insertions(+), 35 deletions(-)
rename src/hotspot/share/gc/{g1/g1BufferNodeList.cpp => shared/bufferNodeList.cpp} (80%)
rename src/hotspot/share/gc/{g1/g1BufferNodeList.hpp => shared/bufferNodeList.hpp} (79%)
diff --git a/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp b/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp
index 8f704fce350..4ef40d29f16 100644
--- a/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp
+++ b/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp
@@ -24,7 +24,6 @@
#include "precompiled.hpp"
#include "gc/g1/g1BarrierSet.inline.hpp"
-#include "gc/g1/g1BufferNodeList.hpp"
#include "gc/g1/g1CardTableEntryClosure.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentRefineStats.hpp"
@@ -35,6 +34,7 @@
#include "gc/g1/g1RemSet.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegionRemSet.inline.hpp"
+#include "gc/shared/bufferNodeList.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
#include "memory/iterator.hpp"
#include "runtime/atomic.hpp"
@@ -313,7 +313,7 @@ void G1DirtyCardQueueSet::enqueue_all_paused_buffers() {
}
void G1DirtyCardQueueSet::abandon_completed_buffers() {
- G1BufferNodeList list = take_all_completed_buffers();
+ BufferNodeList list = take_all_completed_buffers();
BufferNode* buffers_to_delete = list._head;
while (buffers_to_delete != NULL) {
BufferNode* bn = buffers_to_delete;
@@ -334,20 +334,20 @@ void G1DirtyCardQueueSet::notify_if_necessary() {
// result. The queue sets must share the same allocator.
void G1DirtyCardQueueSet::merge_bufferlists(G1RedirtyCardsQueueSet* src) {
assert(allocator() == src->allocator(), "precondition");
- const G1BufferNodeList from = src->take_all_completed_buffers();
+ const BufferNodeList from = src->take_all_completed_buffers();
if (from._head != NULL) {
Atomic::add(&_num_cards, from._entry_count);
_completed.append(*from._head, *from._tail);
}
}
-G1BufferNodeList G1DirtyCardQueueSet::take_all_completed_buffers() {
+BufferNodeList G1DirtyCardQueueSet::take_all_completed_buffers() {
enqueue_all_paused_buffers();
verify_num_cards();
Pair pair = _completed.take_all();
size_t num_cards = Atomic::load(&_num_cards);
Atomic::store(&_num_cards, size_t(0));
- return G1BufferNodeList(pair.first, pair.second, num_cards);
+ return BufferNodeList(pair.first, pair.second, num_cards);
}
class G1RefineBufferedCards : public StackObj {
diff --git a/src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp b/src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp
index 9e9ad0ee80c..051e29058eb 100644
--- a/src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp
+++ b/src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
#ifndef SHARE_GC_G1_G1DIRTYCARDQUEUE_HPP
#define SHARE_GC_G1_G1DIRTYCARDQUEUE_HPP
-#include "gc/g1/g1BufferNodeList.hpp"
#include "gc/g1/g1FreeIdSet.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1ConcurrentRefineStats.hpp"
+#include "gc/shared/bufferNodeList.hpp"
#include "gc/shared/ptrQueue.hpp"
#include "memory/allocation.hpp"
#include "memory/padded.hpp"
@@ -69,7 +69,7 @@ public:
class G1DirtyCardQueueSet: public PtrQueueSet {
// Head and tail of a list of BufferNodes, linked through their next()
- // fields. Similar to G1BufferNodeList, but without the _entry_count.
+ // fields. Similar to BufferNodeList, but without the _entry_count.
struct HeadTail {
BufferNode* _head;
BufferNode* _tail;
@@ -275,7 +275,7 @@ public:
void merge_bufferlists(G1RedirtyCardsQueueSet* src);
- G1BufferNodeList take_all_completed_buffers();
+ BufferNodeList take_all_completed_buffers();
void flush_queue(G1DirtyCardQueue& queue);
diff --git a/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp b/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp
index a1802e01821..d6c2ae148be 100644
--- a/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp
+++ b/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@ void G1RedirtyCardsLocalQueueSet::enqueue(void* value) {
void G1RedirtyCardsLocalQueueSet::flush() {
flush_queue(_queue);
_shared_qset->add_bufferlist(_buffers);
- _buffers = G1BufferNodeList();
+ _buffers = BufferNodeList();
}
// G1RedirtyCardsLocalQueueSet::Queue
@@ -109,9 +109,9 @@ BufferNode* G1RedirtyCardsQueueSet::all_completed_buffers() const {
return _list.top();
}
-G1BufferNodeList G1RedirtyCardsQueueSet::take_all_completed_buffers() {
+BufferNodeList G1RedirtyCardsQueueSet::take_all_completed_buffers() {
DEBUG_ONLY(_collecting = false;)
- G1BufferNodeList result(_list.pop_all(), _tail, _entry_count);
+ BufferNodeList result(_list.pop_all(), _tail, _entry_count);
_tail = NULL;
_entry_count = 0;
DEBUG_ONLY(_collecting = true;)
@@ -135,7 +135,7 @@ void G1RedirtyCardsQueueSet::enqueue_completed_buffer(BufferNode* node) {
update_tail(node);
}
-void G1RedirtyCardsQueueSet::add_bufferlist(const G1BufferNodeList& buffers) {
+void G1RedirtyCardsQueueSet::add_bufferlist(const BufferNodeList& buffers) {
assert(_collecting, "precondition");
if (buffers._head != NULL) {
assert(buffers._tail != NULL, "invariant");
diff --git a/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.hpp b/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.hpp
index 26bb78c4096..b464d377298 100644
--- a/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.hpp
+++ b/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_G1_G1REDIRTYCARDSQUEUE_HPP
#define SHARE_GC_G1_G1REDIRTYCARDSQUEUE_HPP
-#include "gc/g1/g1BufferNodeList.hpp"
+#include "gc/shared/bufferNodeList.hpp"
#include "gc/shared/ptrQueue.hpp"
#include "memory/padded.hpp"
#include "utilities/macros.hpp"
@@ -42,7 +42,7 @@ class G1RedirtyCardsLocalQueueSet : private PtrQueueSet {
};
G1RedirtyCardsQueueSet* _shared_qset;
- G1BufferNodeList _buffers;
+ BufferNodeList _buffers;
Queue _queue;
// Add the buffer to the local list.
@@ -84,12 +84,12 @@ public:
// Collect buffers. These functions are thread-safe.
// precondition: Must not be concurrent with buffer processing.
virtual void enqueue_completed_buffer(BufferNode* node);
- void add_bufferlist(const G1BufferNodeList& buffers);
+ void add_bufferlist(const BufferNodeList& buffers);
// Processing phase operations.
// precondition: Must not be concurrent with buffer collection.
BufferNode* all_completed_buffers() const;
- G1BufferNodeList take_all_completed_buffers();
+ BufferNodeList take_all_completed_buffers();
};
#endif // SHARE_GC_G1_G1REDIRTYCARDSQUEUE_HPP
diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp
index c8f3b0d49b2..603ddbc1e26 100644
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
#include "gc/g1/heapRegion.inline.hpp"
#include "gc/g1/heapRegionManager.inline.hpp"
#include "gc/g1/heapRegionRemSet.inline.hpp"
+#include "gc/shared/bufferNodeList.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/ptrQueue.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
@@ -1429,7 +1430,7 @@ public:
{
if (initial_evacuation) {
G1DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set();
- G1BufferNodeList buffers = dcqs.take_all_completed_buffers();
+ BufferNodeList buffers = dcqs.take_all_completed_buffers();
if (buffers._entry_count != 0) {
_dirty_card_buffers.prepend(*buffers._head, *buffers._tail);
}
diff --git a/src/hotspot/share/gc/g1/g1BufferNodeList.cpp b/src/hotspot/share/gc/shared/bufferNodeList.cpp
similarity index 80%
rename from src/hotspot/share/gc/g1/g1BufferNodeList.cpp
rename to src/hotspot/share/gc/shared/bufferNodeList.cpp
index 3b89b0c7cd7..bcf4b42ec96 100644
--- a/src/hotspot/share/gc/g1/g1BufferNodeList.cpp
+++ b/src/hotspot/share/gc/shared/bufferNodeList.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,15 +23,15 @@
*/
#include "precompiled.hpp"
-#include "gc/g1/g1BufferNodeList.hpp"
+#include "gc/shared/bufferNodeList.hpp"
#include "utilities/debug.hpp"
-G1BufferNodeList::G1BufferNodeList() :
+BufferNodeList::BufferNodeList() :
_head(NULL), _tail(NULL), _entry_count(0) {}
-G1BufferNodeList::G1BufferNodeList(BufferNode* head,
- BufferNode* tail,
- size_t entry_count) :
+BufferNodeList::BufferNodeList(BufferNode* head,
+ BufferNode* tail,
+ size_t entry_count) :
_head(head), _tail(tail), _entry_count(entry_count)
{
assert((_head == NULL) == (_tail == NULL), "invariant");
diff --git a/src/hotspot/share/gc/g1/g1BufferNodeList.hpp b/src/hotspot/share/gc/shared/bufferNodeList.hpp
similarity index 79%
rename from src/hotspot/share/gc/g1/g1BufferNodeList.hpp
rename to src/hotspot/share/gc/shared/bufferNodeList.hpp
index 785c3118f9b..ae66a1fcc71 100644
--- a/src/hotspot/share/gc/g1/g1BufferNodeList.hpp
+++ b/src/hotspot/share/gc/shared/bufferNodeList.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,21 +22,20 @@
*
*/
-#ifndef SHARE_GC_G1_G1BUFFERNODELIST_HPP
-#define SHARE_GC_G1_G1BUFFERNODELIST_HPP
+#ifndef SHARE_GC_SHARED_BUFFERNODELIST_HPP
+#define SHARE_GC_SHARED_BUFFERNODELIST_HPP
#include "utilities/globalDefinitions.hpp"
class BufferNode;
-struct G1BufferNodeList {
+struct BufferNodeList {
BufferNode* _head; // First node in list or NULL if empty.
BufferNode* _tail; // Last node in list or NULL if empty.
size_t _entry_count; // Sum of entries in nodes in list.
- G1BufferNodeList();
- G1BufferNodeList(BufferNode* head, BufferNode* tail, size_t entry_count);
+ BufferNodeList();
+ BufferNodeList(BufferNode* head, BufferNode* tail, size_t entry_count);
};
-#endif // SHARE_GC_G1_G1BUFFERNODELIST_HPP
-
+#endif // SHARE_GC_SHARED_BUFFERNODELIST_HPP
--
GitLab
From dae2226a538f7156056d1f101fb5b4d1c6f72520 Mon Sep 17 00:00:00 2001
From: Alexey Ivanov
Date: Mon, 24 Jan 2022 18:30:31 +0000
Subject: [PATCH 022/339] 8279795: Fix typo in BasicFileChooserUI: Constucts ->
Constructs
Reviewed-by: prr, serb
---
.../swing/plaf/basic/BasicFileChooserUI.java | 72 ++++++++++++++-----
1 file changed, 55 insertions(+), 17 deletions(-)
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java
index 33f42da00f8..439101c0ef2 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,21 +25,58 @@
package javax.swing.plaf.basic;
-import javax.swing.*;
-import javax.swing.filechooser.*;
-import javax.swing.filechooser.FileFilter;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.datatransfer.*;
-import java.beans.*;
-import java.io.*;
-import java.util.*;
+import java.awt.BorderLayout;
+import java.awt.Toolkit;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Hashtable;
import java.util.List;
-import java.util.regex.*;
+import java.util.Locale;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.ActionMap;
+import javax.swing.Icon;
+import javax.swing.InputMap;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTable;
+import javax.swing.LookAndFeel;
+import javax.swing.SwingUtilities;
+import javax.swing.TransferHandler;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.filechooser.FileFilter;
+import javax.swing.filechooser.FileSystemView;
+import javax.swing.filechooser.FileView;
+import javax.swing.plaf.ActionMapUIResource;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.FileChooserUI;
+import javax.swing.plaf.UIResource;
+
import sun.awt.shell.ShellFolder;
-import sun.swing.*;
+import sun.swing.DefaultLookup;
+import sun.swing.FilePane;
+import sun.swing.SwingUtilities2;
+import sun.swing.UIAction;
/**
* Basic L&F implementation of a FileChooser.
@@ -723,11 +760,12 @@ public class BasicFileChooserUI extends FileChooserUI {
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
Handler handler;
+
/**
- * Constucts a {@code DoubleClickListener}.
- * @param list the lsit
+ * Constructs a {@code DoubleClickListener}.
+ * @param list the list
*/
- public DoubleClickListener(JList> list) {
+ public DoubleClickListener(JList> list) {
handler = new Handler(list);
}
--
GitLab
From acd98294c628e8e03a036a8e3e08d775147b2fda Mon Sep 17 00:00:00 2001
From: Alexey Ivanov
Date: Mon, 24 Jan 2022 18:31:43 +0000
Subject: [PATCH 023/339] 8279794: Fix typos in BasicScrollBarUI: Laysouts a
vertical scroll bar
Reviewed-by: prr, psadhukhan
---
.../swing/plaf/basic/BasicScrollBarUI.java | 53 ++++++++++++++-----
1 file changed, 41 insertions(+), 12 deletions(-)
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java
index afb2d58b885..8c7f348097e 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,47 @@
package javax.swing.plaf.basic;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.LayoutManager;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseMotionListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.BoundedRangeModel;
+import javax.swing.InputMap;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JList;
+import javax.swing.JScrollBar;
+import javax.swing.JScrollPane;
+import javax.swing.JViewport;
+import javax.swing.LookAndFeel;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+import javax.swing.Timer;
+import javax.swing.UIManager;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.ScrollBarUI;
+import javax.swing.plaf.UIResource;
+
import sun.swing.DefaultLookup;
import sun.swing.UIAction;
-import java.awt.*;
-import java.awt.event.*;
-
-import java.beans.*;
-
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
-
import static sun.swing.SwingUtilities2.drawHLine;
import static sun.swing.SwingUtilities2.drawRect;
import static sun.swing.SwingUtilities2.drawVLine;
@@ -754,7 +783,7 @@ public class BasicScrollBarUI
}
/**
- * Laysouts a vertical scroll bar.
+ * Lays out a vertical scroll bar.
* @param sb the scroll bar
*/
protected void layoutVScrollbar(JScrollBar sb)
@@ -856,7 +885,7 @@ public class BasicScrollBarUI
}
/**
- * Laysouts a vertical scroll bar.
+ * Lays out a horizontal scroll bar.
* @param sb the scroll bar
*/
protected void layoutHScrollbar(JScrollBar sb)
--
GitLab
From 0b5c54be675c63ecac17cd37f6d388fd42f09aa8 Mon Sep 17 00:00:00 2001
From: Alexey Ivanov
Date: Mon, 24 Jan 2022 18:32:35 +0000
Subject: [PATCH 024/339] 8279798: Javadoc for BasicTabbedPaneUI is
inconsistent
Reviewed-by: prr, psadhukhan
---
.../swing/plaf/basic/BasicTabbedPaneUI.java | 89 +++++++++++++------
1 file changed, 64 insertions(+), 25 deletions(-)
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java
index c9e5fd51f7f..3fc99dd2bc7 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,21 +25,60 @@
package javax.swing.plaf.basic;
-import sun.swing.SwingUtilities2;
-
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
-import javax.swing.text.View;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.beans.PropertyChangeListener;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Insets;
+import java.awt.LayoutManager;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ContainerEvent;
+import java.awt.event.ContainerListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
import java.beans.PropertyChangeEvent;
-import java.util.Vector;
+import java.beans.PropertyChangeListener;
import java.util.Hashtable;
+import java.util.Vector;
+
+import javax.swing.Action;
+import javax.swing.ActionMap;
+import javax.swing.Icon;
+import javax.swing.InputMap;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+import javax.swing.JViewport;
+import javax.swing.KeyStroke;
+import javax.swing.LookAndFeel;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.plaf.ComponentInputMapUIResource;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.TabbedPaneUI;
+import javax.swing.plaf.UIResource;
+import javax.swing.text.View;
import sun.swing.DefaultLookup;
+import sun.swing.SwingUtilities2;
import sun.swing.UIAction;
/**
@@ -216,7 +255,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
public BasicTabbedPaneUI() {}
/**
- * Create a UI.
+ * Creates a UI.
* @param c a component
* @return a UI
*/
@@ -386,7 +425,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * Install the defaults.
+ * Installs the defaults.
*/
protected void installDefaults() {
LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background",
@@ -423,7 +462,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * Uninstall the defaults.
+ * Uninstalls the defaults.
*/
protected void uninstallDefaults() {
highlight = null;
@@ -438,7 +477,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * Install the listeners.
+ * Installs the listeners.
*/
protected void installListeners() {
if ((propertyChangeListener = createPropertyChangeListener()) != null) {
@@ -461,7 +500,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * Uninstall the listeners.
+ * Uninstalls the listeners.
*/
protected void uninstallListeners() {
if (mouseListener != null) {
@@ -1090,9 +1129,9 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * Laysout a label.
+ * Lays out a label.
* @param tabPlacement the tab placement
- * @param metrics the font metric
+ * @param metrics the font metrics
* @param tabIndex the tab index
* @param title the title
* @param icon the icon
@@ -2144,7 +2183,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
// Tab Navigation methods
/**
- * Navigate the selected tab.
+ * Navigates the selected tab.
* @param direction the direction
*/
protected void navigateSelectedTab(int direction) {
@@ -2226,7 +2265,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * Select the next tab in the run.
+ * Selects the next tab in the run.
* @param current the current tab
*/
protected void selectNextTabInRun(int current) {
@@ -2240,7 +2279,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * Select the previous tab in the run.
+ * Selects the previous tab in the run.
* @param current the current tab
*/
protected void selectPreviousTabInRun(int current) {
@@ -2254,7 +2293,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * Select the next tab.
+ * Selects the next tab.
* @param current the current tab
*/
protected void selectNextTab(int current) {
@@ -2267,7 +2306,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * Select the previous tab.
+ * Selects the previous tab.
* @param current the current tab
*/
protected void selectPreviousTab(int current) {
@@ -2772,7 +2811,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
* Returns the preferred tab area width.
* @param tabPlacement the tab placement
* @param height the height
- * @return the preferred tab area widty
+ * @return the preferred tab area width
*/
protected int preferredTabAreaWidth(int tabPlacement, int height) {
FontMetrics metrics = getFontMetrics();
--
GitLab
From a825a4a1dba14317547b57bc0188b1e912baa251 Mon Sep 17 00:00:00 2001
From: Alexey Ivanov
Date: Mon, 24 Jan 2022 18:35:53 +0000
Subject: [PATCH 025/339] 8279861: Clarify 'rect' parameters and description of
paintTabBorder method in BasicTabbedPaneUI
Reviewed-by: prr, psadhukhan
---
.../javax/swing/plaf/basic/BasicTabbedPaneUI.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java
index 3fc99dd2bc7..360e98eee7a 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java
@@ -955,7 +955,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
* Paints a tab.
* @param g the graphics
* @param tabPlacement the tab placement
- * @param rects rectangles
+ * @param rects the tab rectangles
* @param tabIndex the tab index
* @param iconRect the icon rectangle
* @param textRect the text rectangle
@@ -1301,7 +1301,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
* Paints the focus indicator.
* @param g the graphics
* @param tabPlacement the tab placement
- * @param rects rectangles
+ * @param rects the tab rectangles
* @param tabIndex the tab index
* @param iconRect the icon rectangle
* @param textRect the text rectangle
@@ -1346,9 +1346,9 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * this function draws the border around each tab
- * note that this function does now draw the background of the tab.
- * that is done elsewhere
+ * Paints the border around a tab.
+ * Note that this function does not paint the background of the tab,
+ * that is done elsewhere.
*
* @param g the graphics context in which to paint
* @param tabPlacement the placement (left, right, bottom, top) of the tab
@@ -1878,7 +1878,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
}
/**
- * Assure the rectangles are created.
+ * Assures the tab rectangles are created.
* @param tabCount the tab count
*/
protected void assureRectsCreated(int tabCount) {
--
GitLab
From a5416669a57a7739af13efc32ec084560527862b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Jeli=C5=84ski?=
Date: Mon, 24 Jan 2022 19:31:11 +0000
Subject: [PATCH 026/339] 8280474: Garbage value passed to getLocaleInfoWrapper
in HostLocaleProviderAdapter_md
Reviewed-by: naoto, alanb
---
.../windows/native/libjava/HostLocaleProviderAdapter_md.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c b/src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c
index 879422f096f..b7c2bcc28db 100644
--- a/src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c
+++ b/src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -835,7 +835,7 @@ void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jint calid, jobjec
WCHAR name[BUFLEN];
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
jstring tmp_string;
- CALTYPE isGenitive;
+ CALTYPE isGenitive = 0;
CHECK_NULL(langtag);
--
GitLab
From 8e82d0021c119b7793870811fad37d7659c1174d Mon Sep 17 00:00:00 2001
From: Joe Darcy
Date: Mon, 24 Jan 2022 20:16:38 +0000
Subject: [PATCH 027/339] 8280492: Use cross-module syntax for cross-module
links
Reviewed-by: iris, serb, lancea, dfuchs, aivanov
---
.../share/classes/java/io/FilenameFilter.java | 4 +--
.../share/classes/java/lang/Character.java | 8 +++---
.../share/classes/java/lang/System.java | 24 ++++++++---------
.../java/lang/invoke/MethodHandleProxies.java | 4 +--
.../java/lang/invoke/MethodHandles.java | 4 +--
.../share/classes/java/net/package-info.java | 4 +--
.../text/AttributedCharacterIterator.java | 6 ++---
.../share/classes/java/text/Bidi.java | 8 +++---
.../share/classes/java/util/Observable.java | 4 +--
.../classes/java/util/ServiceLoader.java | 4 +--
.../java/awt/datatransfer/Clipboard.java | 14 +++++-----
.../classes/java/util/logging/LogManager.java | 8 +++---
.../java/util/logging/LoggingMXBean.java | 14 +++++-----
.../lang/management/ManagementFactory.java | 4 +--
.../management/PlatformLoggingMXBean.java | 26 +++++++++----------
.../management/remote/JMXAddressable.java | 4 +--
.../remote/JMXServerErrorException.java | 4 +--
17 files changed, 72 insertions(+), 72 deletions(-)
diff --git a/src/java.base/share/classes/java/io/FilenameFilter.java b/src/java.base/share/classes/java/io/FilenameFilter.java
index fcd81479ee1..019ffb11771 100644
--- a/src/java.base/share/classes/java/io/FilenameFilter.java
+++ b/src/java.base/share/classes/java/io/FilenameFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@ package java.io;
*
* @author Arthur van Hoff
* @author Jonathan Payne
- * @see java.awt.FileDialog#setFilenameFilter(java.io.FilenameFilter)
+ * @see java.desktop/java.awt.FileDialog#setFilenameFilter(java.io.FilenameFilter)
* @see java.io.File
* @see java.io.File#list(java.io.FilenameFilter)
* @since 1.0
diff --git a/src/java.base/share/classes/java/lang/Character.java b/src/java.base/share/classes/java/lang/Character.java
index 1cc12940ef1..0fdd23997cc 100644
--- a/src/java.base/share/classes/java/lang/Character.java
+++ b/src/java.base/share/classes/java/lang/Character.java
@@ -10302,7 +10302,7 @@ class Character implements java.io.Serializable, Comparable, Constabl
* @see Character#isJavaIdentifierPart(char)
* @see Character#isLetter(char)
* @see Character#isUnicodeIdentifierStart(char)
- * @see javax.lang.model.SourceVersion#isIdentifier(CharSequence)
+ * @see java.compiler/javax.lang.model.SourceVersion#isIdentifier(CharSequence)
* @since 1.1
*/
public static boolean isJavaIdentifierStart(char ch) {
@@ -10331,7 +10331,7 @@ class Character implements java.io.Serializable, Comparable, Constabl
* @see Character#isJavaIdentifierPart(int)
* @see Character#isLetter(int)
* @see Character#isUnicodeIdentifierStart(int)
- * @see javax.lang.model.SourceVersion#isIdentifier(CharSequence)
+ * @see java.compiler/javax.lang.model.SourceVersion#isIdentifier(CharSequence)
* @since 1.5
*/
public static boolean isJavaIdentifierStart(int codePoint) {
@@ -10368,7 +10368,7 @@ class Character implements java.io.Serializable, Comparable, Constabl
* @see Character#isJavaIdentifierStart(char)
* @see Character#isLetterOrDigit(char)
* @see Character#isUnicodeIdentifierPart(char)
- * @see javax.lang.model.SourceVersion#isIdentifier(CharSequence)
+ * @see java.compiler/javax.lang.model.SourceVersion#isIdentifier(CharSequence)
* @since 1.1
*/
public static boolean isJavaIdentifierPart(char ch) {
@@ -10401,7 +10401,7 @@ class Character implements java.io.Serializable, Comparable, Constabl
* @see Character#isJavaIdentifierStart(int)
* @see Character#isLetterOrDigit(int)
* @see Character#isUnicodeIdentifierPart(int)
- * @see javax.lang.model.SourceVersion#isIdentifier(CharSequence)
+ * @see java.compiler/javax.lang.model.SourceVersion#isIdentifier(CharSequence)
* @since 1.5
*/
public static boolean isJavaIdentifierPart(int codePoint) {
diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java
index 47b436847cb..2f9c205a327 100644
--- a/src/java.base/share/classes/java/lang/System.java
+++ b/src/java.base/share/classes/java/lang/System.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1207,7 +1207,7 @@ public final class System {
* Severity values and Mapping to {@code java.util.logging.Level}.
*
* {@linkplain System.Logger.Level System logger levels} are mapped to
- * {@linkplain java.util.logging.Level java.util.logging levels}
+ * {@linkplain java.logging/java.util.logging.Level java.util.logging levels}
* of corresponding severity.
* The mapping is as follows:
*
@@ -1219,19 +1219,19 @@ public final class System {
*
*
*
*
@@ -1542,7 +1542,7 @@ public final class System {
* {@code java.util.logging} as the backend framework when the
* {@code java.logging} module is present.
* It returns a {@linkplain System.Logger logger} instance
- * that will route log messages to a {@link java.util.logging.Logger
+ * that will route log messages to a {@link java.logging/java.util.logging.Logger
* java.util.logging.Logger}. Otherwise, if {@code java.logging} is not
* present, the default implementation will return a simple logger
* instance that will route log messages of {@code INFO} level and above to
@@ -1556,7 +1556,7 @@ public final class System {
* logging backend, and usually requires using APIs specific to that backend.
*
For the default {@code LoggerFinder} implementation
* using {@code java.util.logging} as its backend, refer to
- * {@link java.util.logging java.util.logging} for logging configuration.
+ * {@link java.logging/java.util.logging java.util.logging} for logging configuration.
* For the default {@code LoggerFinder} implementation returning simple loggers
* when the {@code java.logging} module is absent, the configuration
* is implementation dependent.
@@ -1591,7 +1591,7 @@ public final class System {
* System.Logger.Level} to a level supported by the logging backend it uses.
* The default LoggerFinder using {@code java.util.logging} as the backend
* maps {@code System.Logger} levels to
- * {@linkplain java.util.logging.Level java.util.logging} levels
+ * {@linkplain java.logging/java.util.logging.Level java.util.logging} levels
* of corresponding severity - as described in {@link Logger.Level
* Logger.Level}.
*
diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java
index 4dd2b1fce7e..784d672ff8f 100644
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -88,7 +88,7 @@ public class MethodHandleProxies {
* Therefore, each instance must implement a unique single-method interface.
* Implementations may not bundle together
* multiple single-method interfaces onto single implementation classes
- * in the style of {@link java.awt.AWTEventMulticaster}.
+ * in the style of {@link java.desktop/java.awt.AWTEventMulticaster}.
*
* The method handle may throw an undeclared exception,
* which means any checked exception (or other checked throwable)
diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
index 743ebb66759..908c277fa86 100644
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2002,7 +2002,7 @@ public class MethodHandles {
* there is no internal form available to record in any class's constant pool.
* A hidden class or interface is not discoverable by {@link Class#forName(String, boolean, ClassLoader)},
* {@link ClassLoader#loadClass(String, boolean)}, or {@link #findClass(String)}, and
- * is not {@linkplain java.lang.instrument.Instrumentation#isModifiableClass(Class)
+ * is not {@linkplain java.instrument/java.lang.instrument.Instrumentation#isModifiableClass(Class)
* modifiable} by Java agents or tool agents using the
* JVM Tool Interface.
*
diff --git a/src/java.base/share/classes/java/net/package-info.java b/src/java.base/share/classes/java/net/package-info.java
index b221c6bf2f7..e0325f6a0f1 100644
--- a/src/java.base/share/classes/java/net/package-info.java
+++ b/src/java.base/share/classes/java/net/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
*
{@link java.net.HttpURLConnection} is a subclass of URLConnection
* and provides some additional functionalities specific to the
* HTTP protocol. This API has been superseded by the newer
- * {@linkplain java.net.http HTTP Client API}.
The recommended usage is to use {@link java.net.URI} to identify
* resources, then convert it into a {@link java.net.URL} when it is time to
diff --git a/src/java.base/share/classes/java/text/AttributedCharacterIterator.java b/src/java.base/share/classes/java/text/AttributedCharacterIterator.java
index 31b5b7d8d3c..a77417462a7 100644
--- a/src/java.base/share/classes/java/text/AttributedCharacterIterator.java
+++ b/src/java.base/share/classes/java/text/AttributedCharacterIterator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -67,10 +67,10 @@ import java.util.Set;
*
*
* Attribute keys are instances of {@link AttributedCharacterIterator.Attribute} and its
- * subclasses, such as {@link java.awt.font.TextAttribute}.
+ * subclasses, such as {@link java.desktop/java.awt.font.TextAttribute}.
*
* @see AttributedCharacterIterator.Attribute
- * @see java.awt.font.TextAttribute
+ * @see java.desktop/java.awt.font.TextAttribute
* @see AttributedString
* @see Annotation
* @since 1.2
diff --git a/src/java.base/share/classes/java/text/Bidi.java b/src/java.base/share/classes/java/text/Bidi.java
index 00a878e1c64..41269afac9b 100644
--- a/src/java.base/share/classes/java/text/Bidi.java
+++ b/src/java.base/share/classes/java/text/Bidi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -121,9 +121,9 @@ public final class Bidi {
*
* @param paragraph a paragraph of text with optional character and paragraph attribute information
*
- * @see java.awt.font.TextAttribute#BIDI_EMBEDDING
- * @see java.awt.font.TextAttribute#NUMERIC_SHAPING
- * @see java.awt.font.TextAttribute#RUN_DIRECTION
+ * @see java.desktop/java.awt.font.TextAttribute#BIDI_EMBEDDING
+ * @see java.desktop/java.awt.font.TextAttribute#NUMERIC_SHAPING
+ * @see java.desktop/java.awt.font.TextAttribute#RUN_DIRECTION
*/
public Bidi(AttributedCharacterIterator paragraph) {
if (paragraph == null) {
diff --git a/src/java.base/share/classes/java/util/Observable.java b/src/java.base/share/classes/java/util/Observable.java
index d71bf5d5d4c..37a90f631ad 100644
--- a/src/java.base/share/classes/java/util/Observable.java
+++ b/src/java.base/share/classes/java/util/Observable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@ package java.util;
* {@code Observable} is unspecified, and state changes are not in
* one-for-one correspondence with notifications.
* For a richer event model, consider using the
- * {@link java.beans} package. For reliable and ordered
+ * {@link java.desktop/java.beans} package. For reliable and ordered
* messaging among threads, consider using one of the concurrent data
* structures in the {@link java.util.concurrent} package.
* For reactive streams style programming, see the
diff --git a/src/java.base/share/classes/java/util/ServiceLoader.java b/src/java.base/share/classes/java/util/ServiceLoader.java
index 64b01c3157e..c5d921896a0 100644
--- a/src/java.base/share/classes/java/util/ServiceLoader.java
+++ b/src/java.base/share/classes/java/util/ServiceLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1585,7 +1585,7 @@ public final class ServiceLoader
* are located in the order that its module descriptor {@linkplain
* java.lang.module.ModuleDescriptor.Provides#providers() lists the
* providers}. Providers added dynamically by instrumentation agents (see
- * {@link java.lang.instrument.Instrumentation#redefineModule redefineModule})
+ * {@link java.instrument/java.lang.instrument.Instrumentation#redefineModule redefineModule})
* are always located after providers declared by the module.
*
*
Step 2: Locate providers in unnamed modules.
diff --git a/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java b/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java
index ad3a56a701f..8aac4495547 100644
--- a/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java
+++ b/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,8 +43,8 @@ import sun.datatransfer.DataFlavorUtil;
*
* @author Amy Fowler
* @author Alexander Gerasimov
- * @see java.awt.Toolkit#getSystemClipboard
- * @see java.awt.Toolkit#getSystemSelection
+ * @see java.desktop/java.awt.Toolkit#getSystemClipboard
+ * @see java.desktop/java.awt.Toolkit#getSystemSelection
* @since 1.1
*/
public class Clipboard {
@@ -81,7 +81,7 @@ public class Clipboard {
* Creates a clipboard object.
*
* @param name for the clipboard
- * @see java.awt.Toolkit#getSystemClipboard
+ * @see java.desktop/java.awt.Toolkit#getSystemClipboard
*/
public Clipboard(String name) {
this.name = name;
@@ -91,7 +91,7 @@ public class Clipboard {
* Returns the name of this clipboard object.
*
* @return the name of this clipboard object
- * @see java.awt.Toolkit#getSystemClipboard
+ * @see java.desktop/java.awt.Toolkit#getSystemClipboard
*/
public String getName() {
return name;
@@ -118,7 +118,7 @@ public class Clipboard {
* content
* @param owner the object which owns the clipboard content
* @throws IllegalStateException if the clipboard is currently unavailable
- * @see java.awt.Toolkit#getSystemClipboard
+ * @see java.desktop/java.awt.Toolkit#getSystemClipboard
*/
public synchronized void setContents(Transferable contents, ClipboardOwner owner) {
final ClipboardOwner oldOwner = this.owner;
@@ -145,7 +145,7 @@ public class Clipboard {
* @param requestor the object requesting the clip data (not used)
* @return the current transferable object on the clipboard
* @throws IllegalStateException if the clipboard is currently unavailable
- * @see java.awt.Toolkit#getSystemClipboard
+ * @see java.desktop/java.awt.Toolkit#getSystemClipboard
*/
public synchronized Transferable getContents(Object requestor) {
return contents;
diff --git a/src/java.logging/share/classes/java/util/logging/LogManager.java b/src/java.logging/share/classes/java/util/logging/LogManager.java
index 59950865283..38e9ebafeb6 100644
--- a/src/java.logging/share/classes/java/util/logging/LogManager.java
+++ b/src/java.logging/share/classes/java/util/logging/LogManager.java
@@ -2556,10 +2556,10 @@ public class LogManager {
/**
* String representation of the
- * {@link javax.management.ObjectName} for the management interface
+ * {@link java.management/javax.management.ObjectName} for the management interface
* for the logging facility.
*
- * @see java.lang.management.PlatformLoggingMXBean
+ * @see java.management/java.lang.management.PlatformLoggingMXBean
*
* @since 1.5
*/
@@ -2573,11 +2573,11 @@ public class LogManager {
*
* @deprecated {@code java.util.logging.LoggingMXBean} is deprecated and
* replaced with {@code java.lang.management.PlatformLoggingMXBean}. Use
- * {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
+ * {@link java.management/java.lang.management.ManagementFactory#getPlatformMXBean(Class)
* ManagementFactory.getPlatformMXBean}(PlatformLoggingMXBean.class)
* instead.
*
- * @see java.lang.management.PlatformLoggingMXBean
+ * @see java.management/java.lang.management.PlatformLoggingMXBean
* @since 1.5
*/
@Deprecated(since="9")
diff --git a/src/java.logging/share/classes/java/util/logging/LoggingMXBean.java b/src/java.logging/share/classes/java/util/logging/LoggingMXBean.java
index 812eb36622d..b966421f9b0 100644
--- a/src/java.logging/share/classes/java/util/logging/LoggingMXBean.java
+++ b/src/java.logging/share/classes/java/util/logging/LoggingMXBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,18 +29,18 @@ package java.util.logging;
/**
* The management interface for the logging facility.
*
- * {@link java.lang.management.PlatformLoggingMXBean
+ * {@link java.management/java.lang.management.PlatformLoggingMXBean
* java.lang.management.PlatformLoggingMXBean} is the management interface
* for logging facility registered in the {@link
- * java.lang.management.ManagementFactory#getPlatformMBeanServer()
+ * java.management/java.lang.management.ManagementFactory#getPlatformMBeanServer()
* platform MBeanServer}.
* It is recommended to use the {@code PlatformLoggingMXBean} obtained via
- * the {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
+ * the {@link java.management/java.lang.management.ManagementFactory#getPlatformMXBean(Class)
* ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class)} method.
*
* @deprecated {@code LoggingMXBean} is no longer a {@link
- * java.lang.management.PlatformManagedObject platform MXBean} and is replaced
- * with {@link java.lang.management.PlatformLoggingMXBean}.
+ * java.management/java.lang.management.PlatformManagedObject platform MXBean} and is replaced
+ * with {@link java.management/java.lang.management.PlatformLoggingMXBean}.
* It will not register in the platform {@code MBeanServer}.
* Use {@code ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class)}
* instead.
@@ -49,7 +49,7 @@ package java.util.logging;
* @author Mandy Chung
* @since 1.5
*
- * @see java.lang.management.PlatformLoggingMXBean
+ * @see java.management/java.lang.management.PlatformLoggingMXBean
*/
@Deprecated(since="9")
public interface LoggingMXBean {
diff --git a/src/java.management/share/classes/java/lang/management/ManagementFactory.java b/src/java.management/share/classes/java/lang/management/ManagementFactory.java
index cba413ccf63..76bc7417e68 100644
--- a/src/java.management/share/classes/java/lang/management/ManagementFactory.java
+++ b/src/java.management/share/classes/java/lang/management/ManagementFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -176,7 +176,7 @@ import sun.management.spi.PlatformMBeanProvider.PlatformComponent;
*
*
*
diff --git a/src/java.management/share/classes/java/lang/management/PlatformLoggingMXBean.java b/src/java.management/share/classes/java/lang/management/PlatformLoggingMXBean.java
index 80595dd75d6..280d145be37 100644
--- a/src/java.management/share/classes/java/lang/management/PlatformLoggingMXBean.java
+++ b/src/java.management/share/classes/java/lang/management/PlatformLoggingMXBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
package java.lang.management;
/**
- * The management interface for the {@linkplain java.util.logging logging} facility.
+ * The management interface for the {@linkplain java.logging/java.util.logging logging} facility.
*
*
There is a single global instance of the {@code PlatformLoggingMXBean}.
* The {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
@@ -41,7 +41,7 @@ package java.lang.management;
* The {@link javax.management.ObjectName ObjectName} for uniquely
* identifying the {@code PlatformLoggingMXBean} within an MBeanServer is:
*
*
* @since 1.7
@@ -50,8 +50,8 @@ public interface PlatformLoggingMXBean extends PlatformManagedObject {
/**
* Returns the list of the currently registered
- * {@linkplain java.util.logging.Logger logger} names. This method
- * calls {@link java.util.logging.LogManager#getLoggerNames} and
+ * {@linkplain java.logging/java.util.logging.Logger logger} names. This method
+ * calls {@link java.logging/java.util.logging.LogManager#getLoggerNames} and
* returns a list of the logger names.
*
* @return A list of {@code String} each of which is a
@@ -60,15 +60,15 @@ public interface PlatformLoggingMXBean extends PlatformManagedObject {
java.util.List getLoggerNames();
/**
- * Gets the name of the log {@linkplain java.util.logging.Logger#getLevel
+ * Gets the name of the log {@linkplain java.logging/java.util.logging.Logger#getLevel
* level} associated with the specified logger.
* If the specified logger does not exist, {@code null}
* is returned.
* This method first finds the logger of the given name and
* then returns the name of the log level by calling:
*
@@ -83,16 +83,16 @@ public interface PlatformLoggingMXBean extends PlatformManagedObject {
* is {@code null}. If the specified logger does not
* exist, {@code null} is returned.
*
- * @see java.util.logging.Logger#getLevel
+ * @see java.logging/java.util.logging.Logger#getLevel
*/
String getLoggerLevel(String loggerName);
/**
* Sets the specified logger to the specified new
- * {@linkplain java.util.logging.Logger#setLevel level}.
+ * {@linkplain java.logging/java.util.logging.Logger#setLevel level}.
* If the {@code levelName} is not {@code null}, the level
* of the specified logger is set to the parsed
- * {@link java.util.logging.Level Level}
+ * {@link java.logging/java.util.logging.Level Level}
* matching the {@code levelName}.
* If the {@code levelName} is {@code null}, the level
* of the specified logger is set to {@code null} and
@@ -111,13 +111,13 @@ public interface PlatformLoggingMXBean extends PlatformManagedObject {
* @throws SecurityException if a security manager exists and if
* the caller does not have LoggingPermission("control").
*
- * @see java.util.logging.Logger#setLevel
+ * @see java.logging/java.util.logging.Logger#setLevel
*/
void setLoggerLevel(String loggerName, String levelName);
/**
* Returns the name of the
- * {@linkplain java.util.logging.Logger#getParent parent}
+ * {@linkplain java.logging/java.util.logging.Logger#getParent parent}
* for the specified logger.
* If the specified logger does not exist, {@code null} is returned.
* If the specified logger is the root {@code Logger} in the namespace,
diff --git a/src/java.management/share/classes/javax/management/remote/JMXAddressable.java b/src/java.management/share/classes/javax/management/remote/JMXAddressable.java
index cc770b75194..973626b99a1 100644
--- a/src/java.management/share/classes/javax/management/remote/JMXAddressable.java
+++ b/src/java.management/share/classes/javax/management/remote/JMXAddressable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@ package javax.management.remote;
* Depending on the connector implementation, a {@link JMXConnector}
* object may implement this interface too. {@code JMXConnector}
* objects for the RMI Connector are instances of
- * {@link javax.management.remote.rmi.RMIConnector RMIConnector} which
+ * {@link java.management.rmi/javax.management.remote.rmi.RMIConnector RMIConnector} which
* implements this interface.
*
*
An object implementing this interface might not have an address
diff --git a/src/java.management/share/classes/javax/management/remote/JMXServerErrorException.java b/src/java.management/share/classes/javax/management/remote/JMXServerErrorException.java
index a8bf827fd3e..856234ad5dc 100644
--- a/src/java.management/share/classes/javax/management/remote/JMXServerErrorException.java
+++ b/src/java.management/share/classes/javax/management/remote/JMXServerErrorException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@ import javax.management.MBeanServer;
* JMXServerErrorException instance contains the original
* Error that occurred as its cause.
*
- * @see java.rmi.ServerError
+ * @see java.rmi/java.rmi.ServerError
* @since 1.5
*/
public class JMXServerErrorException extends IOException {
--
GitLab
From e3076552ec528864e61a6e0ec91e228006fddefc Mon Sep 17 00:00:00 2001
From: Ian Graves
Date: Mon, 24 Jan 2022 22:21:22 +0000
Subject: [PATCH 028/339] 8280403: RegEx: String.split can fail with NPE in
Pattern.CharPredicate::match
Reviewed-by: lancea, iris, naoto, rriggs
---
.../share/classes/java/util/regex/Pattern.java | 4 +++-
test/jdk/java/util/regex/RegExTest.java | 11 ++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/java.base/share/classes/java/util/regex/Pattern.java b/src/java.base/share/classes/java/util/regex/Pattern.java
index 84e1063621d..b1e3977d0b2 100644
--- a/src/java.base/share/classes/java/util/regex/Pattern.java
+++ b/src/java.base/share/classes/java/util/regex/Pattern.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2689,6 +2689,8 @@ loop: for(int x=0, offset=0; x
+ Pattern.compile(pattern));
+ assertTrue(e.getMessage().contains("Bad intersection syntax"));
+ }
}
--
GitLab
From f35df5bfb5d23f439fb64e8511fd5ca34c773f30 Mon Sep 17 00:00:00 2001
From: David Holmes
Date: Tue, 25 Jan 2022 01:22:48 +0000
Subject: [PATCH 029/339] 8280422: thread_from_jni_environment can never return
NULL
Reviewed-by: shade, kbarrett
---
src/hotspot/share/runtime/globals.hpp | 4 ----
.../share/runtime/interfaceSupport.inline.hpp | 9 ++++++--
src/hotspot/share/runtime/thread.hpp | 23 +++++++++++--------
3 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
index c963a69fa60..bc80a2eb45f 100644
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -1191,10 +1191,6 @@ const intx ObjectAlignmentInBytes = 8;
develop(bool, VerifyJNIFields, trueInDebug, \
"Verify jfieldIDs for instance fields") \
\
- notproduct(bool, VerifyJNIEnvThread, false, \
- "Verify JNIEnv.thread == Thread::current() when entering VM " \
- "from JNI") \
- \
develop(bool, VerifyFPU, false, \
"Verify FPU state (check for NaN's, etc.)") \
\
diff --git a/src/hotspot/share/runtime/interfaceSupport.inline.hpp b/src/hotspot/share/runtime/interfaceSupport.inline.hpp
index 26a0cfe608e..13ecf2d80ce 100644
--- a/src/hotspot/share/runtime/interfaceSupport.inline.hpp
+++ b/src/hotspot/share/runtime/interfaceSupport.inline.hpp
@@ -340,6 +340,11 @@ class VMNativeEntryWrapper {
#define JRT_END }
// Definitions for JNI
+//
+// As the JNIEnv can be passed from external native code we validate
+// it in debug builds, primarily for our own testing. In general JNI
+// does not attempt to detect programming errors and a bad JNIEnv may
+// not even be readable.
#define JNI_ENTRY(result_type, header) \
JNI_ENTRY_NO_PRESERVE(result_type, header) \
@@ -349,7 +354,7 @@ class VMNativeEntryWrapper {
extern "C" { \
result_type JNICALL header { \
JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
- assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
+ assert(thread == Thread::current(), "JNIEnv is only valid in same thread"); \
MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
ThreadInVMfromNative __tiv(thread); \
debug_only(VMNativeEntryWrapper __vew;) \
@@ -360,7 +365,7 @@ extern "C" { \
extern "C" { \
result_type JNICALL header { \
JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
- assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
+ assert(thread == Thread::current(), "JNIEnv is only valid in same thread"); \
VM_LEAF_BASE(result_type, header)
diff --git a/src/hotspot/share/runtime/thread.hpp b/src/hotspot/share/runtime/thread.hpp
index 74916b98275..71100dbe637 100644
--- a/src/hotspot/share/runtime/thread.hpp
+++ b/src/hotspot/share/runtime/thread.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -1312,16 +1312,21 @@ class JavaThread: public Thread {
// Returns the jni environment for this thread
JNIEnv* jni_environment() { return &_jni_environment; }
+ // Returns the current thread as indicated by the given JNIEnv.
+ // We don't assert it is Thread::current here as that is done at the
+ // external JNI entry points where the JNIEnv is passed into the VM.
static JavaThread* thread_from_jni_environment(JNIEnv* env) {
- JavaThread *thread_from_jni_env = (JavaThread*)((intptr_t)env - in_bytes(jni_environment_offset()));
- // Only return NULL if thread is off the thread list; starting to
- // exit should not return NULL.
- if (thread_from_jni_env->is_terminated()) {
- thread_from_jni_env->block_if_vm_exited();
- return NULL;
- } else {
- return thread_from_jni_env;
+ JavaThread* current = (JavaThread*)((intptr_t)env - in_bytes(jni_environment_offset()));
+ // We can't get here in a thread that has completed its execution and so
+ // "is_terminated", but a thread is also considered terminated if the VM
+ // has exited, so we have to check this and block in case this is a daemon
+ // thread returning to the VM (the JNI DirectBuffer entry points rely on
+ // this).
+ if (current->is_terminated()) {
+ current->block_if_vm_exited();
+ ShouldNotReachHere();
}
+ return current;
}
// JNI critical regions. These can nest.
--
GitLab
From a59d717fd65d523bb6f4fc57949054e904a149f1 Mon Sep 17 00:00:00 2001
From: Zhengyu Gu
Date: Tue, 25 Jan 2022 01:31:24 +0000
Subject: [PATCH 030/339] 8280289: Enhance debug pp() command with NMT info
Reviewed-by: stuefe, iklam
---
src/hotspot/share/services/mallocTracker.cpp | 55 ++++++++++++-------
src/hotspot/share/services/mallocTracker.hpp | 14 +++--
.../share/services/virtualMemoryTracker.cpp | 28 +++++++++-
.../share/services/virtualMemoryTracker.hpp | 6 +-
src/hotspot/share/utilities/debug.cpp | 40 +++++++++++++-
5 files changed, 113 insertions(+), 30 deletions(-)
diff --git a/src/hotspot/share/services/mallocTracker.cpp b/src/hotspot/share/services/mallocTracker.cpp
index 285a60d853f..e27d312ad81 100644
--- a/src/hotspot/share/services/mallocTracker.cpp
+++ b/src/hotspot/share/services/mallocTracker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
#include "utilities/debug.hpp"
#include "utilities/ostream.hpp"
+#include "jvm_io.h"
+
size_t MallocMemorySummary::_snapshot[CALC_OBJ_SIZE_IN_TYPE(MallocMemorySnapshot, size_t)];
#ifdef ASSERT
@@ -115,7 +117,7 @@ void MallocHeader::mark_block_as_dead() {
void MallocHeader::release() {
assert(MemTracker::enabled(), "Sanity");
- check_block_integrity();
+ assert_block_integrity();
MallocMemorySummary::record_free(size(), flags());
MallocMemorySummary::record_free_malloc_header(sizeof(MallocHeader));
@@ -153,13 +155,18 @@ void MallocHeader::print_block_on_error(outputStream* st, address bad_address) c
os::print_hex_dump(st, from1, to2, 1);
}
}
+void MallocHeader::assert_block_integrity() const {
+ char msg[256];
+ address corruption = NULL;
+ if (!check_block_integrity(msg, sizeof(msg), &corruption)) {
+ if (corruption != NULL) {
+ print_block_on_error(tty, (address)this);
+ }
+ fatal("NMT corruption: Block at " PTR_FORMAT ": %s", p2i(this), msg);
+ }
+}
-// Check block integrity. If block is broken, print out a report
-// to tty (optionally with hex dump surrounding the broken block),
-// then trigger a fatal error.
-void MallocHeader::check_block_integrity() const {
-
-#define PREFIX "NMT corruption: "
+bool MallocHeader::check_block_integrity(char* msg, size_t msglen, address* p_corruption) const {
// Note: if you modify the error messages here, make sure you
// adapt the associated gtests too.
@@ -167,7 +174,8 @@ void MallocHeader::check_block_integrity() const {
// values. Note that we should not call this for ::free(NULL),
// which should be handled by os::free() above us.
if (((size_t)p2i(this)) < K) {
- fatal(PREFIX "Block at " PTR_FORMAT ": invalid block address", p2i(this));
+ jio_snprintf(msg, msglen, "invalid block address");
+ return false;
}
// From here on we assume the block pointer to be valid. We could
@@ -186,37 +194,42 @@ void MallocHeader::check_block_integrity() const {
// Should we ever start using std::max_align_t, this would be one place to
// fix up.
if (!is_aligned(this, sizeof(uint64_t))) {
- print_block_on_error(tty, (address)this);
- fatal(PREFIX "Block at " PTR_FORMAT ": block address is unaligned", p2i(this));
+ *p_corruption = (address)this;
+ jio_snprintf(msg, msglen, "block address is unaligned");
+ return false;
}
// Check header canary
if (_canary != _header_canary_life_mark) {
- print_block_on_error(tty, (address)this);
- fatal(PREFIX "Block at " PTR_FORMAT ": header canary broken.", p2i(this));
+ *p_corruption = (address)this;
+ jio_snprintf(msg, msglen, "header canary broken");
+ return false;
}
#ifndef _LP64
// On 32-bit we have a second canary, check that one too.
if (_alt_canary != _header_alt_canary_life_mark) {
- print_block_on_error(tty, (address)this);
- fatal(PREFIX "Block at " PTR_FORMAT ": header alternate canary broken.", p2i(this));
+ *p_corruption = (address)this;
+ jio_snprintf(msg, msglen, "header canary broken");
+ return false;
}
#endif
// Does block size seems reasonable?
if (_size >= max_reasonable_malloc_size) {
- print_block_on_error(tty, (address)this);
- fatal(PREFIX "Block at " PTR_FORMAT ": header looks invalid (weirdly large block size)", p2i(this));
+ *p_corruption = (address)this;
+ jio_snprintf(msg, msglen, "header looks invalid (weirdly large block size)");
+ return false;
}
// Check footer canary
if (get_footer() != _footer_canary_life_mark) {
- print_block_on_error(tty, footer_address());
- fatal(PREFIX "Block at " PTR_FORMAT ": footer canary broken at " PTR_FORMAT " (buffer overflow?)",
- p2i(this), p2i(footer_address()));
+ *p_corruption = footer_address();
+ jio_snprintf(msg, msglen, "footer canary broken at " PTR_FORMAT " (buffer overflow?)",
+ p2i(footer_address()));
+ return false;
}
-#undef PREFIX
+ return true;
}
bool MallocHeader::record_malloc_site(const NativeCallStack& stack, size_t size,
diff --git a/src/hotspot/share/services/mallocTracker.hpp b/src/hotspot/share/services/mallocTracker.hpp
index 6490b3d53ff..a0953c2b186 100644
--- a/src/hotspot/share/services/mallocTracker.hpp
+++ b/src/hotspot/share/services/mallocTracker.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -314,10 +314,9 @@ class MallocHeader {
// We discount sizes larger than these
static const size_t max_reasonable_malloc_size = LP64_ONLY(256 * G) NOT_LP64(3500 * M);
- // Check block integrity. If block is broken, print out a report
- // to tty (optionally with hex dump surrounding the broken block),
- // then trigger a fatal error.
- void check_block_integrity() const;
+ // If block is broken, print out a report to tty (optionally with
+ // hex dump surrounding the broken block), then trigger a fatal error
+ void assert_block_integrity() const;
void print_block_on_error(outputStream* st, address bad_address) const;
void mark_block_as_dead();
@@ -363,6 +362,11 @@ class MallocHeader {
// Cleanup tracking information and mark block as dead before the memory is released.
void release();
+ // If block is broken, fill in a short descriptive text in out,
+ // an option pointer to the corruption in p_corruption, and return false.
+ // Return true if block is fine.
+ bool check_block_integrity(char* msg, size_t msglen, address* p_corruption) const;
+
private:
inline void set_size(size_t size) {
_size = size;
diff --git a/src/hotspot/share/services/virtualMemoryTracker.cpp b/src/hotspot/share/services/virtualMemoryTracker.cpp
index 77fb24927f5..53a2cf10642 100644
--- a/src/hotspot/share/services/virtualMemoryTracker.cpp
+++ b/src/hotspot/share/services/virtualMemoryTracker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -671,3 +671,29 @@ bool VirtualMemoryTracker::walk_virtual_memory(VirtualMemoryWalker* walker) {
}
return true;
}
+
+class FindAndSnapshotRegionWalker : public VirtualMemoryWalker {
+private:
+ ReservedMemoryRegion& _region;
+ const address _p;
+ bool _found_region;
+public:
+ FindAndSnapshotRegionWalker(void* p, ReservedMemoryRegion& region) :
+ _region(region), _p((address)p), _found_region(false) { }
+
+ bool do_allocation_site(const ReservedMemoryRegion* rgn) {
+ if (rgn->contain_address(_p)) {
+ _region = *rgn;
+ _found_region = true;
+ return false;
+ }
+ return true;
+ }
+ bool found_region() const { return _found_region; }
+};
+
+const bool VirtualMemoryTracker::snapshot_region_contains(void* p, ReservedMemoryRegion& region) {
+ FindAndSnapshotRegionWalker walker(p, region);
+ walk_virtual_memory(&walker);
+ return walker.found_region();
+}
diff --git a/src/hotspot/share/services/virtualMemoryTracker.hpp b/src/hotspot/share/services/virtualMemoryTracker.hpp
index c96af6b8387..2f04503cf6e 100644
--- a/src/hotspot/share/services/virtualMemoryTracker.hpp
+++ b/src/hotspot/share/services/virtualMemoryTracker.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -341,7 +341,7 @@ class ReservedMemoryRegion : public VirtualMemoryRegion {
return *this;
}
- const char* flag_name() { return NMTUtil::flag_to_name(_flag); }
+ const char* flag_name() const { return NMTUtil::flag_to_name(_flag); }
private:
// The committed region contains the uncommitted region, subtract the uncommitted
@@ -387,6 +387,8 @@ class VirtualMemoryTracker : AllStatic {
// Walk virtual memory data structure for creating baseline, etc.
static bool walk_virtual_memory(VirtualMemoryWalker* walker);
+ static const bool snapshot_region_contains(void* p, ReservedMemoryRegion& region);
+
// Snapshot current thread stacks
static void snapshot_thread_stacks();
diff --git a/src/hotspot/share/utilities/debug.cpp b/src/hotspot/share/utilities/debug.cpp
index 1a0c3a84647..c3c98d3067f 100644
--- a/src/hotspot/share/utilities/debug.cpp
+++ b/src/hotspot/share/utilities/debug.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,7 @@
#include "runtime/handles.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
+#include "runtime/safefetch.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubCodeGenerator.hpp"
#include "runtime/stubRoutines.hpp"
@@ -51,7 +52,9 @@
#include "runtime/vframe.hpp"
#include "runtime/vm_version.hpp"
#include "services/heapDumper.hpp"
+#include "services/mallocTracker.hpp"
#include "services/memTracker.hpp"
+#include "services/virtualMemoryTracker.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/events.hpp"
#include "utilities/formatBuffer.hpp"
@@ -480,6 +483,41 @@ extern "C" JNIEXPORT void pp(void* p) {
oop obj = cast_to_oop(p);
obj->print();
} else {
+#if INCLUDE_NMT
+ // With NMT
+ if (MemTracker::enabled()) {
+ const NMT_TrackingLevel tracking_level = MemTracker::tracking_level();
+ ReservedMemoryRegion region(0, 0);
+ // Check and snapshot a mmap'd region that contains the pointer
+ if (VirtualMemoryTracker::snapshot_region_contains(p, region)) {
+ tty->print_cr(PTR_FORMAT " in mmap'd memory region [" PTR_FORMAT " - " PTR_FORMAT "] by %s",
+ p2i(p), p2i(region.base()), p2i(region.base() + region.size()), region.flag_name());
+ if (tracking_level == NMT_detail) {
+ region.call_stack()->print_on(tty);
+ tty->cr();
+ }
+ return;
+ }
+ // Check if it is a malloc'd memory block
+ if (CanUseSafeFetchN() && SafeFetchN((intptr_t*)p, 0) != 0) {
+ const MallocHeader* mhdr = (const MallocHeader*)MallocTracker::get_base(p, tracking_level);
+ char msg[256];
+ address p_corrupted;
+ if (SafeFetchN((intptr_t*)mhdr, 0) != 0 && mhdr->check_block_integrity(msg, sizeof(msg), &p_corrupted)) {
+ tty->print_cr(PTR_FORMAT " malloc'd " SIZE_FORMAT " bytes by %s",
+ p2i(p), mhdr->size(), NMTUtil::flag_to_name(mhdr->flags()));
+ if (tracking_level == NMT_detail) {
+ NativeCallStack ncs;
+ if (mhdr->get_stack(ncs)) {
+ ncs.print_on(tty);
+ tty->cr();
+ }
+ }
+ return;
+ }
+ }
+ }
+#endif // INCLUDE_NMT
tty->print(PTR_FORMAT, p2i(p));
}
}
--
GitLab
From 53804720a04b5b314701de82eddf1a55798eba00 Mon Sep 17 00:00:00 2001
From: Andrey Turbanov
Date: Tue, 25 Jan 2022 08:08:17 +0000
Subject: [PATCH 031/339] 8280470: Confusing instanceof check in
HijrahChronology.range
Reviewed-by: rriggs, naoto, dfuchs, iris
---
.../java/time/chrono/HijrahChronology.java | 22 ++++++++-----------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/src/java.base/share/classes/java/time/chrono/HijrahChronology.java b/src/java.base/share/classes/java/time/chrono/HijrahChronology.java
index 87f307e15d3..1ce99906708 100644
--- a/src/java.base/share/classes/java/time/chrono/HijrahChronology.java
+++ b/src/java.base/share/classes/java/time/chrono/HijrahChronology.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -533,18 +533,14 @@ public final class HijrahChronology extends AbstractChronology implements Serial
@Override
public ValueRange range(ChronoField field) {
checkCalendarInit();
- if (field instanceof ChronoField) {
- ChronoField f = field;
- return switch (f) {
- case DAY_OF_MONTH -> ValueRange.of(1, 1, getMinimumMonthLength(), getMaximumMonthLength());
- case DAY_OF_YEAR -> ValueRange.of(1, getMaximumDayOfYear());
- case ALIGNED_WEEK_OF_MONTH -> ValueRange.of(1, 5);
- case YEAR, YEAR_OF_ERA -> ValueRange.of(getMinimumYear(), getMaximumYear());
- case ERA -> ValueRange.of(1, 1);
- default -> field.range();
- };
- }
- return field.range();
+ return switch (field) {
+ case DAY_OF_MONTH -> ValueRange.of(1, 1, getMinimumMonthLength(), getMaximumMonthLength());
+ case DAY_OF_YEAR -> ValueRange.of(1, getMaximumDayOfYear());
+ case ALIGNED_WEEK_OF_MONTH -> ValueRange.of(1, 5);
+ case YEAR, YEAR_OF_ERA -> ValueRange.of(getMinimumYear(), getMaximumYear());
+ case ERA -> ValueRange.of(1, 1);
+ default -> field.range();
+ };
}
//-----------------------------------------------------------------------
--
GitLab
From b32774653f72f379655192874cb7076079d238e6 Mon Sep 17 00:00:00 2001
From: Thomas Schatzl
Date: Tue, 25 Jan 2022 09:12:18 +0000
Subject: [PATCH 032/339] 8280384: Parallel: Remove VMThread specific
ParCompactionManager
Reviewed-by: ayang, sjohanss
---
.../share/gc/parallel/psCompactionManager.cpp | 13 ++++----
.../share/gc/parallel/psCompactionManager.hpp | 4 ++-
.../share/gc/parallel/psParallelCompact.cpp | 30 ++++---------------
.../share/gc/parallel/psParallelCompact.hpp | 5 ++--
.../gc/parallel/psParallelCompact.inline.hpp | 6 +---
.../share/gc/parallel/psPromotionManager.cpp | 12 ++++----
.../gc/parallel/psPromotionManager.inline.hpp | 2 +-
7 files changed, 23 insertions(+), 49 deletions(-)
diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.cpp b/src/hotspot/share/gc/parallel/psCompactionManager.cpp
index 0a71ec80e3b..3a7fc8ae758 100644
--- a/src/hotspot/share/gc/parallel/psCompactionManager.cpp
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.cpp
@@ -70,7 +70,7 @@ void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
uint parallel_gc_threads = ParallelScavengeHeap::heap()->workers().max_workers();
assert(_manager_array == NULL, "Attempt to initialize twice");
- _manager_array = NEW_C_HEAP_ARRAY(ParCompactionManager*, parallel_gc_threads+1, mtGC);
+ _manager_array = NEW_C_HEAP_ARRAY(ParCompactionManager*, parallel_gc_threads, mtGC);
_oop_task_queues = new OopTaskQueueSet(parallel_gc_threads);
_objarray_task_queues = new ObjArrayTaskQueueSet(parallel_gc_threads);
@@ -84,9 +84,6 @@ void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
region_task_queues()->register_queue(i, _manager_array[i]->region_stack());
}
- // The VMThread gets its own ParCompactionManager, which is not available
- // for work stealing.
- _manager_array[parallel_gc_threads] = new ParCompactionManager();
assert(ParallelScavengeHeap::heap()->workers().max_workers() != 0,
"Not initialized?");
@@ -97,14 +94,14 @@ void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
void ParCompactionManager::reset_all_bitmap_query_caches() {
uint parallel_gc_threads = ParallelScavengeHeap::heap()->workers().max_workers();
- for (uint i=0; i<=parallel_gc_threads; i++) {
+ for (uint i=0; ireset_bitmap_query_cache();
}
}
void ParCompactionManager::flush_all_string_dedup_requests() {
uint parallel_gc_threads = ParallelScavengeHeap::heap()->workers().max_workers();
- for (uint i=0; i<=parallel_gc_threads; i++) {
+ for (uint i=0; iflush_string_dedup_requests();
}
}
@@ -184,14 +181,14 @@ void ParCompactionManager::remove_all_shadow_regions() {
#ifdef ASSERT
void ParCompactionManager::verify_all_marking_stack_empty() {
uint parallel_gc_threads = ParallelGCThreads;
- for (uint i = 0; i <= parallel_gc_threads; i++) {
+ for (uint i = 0; i < parallel_gc_threads; i++) {
assert(_manager_array[i]->marking_stacks_empty(), "Marking stack should be empty");
}
}
void ParCompactionManager::verify_all_region_stack_empty() {
uint parallel_gc_threads = ParallelGCThreads;
- for (uint i = 0; i <= parallel_gc_threads; i++) {
+ for (uint i = 0; i < parallel_gc_threads; i++) {
assert(_manager_array[i]->region_stack()->is_empty(), "Region stack should be empty");
}
}
diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.hpp b/src/hotspot/share/gc/parallel/psCompactionManager.hpp
index 2e73da920b5..4299f7e4c02 100644
--- a/src/hotspot/share/gc/parallel/psCompactionManager.hpp
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.hpp
@@ -147,7 +147,9 @@ class ParCompactionManager : public CHeapObj {
RegionTaskQueue* region_stack() { return &_region_stack; }
- static ParCompactionManager* get_vmthread_cm() { return _manager_array[ParallelGCThreads]; }
+ // Get the compaction manager when doing evacuation work from the VM thread.
+ // Simply use the first compaction manager here.
+ static ParCompactionManager* get_vmthread_cm() { return _manager_array[0]; }
ParCompactionManager();
diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
index 9d30f4bf2e2..4657975b1bc 100644
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
@@ -1595,8 +1595,7 @@ void PSParallelCompact::summary_phase_msg(SpaceId dst_space_id,
}
#endif // #ifndef PRODUCT
-void PSParallelCompact::summary_phase(ParCompactionManager* cm,
- bool maximum_compaction)
+void PSParallelCompact::summary_phase(bool maximum_compaction)
{
GCTraceTime(Info, gc, phases) tm("Summary Phase", &_gc_timer);
@@ -1756,9 +1755,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
const PreGenGCValues pre_gc_values = heap->get_pre_gc_values();
- // Get the compaction manager reserved for the VM thread.
- ParCompactionManager* const vmthread_cm = ParCompactionManager::get_vmthread_cm();
-
{
const uint active_workers =
WorkerPolicy::calc_active_workers(ParallelScavengeHeap::heap()->workers().max_workers(),
@@ -1787,11 +1783,11 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
ref_processor()->start_discovery(maximum_heap_compaction);
- marking_phase(vmthread_cm, &_gc_tracer);
+ marking_phase(&_gc_tracer);
bool max_on_system_gc = UseMaximumCompactionOnSystemGC
&& GCCause::is_user_requested_gc(gc_cause);
- summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc);
+ summary_phase(maximum_heap_compaction || max_on_system_gc);
#if COMPILER2_OR_JVMCI
assert(DerivedPointerTable::is_active(), "Sanity");
@@ -2063,8 +2059,7 @@ public:
}
};
-void PSParallelCompact::marking_phase(ParCompactionManager* cm,
- ParallelOldTracer *gc_tracer) {
+void PSParallelCompact::marking_phase(ParallelOldTracer *gc_tracer) {
// Recursively traverse all live objects and mark them
GCTraceTime(Info, gc, phases) tm("Marking Phase", &_gc_timer);
@@ -2125,19 +2120,6 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm,
_gc_tracer.report_object_count_after_gc(is_alive_closure());
}
-#ifdef ASSERT
-void PCAdjustPointerClosure::verify_cm(ParCompactionManager* cm) {
- assert(cm != NULL, "associate ParCompactionManage should not be NULL");
- auto vmthread_cm = ParCompactionManager::get_vmthread_cm();
- if (Thread::current()->is_VM_thread()) {
- assert(cm == vmthread_cm, "VM threads should use ParCompactionManager from get_vmthread_cm()");
- } else {
- assert(Thread::current()->is_Worker_thread(), "Must be a GC thread");
- assert(cm != vmthread_cm, "GC threads should use ParCompactionManager from gc_thread_compaction_manager()");
- }
-}
-#endif
-
class PSAdjustTask final : public WorkerTask {
SubTasksDone _sub_tasks;
WeakProcessor::Task _weak_proc_task;
@@ -2528,9 +2510,7 @@ void PSParallelCompact::compact() {
{
GCTraceTime(Trace, gc, phases) tm("Deferred Updates", &_gc_timer);
- // Update the deferred objects, if any. In principle, any compaction
- // manager can be used. However, since the current thread is VM thread, we
- // use the rightful one to keep the verification logic happy.
+ // Update the deferred objects, if any.
ParCompactionManager* cm = ParCompactionManager::get_vmthread_cm();
for (unsigned int id = old_space_id; id < last_space_id; ++id) {
update_deferred_objects(cm, SpaceId(id));
diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.hpp b/src/hotspot/share/gc/parallel/psParallelCompact.hpp
index 0b8eb6b0116..77a9d44f9b6 100644
--- a/src/hotspot/share/gc/parallel/psParallelCompact.hpp
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.hpp
@@ -1062,8 +1062,7 @@ class PSParallelCompact : AllStatic {
static void post_compact();
// Mark live objects
- static void marking_phase(ParCompactionManager* cm,
- ParallelOldTracer *gc_tracer);
+ static void marking_phase(ParallelOldTracer *gc_tracer);
// Compute the dense prefix for the designated space. This is an experimental
// implementation currently not used in production.
@@ -1123,7 +1122,7 @@ class PSParallelCompact : AllStatic {
static void summarize_spaces_quick();
static void summarize_space(SpaceId id, bool maximum_compaction);
- static void summary_phase(ParCompactionManager* cm, bool maximum_compaction);
+ static void summary_phase(bool maximum_compaction);
// Adjust addresses in roots. Does not adjust addresses in heap.
static void adjust_roots();
diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp b/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp
index 001f55c076a..48c5a98fd1a 100644
--- a/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp
@@ -126,9 +126,7 @@ inline void PSParallelCompact::adjust_pointer(T* p, ParCompactionManager* cm) {
class PCAdjustPointerClosure: public BasicOopIterateClosure {
public:
- PCAdjustPointerClosure(ParCompactionManager* cm) {
- verify_cm(cm);
- _cm = cm;
+ PCAdjustPointerClosure(ParCompactionManager* cm) : _cm(cm) {
}
template void do_oop_nv(T* p) { PSParallelCompact::adjust_pointer(p, _cm); }
virtual void do_oop(oop* p) { do_oop_nv(p); }
@@ -137,8 +135,6 @@ public:
virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; }
private:
ParCompactionManager* _cm;
-
- static void verify_cm(ParCompactionManager* cm) NOT_DEBUG_RETURN;
};
#endif // SHARE_GC_PARALLEL_PSPARALLELCOMPACT_INLINE_HPP
diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.cpp b/src/hotspot/share/gc/parallel/psPromotionManager.cpp
index 7ef706aba93..f7308366400 100644
--- a/src/hotspot/share/gc/parallel/psPromotionManager.cpp
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.cpp
@@ -54,7 +54,7 @@ void PSPromotionManager::initialize() {
_old_gen = heap->old_gen();
_young_space = heap->young_gen()->to_space();
- const uint promotion_manager_num = ParallelGCThreads + 1;
+ const uint promotion_manager_num = ParallelGCThreads;
// To prevent false sharing, we pad the PSPromotionManagers
// and make sure that the first instance starts at a cache line.
@@ -95,7 +95,7 @@ PSPromotionManager* PSPromotionManager::gc_thread_promotion_manager(uint index)
PSPromotionManager* PSPromotionManager::vm_thread_promotion_manager() {
assert(_manager_array != NULL, "Sanity");
- return &_manager_array[ParallelGCThreads];
+ return &_manager_array[0];
}
void PSPromotionManager::pre_scavenge() {
@@ -104,7 +104,7 @@ void PSPromotionManager::pre_scavenge() {
_preserved_marks_set->assert_empty();
_young_space = heap->young_gen()->to_space();
- for(uint i=0; ireset();
}
}
@@ -113,7 +113,7 @@ bool PSPromotionManager::post_scavenge(YoungGCTracer& gc_tracer) {
bool promotion_failure_occurred = false;
TASKQUEUE_STATS_ONLY(print_taskqueue_stats());
- for (uint i = 0; i < ParallelGCThreads + 1; i++) {
+ for (uint i = 0; i < ParallelGCThreads; i++) {
PSPromotionManager* manager = manager_array(i);
assert(manager->claimed_stack_depth()->is_empty(), "should be empty");
if (manager->_promotion_failed_info.has_failed()) {
@@ -162,7 +162,7 @@ PSPromotionManager::print_taskqueue_stats() {
TaskQueueStats totals;
out->print("thr "); TaskQueueStats::print_header(1, out); out->cr();
out->print("--- "); TaskQueueStats::print_header(2, out); out->cr();
- for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
+ for (uint i = 0; i < ParallelGCThreads; ++i) {
TaskQueueStats& next = manager_array(i)->_claimed_stack_depth.stats;
out->print("%3d ", i); next.print(out); out->cr();
totals += next;
@@ -171,7 +171,7 @@ PSPromotionManager::print_taskqueue_stats() {
const uint hlines = sizeof(pm_stats_hdr) / sizeof(pm_stats_hdr[0]);
for (uint i = 0; i < hlines; ++i) out->print_cr("%s", pm_stats_hdr[i]);
- for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
+ for (uint i = 0; i < ParallelGCThreads; ++i) {
manager_array(i)->print_local_stats(out, i);
}
}
diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
index 733af9bee7f..b3f1c7297f4 100644
--- a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
@@ -44,7 +44,7 @@
inline PSPromotionManager* PSPromotionManager::manager_array(uint index) {
assert(_manager_array != NULL, "access of NULL manager_array");
- assert(index <= ParallelGCThreads, "out of range manager_array access");
+ assert(index < ParallelGCThreads, "out of range manager_array access");
return &_manager_array[index];
}
--
GitLab
From 295b263fa951b9d51bfa92c04e49b2a17a62bd6f Mon Sep 17 00:00:00 2001
From: Thomas Schatzl
Date: Tue, 25 Jan 2022 09:13:50 +0000
Subject: [PATCH 033/339] 8279241: G1 Full GC does not always slide memory to
bottom addresses
Reviewed-by: iwalulya, ayang, sjohanss
---
src/hotspot/share/gc/g1/g1FullCollector.cpp | 65 ++++-
src/hotspot/share/gc/g1/g1FullCollector.hpp | 12 +-
.../share/gc/g1/g1FullCollector.inline.hpp | 6 +-
.../share/gc/g1/g1FullGCHeapRegionAttr.hpp | 6 +-
.../share/gc/g1/g1FullGCPrepareTask.cpp | 239 ++++++------------
.../share/gc/g1/g1FullGCPrepareTask.hpp | 93 ++++---
.../gc/g1/g1FullGCPrepareTask.inline.hpp | 126 +++++++++
src/hotspot/share/gc/g1/g1FullGCScope.cpp | 4 +-
src/hotspot/share/gc/g1/g1FullGCScope.hpp | 4 +-
9 files changed, 346 insertions(+), 209 deletions(-)
create mode 100644 src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp
diff --git a/src/hotspot/share/gc/g1/g1FullCollector.cpp b/src/hotspot/share/gc/g1/g1FullCollector.cpp
index 603b3818029..dd20a099919 100644
--- a/src/hotspot/share/gc/g1/g1FullCollector.cpp
+++ b/src/hotspot/share/gc/g1/g1FullCollector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
#include "gc/g1/g1FullGCCompactTask.hpp"
#include "gc/g1/g1FullGCMarker.inline.hpp"
#include "gc/g1/g1FullGCMarkTask.hpp"
-#include "gc/g1/g1FullGCPrepareTask.hpp"
+#include "gc/g1/g1FullGCPrepareTask.inline.hpp"
#include "gc/g1/g1FullGCScope.hpp"
#include "gc/g1/g1OopClosures.hpp"
#include "gc/g1/g1Policy.hpp"
@@ -297,14 +297,67 @@ void G1FullCollector::phase1_mark_live_objects() {
}
void G1FullCollector::phase2_prepare_compaction() {
- GCTraceTime(Info, gc, phases) info("Phase 2: Prepare for compaction", scope()->timer());
+ GCTraceTime(Info, gc, phases) info("Phase 2: Prepare compaction", scope()->timer());
+
+ phase2a_determine_worklists();
+
+ bool has_free_compaction_targets = phase2b_forward_oops();
+
+ // Try to avoid OOM immediately after Full GC in case there are no free regions
+ // left after determining the result locations (i.e. this phase). Prepare to
+ // maximally compact the tail regions of the compaction queues serially.
+ if (!has_free_compaction_targets) {
+ phase2c_prepare_serial_compaction();
+ }
+}
+
+void G1FullCollector::phase2a_determine_worklists() {
+ GCTraceTime(Debug, gc, phases) debug("Phase 2: Determine work lists", scope()->timer());
+
+ G1DetermineCompactionQueueClosure cl(this);
+ _heap->heap_region_iterate(&cl);
+}
+
+bool G1FullCollector::phase2b_forward_oops() {
+ GCTraceTime(Debug, gc, phases) debug("Phase 2: Prepare parallel compaction", scope()->timer());
+
G1FullGCPrepareTask task(this);
run_task(&task);
- // To avoid OOM when there is memory left.
- if (!task.has_freed_regions()) {
- task.prepare_serial_compaction();
+ return task.has_free_compaction_targets();
+}
+
+void G1FullCollector::phase2c_prepare_serial_compaction() {
+ GCTraceTime(Debug, gc, phases) debug("Phase 2: Prepare serial compaction", scope()->timer());
+ // At this point we know that after parallel compaction there will be no
+ // completely free regions. That means that the last region of
+ // all compaction queues still have data in them. We try to compact
+ // these regions in serial to avoid a premature OOM when the mutator wants
+ // to allocate the first eden region after gc.
+ for (uint i = 0; i < workers(); i++) {
+ G1FullGCCompactionPoint* cp = compaction_point(i);
+ if (cp->has_regions()) {
+ serial_compaction_point()->add(cp->remove_last());
+ }
+ }
+
+ // Update the forwarding information for the regions in the serial
+ // compaction point.
+ G1FullGCCompactionPoint* cp = serial_compaction_point();
+ for (GrowableArrayIterator it = cp->regions()->begin(); it != cp->regions()->end(); ++it) {
+ HeapRegion* current = *it;
+ if (!cp->is_initialized()) {
+ // Initialize the compaction point. Nothing more is needed for the first heap region
+ // since it is already prepared for compaction.
+ cp->initialize(current, false);
+ } else {
+ assert(!current->is_humongous(), "Should be no humongous regions in compaction queue");
+ G1SerialRePrepareClosure re_prepare(cp, current);
+ current->set_compaction_top(current->bottom());
+ current->apply_to_marked_objects(mark_bitmap(), &re_prepare);
+ }
}
+ cp->update();
}
void G1FullCollector::phase3_adjust_pointers() {
diff --git a/src/hotspot/share/gc/g1/g1FullCollector.hpp b/src/hotspot/share/gc/g1/g1FullCollector.hpp
index c4d019629dd..f9087298b86 100644
--- a/src/hotspot/share/gc/g1/g1FullCollector.hpp
+++ b/src/hotspot/share/gc/g1/g1FullCollector.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -110,7 +110,7 @@ public:
G1FullGCCompactionPoint* serial_compaction_point() { return &_serial_compaction_point; }
G1CMBitMap* mark_bitmap();
ReferenceProcessor* reference_processor();
- size_t live_words(uint region_index) {
+ size_t live_words(uint region_index) const {
assert(region_index < _heap->max_regions(), "sanity");
return _live_stats[region_index]._live_words;
}
@@ -121,6 +121,9 @@ public:
inline bool is_skip_compacting(uint region_index) const;
inline bool is_skip_marking(oop obj) const;
+ // Are we (potentially) going to compact into this region?
+ inline bool is_compaction_target(uint region_index) const;
+
inline void set_free(uint region_idx);
inline bool is_free(uint region_idx) const;
inline void update_from_compacting_to_skip_compacting(uint region_idx);
@@ -128,6 +131,11 @@ public:
private:
void phase1_mark_live_objects();
void phase2_prepare_compaction();
+
+ void phase2a_determine_worklists();
+ bool phase2b_forward_oops();
+ void phase2c_prepare_serial_compaction();
+
void phase3_adjust_pointers();
void phase4_do_compaction();
diff --git a/src/hotspot/share/gc/g1/g1FullCollector.inline.hpp b/src/hotspot/share/gc/g1/g1FullCollector.inline.hpp
index 5a0863b202a..37e16fc6f78 100644
--- a/src/hotspot/share/gc/g1/g1FullCollector.inline.hpp
+++ b/src/hotspot/share/gc/g1/g1FullCollector.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,10 @@ bool G1FullCollector::is_skip_marking(oop obj) const {
return _region_attr_table.is_skip_marking(cast_from_oop(obj));
}
+bool G1FullCollector::is_compaction_target(uint region_index) const {
+ return _region_attr_table.is_compacting(region_index) || is_free(region_index);
+}
+
void G1FullCollector::set_free(uint region_idx) {
_region_attr_table.set_free(region_idx);
}
diff --git a/src/hotspot/share/gc/g1/g1FullGCHeapRegionAttr.hpp b/src/hotspot/share/gc/g1/g1FullGCHeapRegionAttr.hpp
index ca2f970edde..017877785f4 100644
--- a/src/hotspot/share/gc/g1/g1FullGCHeapRegionAttr.hpp
+++ b/src/hotspot/share/gc/g1/g1FullGCHeapRegionAttr.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -70,6 +70,10 @@ public:
return get_by_address(obj) == Compacting;
}
+ bool is_compacting(uint idx) const {
+ return get_by_index(idx) == Compacting;
+ }
+
bool is_skip_compacting(uint idx) const {
return get_by_index(idx) == SkipCompacting;
}
diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
index 883e0a51f86..4ffe9329dc7 100644
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,13 @@
*/
#include "precompiled.hpp"
-#include "gc/g1/g1CollectedHeap.hpp"
+#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
#include "gc/g1/g1FullCollector.inline.hpp"
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/g1FullGCMarker.hpp"
#include "gc/g1/g1FullGCOopClosures.inline.hpp"
-#include "gc/g1/g1FullGCPrepareTask.hpp"
+#include "gc/g1/g1FullGCPrepareTask.inline.hpp"
#include "gc/g1/g1HotCardCache.hpp"
#include "gc/g1/heapRegion.inline.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
@@ -39,113 +39,84 @@
#include "oops/oop.inline.hpp"
#include "utilities/ticks.hpp"
-template
-void G1FullGCPrepareTask::G1CalculatePointersClosure::free_pinned_region(HeapRegion* hr) {
- _regions_freed = true;
- if (is_humongous) {
- _g1h->free_humongous_region(hr, nullptr);
- } else {
- _g1h->free_region(hr, nullptr);
- }
- _collector->set_free(hr->hrm_index());
- prepare_for_compaction(hr);
-}
+G1DetermineCompactionQueueClosure::G1DetermineCompactionQueueClosure(G1FullCollector* collector) :
+ _g1h(G1CollectedHeap::heap()),
+ _collector(collector),
+ _cur_worker(0) { }
bool G1FullGCPrepareTask::G1CalculatePointersClosure::do_heap_region(HeapRegion* hr) {
- if (should_compact(hr)) {
- assert(!hr->is_humongous(), "moving humongous objects not supported.");
- prepare_for_compaction(hr);
- } else {
- // There is no need to iterate and forward objects in pinned regions ie.
- // prepare them for compaction. The adjust pointers phase will skip
- // work for them.
- assert(hr->containing_set() == nullptr, "already cleared by PrepareRegionsClosure");
- if (hr->is_humongous()) {
- oop obj = cast_to_oop(hr->humongous_start_region()->bottom());
- if (!_bitmap->is_marked(obj)) {
- free_pinned_region(hr);
- }
- } else if (hr->is_open_archive()) {
- bool is_empty = _collector->live_words(hr->hrm_index()) == 0;
- if (is_empty) {
- free_pinned_region(hr);
- }
- } else if (hr->is_closed_archive()) {
- // nothing to do with closed archive region
- } else {
- assert(MarkSweepDeadRatio > 0,
- "only skip compaction for other regions when MarkSweepDeadRatio > 0");
-
- // Too many live objects; skip compacting it.
- _collector->update_from_compacting_to_skip_compacting(hr->hrm_index());
- if (hr->is_young()) {
- // G1 updates the BOT for old region contents incrementally, but young regions
- // lack BOT information for performance reasons.
- // Recreate BOT information of high live ratio young regions here to keep expected
- // performance during scanning their card tables in the collection pauses later.
- hr->update_bot();
- }
- log_trace(gc, phases)("Phase 2: skip compaction region index: %u, live words: " SIZE_FORMAT,
- hr->hrm_index(), _collector->live_words(hr->hrm_index()));
- }
- }
+ uint region_idx = hr->hrm_index();
+ assert(_collector->is_compaction_target(region_idx), "must be");
- // Reset data structures not valid after Full GC.
- reset_region_metadata(hr);
+ assert(!hr->is_pinned(), "must be");
+ assert(!hr->is_closed_archive(), "must be");
+ assert(!hr->is_open_archive(), "must be");
+
+ prepare_for_compaction(hr);
return false;
}
G1FullGCPrepareTask::G1FullGCPrepareTask(G1FullCollector* collector) :
G1FullGCTask("G1 Prepare Compact Task", collector),
- _freed_regions(false),
+ _has_free_compaction_targets(false),
_hrclaimer(collector->workers()) {
}
-void G1FullGCPrepareTask::set_freed_regions() {
- if (!_freed_regions) {
- _freed_regions = true;
+void G1FullGCPrepareTask::set_has_free_compaction_targets() {
+ if (!_has_free_compaction_targets) {
+ _has_free_compaction_targets = true;
}
}
-bool G1FullGCPrepareTask::has_freed_regions() {
- return _freed_regions;
+bool G1FullGCPrepareTask::has_free_compaction_targets() {
+ return _has_free_compaction_targets;
}
void G1FullGCPrepareTask::work(uint worker_id) {
Ticks start = Ticks::now();
- G1FullGCCompactionPoint* compaction_point = collector()->compaction_point(worker_id);
- G1CalculatePointersClosure closure(collector(), compaction_point);
- G1CollectedHeap::heap()->heap_region_par_iterate_from_start(&closure, &_hrclaimer);
-
- compaction_point->update();
+ // Calculate the target locations for the objects in the non-free regions of
+ // the compaction queues provided by the associate compaction point.
+ {
+ G1FullGCCompactionPoint* compaction_point = collector()->compaction_point(worker_id);
+ G1CalculatePointersClosure closure(collector(), compaction_point);
+
+ for (GrowableArrayIterator it = compaction_point->regions()->begin();
+ it != compaction_point->regions()->end();
+ ++it) {
+ closure.do_heap_region(*it);
+ }
+ compaction_point->update();
+ // Determine if there are any unused compaction targets. This is only the case if
+ // there are
+ // - any regions in queue, so no free ones either.
+ // - and the current region is not the last one in the list.
+ if (compaction_point->has_regions() &&
+ compaction_point->current_region() != compaction_point->regions()->last()) {
+ set_has_free_compaction_targets();
+ }
+ }
- // Check if any regions was freed by this worker and store in task.
- if (closure.freed_regions()) {
- set_freed_regions();
+ // Clear region metadata that is invalid after GC for all regions.
+ {
+ G1ResetMetadataClosure closure(collector());
+ G1CollectedHeap::heap()->heap_region_par_iterate_from_start(&closure, &_hrclaimer);
}
log_task("Prepare compaction task", worker_id, start);
}
G1FullGCPrepareTask::G1CalculatePointersClosure::G1CalculatePointersClosure(G1FullCollector* collector,
G1FullGCCompactionPoint* cp) :
- _g1h(G1CollectedHeap::heap()),
- _collector(collector),
- _bitmap(collector->mark_bitmap()),
- _cp(cp),
- _regions_freed(false) { }
-
-bool G1FullGCPrepareTask::G1CalculatePointersClosure::should_compact(HeapRegion* hr) {
- if (hr->is_pinned()) {
- return false;
- }
- size_t live_words = _collector->live_words(hr->hrm_index());
- size_t live_words_threshold = _collector->scope()->region_compaction_threshold();
- // High live ratio region will not be compacted.
- return live_words <= live_words_threshold;
-}
+ _g1h(G1CollectedHeap::heap()),
+ _collector(collector),
+ _bitmap(collector->mark_bitmap()),
+ _cp(cp) { }
-void G1FullGCPrepareTask::G1CalculatePointersClosure::reset_region_metadata(HeapRegion* hr) {
+G1FullGCPrepareTask::G1ResetMetadataClosure::G1ResetMetadataClosure(G1FullCollector* collector) :
+ _g1h(G1CollectedHeap::heap()),
+ _collector(collector) { }
+
+void G1FullGCPrepareTask::G1ResetMetadataClosure::reset_region_metadata(HeapRegion* hr) {
hr->rem_set()->clear();
hr->clear_cardtable();
@@ -155,6 +126,26 @@ void G1FullGCPrepareTask::G1CalculatePointersClosure::reset_region_metadata(Heap
}
}
+bool G1FullGCPrepareTask::G1ResetMetadataClosure::do_heap_region(HeapRegion* hr) {
+ uint const region_idx = hr->hrm_index();
+ if (!_collector->is_compaction_target(region_idx)) {
+ assert(!hr->is_free(), "all free regions should be compaction targets");
+ assert(_collector->is_skip_compacting(region_idx) || hr->is_closed_archive(), "must be");
+ if (hr->is_young()) {
+ // G1 updates the BOT for old region contents incrementally, but young regions
+ // lack BOT information for performance reasons.
+ // Recreate BOT information of high live ratio young regions here to keep expected
+ // performance during scanning their card tables in the collection pauses later.
+ hr->update_bot();
+ }
+ }
+
+ // Reset data structures not valid after Full GC.
+ reset_region_metadata(hr);
+
+ return false;
+}
+
G1FullGCPrepareTask::G1PrepareCompactLiveClosure::G1PrepareCompactLiveClosure(G1FullGCCompactionPoint* cp) :
_cp(cp) { }
@@ -164,87 +155,9 @@ size_t G1FullGCPrepareTask::G1PrepareCompactLiveClosure::apply(oop object) {
return size;
}
-size_t G1FullGCPrepareTask::G1RePrepareClosure::apply(oop obj) {
- // We only re-prepare objects forwarded within the current region, so
- // skip objects that are already forwarded to another region.
- if (obj->is_forwarded() && !_current->is_in(obj->forwardee())) {
- return obj->size();
- }
-
- // Get size and forward.
- size_t size = obj->size();
- _cp->forward(obj, size);
-
- return size;
-}
-
-void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction_work(G1FullGCCompactionPoint* cp,
- HeapRegion* hr) {
- hr->set_compaction_top(hr->bottom());
+void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction(HeapRegion* hr) {
if (!_collector->is_free(hr->hrm_index())) {
- G1PrepareCompactLiveClosure prepare_compact(cp);
+ G1PrepareCompactLiveClosure prepare_compact(_cp);
hr->apply_to_marked_objects(_bitmap, &prepare_compact);
}
}
-
-void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction(HeapRegion* hr) {
- if (!_cp->is_initialized()) {
- hr->set_compaction_top(hr->bottom());
- _cp->initialize(hr, true);
- }
- // Add region to the compaction queue and prepare it.
- _cp->add(hr);
- prepare_for_compaction_work(_cp, hr);
-}
-
-void G1FullGCPrepareTask::prepare_serial_compaction() {
- GCTraceTime(Debug, gc, phases) debug("Phase 2: Prepare Serial Compaction", collector()->scope()->timer());
- // At this point we know that no regions were completely freed by
- // the parallel compaction. That means that the last region of
- // all compaction queues still have data in them. We try to compact
- // these regions in serial to avoid a premature OOM.
- for (uint i = 0; i < collector()->workers(); i++) {
- G1FullGCCompactionPoint* cp = collector()->compaction_point(i);
- if (cp->has_regions()) {
- collector()->serial_compaction_point()->add(cp->remove_last());
- }
- }
-
- // Update the forwarding information for the regions in the serial
- // compaction point.
- G1FullGCCompactionPoint* cp = collector()->serial_compaction_point();
- for (GrowableArrayIterator it = cp->regions()->begin(); it != cp->regions()->end(); ++it) {
- HeapRegion* current = *it;
- if (!cp->is_initialized()) {
- // Initialize the compaction point. Nothing more is needed for the first heap region
- // since it is already prepared for compaction.
- cp->initialize(current, false);
- } else {
- assert(!current->is_humongous(), "Should be no humongous regions in compaction queue");
- G1RePrepareClosure re_prepare(cp, current);
- current->set_compaction_top(current->bottom());
- current->apply_to_marked_objects(collector()->mark_bitmap(), &re_prepare);
- }
- }
- cp->update();
-}
-
-bool G1FullGCPrepareTask::G1CalculatePointersClosure::freed_regions() {
- if (_regions_freed) {
- return true;
- }
-
- if (!_cp->has_regions()) {
- // No regions in queue, so no free ones either.
- return false;
- }
-
- if (_cp->current_region() != _cp->regions()->last()) {
- // The current region used for compaction is not the last in the
- // queue. That means there is at least one free region in the queue.
- return true;
- }
-
- // No free regions in the queue.
- return false;
-}
diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp
index d694fc6ffca..41c0c67d87c 100644
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,53 +25,81 @@
#ifndef SHARE_GC_G1_G1FULLGCPREPARETASK_HPP
#define SHARE_GC_G1_G1FULLGCPREPARETASK_HPP
-#include "gc/g1/g1FullGCCompactionPoint.hpp"
-#include "gc/g1/g1FullGCScope.hpp"
#include "gc/g1/g1FullGCTask.hpp"
-#include "gc/g1/g1RootProcessor.hpp"
-#include "gc/g1/heapRegionManager.hpp"
-#include "gc/shared/referenceProcessor.hpp"
+#include "gc/g1/heapRegion.hpp"
+#include "memory/allocation.hpp"
+class G1CollectedHeap;
class G1CMBitMap;
class G1FullCollector;
+class G1FullGCCompactionPoint;
+class HeapRegion;
+
+// Determines the regions in the heap that should be part of the compaction and
+// distributes them among the compaction queues in round-robin fashion.
+class G1DetermineCompactionQueueClosure : public HeapRegionClosure {
+ G1CollectedHeap* _g1h;
+ G1FullCollector* _collector;
+ uint _cur_worker;
+
+ template
+ inline void free_pinned_region(HeapRegion* hr);
+
+ inline bool should_compact(HeapRegion* hr) const;
+
+ // Returns the current worker id to assign a compaction point to, and selects
+ // the next one round-robin style.
+ inline uint next_worker();
+
+ inline G1FullGCCompactionPoint* next_compaction_point();
+
+ inline void add_to_compaction_queue(HeapRegion* hr);
+
+public:
+ G1DetermineCompactionQueueClosure(G1FullCollector* collector);
+
+ inline bool do_heap_region(HeapRegion* hr) override;
+};
class G1FullGCPrepareTask : public G1FullGCTask {
-protected:
- volatile bool _freed_regions;
+ volatile bool _has_free_compaction_targets;
HeapRegionClaimer _hrclaimer;
- void set_freed_regions();
+ void set_has_free_compaction_targets();
public:
G1FullGCPrepareTask(G1FullCollector* collector);
void work(uint worker_id);
- void prepare_serial_compaction();
- bool has_freed_regions();
+ // After the Prepare phase, are there any unused (empty) regions (compaction
+ // targets) at the end of any compaction queues?
+ bool has_free_compaction_targets();
-protected:
+private:
class G1CalculatePointersClosure : public HeapRegionClosure {
- private:
- template
- void free_pinned_region(HeapRegion* hr);
- protected:
G1CollectedHeap* _g1h;
G1FullCollector* _collector;
G1CMBitMap* _bitmap;
G1FullGCCompactionPoint* _cp;
- bool _regions_freed;
- bool should_compact(HeapRegion* hr);
void prepare_for_compaction(HeapRegion* hr);
- void prepare_for_compaction_work(G1FullGCCompactionPoint* cp, HeapRegion* hr);
-
- void reset_region_metadata(HeapRegion* hr);
public:
G1CalculatePointersClosure(G1FullCollector* collector,
G1FullGCCompactionPoint* cp);
bool do_heap_region(HeapRegion* hr);
- bool freed_regions();
+ };
+
+ class G1ResetMetadataClosure : public HeapRegionClosure {
+ G1CollectedHeap* _g1h;
+ G1FullCollector* _collector;
+
+ void reset_region_metadata(HeapRegion* hr);
+
+ public:
+ G1ResetMetadataClosure(G1FullCollector* collector);
+
+ bool do_heap_region(HeapRegion* hr);
};
class G1PrepareCompactLiveClosure : public StackObj {
@@ -81,19 +109,20 @@ protected:
G1PrepareCompactLiveClosure(G1FullGCCompactionPoint* cp);
size_t apply(oop object);
};
+};
- class G1RePrepareClosure : public StackObj {
- G1FullGCCompactionPoint* _cp;
- HeapRegion* _current;
+// Closure to re-prepare objects in the serial compaction point queue regions for
+// serial compaction.
+class G1SerialRePrepareClosure : public StackObj {
+ G1FullGCCompactionPoint* _cp;
+ HeapRegion* _current;
- public:
- G1RePrepareClosure(G1FullGCCompactionPoint* hrcp,
- HeapRegion* hr) :
- _cp(hrcp),
- _current(hr) { }
+public:
+ G1SerialRePrepareClosure(G1FullGCCompactionPoint* hrcp, HeapRegion* hr) :
+ _cp(hrcp),
+ _current(hr) { }
- size_t apply(oop object);
- };
+ inline size_t apply(oop obj);
};
#endif // SHARE_GC_G1_G1FULLGCPREPARETASK_HPP
diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp
new file mode 100644
index 00000000000..75493b7de4f
--- /dev/null
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_GC_G1_G1FULLGCPREPARETASK_INLINE_HPP
+#define SHARE_GC_G1_G1FULLGCPREPARETASK_INLINE_HPP
+
+#include "gc/g1/g1FullGCPrepareTask.hpp"
+
+#include "gc/g1/g1CollectedHeap.inline.hpp"
+#include "gc/g1/g1FullCollector.hpp"
+#include "gc/g1/g1FullGCCompactionPoint.hpp"
+#include "gc/g1/g1FullGCScope.hpp"
+#include "gc/g1/heapRegion.inline.hpp"
+
+template
+void G1DetermineCompactionQueueClosure::free_pinned_region(HeapRegion* hr) {
+ if (is_humongous) {
+ _g1h->free_humongous_region(hr, nullptr);
+ } else {
+ _g1h->free_region(hr, nullptr);
+ }
+ _collector->set_free(hr->hrm_index());
+ add_to_compaction_queue(hr);
+}
+
+inline bool G1DetermineCompactionQueueClosure::should_compact(HeapRegion* hr) const {
+ // There is no need to iterate and forward objects in pinned regions ie.
+ // prepare them for compaction.
+ if (hr->is_pinned()) {
+ return false;
+ }
+ size_t live_words = _collector->live_words(hr->hrm_index());
+ size_t live_words_threshold = _collector->scope()->region_compaction_threshold();
+ // High live ratio region will not be compacted.
+ return live_words <= live_words_threshold;
+}
+
+inline uint G1DetermineCompactionQueueClosure::next_worker() {
+ uint result = _cur_worker;
+ _cur_worker = (_cur_worker + 1) % _collector->workers();
+ return result;
+}
+
+inline G1FullGCCompactionPoint* G1DetermineCompactionQueueClosure::next_compaction_point() {
+ return _collector->compaction_point(next_worker());
+}
+
+inline void G1DetermineCompactionQueueClosure::add_to_compaction_queue(HeapRegion* hr) {
+ hr->set_compaction_top(hr->bottom());
+ G1FullGCCompactionPoint* cp = next_compaction_point();
+ if (!cp->is_initialized()) {
+ cp->initialize(hr, true);
+ }
+ // Add region to the compaction queue.
+ cp->add(hr);
+}
+
+inline bool G1DetermineCompactionQueueClosure::do_heap_region(HeapRegion* hr) {
+ if (should_compact(hr)) {
+ assert(!hr->is_humongous(), "moving humongous objects not supported.");
+ add_to_compaction_queue(hr);
+ } else {
+ assert(hr->containing_set() == nullptr, "already cleared by PrepareRegionsClosure");
+ if (hr->is_humongous()) {
+ oop obj = cast_to_oop(hr->humongous_start_region()->bottom());
+ bool is_empty = !_collector->mark_bitmap()->is_marked(obj);
+ if (is_empty) {
+ free_pinned_region(hr);
+ }
+ } else if (hr->is_open_archive()) {
+ bool is_empty = _collector->live_words(hr->hrm_index()) == 0;
+ if (is_empty) {
+ free_pinned_region(hr);
+ }
+ } else if (hr->is_closed_archive()) {
+ // nothing to do with closed archive region
+ } else {
+ assert(MarkSweepDeadRatio > 0,
+ "only skip compaction for other regions when MarkSweepDeadRatio > 0");
+
+ // Too many live objects in the region; skip compacting it.
+ _collector->update_from_compacting_to_skip_compacting(hr->hrm_index());
+ log_trace(gc, phases)("Phase 2: skip compaction region index: %u, live words: " SIZE_FORMAT,
+ hr->hrm_index(), _collector->live_words(hr->hrm_index()));
+ }
+ }
+
+ return false;
+}
+
+inline size_t G1SerialRePrepareClosure::apply(oop obj) {
+ // We only re-prepare objects forwarded within the current region, so
+ // skip objects that are already forwarded to another region.
+ if (obj->is_forwarded() && !_current->is_in(obj->forwardee())) {
+ return obj->size();
+ }
+
+ // Get size and forward.
+ size_t size = obj->size();
+ _cp->forward(obj, size);
+
+ return size;
+}
+
+#endif // SHARE_GC_G1_G1FULLGCPREPARETASK_INLINE_HPP
diff --git a/src/hotspot/share/gc/g1/g1FullGCScope.cpp b/src/hotspot/share/gc/g1/g1FullGCScope.cpp
index b4d3b365603..0437d157eb0 100644
--- a/src/hotspot/share/gc/g1/g1FullGCScope.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCScope.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -70,6 +70,6 @@ G1FullGCTracer* G1FullGCScope::tracer() {
return &_tracer;
}
-size_t G1FullGCScope::region_compaction_threshold() {
+size_t G1FullGCScope::region_compaction_threshold() const {
return _region_compaction_threshold;
}
diff --git a/src/hotspot/share/gc/g1/g1FullGCScope.hpp b/src/hotspot/share/gc/g1/g1FullGCScope.hpp
index c0035b9052a..a6e079f4d63 100644
--- a/src/hotspot/share/gc/g1/g1FullGCScope.hpp
+++ b/src/hotspot/share/gc/g1/g1FullGCScope.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@ public:
STWGCTimer* timer();
G1FullGCTracer* tracer();
G1HeapTransition* heap_transition();
- size_t region_compaction_threshold();
+ size_t region_compaction_threshold() const;
};
#endif // SHARE_GC_G1_G1FULLGCSCOPE_HPP
--
GitLab
From 2155afe2a87d718757b009d712361d7a63946a7f Mon Sep 17 00:00:00 2001
From: Thomas Stuefe
Date: Tue, 25 Jan 2022 09:15:11 +0000
Subject: [PATCH 034/339] 8280503: Use allStatic.hpp instead of allocation.hpp
where possible
Reviewed-by: dholmes, iklam
---
src/hotspot/cpu/aarch64/bytes_aarch64.hpp | 4 ++--
src/hotspot/cpu/aarch64/jniTypes_aarch64.hpp | 4 ++--
src/hotspot/cpu/arm/bytes_arm.hpp | 4 ++--
src/hotspot/cpu/arm/jniTypes_arm.hpp | 4 ++--
src/hotspot/cpu/ppc/bytes_ppc.hpp | 6 +++---
src/hotspot/cpu/ppc/jniTypes_ppc.hpp | 6 +++---
src/hotspot/cpu/s390/bytes_s390.hpp | 6 +++---
src/hotspot/cpu/s390/jniTypes_s390.hpp | 4 ++--
src/hotspot/cpu/x86/bytes_x86.hpp | 4 ++--
src/hotspot/cpu/x86/c2_intelJccErratum_x86.hpp | 4 ++--
src/hotspot/cpu/x86/jniTypes_x86.hpp | 4 ++--
src/hotspot/cpu/x86/rdtsc_x86.hpp | 5 +++--
src/hotspot/cpu/zero/bytes_zero.hpp | 4 ++--
src/hotspot/cpu/zero/jniTypes_zero.hpp | 4 ++--
src/hotspot/os/bsd/gc/z/zNUMA_bsd.cpp | 1 +
src/hotspot/os/linux/gc/z/zSyscall_linux.hpp | 5 +++--
src/hotspot/os/linux/osContainer_linux.hpp | 4 ++--
src/hotspot/os/posix/signals_posix.hpp | 4 ++--
src/hotspot/os/posix/threadLocalStorage_posix.cpp | 3 ++-
src/hotspot/os/windows/gc/z/zMapper_windows.hpp | 2 +-
src/hotspot/os/windows/iphlp_interface.hpp | 4 ++--
src/hotspot/os/windows/pdh_interface.hpp | 4 ++--
src/hotspot/os/windows/threadLocalStorage_windows.cpp | 1 +
src/hotspot/share/c1/c1_Runtime1.hpp | 4 ++--
src/hotspot/share/cds/archiveUtils.cpp | 4 +++-
src/hotspot/share/cds/dynamicArchive.hpp | 4 ++--
src/hotspot/share/classfile/altHashing.hpp | 5 +++--
src/hotspot/share/classfile/klassFactory.hpp | 4 ++--
src/hotspot/share/classfile/modules.hpp | 4 ++--
src/hotspot/share/code/vtableStubs.hpp | 4 ++--
src/hotspot/share/compiler/compilerDefinitions.hpp | 4 ++--
src/hotspot/share/compiler/compilerEvent.hpp | 4 ++--
src/hotspot/share/compiler/compilerOracle.hpp | 4 ++--
src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp | 4 ++--
src/hotspot/share/gc/g1/g1FromCardCache.hpp | 4 ++--
src/hotspot/share/gc/g1/g1HeapRegionEventSender.hpp | 4 ++--
src/hotspot/share/gc/g1/g1HeapRegionTraceType.hpp | 4 ++--
src/hotspot/share/gc/g1/heapRegionBounds.hpp | 5 +++--
src/hotspot/share/gc/g1/heapRegionTracer.hpp | 5 +++--
src/hotspot/share/gc/g1/heapRegionType.hpp | 3 ++-
src/hotspot/share/gc/parallel/psRootType.hpp | 4 ++--
src/hotspot/share/gc/parallel/psScavenge.hpp | 4 ++--
src/hotspot/share/gc/shared/accessBarrierSupport.hpp | 4 ++--
src/hotspot/share/gc/shared/ageTableTracer.hpp | 5 +++--
src/hotspot/share/gc/shared/allocTracer.hpp | 4 ++--
src/hotspot/share/gc/shared/blockOffsetTable.hpp | 4 ++--
src/hotspot/share/gc/shared/concurrentGCBreakpoints.hpp | 4 ++--
src/hotspot/share/gc/shared/gcCause.hpp | 5 +++--
src/hotspot/share/gc/shared/gcConfig.hpp | 2 +-
src/hotspot/share/gc/shared/gcLocker.hpp | 4 ++--
src/hotspot/share/gc/shared/gcLogPrecious.hpp | 2 +-
src/hotspot/share/gc/shared/gcWhen.hpp | 4 ++--
src/hotspot/share/gc/shared/locationPrinter.hpp | 2 +-
src/hotspot/share/gc/shared/objectCountEventSender.hpp | 4 ++--
src/hotspot/share/gc/shared/scavengableNMethods.hpp | 4 ++--
src/hotspot/share/gc/shared/spaceDecorator.hpp | 4 ++--
src/hotspot/share/gc/shared/weakProcessor.hpp | 4 ++--
src/hotspot/share/gc/shared/workerPolicy.hpp | 4 ++--
src/hotspot/share/gc/shenandoah/shenandoahBreakpoint.hpp | 6 +++---
src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp | 4 ++--
src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp | 4 ++--
src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp | 4 ++--
src/hotspot/share/gc/z/zAbort.hpp | 4 ++--
src/hotspot/share/gc/z/zAddress.hpp | 5 +++--
src/hotspot/share/gc/z/zAddressSpaceLimit.hpp | 5 +++--
src/hotspot/share/gc/z/zBarrier.hpp | 4 ++--
src/hotspot/share/gc/z/zBarrierSetRuntime.hpp | 2 +-
src/hotspot/share/gc/z/zBitField.hpp | 5 +++--
src/hotspot/share/gc/z/zBreakpoint.hpp | 4 ++--
src/hotspot/share/gc/z/zCPU.hpp | 4 ++--
src/hotspot/share/gc/z/zHash.hpp | 4 ++--
src/hotspot/share/gc/z/zHeuristics.hpp | 4 ++--
src/hotspot/share/gc/z/zLargePages.hpp | 4 ++--
src/hotspot/share/gc/z/zNMethod.hpp | 4 ++--
src/hotspot/share/gc/z/zNMethodTable.hpp | 4 ++--
src/hotspot/share/gc/z/zNUMA.hpp | 5 +++--
src/hotspot/share/gc/z/zOop.hpp | 4 ++--
src/hotspot/share/gc/z/zResurrection.hpp | 4 ++--
src/hotspot/share/gc/z/zThread.hpp | 4 ++--
src/hotspot/share/gc/z/zThreadLocalAllocBuffer.hpp | 4 ++--
src/hotspot/share/gc/z/zUtils.hpp | 5 +++--
src/hotspot/share/gc/z/zValue.hpp | 4 ++--
src/hotspot/share/gc/z/zVerify.hpp | 4 ++--
src/hotspot/share/interpreter/bytecodeHistogram.hpp | 4 ++--
src/hotspot/share/interpreter/bytecodeTracer.hpp | 4 ++--
src/hotspot/share/interpreter/bytecodeUtils.hpp | 6 +++---
src/hotspot/share/interpreter/bytecodes.hpp | 5 +++--
src/hotspot/share/interpreter/templateTable.hpp | 4 ++--
.../share/jfr/instrumentation/jfrEventClassTransformer.hpp | 4 ++--
src/hotspot/share/jfr/jfr.hpp | 6 ++++--
src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.hpp | 4 ++--
.../jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp | 4 ++--
.../share/jfr/leakprofiler/checkpoint/rootResolver.hpp | 4 ++--
src/hotspot/share/jfr/leakprofiler/leakProfiler.hpp | 5 +++--
.../share/jfr/leakprofiler/utilities/granularTimer.hpp | 4 ++--
src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp | 4 ++--
.../share/jfr/periodic/jfrFinalizerStatisticsEvent.hpp | 4 ++--
src/hotspot/share/jfr/periodic/jfrModuleEvent.hpp | 4 ++--
src/hotspot/share/jfr/periodic/jfrNetworkUtilization.hpp | 4 ++--
src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.hpp | 4 ++--
src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.hpp | 4 ++--
.../share/jfr/recorder/checkpoint/jfrMetadataEvent.hpp | 4 ++--
.../share/jfr/recorder/checkpoint/types/jfrThreadState.hpp | 4 ++--
.../jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp | 4 ++--
.../recorder/checkpoint/types/traceid/jfrTraceIdBits.hpp | 2 +-
.../recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp | 4 ++--
.../checkpoint/types/traceid/jfrTraceIdLoadBarrier.hpp | 4 ++--
.../share/jfr/recorder/repository/jfrChunkRotation.hpp | 4 ++--
.../share/jfr/recorder/repository/jfrEmergencyDump.hpp | 4 ++--
src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp | 4 ++--
src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp | 4 ++--
.../share/jfr/recorder/service/jfrRecorderThread.hpp | 4 ++--
src/hotspot/share/jfr/support/jfrJdkJfrEvent.hpp | 4 ++--
src/hotspot/share/jfr/support/jfrKlassUnloading.hpp | 4 ++--
src/hotspot/share/jfr/support/jfrMethodLookup.hpp | 2 +-
src/hotspot/share/jfr/support/jfrObjectAllocationSample.hpp | 4 ++--
src/hotspot/share/jfr/utilities/jfrBigEndian.hpp | 4 ++--
src/hotspot/share/jfr/utilities/jfrJavaLog.hpp | 4 ++--
src/hotspot/share/jfr/utilities/jfrPredicate.hpp | 4 ++--
src/hotspot/share/jfr/utilities/jfrTimeConverter.hpp | 4 ++--
src/hotspot/share/jfr/writers/jfrEncoding.hpp | 4 ++--
src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp | 4 ++--
src/hotspot/share/logging/logConfiguration.hpp | 5 +++--
src/hotspot/share/logging/logLevel.hpp | 5 +++--
src/hotspot/share/logging/logTag.hpp | 6 ++++--
src/hotspot/share/memory/metaspace/internalStats.hpp | 6 +++---
src/hotspot/share/memory/metaspace/metaspaceReporter.hpp | 6 +++---
src/hotspot/share/memory/metaspace/metaspaceSettings.hpp | 6 +++---
src/hotspot/share/memory/metaspace/runningCounters.hpp | 6 +++---
src/hotspot/share/memory/metaspaceCounters.hpp | 4 ++--
src/hotspot/share/memory/metaspaceCriticalAllocation.hpp | 2 +-
src/hotspot/share/metaprogramming/conditional.hpp | 4 ++--
src/hotspot/share/metaprogramming/decay.hpp | 4 ++--
src/hotspot/share/metaprogramming/removeCV.hpp | 4 ++--
src/hotspot/share/metaprogramming/removeExtent.hpp | 4 ++--
src/hotspot/share/metaprogramming/removePointer.hpp | 4 ++--
src/hotspot/share/metaprogramming/removeReference.hpp | 4 ++--
src/hotspot/share/oops/access.hpp | 4 ++--
src/hotspot/share/oops/accessDecorators.hpp | 4 ++--
src/hotspot/share/oops/compressedOops.hpp | 4 ++--
src/hotspot/share/prims/jniFastGetField.hpp | 4 ++--
src/hotspot/share/prims/jvmtiEventController.hpp | 4 ++--
src/hotspot/share/prims/jvmtiExtensions.hpp | 4 ++--
src/hotspot/share/prims/jvmtiManageCapabilities.hpp | 4 ++--
src/hotspot/share/prims/nativeLookup.hpp | 4 ++--
src/hotspot/share/prims/resolvedMethodTable.hpp | 4 ++--
src/hotspot/share/prims/vectorSupport.hpp | 4 ++--
src/hotspot/share/runtime/abstract_vm_version.hpp | 4 ++--
src/hotspot/share/runtime/arguments.hpp | 4 ++--
src/hotspot/share/runtime/handshake.hpp | 4 ++--
src/hotspot/share/runtime/icache.hpp | 4 ++--
src/hotspot/share/runtime/jniHandles.hpp | 4 ++--
src/hotspot/share/runtime/orderAccess.hpp | 4 ++--
src/hotspot/share/runtime/prefetch.hpp | 4 ++--
src/hotspot/share/runtime/reflectionUtils.hpp | 4 ++--
src/hotspot/share/runtime/safepoint.hpp | 2 +-
src/hotspot/share/runtime/sharedRuntime.hpp | 4 ++--
src/hotspot/share/runtime/stackWatermark.hpp | 4 ++--
src/hotspot/share/runtime/threadLocalStorage.hpp | 4 ++--
src/hotspot/share/services/attachListener.hpp | 4 ++--
src/hotspot/share/services/gcNotifier.hpp | 4 ++--
src/hotspot/share/services/lowMemoryDetector.hpp | 4 ++--
src/hotspot/share/services/nmtCommon.hpp | 4 ++--
src/hotspot/share/services/threadIdTable.hpp | 2 +-
src/hotspot/share/utilities/decoder.hpp | 4 ++--
src/hotspot/share/utilities/globalCounter.hpp | 4 ++--
src/hotspot/share/utilities/quickSort.hpp | 4 ++--
src/hotspot/share/utilities/stringUtils.cpp | 4 +++-
src/hotspot/share/utilities/stringUtils.hpp | 4 ++--
src/hotspot/share/utilities/utf8.cpp | 6 +++++-
src/hotspot/share/utilities/utf8.hpp | 6 ++++--
test/hotspot/gtest/classfile/test_AltHashing.cpp | 3 ++-
172 files changed, 368 insertions(+), 333 deletions(-)
diff --git a/src/hotspot/cpu/aarch64/bytes_aarch64.hpp b/src/hotspot/cpu/aarch64/bytes_aarch64.hpp
index acb2e493a9a..672f03b93a9 100644
--- a/src/hotspot/cpu/aarch64/bytes_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/bytes_aarch64.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -26,7 +26,7 @@
#ifndef CPU_AARCH64_BYTES_AARCH64_HPP
#define CPU_AARCH64_BYTES_AARCH64_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class Bytes: AllStatic {
public:
diff --git a/src/hotspot/cpu/aarch64/jniTypes_aarch64.hpp b/src/hotspot/cpu/aarch64/jniTypes_aarch64.hpp
index 4254cdf4cfd..8d20a6a1701 100644
--- a/src/hotspot/cpu/aarch64/jniTypes_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/jniTypes_aarch64.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -27,7 +27,7 @@
#define CPU_AARCH64_JNITYPES_AARCH64_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oop.hpp"
// This file holds platform-dependent routines used to write primitive jni
diff --git a/src/hotspot/cpu/arm/bytes_arm.hpp b/src/hotspot/cpu/arm/bytes_arm.hpp
index b0d481f314d..34af43edcac 100644
--- a/src/hotspot/cpu/arm/bytes_arm.hpp
+++ b/src/hotspot/cpu/arm/bytes_arm.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef CPU_ARM_BYTES_ARM_HPP
#define CPU_ARM_BYTES_ARM_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/macros.hpp"
#ifndef VM_LITTLE_ENDIAN
diff --git a/src/hotspot/cpu/arm/jniTypes_arm.hpp b/src/hotspot/cpu/arm/jniTypes_arm.hpp
index 66596eac1a0..660e58110f8 100644
--- a/src/hotspot/cpu/arm/jniTypes_arm.hpp
+++ b/src/hotspot/cpu/arm/jniTypes_arm.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define CPU_ARM_JNITYPES_ARM_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oop.hpp"
// This file holds platform-dependent routines used to write primitive jni
diff --git a/src/hotspot/cpu/ppc/bytes_ppc.hpp b/src/hotspot/cpu/ppc/bytes_ppc.hpp
index 8249068ecd6..a4d061e9b73 100644
--- a/src/hotspot/cpu/ppc/bytes_ppc.hpp
+++ b/src/hotspot/cpu/ppc/bytes_ppc.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 SAP SE. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#ifndef CPU_PPC_BYTES_PPC_HPP
#define CPU_PPC_BYTES_PPC_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class Bytes: AllStatic {
public:
diff --git a/src/hotspot/cpu/ppc/jniTypes_ppc.hpp b/src/hotspot/cpu/ppc/jniTypes_ppc.hpp
index ef1fe4acfdf..13ccaf408e9 100644
--- a/src/hotspot/cpu/ppc/jniTypes_ppc.hpp
+++ b/src/hotspot/cpu/ppc/jniTypes_ppc.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2013 SAP SE. All rights reserved.
+ * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#define CPU_PPC_JNITYPES_PPC_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oop.hpp"
// This file holds platform-dependent routines used to write primitive
diff --git a/src/hotspot/cpu/s390/bytes_s390.hpp b/src/hotspot/cpu/s390/bytes_s390.hpp
index f6882f980ab..9b4d7b04221 100644
--- a/src/hotspot/cpu/s390/bytes_s390.hpp
+++ b/src/hotspot/cpu/s390/bytes_s390.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2016, 2018 SAP SE. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#ifndef CPU_S390_BYTES_S390_HPP
#define CPU_S390_BYTES_S390_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class Bytes: AllStatic {
public:
diff --git a/src/hotspot/cpu/s390/jniTypes_s390.hpp b/src/hotspot/cpu/s390/jniTypes_s390.hpp
index 56f4a05c6d4..951e7f5f6d2 100644
--- a/src/hotspot/cpu/s390/jniTypes_s390.hpp
+++ b/src/hotspot/cpu/s390/jniTypes_s390.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -30,7 +30,7 @@
// jni types to the array of arguments passed into JavaCalls::call.
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oop.hpp"
class JNITypes : AllStatic {
diff --git a/src/hotspot/cpu/x86/bytes_x86.hpp b/src/hotspot/cpu/x86/bytes_x86.hpp
index 4ce19a473b4..cb5987d2c82 100644
--- a/src/hotspot/cpu/x86/bytes_x86.hpp
+++ b/src/hotspot/cpu/x86/bytes_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef CPU_X86_BYTES_X86_HPP
#define CPU_X86_BYTES_X86_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/align.hpp"
#include "utilities/macros.hpp"
diff --git a/src/hotspot/cpu/x86/c2_intelJccErratum_x86.hpp b/src/hotspot/cpu/x86/c2_intelJccErratum_x86.hpp
index f3f66f3d7bc..415d8a99933 100644
--- a/src/hotspot/cpu/x86/c2_intelJccErratum_x86.hpp
+++ b/src/hotspot/cpu/x86/c2_intelJccErratum_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef CPU_X86_INTELJCCERRATUM_X86_HPP
#define CPU_X86_INTELJCCERRATUM_X86_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
class Block;
diff --git a/src/hotspot/cpu/x86/jniTypes_x86.hpp b/src/hotspot/cpu/x86/jniTypes_x86.hpp
index 403a0b63e2b..5c925474796 100644
--- a/src/hotspot/cpu/x86/jniTypes_x86.hpp
+++ b/src/hotspot/cpu/x86/jniTypes_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define CPU_X86_JNITYPES_X86_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oop.hpp"
// This file holds platform-dependent routines used to write primitive jni
diff --git a/src/hotspot/cpu/x86/rdtsc_x86.hpp b/src/hotspot/cpu/x86/rdtsc_x86.hpp
index f66997c9cfe..d9e77a0ae6b 100644
--- a/src/hotspot/cpu/x86/rdtsc_x86.hpp
+++ b/src/hotspot/cpu/x86/rdtsc_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,8 @@
#ifndef CPU_X86_RDTSC_X86_HPP
#define CPU_X86_RDTSC_X86_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
// Interface to the x86 rdtsc() time counter, if available.
diff --git a/src/hotspot/cpu/zero/bytes_zero.hpp b/src/hotspot/cpu/zero/bytes_zero.hpp
index 9acd9dd2430..93d49b8a28d 100644
--- a/src/hotspot/cpu/zero/bytes_zero.hpp
+++ b/src/hotspot/cpu/zero/bytes_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -26,7 +26,7 @@
#ifndef CPU_ZERO_BYTES_ZERO_HPP
#define CPU_ZERO_BYTES_ZERO_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
typedef union unaligned {
u4 u;
diff --git a/src/hotspot/cpu/zero/jniTypes_zero.hpp b/src/hotspot/cpu/zero/jniTypes_zero.hpp
index 8d5a6bee7fa..9f6fe78005b 100644
--- a/src/hotspot/cpu/zero/jniTypes_zero.hpp
+++ b/src/hotspot/cpu/zero/jniTypes_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define CPU_ZERO_JNITYPES_ZERO_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oop.hpp"
// This file holds platform-dependent routines used to write primitive jni
diff --git a/src/hotspot/os/bsd/gc/z/zNUMA_bsd.cpp b/src/hotspot/os/bsd/gc/z/zNUMA_bsd.cpp
index a0fe34c6504..e5b3895c44e 100644
--- a/src/hotspot/os/bsd/gc/z/zNUMA_bsd.cpp
+++ b/src/hotspot/os/bsd/gc/z/zNUMA_bsd.cpp
@@ -23,6 +23,7 @@
#include "precompiled.hpp"
#include "gc/z/zNUMA.hpp"
+#include "utilities/globalDefinitions.hpp"
void ZNUMA::pd_initialize() {
_enabled = false;
diff --git a/src/hotspot/os/linux/gc/z/zSyscall_linux.hpp b/src/hotspot/os/linux/gc/z/zSyscall_linux.hpp
index 95b13841b2a..1e1becf5a14 100644
--- a/src/hotspot/os/linux/gc/z/zSyscall_linux.hpp
+++ b/src/hotspot/os/linux/gc/z/zSyscall_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,8 @@
#ifndef OS_LINUX_GC_Z_ZSYSCALL_LINUX_HPP
#define OS_LINUX_GC_Z_ZSYSCALL_LINUX_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
// Flags for get_mempolicy()
#ifndef MPOL_F_NODE
diff --git a/src/hotspot/os/linux/osContainer_linux.hpp b/src/hotspot/os/linux/osContainer_linux.hpp
index 940bc0e3874..1ba4a9dabdc 100644
--- a/src/hotspot/os/linux/osContainer_linux.hpp
+++ b/src/hotspot/os/linux/osContainer_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#define OSCONTAINER_ERROR (-2)
diff --git a/src/hotspot/os/posix/signals_posix.hpp b/src/hotspot/os/posix/signals_posix.hpp
index 373a02ff3a3..2efdb374c4e 100644
--- a/src/hotspot/os/posix/signals_posix.hpp
+++ b/src/hotspot/os/posix/signals_posix.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef OS_POSIX_SIGNALS_POSIX_HPP
#define OS_POSIX_SIGNALS_POSIX_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
class outputStream;
diff --git a/src/hotspot/os/posix/threadLocalStorage_posix.cpp b/src/hotspot/os/posix/threadLocalStorage_posix.cpp
index cc703ef811f..25bbbe2244f 100644
--- a/src/hotspot/os/posix/threadLocalStorage_posix.cpp
+++ b/src/hotspot/os/posix/threadLocalStorage_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
*/
#include "runtime/threadLocalStorage.hpp"
+#include "utilities/debug.hpp"
#include
static pthread_key_t _thread_key;
diff --git a/src/hotspot/os/windows/gc/z/zMapper_windows.hpp b/src/hotspot/os/windows/gc/z/zMapper_windows.hpp
index 4db80c89956..3e47b470f5f 100644
--- a/src/hotspot/os/windows/gc/z/zMapper_windows.hpp
+++ b/src/hotspot/os/windows/gc/z/zMapper_windows.hpp
@@ -24,7 +24,7 @@
#ifndef OS_WINDOWS_GC_Z_ZMAPPER_WINDOWS_HPP
#define OS_WINDOWS_GC_Z_ZMAPPER_WINDOWS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
#include
diff --git a/src/hotspot/os/windows/iphlp_interface.hpp b/src/hotspot/os/windows/iphlp_interface.hpp
index 0ebe971a5f1..3e7e0adef65 100644
--- a/src/hotspot/os/windows/iphlp_interface.hpp
+++ b/src/hotspot/os/windows/iphlp_interface.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef OS_WINDOWS_IPHLP_INTERFACE_HPP
#define OS_WINDOWS_IPHLP_INTERFACE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/macros.hpp"
#include
#include
diff --git a/src/hotspot/os/windows/pdh_interface.hpp b/src/hotspot/os/windows/pdh_interface.hpp
index 743c737d998..151f9edd0e9 100644
--- a/src/hotspot/os/windows/pdh_interface.hpp
+++ b/src/hotspot/os/windows/pdh_interface.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef OS_WINDOWS_PDH_INTERFACE_HPP
#define OS_WINDOWS_PDH_INTERFACE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include
#include
diff --git a/src/hotspot/os/windows/threadLocalStorage_windows.cpp b/src/hotspot/os/windows/threadLocalStorage_windows.cpp
index 5648a672d71..7d809518aab 100644
--- a/src/hotspot/os/windows/threadLocalStorage_windows.cpp
+++ b/src/hotspot/os/windows/threadLocalStorage_windows.cpp
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "runtime/threadLocalStorage.hpp"
+#include "utilities/debug.hpp"
#include
static DWORD _thread_key;
diff --git a/src/hotspot/share/c1/c1_Runtime1.hpp b/src/hotspot/share/c1/c1_Runtime1.hpp
index 9212a4fb249..3dcb27476a6 100644
--- a/src/hotspot/share/c1/c1_Runtime1.hpp
+++ b/src/hotspot/share/c1/c1_Runtime1.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
#include "c1/c1_FrameMap.hpp"
#include "code/stubs.hpp"
#include "interpreter/interpreter.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/deoptimization.hpp"
class StubAssembler;
diff --git a/src/hotspot/share/cds/archiveUtils.cpp b/src/hotspot/share/cds/archiveUtils.cpp
index 8c273c06a8d..27c94290c23 100644
--- a/src/hotspot/share/cds/archiveUtils.cpp
+++ b/src/hotspot/share/cds/archiveUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,9 @@
#include "oops/compressedOops.inline.hpp"
#include "runtime/arguments.hpp"
#include "utilities/bitMap.inline.hpp"
+#include "utilities/debug.hpp"
#include "utilities/formatBuffer.hpp"
+#include "utilities/globalDefinitions.hpp"
CHeapBitMap* ArchivePtrMarker::_ptrmap = NULL;
VirtualSpace* ArchivePtrMarker::_vs;
diff --git a/src/hotspot/share/cds/dynamicArchive.hpp b/src/hotspot/share/cds/dynamicArchive.hpp
index fbb831ae195..ec8a505978b 100644
--- a/src/hotspot/share/cds/dynamicArchive.hpp
+++ b/src/hotspot/share/cds/dynamicArchive.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#include "cds/filemap.hpp"
#include "classfile/compactHashtable.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/memRegion.hpp"
#include "memory/virtualspace.hpp"
#include "oops/oop.hpp"
diff --git a/src/hotspot/share/classfile/altHashing.hpp b/src/hotspot/share/classfile/altHashing.hpp
index f2fc52410d1..555720c0666 100644
--- a/src/hotspot/share/classfile/altHashing.hpp
+++ b/src/hotspot/share/classfile/altHashing.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,8 @@
#define SHARE_CLASSFILE_ALTHASHING_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
/**
* Implementation of alternate more secure hashing.
diff --git a/src/hotspot/share/classfile/klassFactory.hpp b/src/hotspot/share/classfile/klassFactory.hpp
index 2b2ee36dfa3..b1584b3e2ca 100644
--- a/src/hotspot/share/classfile/klassFactory.hpp
+++ b/src/hotspot/share/classfile/klassFactory.hpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_CLASSFILE_KLASSFACTORY_HPP
#define SHARE_CLASSFILE_KLASSFACTORY_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/handles.hpp"
class ClassFileStream;
diff --git a/src/hotspot/share/classfile/modules.hpp b/src/hotspot/share/classfile/modules.hpp
index 31cab8209fa..5c52a323b0c 100644
--- a/src/hotspot/share/classfile/modules.hpp
+++ b/src/hotspot/share/classfile/modules.hpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_CLASSFILE_MODULES_HPP
#define SHARE_CLASSFILE_MODULES_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/handles.hpp"
class ModuleEntryTable;
diff --git a/src/hotspot/share/code/vtableStubs.hpp b/src/hotspot/share/code/vtableStubs.hpp
index 8fc2bdae94c..9498ad7d329 100644
--- a/src/hotspot/share/code/vtableStubs.hpp
+++ b/src/hotspot/share/code/vtableStubs.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#include "asm/macroAssembler.hpp"
#include "code/vmreg.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
// A VtableStub holds an individual code stub for a pair (vtable index, #args) for either itables or vtables
// There's a one-to-one relationship between a VtableStub and such a pair.
diff --git a/src/hotspot/share/compiler/compilerDefinitions.hpp b/src/hotspot/share/compiler/compilerDefinitions.hpp
index 1c8096918a6..153dfaad364 100644
--- a/src/hotspot/share/compiler/compilerDefinitions.hpp
+++ b/src/hotspot/share/compiler/compilerDefinitions.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#include "compiler/compiler_globals.hpp"
#include "jvmci/jvmci_globals.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/globals.hpp"
// The (closed set) of concrete compiler classes.
diff --git a/src/hotspot/share/compiler/compilerEvent.hpp b/src/hotspot/share/compiler/compilerEvent.hpp
index 65fc296b66b..cf04ce9a436 100644
--- a/src/hotspot/share/compiler/compilerEvent.hpp
+++ b/src/hotspot/share/compiler/compilerEvent.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#include "jni.h"
#include "compiler/compilerDefinitions.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/macros.hpp"
#include "utilities/ticks.hpp"
diff --git a/src/hotspot/share/compiler/compilerOracle.hpp b/src/hotspot/share/compiler/compilerOracle.hpp
index e5be64cbdd4..f2fc0e8251d 100644
--- a/src/hotspot/share/compiler/compilerOracle.hpp
+++ b/src/hotspot/share/compiler/compilerOracle.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_COMPILER_COMPILERORACLE_HPP
#define SHARE_COMPILER_COMPILERORACLE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oopsHierarchy.hpp"
class methodHandle;
diff --git a/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp b/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp
index 5692a0c407e..e8894323d65 100644
--- a/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp
+++ b/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_GC_G1_G1COLLECTIONSETCHOOSER_HPP
#include "gc/g1/heapRegion.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/globals.hpp"
class G1CollectionSetCandidates;
diff --git a/src/hotspot/share/gc/g1/g1FromCardCache.hpp b/src/hotspot/share/gc/g1/g1FromCardCache.hpp
index b76d7b1b863..0a01e0102ae 100644
--- a/src/hotspot/share/gc/g1/g1FromCardCache.hpp
+++ b/src/hotspot/share/gc/g1/g1FromCardCache.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_G1_G1FROMCARDCACHE_HPP
#define SHARE_GC_G1_G1FROMCARDCACHE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/ostream.hpp"
// G1FromCardCache remembers the most recently processed card on the heap on
diff --git a/src/hotspot/share/gc/g1/g1HeapRegionEventSender.hpp b/src/hotspot/share/gc/g1/g1HeapRegionEventSender.hpp
index c8518a5172e..eb3d60656d4 100644
--- a/src/hotspot/share/gc/g1/g1HeapRegionEventSender.hpp
+++ b/src/hotspot/share/gc/g1/g1HeapRegionEventSender.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_G1_G1HEAPREGIONEVENTSENDER_HPP
#define SHARE_GC_G1_G1HEAPREGIONEVENTSENDER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class G1HeapRegionEventSender : public AllStatic {
public:
diff --git a/src/hotspot/share/gc/g1/g1HeapRegionTraceType.hpp b/src/hotspot/share/gc/g1/g1HeapRegionTraceType.hpp
index ab3ee03137c..1c5690e566d 100644
--- a/src/hotspot/share/gc/g1/g1HeapRegionTraceType.hpp
+++ b/src/hotspot/share/gc/g1/g1HeapRegionTraceType.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_G1_G1HEAPREGIONTRACETYPE_HPP
#define SHARE_GC_G1_G1HEAPREGIONTRACETYPE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/debug.hpp"
class G1HeapRegionTraceType : AllStatic {
diff --git a/src/hotspot/share/gc/g1/heapRegionBounds.hpp b/src/hotspot/share/gc/g1/heapRegionBounds.hpp
index 5e748de5928..5a6db9fac3b 100644
--- a/src/hotspot/share/gc/g1/heapRegionBounds.hpp
+++ b/src/hotspot/share/gc/g1/heapRegionBounds.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,8 @@
#ifndef SHARE_GC_G1_HEAPREGIONBOUNDS_HPP
#define SHARE_GC_G1_HEAPREGIONBOUNDS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
class HeapRegionBounds : public AllStatic {
private:
diff --git a/src/hotspot/share/gc/g1/heapRegionTracer.hpp b/src/hotspot/share/gc/g1/heapRegionTracer.hpp
index bdfcd1cfd8e..647744d0d5e 100644
--- a/src/hotspot/share/gc/g1/heapRegionTracer.hpp
+++ b/src/hotspot/share/gc/g1/heapRegionTracer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,8 @@
#define SHARE_GC_G1_HEAPREGIONTRACER_HPP
#include "gc/g1/g1HeapRegionTraceType.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
class HeapRegionTracer : AllStatic {
public:
diff --git a/src/hotspot/share/gc/g1/heapRegionType.hpp b/src/hotspot/share/gc/g1/heapRegionType.hpp
index 74807c37746..9e1c79ea0d0 100644
--- a/src/hotspot/share/gc/g1/heapRegionType.hpp
+++ b/src/hotspot/share/gc/g1/heapRegionType.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
#define SHARE_GC_G1_HEAPREGIONTYPE_HPP
#include "gc/g1/g1HeapRegionTraceType.hpp"
+#include "utilities/globalDefinitions.hpp"
#define hrt_assert_is_valid(tag) \
assert(is_valid((tag)), "invalid HR type: %u", (uint) (tag))
diff --git a/src/hotspot/share/gc/parallel/psRootType.hpp b/src/hotspot/share/gc/parallel/psRootType.hpp
index 921bbfdd2b0..cbdc94dc9ab 100644
--- a/src/hotspot/share/gc/parallel/psRootType.hpp
+++ b/src/hotspot/share/gc/parallel/psRootType.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_PARALLEL_PSROOTTYPE_HPP
#define SHARE_GC_PARALLEL_PSROOTTYPE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/macros.hpp"
class ParallelRootType : public AllStatic {
diff --git a/src/hotspot/share/gc/parallel/psScavenge.hpp b/src/hotspot/share/gc/parallel/psScavenge.hpp
index 80f41a99934..c575e8a3f2c 100644
--- a/src/hotspot/share/gc/parallel/psScavenge.hpp
+++ b/src/hotspot/share/gc/parallel/psScavenge.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
#include "gc/parallel/psVirtualspace.hpp"
#include "gc/shared/collectorCounters.hpp"
#include "gc/shared/gcTrace.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oop.hpp"
#include "utilities/stack.hpp"
diff --git a/src/hotspot/share/gc/shared/accessBarrierSupport.hpp b/src/hotspot/share/gc/shared/accessBarrierSupport.hpp
index 58bc562d988..ca3b4589224 100644
--- a/src/hotspot/share/gc/shared/accessBarrierSupport.hpp
+++ b/src/hotspot/share/gc/shared/accessBarrierSupport.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_SHARED_ACCESSBARRIERSUPPORT_HPP
#define SHARE_GC_SHARED_ACCESSBARRIERSUPPORT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/access.hpp"
class AccessBarrierSupport: AllStatic {
diff --git a/src/hotspot/share/gc/shared/ageTableTracer.hpp b/src/hotspot/share/gc/shared/ageTableTracer.hpp
index cca3f125bfd..02e1fe3338d 100644
--- a/src/hotspot/share/gc/shared/ageTableTracer.hpp
+++ b/src/hotspot/share/gc/shared/ageTableTracer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,8 @@
#ifndef SHARE_GC_SHARED_AGETABLETRACER_HPP
#define SHARE_GC_SHARED_AGETABLETRACER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
class AgeTableTracer : AllStatic {
public:
diff --git a/src/hotspot/share/gc/shared/allocTracer.hpp b/src/hotspot/share/gc/shared/allocTracer.hpp
index c30628b2889..273f20d70ea 100644
--- a/src/hotspot/share/gc/shared/allocTracer.hpp
+++ b/src/hotspot/share/gc/shared/allocTracer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_SHARED_ALLOCTRACER_HPP
#define SHARE_GC_SHARED_ALLOCTRACER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/handles.hpp"
class AllocTracer : AllStatic {
diff --git a/src/hotspot/share/gc/shared/blockOffsetTable.hpp b/src/hotspot/share/gc/shared/blockOffsetTable.hpp
index 7d6ddfdf799..9a32594c123 100644
--- a/src/hotspot/share/gc/shared/blockOffsetTable.hpp
+++ b/src/hotspot/share/gc/shared/blockOffsetTable.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/memset_with_concurrent_readers.hpp"
#include "gc/shared/cardTable.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/memRegion.hpp"
#include "memory/virtualspace.hpp"
#include "runtime/globals.hpp"
diff --git a/src/hotspot/share/gc/shared/concurrentGCBreakpoints.hpp b/src/hotspot/share/gc/shared/concurrentGCBreakpoints.hpp
index c11c0e116c5..7af1b5746c3 100644
--- a/src/hotspot/share/gc/shared/concurrentGCBreakpoints.hpp
+++ b/src/hotspot/share/gc/shared/concurrentGCBreakpoints.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_GC_SHARED_CONCURRENTGCBREAKPOINTS_HPP
#include "gc/shared/gcCause.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
class Monitor;
diff --git a/src/hotspot/share/gc/shared/gcCause.hpp b/src/hotspot/share/gc/shared/gcCause.hpp
index 75f7dc73a8c..a3746fa8745 100644
--- a/src/hotspot/share/gc/shared/gcCause.hpp
+++ b/src/hotspot/share/gc/shared/gcCause.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,8 @@
#ifndef SHARE_GC_SHARED_GCCAUSE_HPP
#define SHARE_GC_SHARED_GCCAUSE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/debug.hpp"
//
// This class exposes implementation details of the various
diff --git a/src/hotspot/share/gc/shared/gcConfig.hpp b/src/hotspot/share/gc/shared/gcConfig.hpp
index 2dfbf186b7f..9b0da3ad528 100644
--- a/src/hotspot/share/gc/shared/gcConfig.hpp
+++ b/src/hotspot/share/gc/shared/gcConfig.hpp
@@ -26,7 +26,7 @@
#define SHARE_GC_SHARED_GCCONFIG_HPP
#include "gc/shared/collectedHeap.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class GCArguments;
diff --git a/src/hotspot/share/gc/shared/gcLocker.hpp b/src/hotspot/share/gc/shared/gcLocker.hpp
index 91ed84c41a9..e567d0c1f16 100644
--- a/src/hotspot/share/gc/shared/gcLocker.hpp
+++ b/src/hotspot/share/gc/shared/gcLocker.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_GC_SHARED_GCLOCKER_HPP
#include "gc/shared/gcCause.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
diff --git a/src/hotspot/share/gc/shared/gcLogPrecious.hpp b/src/hotspot/share/gc/shared/gcLogPrecious.hpp
index 5f1158caca7..ec8b1c670f3 100644
--- a/src/hotspot/share/gc/shared/gcLogPrecious.hpp
+++ b/src/hotspot/share/gc/shared/gcLogPrecious.hpp
@@ -26,7 +26,7 @@
#include "utilities/globalDefinitions.hpp"
#include "logging/logHandle.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/debug.hpp"
class Mutex;
diff --git a/src/hotspot/share/gc/shared/gcWhen.hpp b/src/hotspot/share/gc/shared/gcWhen.hpp
index ff489226f65..23e2ef6b229 100644
--- a/src/hotspot/share/gc/shared/gcWhen.hpp
+++ b/src/hotspot/share/gc/shared/gcWhen.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_SHARED_GCWHEN_HPP
#define SHARE_GC_SHARED_GCWHEN_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/debug.hpp"
class GCWhen : AllStatic {
diff --git a/src/hotspot/share/gc/shared/locationPrinter.hpp b/src/hotspot/share/gc/shared/locationPrinter.hpp
index 2c99e452845..2d5d997376d 100644
--- a/src/hotspot/share/gc/shared/locationPrinter.hpp
+++ b/src/hotspot/share/gc/shared/locationPrinter.hpp
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_SHARED_LOCATIONPRINTER_HPP
#define SHARE_GC_SHARED_LOCATIONPRINTER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oopsHierarchy.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/gc/shared/objectCountEventSender.hpp b/src/hotspot/share/gc/shared/objectCountEventSender.hpp
index 58e6da016da..115fbfdaf7d 100644
--- a/src/hotspot/share/gc/shared/objectCountEventSender.hpp
+++ b/src/hotspot/share/gc/shared/objectCountEventSender.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_GC_SHARED_OBJECTCOUNTEVENTSENDER_HPP
#include "gc/shared/gcTrace.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
#include "utilities/ticks.hpp"
diff --git a/src/hotspot/share/gc/shared/scavengableNMethods.hpp b/src/hotspot/share/gc/shared/scavengableNMethods.hpp
index 276ea9843c0..4852e6d32fb 100644
--- a/src/hotspot/share/gc/shared/scavengableNMethods.hpp
+++ b/src/hotspot/share/gc/shared/scavengableNMethods.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_SHARED_SCAVENGABLENMETHODS_HPP
#define SHARE_GC_SHARED_SCAVENGABLENMETHODS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/macros.hpp"
class BoolObjectClosure;
diff --git a/src/hotspot/share/gc/shared/spaceDecorator.hpp b/src/hotspot/share/gc/shared/spaceDecorator.hpp
index d421a2a40f5..778881f75a1 100644
--- a/src/hotspot/share/gc/shared/spaceDecorator.hpp
+++ b/src/hotspot/share/gc/shared/spaceDecorator.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_SHARED_SPACEDECORATOR_HPP
#define SHARE_GC_SHARED_SPACEDECORATOR_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/memRegion.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/gc/shared/weakProcessor.hpp b/src/hotspot/share/gc/shared/weakProcessor.hpp
index 5eb2c59f3f2..b86129c9b93 100644
--- a/src/hotspot/share/gc/shared/weakProcessor.hpp
+++ b/src/hotspot/share/gc/shared/weakProcessor.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
#include "gc/shared/oopStorageParState.hpp"
#include "gc/shared/oopStorageSetParState.hpp"
#include "gc/shared/workerThread.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class WeakProcessorTimes;
class WorkerThreads;
diff --git a/src/hotspot/share/gc/shared/workerPolicy.hpp b/src/hotspot/share/gc/shared/workerPolicy.hpp
index 377c9135d29..769b0e0ed8b 100644
--- a/src/hotspot/share/gc/shared/workerPolicy.hpp
+++ b/src/hotspot/share/gc/shared/workerPolicy.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_SHARED_WORKERPOLICY_HPP
#define SHARE_GC_SHARED_WORKERPOLICY_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
class WorkerPolicy : public AllStatic {
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBreakpoint.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBreakpoint.hpp
index f8b7489a3bb..acc497618c9 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahBreakpoint.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBreakpoint.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2021, Red Hat, Inc. All rights reserved.
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2022, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHBREAKPOINT_HPP
#define SHARE_GC_SHENANDOAH_SHENANDOAHBREAKPOINT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class ShenandoahBreakpoint : public AllStatic {
private:
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp
index 17bc5b78934..377d7688333 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2020, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 2022, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
#include "gc/shenandoah/shenandoahSharedVariables.hpp"
#include "gc/shenandoah/shenandoahLock.hpp"
#include "gc/shenandoah/shenandoahPadding.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/iterator.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp
index 788fe3fbeca..e187e4360b1 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2018, 2022, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHRUNTIME_HPP
#define SHARE_GC_SHENANDOAH_SHENANDOAHRUNTIME_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oopsHierarchy.hpp"
class JavaThread;
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp
index 10a6fec6535..3f47822f220 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 2022, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHWORKERPOLICY_HPP
#define SHARE_GC_SHENANDOAH_SHENANDOAHWORKERPOLICY_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class ShenandoahWorkerPolicy : AllStatic {
private:
diff --git a/src/hotspot/share/gc/z/zAbort.hpp b/src/hotspot/share/gc/z/zAbort.hpp
index 1a5bcc15f19..f87bca8c0a3 100644
--- a/src/hotspot/share/gc/z/zAbort.hpp
+++ b/src/hotspot/share/gc/z/zAbort.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZABORT_HPP
#define SHARE_GC_Z_ZABORT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class ZAbort : public AllStatic {
private:
diff --git a/src/hotspot/share/gc/z/zAddress.hpp b/src/hotspot/share/gc/z/zAddress.hpp
index eddd104189e..2908c37bbe6 100644
--- a/src/hotspot/share/gc/z/zAddress.hpp
+++ b/src/hotspot/share/gc/z/zAddress.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,8 @@
#ifndef SHARE_GC_Z_ZADDRESS_HPP
#define SHARE_GC_Z_ZADDRESS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
class ZAddress : public AllStatic {
friend class ZAddressTest;
diff --git a/src/hotspot/share/gc/z/zAddressSpaceLimit.hpp b/src/hotspot/share/gc/z/zAddressSpaceLimit.hpp
index b6a03776f5c..ec0faf2c087 100644
--- a/src/hotspot/share/gc/z/zAddressSpaceLimit.hpp
+++ b/src/hotspot/share/gc/z/zAddressSpaceLimit.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,8 @@
#ifndef SHARE_GC_Z_ZADDRESSSPACELIMIT_HPP
#define SHARE_GC_Z_ZADDRESSSPACELIMIT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
class ZAddressSpaceLimit : public AllStatic {
public:
diff --git a/src/hotspot/share/gc/z/zBarrier.hpp b/src/hotspot/share/gc/z/zBarrier.hpp
index d57bef74f91..2dfc1591888 100644
--- a/src/hotspot/share/gc/z/zBarrier.hpp
+++ b/src/hotspot/share/gc/z/zBarrier.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZBARRIER_HPP
#define SHARE_GC_Z_ZBARRIER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/iterator.hpp"
#include "oops/oop.hpp"
diff --git a/src/hotspot/share/gc/z/zBarrierSetRuntime.hpp b/src/hotspot/share/gc/z/zBarrierSetRuntime.hpp
index f3d4fb9c6bd..b3a143de3e9 100644
--- a/src/hotspot/share/gc/z/zBarrierSetRuntime.hpp
+++ b/src/hotspot/share/gc/z/zBarrierSetRuntime.hpp
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZBARRIERSETRUNTIME_HPP
#define SHARE_GC_Z_ZBARRIERSETRUNTIME_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/accessDecorators.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/gc/z/zBitField.hpp b/src/hotspot/share/gc/z/zBitField.hpp
index 4d7171c41ac..9bec4e05594 100644
--- a/src/hotspot/share/gc/z/zBitField.hpp
+++ b/src/hotspot/share/gc/z/zBitField.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,9 @@
#ifndef SHARE_GC_Z_ZBITFIELD_HPP
#define SHARE_GC_Z_ZBITFIELD_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
//
// Example
diff --git a/src/hotspot/share/gc/z/zBreakpoint.hpp b/src/hotspot/share/gc/z/zBreakpoint.hpp
index 14ba227e189..920169fb6a6 100644
--- a/src/hotspot/share/gc/z/zBreakpoint.hpp
+++ b/src/hotspot/share/gc/z/zBreakpoint.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZBREAKPOINT_HPP
#define SHARE_GC_Z_ZBREAKPOINT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class ZBreakpoint : public AllStatic {
private:
diff --git a/src/hotspot/share/gc/z/zCPU.hpp b/src/hotspot/share/gc/z/zCPU.hpp
index 65e04cc75e3..0acc949e508 100644
--- a/src/hotspot/share/gc/z/zCPU.hpp
+++ b/src/hotspot/share/gc/z/zCPU.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZCPU_HPP
#define SHARE_GC_Z_ZCPU_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/padded.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/gc/z/zHash.hpp b/src/hotspot/share/gc/z/zHash.hpp
index 5752d2abee3..e6469698488 100644
--- a/src/hotspot/share/gc/z/zHash.hpp
+++ b/src/hotspot/share/gc/z/zHash.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZHASH_HPP
#define SHARE_GC_Z_ZHASH_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
class ZHash : public AllStatic {
diff --git a/src/hotspot/share/gc/z/zHeuristics.hpp b/src/hotspot/share/gc/z/zHeuristics.hpp
index 5b810a84851..362fd775f0f 100644
--- a/src/hotspot/share/gc/z/zHeuristics.hpp
+++ b/src/hotspot/share/gc/z/zHeuristics.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZHEURISTICS_HPP
#define SHARE_GC_Z_ZHEURISTICS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class ZHeuristics : public AllStatic {
public:
diff --git a/src/hotspot/share/gc/z/zLargePages.hpp b/src/hotspot/share/gc/z/zLargePages.hpp
index 1201b496266..9f7c8310e50 100644
--- a/src/hotspot/share/gc/z/zLargePages.hpp
+++ b/src/hotspot/share/gc/z/zLargePages.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZLARGEPAGES_HPP
#define SHARE_GC_Z_ZLARGEPAGES_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class ZLargePages : public AllStatic {
private:
diff --git a/src/hotspot/share/gc/z/zNMethod.hpp b/src/hotspot/share/gc/z/zNMethod.hpp
index 40ac93adb8e..117c5e34f4e 100644
--- a/src/hotspot/share/gc/z/zNMethod.hpp
+++ b/src/hotspot/share/gc/z/zNMethod.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZNMETHOD_HPP
#define SHARE_GC_Z_ZNMETHOD_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class nmethod;
class NMethodClosure;
diff --git a/src/hotspot/share/gc/z/zNMethodTable.hpp b/src/hotspot/share/gc/z/zNMethodTable.hpp
index 26ae2d27933..a1af8512f69 100644
--- a/src/hotspot/share/gc/z/zNMethodTable.hpp
+++ b/src/hotspot/share/gc/z/zNMethodTable.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#include "gc/z/zNMethodTableIteration.hpp"
#include "gc/z/zSafeDelete.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class nmethod;
class NMethodClosure;
diff --git a/src/hotspot/share/gc/z/zNUMA.hpp b/src/hotspot/share/gc/z/zNUMA.hpp
index 0dc4390e8b4..fb29e1faaa7 100644
--- a/src/hotspot/share/gc/z/zNUMA.hpp
+++ b/src/hotspot/share/gc/z/zNUMA.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,8 @@
#ifndef SHARE_GC_Z_ZNUMA_HPP
#define SHARE_GC_Z_ZNUMA_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
class ZNUMA : public AllStatic {
private:
diff --git a/src/hotspot/share/gc/z/zOop.hpp b/src/hotspot/share/gc/z/zOop.hpp
index cf752ba61c3..4fb0e6499e1 100644
--- a/src/hotspot/share/gc/z/zOop.hpp
+++ b/src/hotspot/share/gc/z/zOop.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZOOP_HPP
#define SHARE_GC_Z_ZOOP_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oopsHierarchy.hpp"
class ZOop : public AllStatic {
diff --git a/src/hotspot/share/gc/z/zResurrection.hpp b/src/hotspot/share/gc/z/zResurrection.hpp
index a88b9354469..3d6a8f95a1c 100644
--- a/src/hotspot/share/gc/z/zResurrection.hpp
+++ b/src/hotspot/share/gc/z/zResurrection.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZRESURRECTION_HPP
#define SHARE_GC_Z_ZRESURRECTION_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class ZResurrection : public AllStatic {
private:
diff --git a/src/hotspot/share/gc/z/zThread.hpp b/src/hotspot/share/gc/z/zThread.hpp
index f98b7a05fb6..c67807ff96e 100644
--- a/src/hotspot/share/gc/z/zThread.hpp
+++ b/src/hotspot/share/gc/z/zThread.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZTHREAD_HPP
#define SHARE_GC_Z_ZTHREAD_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
class ZThread : public AllStatic {
diff --git a/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.hpp b/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.hpp
index d6693fceb00..086c8a5c351 100644
--- a/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.hpp
+++ b/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#include "gc/shared/threadLocalAllocBuffer.hpp"
#include "gc/z/zValue.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class JavaThread;
diff --git a/src/hotspot/share/gc/z/zUtils.hpp b/src/hotspot/share/gc/z/zUtils.hpp
index f4abea9c6fe..470329daf0d 100644
--- a/src/hotspot/share/gc/z/zUtils.hpp
+++ b/src/hotspot/share/gc/z/zUtils.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,8 @@
#ifndef SHARE_GC_Z_ZUTILS_HPP
#define SHARE_GC_Z_ZUTILS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
class ZUtils : public AllStatic {
public:
diff --git a/src/hotspot/share/gc/z/zValue.hpp b/src/hotspot/share/gc/z/zValue.hpp
index 281a2e48b8c..e2c67e8c48d 100644
--- a/src/hotspot/share/gc/z/zValue.hpp
+++ b/src/hotspot/share/gc/z/zValue.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZVALUE_HPP
#define SHARE_GC_Z_ZVALUE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
//
diff --git a/src/hotspot/share/gc/z/zVerify.hpp b/src/hotspot/share/gc/z/zVerify.hpp
index db2d56d0095..8d7abd4a8d5 100644
--- a/src/hotspot/share/gc/z/zVerify.hpp
+++ b/src/hotspot/share/gc/z/zVerify.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
#ifndef SHARE_GC_Z_ZVERIFY_HPP
#define SHARE_GC_Z_ZVERIFY_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class frame;
class ZPageAllocator;
diff --git a/src/hotspot/share/interpreter/bytecodeHistogram.hpp b/src/hotspot/share/interpreter/bytecodeHistogram.hpp
index b919227702f..44ddca074d0 100644
--- a/src/hotspot/share/interpreter/bytecodeHistogram.hpp
+++ b/src/hotspot/share/interpreter/bytecodeHistogram.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_INTERPRETER_BYTECODEHISTOGRAM_HPP
#include "interpreter/bytecodes.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
// BytecodeCounter counts the number of bytecodes executed
diff --git a/src/hotspot/share/interpreter/bytecodeTracer.hpp b/src/hotspot/share/interpreter/bytecodeTracer.hpp
index 52e91a0e712..38c2b092ce3 100644
--- a/src/hotspot/share/interpreter/bytecodeTracer.hpp
+++ b/src/hotspot/share/interpreter/bytecodeTracer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_INTERPRETER_BYTECODETRACER_HPP
#define SHARE_INTERPRETER_BYTECODETRACER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/ostream.hpp"
// The BytecodeTracer is a helper class used by the interpreter for run-time
diff --git a/src/hotspot/share/interpreter/bytecodeUtils.hpp b/src/hotspot/share/interpreter/bytecodeUtils.hpp
index ede99a995b7..ff23b9c000f 100644
--- a/src/hotspot/share/interpreter/bytecodeUtils.hpp
+++ b/src/hotspot/share/interpreter/bytecodeUtils.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2019 SAP SE. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#ifndef SHARE_INTERPRETER_BYTECODEUTILS_HPP
#define SHARE_INTERPRETER_BYTECODEUTILS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
class Method;
diff --git a/src/hotspot/share/interpreter/bytecodes.hpp b/src/hotspot/share/interpreter/bytecodes.hpp
index 9a34a227c04..7c70518d2b1 100644
--- a/src/hotspot/share/interpreter/bytecodes.hpp
+++ b/src/hotspot/share/interpreter/bytecodes.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,8 @@
#ifndef SHARE_INTERPRETER_BYTECODES_HPP
#define SHARE_INTERPRETER_BYTECODES_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
// Bytecodes specifies all bytecodes used in the VM and
// provides utility functions to get bytecode attributes.
diff --git a/src/hotspot/share/interpreter/templateTable.hpp b/src/hotspot/share/interpreter/templateTable.hpp
index ff5d2c33880..e7575eeb40a 100644
--- a/src/hotspot/share/interpreter/templateTable.hpp
+++ b/src/hotspot/share/interpreter/templateTable.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_INTERPRETER_TEMPLATETABLE_HPP
#include "interpreter/bytecodes.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/frame.hpp"
#include "utilities/macros.hpp"
diff --git a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.hpp b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.hpp
index d34a4e57a78..939c02bfdf4 100644
--- a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.hpp
+++ b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_INSTRUMENTATION_JFREVENTCLASSTRANSFORMER_HPP
#define SHARE_JFR_INSTRUMENTATION_JFREVENTCLASSTRANSFORMER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/exceptions.hpp"
class ClassFileParser;
diff --git a/src/hotspot/share/jfr/jfr.hpp b/src/hotspot/share/jfr/jfr.hpp
index c97cc807c3b..b4b1ae78adc 100644
--- a/src/hotspot/share/jfr/jfr.hpp
+++ b/src/hotspot/share/jfr/jfr.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,11 +26,13 @@
#define SHARE_JFR_JFR_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
class JavaThread;
class Thread;
class Klass;
+class outputStream;
extern "C" void JNICALL jfr_register_natives(JNIEnv*, jclass);
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.hpp b/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.hpp
index c9a169e6edb..0f107e7c32e 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.hpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_LEAKPROFILER_CHAINS_EDGEUTILS_HPP
#define SHARE_JFR_LEAKPROFILER_CHAINS_EDGEUTILS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class Edge;
class Symbol;
diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp
index 0ed82fd55c8..f9f928699e2 100644
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_LEAKPROFILER_CHECKPOINT_OBJECTSAMPLECHECKPOINT_HPP
#define SHARE_JFR_LEAKPROFILER_CHECKPOINT_OBJECTSAMPLECHECKPOINT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "jfr/utilities/jfrTypes.hpp"
class EdgeStore;
diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.hpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.hpp
index 63dca4afc72..279cb5032ff 100644
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.hpp
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#include "jfr/leakprofiler/utilities/rootType.hpp"
#include "jfr/leakprofiler/utilities/unifiedOopRef.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oopsHierarchy.hpp"
struct RootCallbackInfo {
diff --git a/src/hotspot/share/jfr/leakprofiler/leakProfiler.hpp b/src/hotspot/share/jfr/leakprofiler/leakProfiler.hpp
index c541ff1086d..6290a10ff74 100644
--- a/src/hotspot/share/jfr/leakprofiler/leakProfiler.hpp
+++ b/src/hotspot/share/jfr/leakprofiler/leakProfiler.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,8 @@
#ifndef SHARE_JFR_LEAKPROFILER_LEAKPROFILER_HPP
#define SHARE_JFR_LEAKPROFILER_LEAKPROFILER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/globalDefinitions.hpp"
class JavaThread;
diff --git a/src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.hpp b/src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.hpp
index 231c1b26df4..e42a815c10d 100644
--- a/src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.hpp
+++ b/src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_JFR_LEAKPROFILER_UTILITIES_GRANULARTIMER_HPP
#include "jfr/utilities/jfrTime.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class GranularTimer : public AllStatic {
private:
diff --git a/src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp b/src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp
index ffc47c7b833..ce975e9b802 100644
--- a/src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp
+++ b/src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_JFR_LEAKPROFILER_UTILITIES_ROOTTYPE_HPP
#include "gc/shared/oopStorageSet.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/enumIterator.hpp"
class OldObjectRoot : public AllStatic {
diff --git a/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.hpp b/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.hpp
index fe739495718..756b5318298 100644
--- a/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.hpp
+++ b/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_PERIODIC_JFRFINALIZERSTATISTICSEVENT_HPP
#define SHARE_JFR_PERIODIC_JFRFINALIZERSTATISTICSEVENT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class InstanceKlass;
diff --git a/src/hotspot/share/jfr/periodic/jfrModuleEvent.hpp b/src/hotspot/share/jfr/periodic/jfrModuleEvent.hpp
index aec662be231..a417ab1bb48 100644
--- a/src/hotspot/share/jfr/periodic/jfrModuleEvent.hpp
+++ b/src/hotspot/share/jfr/periodic/jfrModuleEvent.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_PERIODIC_JFRMODULEEVENT_HPP
#define SHARE_JFR_PERIODIC_JFRMODULEEVENT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class JfrModuleEvent : AllStatic {
public:
diff --git a/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.hpp b/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.hpp
index b7a78498a9f..0ec3de18dee 100644
--- a/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.hpp
+++ b/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_PERIODIC_JFRNETWORKUTILIZATION_HPP
#define SHARE_JFR_PERIODIC_JFRNETWORKUTILIZATION_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class NetworkInterface;
diff --git a/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.hpp b/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.hpp
index 84d3099e825..d5bed0fd821 100644
--- a/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.hpp
+++ b/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_JFR_PERIODIC_JFRTHREADCPULOADEVENT_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class JavaThread;
class EventThreadCPULoad;
diff --git a/src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.hpp b/src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.hpp
index 23af6a3060b..c00925903b1 100644
--- a/src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.hpp
+++ b/src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_PERIODIC_JFRTHREADDUMPEVENT_HPP
#define SHARE_JFR_PERIODIC_JFRTHREADDUMPEVENT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
/*
* Helper for generating jfr events using output data from Dcmd's.
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.hpp b/src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.hpp
index 0111d3becbe..abadbfb0b13 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.hpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_JFR_RECORDER_CHECKPOINT_JFRMETADATAEVENT_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class JfrChunkWriter;
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.hpp
index 9421273dca7..4fd519b5064 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.hpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.hpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_RECORDER_CHECKPOINT_TYPES_JFRTHREADSTATE_HPP
#define SHARE_JFR_RECORDER_CHECKPOINT_TYPES_JFRTHREADSTATE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class JfrCheckpointWriter;
class Thread;
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp
index 8136d125804..456599b45f3 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#include "jni.h"
#include "jfr/utilities/jfrTypes.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class ClassLoaderData;
class Klass;
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.hpp
index 7fba5d8d1e8..d7f7effdc3e 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.hpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.hpp
@@ -27,7 +27,7 @@
#include "jni.h"
#include "jfr/utilities/jfrTypes.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class JfrTraceIdBits : AllStatic {
public:
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp
index ba14919c935..1216f6956ef 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#include "jfr/utilities/jfrSignal.hpp"
#include "jfr/utilities/jfrTypes.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/atomic.hpp"
#define BIT 1
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.hpp
index 7113a65bd42..e7b7e1a8780 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.hpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_JFR_RECORDER_CHECKPOINT_TYPES_TRACEID_JFRTRACEIDLOADBARRIER_HPP
#include "jfr/utilities/jfrTypes.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class ClassLoaderData;
class JfrBuffer;
diff --git a/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.hpp b/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.hpp
index 973fa611718..76603b1cd5e 100644
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.hpp
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_RECORDER_REPOSITORY_JFRCHUNKROTATION_HPP
#define SHARE_JFR_RECORDER_REPOSITORY_JFRCHUNKROTATION_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class JfrChunkWriter;
diff --git a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.hpp b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.hpp
index c96a7d802dc..7912daf35c9 100644
--- a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.hpp
+++ b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_RECORDER_REPOSITORY_JFREMERGENCYDUMP_HPP
#define SHARE_JFR_RECORDER_REPOSITORY_JFREMERGENCYDUMP_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/ostream.hpp"
//
diff --git a/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp b/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp
index 8f056e95398..5e226437987 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_RECORDER_SERVICE_JFRMEMORYSIZER_HPP
#define SHARE_JFR_RECORDER_SERVICE_JFRMEMORYSIZER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
extern const julong MIN_BUFFER_COUNT;
diff --git a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp
index 9e1dd6cef11..9ad810bc3cd 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_JFR_RECORDER_SERVICE_JFROPTIONSET_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/exceptions.hpp"
template
diff --git a/src/hotspot/share/jfr/recorder/service/jfrRecorderThread.hpp b/src/hotspot/share/jfr/recorder/service/jfrRecorderThread.hpp
index 736cc350833..ca8d3e87841 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrRecorderThread.hpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrRecorderThread.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_RECORDER_SERVICE_JFRRECORDERTHREAD_HPP
#define SHARE_JFR_RECORDER_SERVICE_JFRRECORDERTHREAD_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/debug.hpp"
class JavaThread;
diff --git a/src/hotspot/share/jfr/support/jfrJdkJfrEvent.hpp b/src/hotspot/share/jfr/support/jfrJdkJfrEvent.hpp
index 06dddd6d39e..3c3a6d69377 100644
--- a/src/hotspot/share/jfr/support/jfrJdkJfrEvent.hpp
+++ b/src/hotspot/share/jfr/support/jfrJdkJfrEvent.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_JFR_SUPPORT_JFRJDKJFREVENT_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/exceptions.hpp"
class Klass;
diff --git a/src/hotspot/share/jfr/support/jfrKlassUnloading.hpp b/src/hotspot/share/jfr/support/jfrKlassUnloading.hpp
index dcbe11ab8f6..5d380df436c 100644
--- a/src/hotspot/share/jfr/support/jfrKlassUnloading.hpp
+++ b/src/hotspot/share/jfr/support/jfrKlassUnloading.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_JFR_SUPPORT_JFRKLASSUNLOADING_HPP
#include "jfr/utilities/jfrTypes.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class Klass;
diff --git a/src/hotspot/share/jfr/support/jfrMethodLookup.hpp b/src/hotspot/share/jfr/support/jfrMethodLookup.hpp
index 2f998a9def3..106648b25d7 100644
--- a/src/hotspot/share/jfr/support/jfrMethodLookup.hpp
+++ b/src/hotspot/share/jfr/support/jfrMethodLookup.hpp
@@ -26,7 +26,7 @@
#define SHARE_JFR_SUPPORT_JFRMETHODLOOKUP_HPP
#include "jfr/utilities/jfrTypes.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class InstanceKlass;
class Method;
diff --git a/src/hotspot/share/jfr/support/jfrObjectAllocationSample.hpp b/src/hotspot/share/jfr/support/jfrObjectAllocationSample.hpp
index 0902db68f5b..f58caf3c2a6 100644
--- a/src/hotspot/share/jfr/support/jfrObjectAllocationSample.hpp
+++ b/src/hotspot/share/jfr/support/jfrObjectAllocationSample.hpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_SUPPORT_JFROBJECTALLOCATIONSAMPLE_HPP
#define SHARE_JFR_SUPPORT_JFROBJECTALLOCATIONSAMPLE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class Klass;
class Thread;
diff --git a/src/hotspot/share/jfr/utilities/jfrBigEndian.hpp b/src/hotspot/share/jfr/utilities/jfrBigEndian.hpp
index db2e7ebaad2..b2e641269e0 100644
--- a/src/hotspot/share/jfr/utilities/jfrBigEndian.hpp
+++ b/src/hotspot/share/jfr/utilities/jfrBigEndian.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_UTILITIES_JFRBIGENDIAN_HPP
#define SHARE_JFR_UTILITIES_JFRBIGENDIAN_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/bytes.hpp"
#include "utilities/macros.hpp"
diff --git a/src/hotspot/share/jfr/utilities/jfrJavaLog.hpp b/src/hotspot/share/jfr/utilities/jfrJavaLog.hpp
index daef51ac81e..3b5ccc661fe 100644
--- a/src/hotspot/share/jfr/utilities/jfrJavaLog.hpp
+++ b/src/hotspot/share/jfr/utilities/jfrJavaLog.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_UTILITIES_JFRJAVALOG_HPP
#define SHARE_JFR_UTILITIES_JFRJAVALOG_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/exceptions.hpp"
/*
diff --git a/src/hotspot/share/jfr/utilities/jfrPredicate.hpp b/src/hotspot/share/jfr/utilities/jfrPredicate.hpp
index b5f87b4c1e0..51ad1fec0c9 100644
--- a/src/hotspot/share/jfr/utilities/jfrPredicate.hpp
+++ b/src/hotspot/share/jfr/utilities/jfrPredicate.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_UTILITIES_JFRPREDICATE_HPP
#define SHARE_JFR_UTILITIES_JFRPREDICATE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/growableArray.hpp"
/*
diff --git a/src/hotspot/share/jfr/utilities/jfrTimeConverter.hpp b/src/hotspot/share/jfr/utilities/jfrTimeConverter.hpp
index 9ce2308a551..6871fbb5461 100644
--- a/src/hotspot/share/jfr/utilities/jfrTimeConverter.hpp
+++ b/src/hotspot/share/jfr/utilities/jfrTimeConverter.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_JFR_UTILITIES_JFRTIMECONVERTER_HPP
#define SHARE_JFR_UTILITIES_JFRTIMECONVERTER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
class JfrTimeConverter : AllStatic {
diff --git a/src/hotspot/share/jfr/writers/jfrEncoding.hpp b/src/hotspot/share/jfr/writers/jfrEncoding.hpp
index 4684cc4bc9d..3d4c7c55e0e 100644
--- a/src/hotspot/share/jfr/writers/jfrEncoding.hpp
+++ b/src/hotspot/share/jfr/writers/jfrEncoding.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_JFR_WRITERS_JFRENCODING_HPP
#include "jfr/writers/jfrEncoders.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
enum JfrStringEncoding {
diff --git a/src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp b/src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp
index 844ce51a3d9..1159766428e 100644
--- a/src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp
+++ b/src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_JFR_WRITERS_JFRJAVAEVENTWRITER_HPP
#include "jni.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class JavaThread;
class Thread;
diff --git a/src/hotspot/share/logging/logConfiguration.hpp b/src/hotspot/share/logging/logConfiguration.hpp
index 542aaa2433b..35491d7459b 100644
--- a/src/hotspot/share/logging/logConfiguration.hpp
+++ b/src/hotspot/share/logging/logConfiguration.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,13 @@
#define SHARE_LOGGING_LOGCONFIGURATION_HPP
#include "logging/logLevel.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
class LogOutput;
class LogDecorators;
class LogSelectionList;
+class outputStream;
// Global configuration of logging. Handles parsing and configuration of the logging framework,
// and manages the list of configured log outputs. The actual tag and level configuration is
diff --git a/src/hotspot/share/logging/logLevel.hpp b/src/hotspot/share/logging/logLevel.hpp
index 7fe2d31f999..56ea7f5958a 100644
--- a/src/hotspot/share/logging/logLevel.hpp
+++ b/src/hotspot/share/logging/logLevel.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,8 @@
#ifndef SHARE_LOGGING_LOGLEVEL_HPP
#define SHARE_LOGGING_LOGLEVEL_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
+#include "utilities/debug.hpp"
#include "utilities/macros.hpp"
// The list of log levels:
diff --git a/src/hotspot/share/logging/logTag.hpp b/src/hotspot/share/logging/logTag.hpp
index 78e0a88d112..9b216a9d35f 100644
--- a/src/hotspot/share/logging/logTag.hpp
+++ b/src/hotspot/share/logging/logTag.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,11 @@
#ifndef SHARE_LOGGING_LOGTAG_HPP
#define SHARE_LOGGING_LOGTAG_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
+class outputStream;
+
// List of available logging tags. New tags should be added here, in
// alphabetical order.
// (The tags 'all', 'disable' and 'help' are special tags that can
diff --git a/src/hotspot/share/memory/metaspace/internalStats.hpp b/src/hotspot/share/memory/metaspace/internalStats.hpp
index dff2534e303..9c127568e57 100644
--- a/src/hotspot/share/memory/metaspace/internalStats.hpp
+++ b/src/hotspot/share/memory/metaspace/internalStats.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2020 SAP SE. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#ifndef SHARE_MEMORY_METASPACE_INTERNALSTATS_HPP
#define SHARE_MEMORY_METASPACE_INTERNALSTATS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/atomic.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/memory/metaspace/metaspaceReporter.hpp b/src/hotspot/share/memory/metaspace/metaspaceReporter.hpp
index 2aab2063379..acc5ca211e8 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceReporter.hpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceReporter.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2020 SAP SE. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#ifndef SHARE_MEMORY_METASPACE_METASPACEREPORTER_HPP
#define SHARE_MEMORY_METASPACE_METASPACEREPORTER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
namespace metaspace {
diff --git a/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp b/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp
index e6d47fec3f4..d2dc3f97441 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2020 SAP SE. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#ifndef SHARE_MEMORY_METASPACE_METASPACESETTINGS_HPP
#define SHARE_MEMORY_METASPACE_METASPACESETTINGS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/metaspace/chunklevel.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/memory/metaspace/runningCounters.hpp b/src/hotspot/share/memory/metaspace/runningCounters.hpp
index 8ef751896d3..ff24ead7ebd 100644
--- a/src/hotspot/share/memory/metaspace/runningCounters.hpp
+++ b/src/hotspot/share/memory/metaspace/runningCounters.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2020 SAP SE. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#ifndef SHARE_MEMORY_METASPACE_RUNNINGCOUNTERS_HPP
#define SHARE_MEMORY_METASPACE_RUNNINGCOUNTERS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/metaspace/counters.hpp"
namespace metaspace {
diff --git a/src/hotspot/share/memory/metaspaceCounters.hpp b/src/hotspot/share/memory/metaspaceCounters.hpp
index 38d9c94ddb6..b83e1fdb1ba 100644
--- a/src/hotspot/share/memory/metaspaceCounters.hpp
+++ b/src/hotspot/share/memory/metaspaceCounters.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -26,7 +26,7 @@
#ifndef SHARE_MEMORY_METASPACECOUNTERS_HPP
#define SHARE_MEMORY_METASPACECOUNTERS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
// Perf Counters for Metaspace
diff --git a/src/hotspot/share/memory/metaspaceCriticalAllocation.hpp b/src/hotspot/share/memory/metaspaceCriticalAllocation.hpp
index 71e8819aef3..bdc9ad8cf2c 100644
--- a/src/hotspot/share/memory/metaspaceCriticalAllocation.hpp
+++ b/src/hotspot/share/memory/metaspaceCriticalAllocation.hpp
@@ -25,7 +25,7 @@
#ifndef SHARE_MEMORY_METASPACECRITICALALLOCATION_HPP
#define SHARE_MEMORY_METASPACECRITICALALLOCATION_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/metaspace.hpp"
class MetadataAllocationRequest;
diff --git a/src/hotspot/share/metaprogramming/conditional.hpp b/src/hotspot/share/metaprogramming/conditional.hpp
index 2d4fe1a86e8..3ba2fb7594e 100644
--- a/src/hotspot/share/metaprogramming/conditional.hpp
+++ b/src/hotspot/share/metaprogramming/conditional.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_METAPROGRAMMING_CONDITIONAL_HPP
#define SHARE_METAPROGRAMMING_CONDITIONAL_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
// This trait evaluates its typedef called "type" to TrueType iff the condition
// is true. Otherwise it evaluates to FalseType.
diff --git a/src/hotspot/share/metaprogramming/decay.hpp b/src/hotspot/share/metaprogramming/decay.hpp
index 4dff0500f13..f504c099e4d 100644
--- a/src/hotspot/share/metaprogramming/decay.hpp
+++ b/src/hotspot/share/metaprogramming/decay.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_METAPROGRAMMING_DECAY_HPP
#define SHARE_METAPROGRAMMING_DECAY_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "metaprogramming/removeCV.hpp"
#include "metaprogramming/removeReference.hpp"
diff --git a/src/hotspot/share/metaprogramming/removeCV.hpp b/src/hotspot/share/metaprogramming/removeCV.hpp
index 0c0b2f47fa7..5ddafc54746 100644
--- a/src/hotspot/share/metaprogramming/removeCV.hpp
+++ b/src/hotspot/share/metaprogramming/removeCV.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_METAPROGRAMMING_REMOVECV_HPP
#define SHARE_METAPROGRAMMING_REMOVECV_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
template
struct RemoveCV: AllStatic {
diff --git a/src/hotspot/share/metaprogramming/removeExtent.hpp b/src/hotspot/share/metaprogramming/removeExtent.hpp
index f188e0db264..3f93dd3eeb6 100644
--- a/src/hotspot/share/metaprogramming/removeExtent.hpp
+++ b/src/hotspot/share/metaprogramming/removeExtent.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_METAPROGRAMMING_REMOVEEXTENT_HPP
#define SHARE_METAPROGRAMMING_REMOVEEXTENT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
template struct RemoveExtent: AllStatic { typedef T type; };
diff --git a/src/hotspot/share/metaprogramming/removePointer.hpp b/src/hotspot/share/metaprogramming/removePointer.hpp
index be0f5b6e6fb..eb267c0702d 100644
--- a/src/hotspot/share/metaprogramming/removePointer.hpp
+++ b/src/hotspot/share/metaprogramming/removePointer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_METAPROGRAMMING_REMOVEPOINTER_HPP
#define SHARE_METAPROGRAMMING_REMOVEPOINTER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
// This metafunction returns for a type T either the underlying type behind
// the pointer iff T is a pointer type (irrespective of CV qualifiers),
diff --git a/src/hotspot/share/metaprogramming/removeReference.hpp b/src/hotspot/share/metaprogramming/removeReference.hpp
index 274c327a0ad..bd263d911a5 100644
--- a/src/hotspot/share/metaprogramming/removeReference.hpp
+++ b/src/hotspot/share/metaprogramming/removeReference.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_METAPROGRAMMING_REMOVEREFERENCE_HPP
#define SHARE_METAPROGRAMMING_REMOVEREFERENCE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
// This metafunction returns for a type T either the underlying type behind
// the reference iff T is a reference type, or the same type T if T is not
diff --git a/src/hotspot/share/oops/access.hpp b/src/hotspot/share/oops/access.hpp
index c3f3d0ba45c..47e6bd27ea0 100644
--- a/src/hotspot/share/oops/access.hpp
+++ b/src/hotspot/share/oops/access.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_OOPS_ACCESS_HPP
#define SHARE_OOPS_ACCESS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/accessBackend.hpp"
#include "oops/accessDecorators.hpp"
#include "oops/oopsHierarchy.hpp"
diff --git a/src/hotspot/share/oops/accessDecorators.hpp b/src/hotspot/share/oops/accessDecorators.hpp
index 21bcff9113d..976f2e355e1 100644
--- a/src/hotspot/share/oops/accessDecorators.hpp
+++ b/src/hotspot/share/oops/accessDecorators.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_OOPS_ACCESSDECORATORS_HPP
#include "gc/shared/barrierSetConfig.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "metaprogramming/integralConstant.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/oops/compressedOops.hpp b/src/hotspot/share/oops/compressedOops.hpp
index 83f18138b5a..2755b1eef92 100644
--- a/src/hotspot/share/oops/compressedOops.hpp
+++ b/src/hotspot/share/oops/compressedOops.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_OOPS_COMPRESSEDOOPS_HPP
#define SHARE_OOPS_COMPRESSEDOOPS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/memRegion.hpp"
#include "oops/oopsHierarchy.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/prims/jniFastGetField.hpp b/src/hotspot/share/prims/jniFastGetField.hpp
index 4673d2cb5c9..525ff0aba87 100644
--- a/src/hotspot/share/prims/jniFastGetField.hpp
+++ b/src/hotspot/share/prims/jniFastGetField.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_PRIMS_JNIFASTGETFIELD_HPP
#define SHARE_PRIMS_JNIFASTGETFIELD_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "prims/jvm_misc.hpp"
// Basic logic of a fast version of jni_GetField:
diff --git a/src/hotspot/share/prims/jvmtiEventController.hpp b/src/hotspot/share/prims/jvmtiEventController.hpp
index 69156d27108..06a3e801876 100644
--- a/src/hotspot/share/prims/jvmtiEventController.hpp
+++ b/src/hotspot/share/prims/jvmtiEventController.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_PRIMS_JVMTIEVENTCONTROLLER_HPP
#include "jvmtifiles/jvmti.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"
// forward declaration
diff --git a/src/hotspot/share/prims/jvmtiExtensions.hpp b/src/hotspot/share/prims/jvmtiExtensions.hpp
index b1156b8be49..d44c6dd4f51 100644
--- a/src/hotspot/share/prims/jvmtiExtensions.hpp
+++ b/src/hotspot/share/prims/jvmtiExtensions.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#include "jvmtifiles/jvmti.h"
#include "jvmtifiles/jvmtiEnv.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
// JvmtiExtensions
//
diff --git a/src/hotspot/share/prims/jvmtiManageCapabilities.hpp b/src/hotspot/share/prims/jvmtiManageCapabilities.hpp
index fc6ef884f07..e588be4fa15 100644
--- a/src/hotspot/share/prims/jvmtiManageCapabilities.hpp
+++ b/src/hotspot/share/prims/jvmtiManageCapabilities.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#define SHARE_PRIMS_JVMTIMANAGECAPABILITIES_HPP
#include "jvmtifiles/jvmti.h"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class JvmtiManageCapabilities : public AllStatic {
diff --git a/src/hotspot/share/prims/nativeLookup.hpp b/src/hotspot/share/prims/nativeLookup.hpp
index a00b16c2fa4..9aafed6f272 100644
--- a/src/hotspot/share/prims/nativeLookup.hpp
+++ b/src/hotspot/share/prims/nativeLookup.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_PRIMS_NATIVELOOKUP_HPP
#define SHARE_PRIMS_NATIVELOOKUP_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/handles.hpp"
// NativeLookup provides an interface for finding DLL entry points for
diff --git a/src/hotspot/share/prims/resolvedMethodTable.hpp b/src/hotspot/share/prims/resolvedMethodTable.hpp
index b89de0e419a..b437f012946 100644
--- a/src/hotspot/share/prims/resolvedMethodTable.hpp
+++ b/src/hotspot/share/prims/resolvedMethodTable.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_PRIMS_RESOLVEDMETHODTABLE_HPP
#define SHARE_PRIMS_RESOLVEDMETHODTABLE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/symbol.hpp"
#include "oops/weakHandle.hpp"
diff --git a/src/hotspot/share/prims/vectorSupport.hpp b/src/hotspot/share/prims/vectorSupport.hpp
index 324400c198d..ccae8bbcfc0 100644
--- a/src/hotspot/share/prims/vectorSupport.hpp
+++ b/src/hotspot/share/prims/vectorSupport.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#include "jni.h"
#include "code/debugInfo.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/typeArrayOop.hpp"
#include "runtime/registerMap.hpp"
#include "utilities/exceptions.hpp"
diff --git a/src/hotspot/share/runtime/abstract_vm_version.hpp b/src/hotspot/share/runtime/abstract_vm_version.hpp
index d2f210ca04d..a1dd51dad2c 100644
--- a/src/hotspot/share/runtime/abstract_vm_version.hpp
+++ b/src/hotspot/share/runtime/abstract_vm_version.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_RUNTIME_ABSTRACT_VM_VERSION_HPP
#define SHARE_RUNTIME_ABSTRACT_VM_VERSION_HPP
-#include "memory/allocation.hpp" // For declaration of class AllStatic
+#include "memory/allStatic.hpp" // For declaration of class AllStatic
#include "utilities/globalDefinitions.hpp"
typedef enum {
diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
index 7b03205cb08..19bb12196e3 100644
--- a/src/hotspot/share/runtime/arguments.hpp
+++ b/src/hotspot/share/runtime/arguments.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
#include "logging/logLevel.hpp"
#include "logging/logTag.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/globals.hpp"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/share/runtime/handshake.hpp b/src/hotspot/share/runtime/handshake.hpp
index f66c731cc2d..f6a8e28a037 100644
--- a/src/hotspot/share/runtime/handshake.hpp
+++ b/src/hotspot/share/runtime/handshake.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_RUNTIME_HANDSHAKE_HPP
#define SHARE_RUNTIME_HANDSHAKE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/iterator.hpp"
#include "runtime/flags/flagSetting.hpp"
#include "runtime/mutex.hpp"
diff --git a/src/hotspot/share/runtime/icache.hpp b/src/hotspot/share/runtime/icache.hpp
index 522fc5ed1fe..d273372a877 100644
--- a/src/hotspot/share/runtime/icache.hpp
+++ b/src/hotspot/share/runtime/icache.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_RUNTIME_ICACHE_HPP
#define SHARE_RUNTIME_ICACHE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/stubCodeGenerator.hpp"
#include "utilities/macros.hpp"
diff --git a/src/hotspot/share/runtime/jniHandles.hpp b/src/hotspot/share/runtime/jniHandles.hpp
index 0ec73966f20..f1d9ee43529 100644
--- a/src/hotspot/share/runtime/jniHandles.hpp
+++ b/src/hotspot/share/runtime/jniHandles.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_RUNTIME_JNIHANDLES_HPP
#define SHARE_RUNTIME_JNIHANDLES_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/handles.hpp"
class JavaThread;
diff --git a/src/hotspot/share/runtime/orderAccess.hpp b/src/hotspot/share/runtime/orderAccess.hpp
index 8e5944916f9..159fbd9038d 100644
--- a/src/hotspot/share/runtime/orderAccess.hpp
+++ b/src/hotspot/share/runtime/orderAccess.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_RUNTIME_ORDERACCESS_HPP
#define SHARE_RUNTIME_ORDERACCESS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/macros.hpp"
diff --git a/src/hotspot/share/runtime/prefetch.hpp b/src/hotspot/share/runtime/prefetch.hpp
index dac34f6cd26..d949899813c 100644
--- a/src/hotspot/share/runtime/prefetch.hpp
+++ b/src/hotspot/share/runtime/prefetch.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_RUNTIME_PREFETCH_HPP
#define SHARE_RUNTIME_PREFETCH_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
// If calls to prefetch methods are in a loop, the loop should be cloned
// such that if Prefetch{Scan,Copy}Interval and/or PrefetchFieldInterval
diff --git a/src/hotspot/share/runtime/reflectionUtils.hpp b/src/hotspot/share/runtime/reflectionUtils.hpp
index a928c50596e..ef9f8bbd62e 100644
--- a/src/hotspot/share/runtime/reflectionUtils.hpp
+++ b/src/hotspot/share/runtime/reflectionUtils.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_RUNTIME_REFLECTIONUTILS_HPP
#define SHARE_RUNTIME_REFLECTIONUTILS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oopsHierarchy.hpp"
diff --git a/src/hotspot/share/runtime/safepoint.hpp b/src/hotspot/share/runtime/safepoint.hpp
index 8024ade2520..e67c960626b 100644
--- a/src/hotspot/share/runtime/safepoint.hpp
+++ b/src/hotspot/share/runtime/safepoint.hpp
@@ -25,7 +25,7 @@
#ifndef SHARE_RUNTIME_SAFEPOINT_HPP
#define SHARE_RUNTIME_SAFEPOINT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/os.hpp"
#include "runtime/thread.hpp"
#include "runtime/vmOperation.hpp"
diff --git a/src/hotspot/share/runtime/sharedRuntime.hpp b/src/hotspot/share/runtime/sharedRuntime.hpp
index 1adc9661985..10e4b0ec0af 100644
--- a/src/hotspot/share/runtime/sharedRuntime.hpp
+++ b/src/hotspot/share/runtime/sharedRuntime.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
#include "code/vmreg.hpp"
#include "interpreter/bytecodeTracer.hpp"
#include "interpreter/linkResolver.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/resourceArea.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/macros.hpp"
diff --git a/src/hotspot/share/runtime/stackWatermark.hpp b/src/hotspot/share/runtime/stackWatermark.hpp
index 3cf7ce59cd9..6210a0bc2bf 100644
--- a/src/hotspot/share/runtime/stackWatermark.hpp
+++ b/src/hotspot/share/runtime/stackWatermark.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_RUNTIME_STACKWATERMARK_HPP
#define SHARE_RUNTIME_STACKWATERMARK_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/mutex.hpp"
#include "runtime/stackWatermarkKind.hpp"
diff --git a/src/hotspot/share/runtime/threadLocalStorage.hpp b/src/hotspot/share/runtime/threadLocalStorage.hpp
index 93607612a4d..604b624757e 100644
--- a/src/hotspot/share/runtime/threadLocalStorage.hpp
+++ b/src/hotspot/share/runtime/threadLocalStorage.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_RUNTIME_THREADLOCALSTORAGE_HPP
#define SHARE_RUNTIME_THREADLOCALSTORAGE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
// forward-decl as we can't have an include cycle
class Thread;
diff --git a/src/hotspot/share/services/attachListener.hpp b/src/hotspot/share/services/attachListener.hpp
index 25fad127d0f..5765240c16c 100644
--- a/src/hotspot/share/services/attachListener.hpp
+++ b/src/hotspot/share/services/attachListener.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_SERVICES_ATTACHLISTENER_HPP
#define SHARE_SERVICES_ATTACHLISTENER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/atomic.hpp"
#include "runtime/globals.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/share/services/gcNotifier.hpp b/src/hotspot/share/services/gcNotifier.hpp
index a13b85e0e69..1a4582025c4 100644
--- a/src/hotspot/share/services/gcNotifier.hpp
+++ b/src/hotspot/share/services/gcNotifier.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_SERVICES_GCNOTIFIER_HPP
#define SHARE_SERVICES_GCNOTIFIER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "services/memoryPool.hpp"
#include "services/memoryService.hpp"
#include "services/memoryManager.hpp"
diff --git a/src/hotspot/share/services/lowMemoryDetector.hpp b/src/hotspot/share/services/lowMemoryDetector.hpp
index 09bb1ce6406..3070eb00ab7 100644
--- a/src/hotspot/share/services/lowMemoryDetector.hpp
+++ b/src/hotspot/share/services/lowMemoryDetector.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_SERVICES_LOWMEMORYDETECTOR_HPP
#define SHARE_SERVICES_LOWMEMORYDETECTOR_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "oops/oopHandle.hpp"
#include "runtime/atomic.hpp"
#include "services/memoryPool.hpp"
diff --git a/src/hotspot/share/services/nmtCommon.hpp b/src/hotspot/share/services/nmtCommon.hpp
index b573fb6b7df..dc85338c025 100644
--- a/src/hotspot/share/services/nmtCommon.hpp
+++ b/src/hotspot/share/services/nmtCommon.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_SERVICES_NMTCOMMON_HPP
#define SHARE_SERVICES_NMTCOMMON_HPP
-#include "memory/allocation.hpp"
+#include "memory/allocation.hpp" // for MEMFLAGS only
#include "utilities/align.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/services/threadIdTable.hpp b/src/hotspot/share/services/threadIdTable.hpp
index 223b57fcecb..12772aed88c 100644
--- a/src/hotspot/share/services/threadIdTable.hpp
+++ b/src/hotspot/share/services/threadIdTable.hpp
@@ -26,7 +26,7 @@
#ifndef SHARE_SERVICES_THREADIDTABLE_HPP
#define SHARE_SERVICES_THREADIDTABLE_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class JavaThread;
class ThreadsList;
diff --git a/src/hotspot/share/utilities/decoder.hpp b/src/hotspot/share/utilities/decoder.hpp
index ccf3ac4ba3c..b0a368fd058 100644
--- a/src/hotspot/share/utilities/decoder.hpp
+++ b/src/hotspot/share/utilities/decoder.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#ifndef SHARE_UTILITIES_DECODER_HPP
#define SHARE_UTILITIES_DECODER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/mutex.hpp"
#include "runtime/mutexLocker.hpp"
#include "utilities/ostream.hpp"
diff --git a/src/hotspot/share/utilities/globalCounter.hpp b/src/hotspot/share/utilities/globalCounter.hpp
index beba72a954a..5f5eba263b9 100644
--- a/src/hotspot/share/utilities/globalCounter.hpp
+++ b/src/hotspot/share/utilities/globalCounter.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_UTILITIES_GLOBALCOUNTER_HPP
#define SHARE_UTILITIES_GLOBALCOUNTER_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "memory/padded.hpp"
class Thread;
diff --git a/src/hotspot/share/utilities/quickSort.hpp b/src/hotspot/share/utilities/quickSort.hpp
index 000f1bf4f42..a94a7cd8b6c 100644
--- a/src/hotspot/share/utilities/quickSort.hpp
+++ b/src/hotspot/share/utilities/quickSort.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_UTILITIES_QUICKSORT_HPP
#define SHARE_UTILITIES_QUICKSORT_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
#include "runtime/globals.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/share/utilities/stringUtils.cpp b/src/hotspot/share/utilities/stringUtils.cpp
index 21fb7a6e8d3..0ee73de809a 100644
--- a/src/hotspot/share/utilities/stringUtils.cpp
+++ b/src/hotspot/share/utilities/stringUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
#include "utilities/debug.hpp"
#include "utilities/stringUtils.hpp"
+#include
+
int StringUtils::replace_no_expand(char* string, const char* from, const char* to) {
int replace_count = 0;
size_t from_len = strlen(from);
diff --git a/src/hotspot/share/utilities/stringUtils.hpp b/src/hotspot/share/utilities/stringUtils.hpp
index 372222d7c70..54d6847a4c4 100644
--- a/src/hotspot/share/utilities/stringUtils.hpp
+++ b/src/hotspot/share/utilities/stringUtils.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
#ifndef SHARE_UTILITIES_STRINGUTILS_HPP
#define SHARE_UTILITIES_STRINGUTILS_HPP
-#include "memory/allocation.hpp"
+#include "memory/allStatic.hpp"
class StringUtils : AllStatic {
public:
diff --git a/src/hotspot/share/utilities/utf8.cpp b/src/hotspot/share/utilities/utf8.cpp
index 6ebeb9a6c9b..81ad02a9ba6 100644
--- a/src/hotspot/share/utilities/utf8.cpp
+++ b/src/hotspot/share/utilities/utf8.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,12 @@
*/
#include "precompiled.hpp"
+#include "memory/allocation.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
#include "utilities/utf8.hpp"
+
// Assume the utf8 string is in legal form and has been
// checked in the class file parser/format checker.
template char* UTF8::next(const char* str, T* value) {
diff --git a/src/hotspot/share/utilities/utf8.hpp b/src/hotspot/share/utilities/utf8.hpp
index 0ebd65b0658..e7b2905e046 100644
--- a/src/hotspot/share/utilities/utf8.hpp
+++ b/src/hotspot/share/utilities/utf8.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,9 @@
#ifndef SHARE_UTILITIES_UTF8_HPP
#define SHARE_UTILITIES_UTF8_HPP
-#include "memory/allocation.hpp"
+#include "jni.h"
+#include "memory/allStatic.hpp"
+#include "utilities/debug.hpp"
// Low-level interface for UTF8 strings
diff --git a/test/hotspot/gtest/classfile/test_AltHashing.cpp b/test/hotspot/gtest/classfile/test_AltHashing.cpp
index d11dc0fb4a2..0070c4fd2c1 100644
--- a/test/hotspot/gtest/classfile/test_AltHashing.cpp
+++ b/test/hotspot/gtest/classfile/test_AltHashing.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
#include "classfile/altHashing.hpp"
#include "utilities/debug.hpp"
#include "utilities/formatBuffer.hpp"
+#include "utilities/globalDefinitions.hpp"
#include "unittest.hpp"
class AltHashingTest : public ::testing::Test {
--
GitLab
From 1b14157677b34891385f643a76a7aa19d7003acf Mon Sep 17 00:00:00 2001
From: Tobias Holenstein <71546117+tobiasholenstein@users.noreply.github.com>
Date: Tue, 25 Jan 2022 09:59:55 +0000
Subject: [PATCH 035/339] 8280274: Guard printing code of Compile::print_method
in PRODUCT
Reviewed-by: thartmann, neliasso
---
src/hotspot/share/opto/compile.cpp | 10 ++++++----
src/hotspot/share/opto/compile.hpp | 4 ++--
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp
index b0a2b3241e7..c730d1d9c98 100644
--- a/src/hotspot/share/opto/compile.cpp
+++ b/src/hotspot/share/opto/compile.cpp
@@ -2357,7 +2357,7 @@ void Compile::inline_vector_reboxing_calls() {
CallGenerator* cg = _vector_reboxing_late_inlines.pop();
cg->do_late_inline();
if (failing()) return;
- print_method(PHASE_INLINE_VECTOR_REBOX, cg->call_node());
+ print_method(PHASE_INLINE_VECTOR_REBOX, cg->call_node(), 3);
}
_vector_reboxing_late_inlines.trunc_to(0);
}
@@ -4815,10 +4815,11 @@ void Compile::sort_macro_nodes() {
}
void Compile::print_method(CompilerPhaseType cpt, int level) {
- print_method_impl(cpt, CompilerPhaseTypeHelper::to_string(cpt), level);
+ print_method_impl(cpt, NOT_PRODUCT(CompilerPhaseTypeHelper::to_string(cpt) COMMA) level);
}
void Compile::print_method(CompilerPhaseType cpt, Node* n, int level) {
+#ifndef PRODUCT
ResourceMark rm;
stringStream ss;
ss.print_raw(CompilerPhaseTypeHelper::to_string(cpt));
@@ -4827,10 +4828,11 @@ void Compile::print_method(CompilerPhaseType cpt, Node* n, int level) {
} else {
ss.print_raw(": NULL");
}
- C->print_method_impl(cpt, ss.as_string(), level);
+#endif
+ C->print_method_impl(cpt, NOT_PRODUCT(ss.as_string() COMMA) level);
}
-void Compile::print_method_impl(CompilerPhaseType cpt, const char *name, int level) {
+void Compile::print_method_impl(CompilerPhaseType cpt, NOT_PRODUCT(const char* name COMMA) int level) {
EventCompilerPhase event;
if (event.should_commit()) {
CompilerEvent::PhaseEvent::post(event, C->_latest_stage_start_counter, cpt, C->_compile_id, level);
diff --git a/src/hotspot/share/opto/compile.hpp b/src/hotspot/share/opto/compile.hpp
index 9b2fd80b589..0bf6b88eb17 100644
--- a/src/hotspot/share/opto/compile.hpp
+++ b/src/hotspot/share/opto/compile.hpp
@@ -656,8 +656,8 @@ class Compile : public Phase {
bool should_print_igv(int level);
void print_method(CompilerPhaseType cpt, int level);
- void print_method(CompilerPhaseType cpt, Node* n, int level = 3);
- void print_method_impl(CompilerPhaseType cpt, const char *name, int level);
+ void print_method(CompilerPhaseType cpt, Node* n, int level);
+ void print_method_impl(CompilerPhaseType cpt, NOT_PRODUCT(const char* name COMMA) int level);
#ifndef PRODUCT
void igv_print_method_to_file(const char* phase_name = "Debug", bool append = false);
--
GitLab
From c43ce85f01c96a4b80b971865306254c9417e549 Mon Sep 17 00:00:00 2001
From: Lutz Schmidt
Date: Tue, 25 Jan 2022 10:07:07 +0000
Subject: [PATCH 036/339] 8278302: [s390] Implement fast-path for
ASCII-compatible CharsetEncoders
Reviewed-by: mdoerr
---
.../cpu/s390/c2_MacroAssembler_s390.cpp | 83 +++++++++++++------
.../cpu/s390/c2_MacroAssembler_s390.hpp | 5 +-
src/hotspot/cpu/s390/matcher_s390.hpp | 5 +-
src/hotspot/cpu/s390/s390.ad | 24 ++++--
4 files changed, 82 insertions(+), 35 deletions(-)
diff --git a/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp b/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp
index 83040fb6b7f..04a6b88052c 100644
--- a/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp
+++ b/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,22 +47,44 @@
// Note:
// cnt is signed int. Do not rely on high word!
// counts # characters, not bytes.
-// The result is the number of characters copied before the first incompatible character was found.
-// If precise is true, the processing stops exactly at this point. Otherwise, the result may be off
-// by a few bytes. The result always indicates the number of copied characters.
-// When used as a character index, the returned value points to the first incompatible character.
//
-// Note: Does not behave exactly like package private StringUTF16 compress java implementation in case of failure:
-// - Different number of characters may have been written to dead array (if precise is false).
-// - Returns a number ---
- // Strings with 4 and 8 characters were fond to occur very frequently.
+ // Strings with 4 and 8 characters were found to occur very frequently.
// Therefore, we handle them right away with minimal overhead.
Label skipShortcut, skip4Shortcut, skip8Shortcut;
Register Rout = Z_R0;
@@ -133,7 +156,8 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
if (VM_Version::has_VectorFacility()) {
const int min_vcnt = 32; // Minimum #characters required to use vector instructions.
// Otherwise just do nothing in vector mode.
- // Must be multiple of 2*(vector register length in chars (8 HW = 128 bits)).
+ // Must correspond to # vector registers used by implementation,
+ // and must be a power of 2.
const int log_min_vcnt = exact_log2(min_vcnt);
Label VectorLoop, VectorDone, VectorBreak;
@@ -150,7 +174,7 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
z_brz(VectorDone); // not enough data for vector loop
z_vzero(Vzero); // all zeroes
- z_vgmh(Vmask, 0, 7); // generate 0xff00 mask for all 2-byte elements
+ z_vgmh(Vmask, mask_ix_l, mask_ix_r); // generate 0xff00/0xff80 mask for all 2-byte elements
z_sllg(Z_R0, Rix, log_min_vcnt); // remember #chars that will be processed by vector loop
bind(VectorLoop);
@@ -162,7 +186,7 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
z_vo(Vtmp2, Z_V22, Z_V23);
z_vo(Vtmp1, Vtmp1, Vtmp2);
z_vn(Vtmp1, Vtmp1, Vmask);
- z_vceqhs(Vtmp1, Vtmp1, Vzero); // high half of all chars must be zero for successful compress.
+ z_vceqhs(Vtmp1, Vtmp1, Vzero); // all bits selected by mask must be zero for successful compress.
z_bvnt(VectorBreak); // break vector loop if not all vector elements compare eq -> incompatible character found.
// re-process data from current iteration in break handler.
@@ -187,7 +211,8 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
{
const int min_cnt = 8; // Minimum #characters required to use unrolled loop.
// Otherwise just do nothing in unrolled loop.
- // Must be multiple of 8.
+ // Must correspond to # registers used by implementation,
+ // and must be a power of 2.
const int log_min_cnt = exact_log2(min_cnt);
Label UnrolledLoop, UnrolledDone, UnrolledBreak;
@@ -197,7 +222,7 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
z_lr(Rix, Rcnt);
z_sr(Rix, Z_R0);
}
- z_sra(Rix, log_min_cnt); // unrolled loop count
+ z_sra(Rix, log_min_cnt); // unrolled loop count
z_brz(UnrolledDone);
bind(UnrolledLoop);
@@ -244,6 +269,8 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
z_sll(Rix, log_min_cnt); // # chars not yet processed in UnrolledLoop (due to break), broken iteration not included.
z_sr(Z_R0, Rix); // fix # chars processed OK so far.
if (!precise) {
+ // Because we don't need to be precise, we just return the # of characters which have been written.
+ // The first illegal character is in the index range [result-min_cnt/2, result+min_cnt/2).
z_lgfr(result, Z_R0);
z_sllg(Z_R1, Z_R0, 1); // # src bytes already processed. Only lower 32 bits are valid!
// Z_R1 contents must be treated as unsigned operand! For huge strings,
@@ -274,7 +301,7 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
z_brh(ScalarDoit);
z_llh(Z_R1, 0, Z_R0, Rsrc);
z_bre(Scalar2Char);
- z_tmll(Z_R1, 0xff00);
+ z_tmll(Z_R1, char_mask);
z_lghi(result, 0); // cnt == 1, first char invalid, no chars successfully processed
z_brnaz(AllDone);
z_stc(Z_R1, 0, Z_R0, Rdst);
@@ -283,11 +310,11 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
bind(Scalar2Char);
z_llh(Z_R0, 2, Z_R0, Rsrc);
- z_tmll(Z_R1, 0xff00);
+ z_tmll(Z_R1, char_mask);
z_lghi(result, 0); // cnt == 2, first char invalid, no chars successfully processed
z_brnaz(AllDone);
z_stc(Z_R1, 0, Z_R0, Rdst);
- z_tmll(Z_R0, 0xff00);
+ z_tmll(Z_R0, char_mask);
z_lghi(result, 1); // cnt == 2, second char invalid, one char successfully processed
z_brnaz(AllDone);
z_stc(Z_R0, 1, Z_R0, Rdst);
@@ -299,17 +326,17 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
#endif
if (VM_Version::has_DistinctOpnds()) {
- z_srk(Rix, Rcnt, Z_R0); // remaining # chars to compress in unrolled loop
+ z_srk(Rix, Rcnt, Z_R0); // remaining # chars to compress in scalar loop
} else {
z_lr(Rix, Rcnt);
z_sr(Rix, Z_R0);
}
- z_lgfr(result, Rcnt); // # processed characters (if all runs ok).
- z_brz(ScalarDone); // uses CC from Rix calculation
+ z_lgfr(result, Rcnt); // # processed characters (if all encodes ok).
+ z_brz(ScalarDone); // anything left to do? (uses CC from Rix calculation)
bind(ScalarLoop);
z_llh(Z_R1, 0, Z_R0, Rsrc);
- z_tmll(Z_R1, 0xff00);
+ z_tmll(Z_R1, char_mask);
z_brnaz(ScalarBreak);
z_stc(Z_R1, 0, Z_R0, Rdst);
add2reg(Rsrc, 2);
@@ -329,7 +356,11 @@ unsigned int C2_MacroAssembler::string_compress(Register result, Register src, R
bind(AllDone);
if (precise) {
- BLOCK_COMMENT("} encode_iso_array");
+ if (toASCII) {
+ BLOCK_COMMENT("} encode_ascii_array");
+ } else {
+ BLOCK_COMMENT("} encode_iso_array");
+ }
} else {
BLOCK_COMMENT("} string_compress");
}
diff --git a/src/hotspot/cpu/s390/c2_MacroAssembler_s390.hpp b/src/hotspot/cpu/s390/c2_MacroAssembler_s390.hpp
index 08112a482d0..a6c98656495 100644
--- a/src/hotspot/cpu/s390/c2_MacroAssembler_s390.hpp
+++ b/src/hotspot/cpu/s390/c2_MacroAssembler_s390.hpp
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +39,7 @@
// Early clobber: result.
// Boolean precise controls accuracy of result value.
unsigned int string_compress(Register result, Register src, Register dst, Register cnt,
- Register tmp, bool precise);
+ Register tmp, bool precise, bool toASCII);
// Inflate byte[] to char[].
unsigned int string_inflate_trot(Register src, Register dst, Register cnt, Register tmp);
diff --git a/src/hotspot/cpu/s390/matcher_s390.hpp b/src/hotspot/cpu/s390/matcher_s390.hpp
index d95e3c17f43..ac55bd84dff 100644
--- a/src/hotspot/cpu/s390/matcher_s390.hpp
+++ b/src/hotspot/cpu/s390/matcher_s390.hpp
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -150,6 +151,6 @@
}
// Implements a variant of EncodeISOArrayNode that encode ASCII only
- static const bool supports_encode_ascii_array = false;
+ static const bool supports_encode_ascii_array = true;
#endif // CPU_S390_MATCHER_S390_HPP
diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad
index 8a6e62a809b..74ad8ef40d3 100644
--- a/src/hotspot/cpu/s390/s390.ad
+++ b/src/hotspot/cpu/s390/s390.ad
@@ -1,6 +1,6 @@
//
-// Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
-// Copyright (c) 2017, 2020 SAP SE. All rights reserved.
+// Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2017, 2022 SAP SE. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it
@@ -10230,7 +10230,7 @@ instruct string_compress(iRegP src, iRegP dst, iRegI result, iRegI len, iRegI tm
format %{ "String Compress $src->$dst($len) -> $result" %}
ins_encode %{
__ string_compress($result$$Register, $src$$Register, $dst$$Register, $len$$Register,
- $tmp$$Register, false);
+ $tmp$$Register, false, false);
%}
ins_pipe(pipe_class_dummy);
%}
@@ -10291,10 +10291,24 @@ instruct encode_iso_array(iRegP src, iRegP dst, iRegI result, iRegI len, iRegI t
match(Set result (EncodeISOArray src (Binary dst len)));
effect(TEMP_DEF result, TEMP tmp, KILL cr); // R0, R1 are killed, too.
ins_cost(300);
- format %{ "Encode array $src->$dst($len) -> $result" %}
+ format %{ "Encode iso array $src->$dst($len) -> $result" %}
ins_encode %{
__ string_compress($result$$Register, $src$$Register, $dst$$Register, $len$$Register,
- $tmp$$Register, true);
+ $tmp$$Register, true, false);
+ %}
+ ins_pipe(pipe_class_dummy);
+%}
+
+// encode char[] to byte[] in ASCII
+instruct encode_ascii_array(iRegP src, iRegP dst, iRegI result, iRegI len, iRegI tmp, flagsReg cr) %{
+ predicate(((EncodeISOArrayNode*)n)->is_ascii());
+ match(Set result (EncodeISOArray src (Binary dst len)));
+ effect(TEMP_DEF result, TEMP tmp, KILL cr); // R0, R1 are killed, too.
+ ins_cost(300);
+ format %{ "Encode ascii array $src->$dst($len) -> $result" %}
+ ins_encode %{
+ __ string_compress($result$$Register, $src$$Register, $dst$$Register, $len$$Register,
+ $tmp$$Register, true, true);
%}
ins_pipe(pipe_class_dummy);
%}
--
GitLab
From 28796cbd1d15de678b80295418f5d1f9f59176a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Jeli=C5=84ski?=
Date: Tue, 25 Jan 2022 11:10:51 +0000
Subject: [PATCH 037/339] 8163921: HttpURLConnection default Accept header is
malformed according to HTTP/1.1 RFC
Reviewed-by: dfuchs, michaelm
---
.../net/www/protocol/http/HttpURLConnection.java | 5 ++---
test/jdk/sun/net/www/B8185898.java | 16 ++++++++--------
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
index cba385f04fa..c3d33014409 100644
--- a/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
+++ b/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -288,8 +288,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
}
static final String httpVersion = "HTTP/1.1";
- static final String acceptString =
- "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
+ static final String acceptString = "*/*";
// the following http request headers should NOT have their values
// returned for security reasons.
diff --git a/test/jdk/sun/net/www/B8185898.java b/test/jdk/sun/net/www/B8185898.java
index a50c6f93c7e..cfa54e15a52 100644
--- a/test/jdk/sun/net/www/B8185898.java
+++ b/test/jdk/sun/net/www/B8185898.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 8185898
+ * @bug 8185898 8163921
* @modules java.base/sun.net.www
* @library /test/lib
* @run main/othervm B8185898
@@ -143,32 +143,32 @@ public class B8185898 {
// {{inputString1, expectedToString1, expectedPrint1}, {...}}
String[][] strings = {
{"HTTP/1.1 200 OK\r\n"
- + "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
+ + "Accept: */*\r\n"
+ "Connection: keep-alive\r\n"
+ "Host: 127.0.0.1:12345\r\n"
+ "User-agent: Java/12\r\n\r\nfoooo",
"pairs: {null: HTTP/1.1 200 OK}"
- + "{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}"
+ + "{Accept: */*}"
+ "{Connection: keep-alive}"
+ "{Host: 127.0.0.1:12345}"
+ "{User-agent: Java/12}",
- "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
+ "Accept: */*\r\n"
+ "Connection: keep-alive\r\n"
+ "Host: 127.0.0.1:12345\r\n"
+ "User-agent: Java/12\r\n\r\n"},
{"HTTP/1.1 200 OK\r\n"
- + "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
+ + "Accept: */*\r\n"
+ "Connection: keep-alive\r\n"
+ "Host: 127.0.0.1:12345\r\n"
+ "User-agent: Java/12\r\n"
+ "X-Header:\r\n\r\n",
"pairs: {null: HTTP/1.1 200 OK}"
- + "{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}"
+ + "{Accept: */*}"
+ "{Connection: keep-alive}"
+ "{Host: 127.0.0.1:12345}"
+ "{User-agent: Java/12}"
+ "{X-Header: }",
- "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
+ "Accept: */*\r\n"
+ "Connection: keep-alive\r\n"
+ "Host: 127.0.0.1:12345\r\n"
+ "User-agent: Java/12\r\n"
--
GitLab
From 36fbec78be837fe1defb72f39c6e3f2b5135fddf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Jeli=C5=84ski?=
Date: Tue, 25 Jan 2022 11:15:47 +0000
Subject: [PATCH 038/339] 8280241: (aio) AsynchronousSocketChannel init fails
in IPv6 only Windows env
Reviewed-by: dfuchs, alanb
---
.../libnio/ch/WindowsAsynchronousServerSocketChannelImpl.c | 6 +++++-
.../native/libnio/ch/WindowsAsynchronousSocketChannelImpl.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/java.base/windows/native/libnio/ch/WindowsAsynchronousServerSocketChannelImpl.c b/src/java.base/windows/native/libnio/ch/WindowsAsynchronousServerSocketChannelImpl.c
index a08f3a3564f..340bbb9c8de 100644
--- a/src/java.base/windows/native/libnio/ch/WindowsAsynchronousServerSocketChannelImpl.c
+++ b/src/java.base/windows/native/libnio/ch/WindowsAsynchronousServerSocketChannelImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -69,6 +69,10 @@ Java_sun_nio_ch_WindowsAsynchronousServerSocketChannelImpl_initIDs(JNIEnv* env,
DWORD dwBytes;
s = socket(AF_INET, SOCK_STREAM, 0);
+ if (s == INVALID_SOCKET && WSAGetLastError() == WSAEAFNOSUPPORT) {
+ /* IPv4 unavailable... try IPv6 instead */
+ s = socket(AF_INET6, SOCK_STREAM, 0);
+ }
if (s == INVALID_SOCKET) {
JNU_ThrowIOExceptionWithLastError(env, "socket failed");
return;
diff --git a/src/java.base/windows/native/libnio/ch/WindowsAsynchronousSocketChannelImpl.c b/src/java.base/windows/native/libnio/ch/WindowsAsynchronousSocketChannelImpl.c
index 40b8d8ba8dc..6b1fa64e708 100644
--- a/src/java.base/windows/native/libnio/ch/WindowsAsynchronousSocketChannelImpl.c
+++ b/src/java.base/windows/native/libnio/ch/WindowsAsynchronousSocketChannelImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,6 +66,10 @@ Java_sun_nio_ch_WindowsAsynchronousSocketChannelImpl_initIDs(JNIEnv* env, jclass
DWORD dwBytes;
s = socket(AF_INET, SOCK_STREAM, 0);
+ if (s == INVALID_SOCKET && WSAGetLastError() == WSAEAFNOSUPPORT) {
+ /* IPv4 unavailable... try IPv6 instead */
+ s = socket(AF_INET6, SOCK_STREAM, 0);
+ }
if (s == INVALID_SOCKET) {
JNU_ThrowIOExceptionWithLastError(env, "socket failed");
return;
--
GitLab
From 4503d0431c0dd4d177cf5eb4df592f26b9d372bb Mon Sep 17 00:00:00 2001
From: Hamlin Li
Date: Tue, 25 Jan 2022 12:11:21 +0000
Subject: [PATCH 039/339] 8280375: G1: Tighten mem region limit in
G1RebuildRemSetHeapRegionClosure
Reviewed-by: tschatzl, ayang
---
src/hotspot/share/gc/g1/g1RemSet.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp
index 603ddbc1e26..13977348825 100644
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp
@@ -1958,7 +1958,7 @@ public:
HeapWord* const top_at_mark_start = hr->prev_top_at_mark_start();
HeapWord* cur = hr->bottom();
- while (cur < hr->end()) {
+ while (true) {
// After every iteration (yield point) we need to check whether the region's
// TARS changed due to e.g. eager reclaim.
HeapWord* const top_at_rebuild_start = _cm->top_at_rebuild_start(region_idx);
--
GitLab
From 496baada1021eecae03e737afe838ad6d383cba9 Mon Sep 17 00:00:00 2001
From: Albert Mingkun Yang
Date: Tue, 25 Jan 2022 14:09:53 +0000
Subject: [PATCH 040/339] 8280030: [REDO] Parallel: More precise boundary in
ObjectStartArray::object_starts_in_range
Reviewed-by: sjohanss, tschatzl
---
src/hotspot/share/gc/parallel/objectStartArray.cpp | 9 ++++++++-
src/hotspot/share/gc/parallel/objectStartArray.hpp | 8 +++++---
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/hotspot/share/gc/parallel/objectStartArray.cpp b/src/hotspot/share/gc/parallel/objectStartArray.cpp
index 827ff73fb58..3e4820aa941 100644
--- a/src/hotspot/share/gc/parallel/objectStartArray.cpp
+++ b/src/hotspot/share/gc/parallel/objectStartArray.cpp
@@ -132,8 +132,15 @@ bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr,
"Range is wrong. start_addr (" PTR_FORMAT ") is after end_addr (" PTR_FORMAT ")",
p2i(start_addr), p2i(end_addr));
+ assert(is_aligned(start_addr, _card_size), "precondition");
+
+ if (start_addr == end_addr) {
+ // No objects in empty range.
+ return false;
+ }
+
jbyte* start_block = block_for_addr(start_addr);
- jbyte* end_block = block_for_addr(end_addr);
+ jbyte* end_block = block_for_addr(end_addr - 1);
for (jbyte* block = start_block; block <= end_block; block++) {
if (*block != clean_block) {
diff --git a/src/hotspot/share/gc/parallel/objectStartArray.hpp b/src/hotspot/share/gc/parallel/objectStartArray.hpp
index be91b51cd94..06005fc0075 100644
--- a/src/hotspot/share/gc/parallel/objectStartArray.hpp
+++ b/src/hotspot/share/gc/parallel/objectStartArray.hpp
@@ -165,9 +165,11 @@ class ObjectStartArray : public CHeapObj {
return *block != clean_block;
}
- // Return true if an object starts in the range of heap addresses.
- // If an object starts at an address corresponding to
- // "start", the method will return true.
+ // Return true iff an object starts in
+ // [start_addr, end_addr_aligned_up)
+ // where
+ // end_addr_aligned_up = align_up(end_addr, _card_size)
+ // Precondition: start_addr is card-size aligned
bool object_starts_in_range(HeapWord* start_addr, HeapWord* end_addr) const;
};
--
GitLab
From fe77250fa450ec803d2818dc90c5bf156521d537 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Jeli=C5=84ski?=
Date: Tue, 25 Jan 2022 14:41:41 +0000
Subject: [PATCH 041/339] 8280414: Memory leak in DefaultProxySelector
Reviewed-by: dfuchs
---
.../native/libnet/DefaultProxySelector.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/java.base/windows/native/libnet/DefaultProxySelector.c b/src/java.base/windows/native/libnet/DefaultProxySelector.c
index d9107e738b3..6b91874eda1 100644
--- a/src/java.base/windows/native/libnet/DefaultProxySelector.c
+++ b/src/java.base/windows/native/libnet/DefaultProxySelector.c
@@ -104,7 +104,6 @@ static int createProxyList(LPWSTR win_proxy, const WCHAR *pproto, list_item **he
int nr_elems = 0;
wchar_t *context = NULL;
wchar_t *current_proxy = NULL;
- BOOL error = FALSE;
/*
* The proxy server list contains one or more of the following strings
@@ -116,7 +115,6 @@ static int createProxyList(LPWSTR win_proxy, const WCHAR *pproto, list_item **he
LPWSTR pport;
LPWSTR phost;
int portVal = 0;
- wchar_t *next_proxy = NULL;
list_item *proxy = NULL;
wchar_t* pos = NULL;
@@ -292,7 +290,6 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxies(JNIEnv *env,
}
if (win_proxy != NULL) {
- wchar_t *context = NULL;
int defport = 0;
int nr_elems = 0;
@@ -315,27 +312,28 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxies(JNIEnv *env,
nr_elems = createProxyList(win_proxy, lpProto, &head);
if (nr_elems != 0 && head != NULL) {
int index = 0;
+ list_item *current = head;
proxy_array = (*env)->NewObjectArray(env, nr_elems, proxy_class, NULL);
if (proxy_array == NULL || (*env)->ExceptionCheck(env)) {
goto noproxy;
}
- while (head != NULL && index < nr_elems) {
+ while (current != NULL && index < nr_elems) {
jstring jhost;
jobject isa;
jobject proxy;
- if (head->host != NULL && proxy_array != NULL) {
+ if (current->host != NULL && proxy_array != NULL) {
/* Let's create the appropriate Proxy object then. */
- if (head->port == 0) {
- head->port = defport;
+ if (current->port == 0) {
+ current->port = defport;
}
- jhost = (*env)->NewString(env, head->host, (jsize)wcslen(head->host));
+ jhost = (*env)->NewString(env, current->host, (jsize)wcslen(current->host));
if (jhost == NULL || (*env)->ExceptionCheck(env)) {
proxy_array = NULL;
}
isa = (*env)->CallStaticObjectMethod(env, isaddr_class,
isaddr_createUnresolvedID, jhost,
- head->port);
+ current->port);
if (isa == NULL || (*env)->ExceptionCheck(env)) {
proxy_array = NULL;
}
@@ -349,7 +347,7 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxies(JNIEnv *env,
}
index++;
}
- head = head->next;
+ current = current->next;
}
}
}
--
GitLab
From 674a97b27ef621e7b54c13c121c625f91df5ee60 Mon Sep 17 00:00:00 2001
From: Thomas Schatzl
Date: Tue, 25 Jan 2022 16:27:30 +0000
Subject: [PATCH 042/339] 8280396: G1: Full gc mark stack draining should
prefer to make work available to other threads
Reviewed-by: sjohanss, ayang
---
src/hotspot/share/gc/g1/g1FullGCMarker.hpp | 12 +++--
.../share/gc/g1/g1FullGCMarker.inline.hpp | 46 +++++++++++++------
2 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1FullGCMarker.hpp b/src/hotspot/share/gc/g1/g1FullGCMarker.hpp
index ec7f029b7ce..2d935d863c5 100644
--- a/src/hotspot/share/gc/g1/g1FullGCMarker.hpp
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -71,8 +71,6 @@ class G1FullGCMarker : public CHeapObj {
G1RegionMarkStatsCache _mark_stats_cache;
inline bool is_empty();
- inline bool pop_object(oop& obj);
- inline bool pop_objarray(ObjArrayTask& array);
inline void push_objarray(oop obj, size_t index);
inline bool mark_object(oop obj);
@@ -80,6 +78,14 @@ class G1FullGCMarker : public CHeapObj {
inline void follow_object(oop obj);
inline void follow_array(objArrayOop array);
inline void follow_array_chunk(objArrayOop array, int index);
+
+ inline void drain_oop_stack();
+ // Transfer contents from the objArray task queue overflow stack to the shared
+ // objArray stack.
+ // Returns true and a valid task if there has not been enough space in the shared
+ // objArray stack, otherwise the task is invalid.
+ inline bool transfer_objArray_overflow_stack(ObjArrayTask& task);
+
public:
G1FullGCMarker(G1FullCollector* collector,
uint worker_id,
diff --git a/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp b/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp
index c261c150e46..a68bae5ced6 100644
--- a/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -91,20 +91,12 @@ inline bool G1FullGCMarker::is_empty() {
return _oop_stack.is_empty() && _objarray_stack.is_empty();
}
-inline bool G1FullGCMarker::pop_object(oop& oop) {
- return _oop_stack.pop_overflow(oop) || _oop_stack.pop_local(oop);
-}
-
inline void G1FullGCMarker::push_objarray(oop obj, size_t index) {
ObjArrayTask task(obj, index);
assert(task.is_valid(), "bad ObjArrayTask");
_objarray_stack.push(task);
}
-inline bool G1FullGCMarker::pop_objarray(ObjArrayTask& arr) {
- return _objarray_stack.pop_overflow(arr) || _objarray_stack.pop_local(arr);
-}
-
inline void G1FullGCMarker::follow_array(objArrayOop array) {
follow_klass(array->klass());
// Don't push empty arrays to avoid unnecessary work.
@@ -159,16 +151,40 @@ inline void G1FullGCMarker::follow_object(oop obj) {
}
}
-void G1FullGCMarker::drain_stack() {
- do {
- oop obj;
- while (pop_object(obj)) {
+inline void G1FullGCMarker::drain_oop_stack() {
+ oop obj;
+ while (_oop_stack.pop_overflow(obj)) {
+ if (!_oop_stack.try_push_to_taskqueue(obj)) {
assert(_bitmap->is_marked(obj), "must be marked");
follow_object(obj);
}
- // Process ObjArrays one at a time to avoid marking stack bloat.
+ }
+ while (_oop_stack.pop_local(obj)) {
+ assert(_bitmap->is_marked(obj), "must be marked");
+ follow_object(obj);
+ }
+}
+
+inline bool G1FullGCMarker::transfer_objArray_overflow_stack(ObjArrayTask& task) {
+ // It is desirable to move as much as possible work from the overflow queue to
+ // the shared queue as quickly as possible.
+ while (_objarray_stack.pop_overflow(task)) {
+ if (!_objarray_stack.try_push_to_taskqueue(task)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void G1FullGCMarker::drain_stack() {
+ do {
+ // First, drain regular oop stack.
+ drain_oop_stack();
+
+ // Then process ObjArrays one at a time to avoid marking stack bloat.
ObjArrayTask task;
- if (pop_objarray(task)) {
+ if (transfer_objArray_overflow_stack(task) ||
+ _objarray_stack.pop_local(task)) {
follow_array_chunk(objArrayOop(task.obj()), task.index());
}
} while (!is_empty());
--
GitLab
From f4575e4052bf66f1259c626e01a74d3ac593e645 Mon Sep 17 00:00:00 2001
From: Brian Burkhalter
Date: Tue, 25 Jan 2022 18:02:18 +0000
Subject: [PATCH 043/339] 8279946: (ch) java.nio.channels.FileChannel tryLock
and write methods are missing @throws NonWritableChannelException
Reviewed-by: alanb
---
.../java/nio/channels/FileChannel.java | 33 ++++++++++++++++---
1 file changed, 28 insertions(+), 5 deletions(-)
diff --git a/src/java.base/share/classes/java/nio/channels/FileChannel.java b/src/java.base/share/classes/java/nio/channels/FileChannel.java
index 2ea213b3509..d8fee6ca995 100644
--- a/src/java.base/share/classes/java/nio/channels/FileChannel.java
+++ b/src/java.base/share/classes/java/nio/channels/FileChannel.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,16 @@
package java.nio.channels;
-import java.io.*;
+import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.spi.AbstractInterruptibleChannel;
-import java.nio.file.*;
+import java.nio.file.FileAlreadyExistsException;
+import java.nio.file.OpenOption;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.FileAttribute;
-import java.nio.file.spi.*;
+import java.nio.file.spi.FileSystemProvider;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
@@ -403,6 +406,9 @@ public abstract class FileChannel
* with the number of bytes actually written. Otherwise this method
* behaves exactly as specified by the {@link WritableByteChannel}
* interface.
+ *
+ * @throws NonWritableChannelException
+ * If this channel was not opened for writing
*/
public abstract int write(ByteBuffer src) throws IOException;
@@ -417,6 +423,9 @@ public abstract class FileChannel
* with the number of bytes actually written. Otherwise this method
* behaves exactly as specified in the {@link GatheringByteChannel}
* interface.
+ *
+ * @throws NonWritableChannelException
+ * If this channel was not opened for writing
*/
public abstract long write(ByteBuffer[] srcs, int offset, int length)
throws IOException;
@@ -431,6 +440,9 @@ public abstract class FileChannel
* with the number of bytes actually written. Otherwise this method
* behaves exactly as specified in the {@link GatheringByteChannel}
* interface.
+ *
+ * @throws NonWritableChannelException
+ * If this channel was not opened for writing
*/
public final long write(ByteBuffer[] srcs) throws IOException {
return write(srcs, 0, srcs.length);
@@ -1030,7 +1042,7 @@ public abstract class FileChannel
* region
*
* @throws NonReadableChannelException
- * If {@code shared} is {@code true} this channel was not
+ * If {@code shared} is {@code true} but this channel was not
* opened for reading
*
* @throws NonWritableChannelException
@@ -1148,6 +1160,14 @@ public abstract class FileChannel
* blocked in this method and is attempting to lock an overlapping
* region of the same file
*
+ * @throws NonReadableChannelException
+ * If {@code shared} is {@code true} but this channel was not
+ * opened for reading
+ *
+ * @throws NonWritableChannelException
+ * If {@code shared} is {@code false} but this channel was not
+ * opened for writing
+ *
* @throws IOException
* If some other I/O error occurs
*
@@ -1180,6 +1200,9 @@ public abstract class FileChannel
* blocked in this method and is attempting to lock an overlapping
* region
*
+ * @throws NonWritableChannelException
+ * If this channel was not opened for writing
+ *
* @throws IOException
* If some other I/O error occurs
*
--
GitLab
From cbe8395ace3230dc599c7f082e3524a861b2da8e Mon Sep 17 00:00:00 2001
From: Joe Darcy
Date: Tue, 25 Jan 2022 18:15:37 +0000
Subject: [PATCH 044/339] 8280168: Add Objects.toIdentityString
Reviewed-by: alanb, mchung, rriggs, smarks
---
.../java/lang/invoke/MethodHandleProxies.java | 2 +-
.../share/classes/java/util/Objects.java | 26 ++++++++++++-
.../java/util/Objects/BasicObjectsTest.java | 37 +++++++++++++++++--
3 files changed, 60 insertions(+), 5 deletions(-)
diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java
index 784d672ff8f..c1c34185ffb 100644
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java
@@ -292,7 +292,7 @@ public class MethodHandleProxies {
private static Object callObjectMethod(Object self, Method m, Object[] args) {
assert(isObjectMethod(m)) : m;
return switch (m.getName()) {
- case "toString" -> self.getClass().getName() + "@" + Integer.toHexString(self.hashCode());
+ case "toString" -> java.util.Objects.toIdentityString(self);
case "hashCode" -> System.identityHashCode(self);
case "equals" -> (self == args[0]);
default -> null;
diff --git a/src/java.base/share/classes/java/util/Objects.java b/src/java.base/share/classes/java/util/Objects.java
index c32a67441da..0b727d6310b 100644
--- a/src/java.base/share/classes/java/util/Objects.java
+++ b/src/java.base/share/classes/java/util/Objects.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -164,6 +164,30 @@ public final class Objects {
return (o != null) ? o.toString() : nullDefault;
}
+ /**
+ * {@return a string equivalent to the string returned by {@code
+ * Object.toString} if that method and {@code hashCode} are not
+ * overridden}
+ *
+ * @implNote
+ * This method constructs a string for an object without calling
+ * any overridable methods of the object.
+ *
+ * @implSpec
+ * The method returns a string equivalent to:
+ * {@code o.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(o))}
+ *
+ * @param o an object
+ * @throws NullPointerException if the argument is null
+ * @see Object#toString
+ * @see System#identityHashCode(Object)
+ * @since 19
+ */
+ public static String toIdentityString(Object o) {
+ requireNonNull(o);
+ return o.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(o));
+ }
+
/**
* Returns 0 if the arguments are identical and {@code
* c.compare(a, b)} otherwise.
diff --git a/test/jdk/java/util/Objects/BasicObjectsTest.java b/test/jdk/java/util/Objects/BasicObjectsTest.java
index a7636ef11d5..51268d4cbaf 100644
--- a/test/jdk/java/util/Objects/BasicObjectsTest.java
+++ b/test/jdk/java/util/Objects/BasicObjectsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,8 @@
/*
* @test
- * @bug 6797535 6889858 6891113 8013712 8011800 8014365
+ * @bug 6797535 6889858 6891113 8013712 8011800 8014365 8280168
* @summary Basic tests for methods in java.util.Objects
- * @author Joseph D. Darcy
*/
import java.util.*;
@@ -40,6 +39,7 @@ public class BasicObjectsTest {
errors += testHash();
errors += testToString();
errors += testToString2();
+ errors += testToIdentityString();
errors += testCompare();
errors += testRequireNonNull();
errors += testIsNull();
@@ -134,6 +134,37 @@ public class BasicObjectsTest {
return errors;
}
+ private static int testToIdentityString() {
+ int errors = 0;
+ // Test null behavior
+ try {
+ Objects.toIdentityString(null);
+ errors++;
+ } catch (NullPointerException npe) {
+ ; // Expected
+ }
+ // Behavior on typical objects
+ Object o = new Object(){};
+ errors += (Objects.toIdentityString(o).equals(o.toString()))? 0 : 1;
+ // Verify object's toString *not* called
+ Object badToString = new Object() {
+ @Override
+ public String toString() {
+ throw new RuntimeException();
+ }
+ };
+ Objects.toIdentityString(badToString);
+ // Verify object's hashCode *not* called
+ Object badHashCode = new Object() {
+ @Override
+ public int hashCode() {
+ throw new RuntimeException("0xDEADBEFF");
+ }
+ };
+ Objects.toIdentityString(badHashCode);
+ return errors;
+ }
+
private static int testCompare() {
int errors = 0;
String[] values = {"e. e. cummings", "zzz"};
--
GitLab
From cebaad1c94c301304fd146526cac95bfeaac66bf Mon Sep 17 00:00:00 2001
From: Aleksey Shipilev
Date: Tue, 25 Jan 2022 19:22:07 +0000
Subject: [PATCH 045/339] 8280041: Retry loop issues in java.io.ClassCache
Co-authored-by: Peter Levart
Reviewed-by: rkennke, rriggs, plevart
---
.../share/classes/java/io/ClassCache.java | 53 ++++++++++++++-----
.../java/io/ClassCache/ContinuousGCTest.java | 50 +++++++++++++++++
.../jdk/java/io/ClassCache/NullValueTest.java | 42 +++++++++++++++
.../java.base/java/io/NameClassCache.java | 35 ++++++++++++
.../java.base/java/io/NullClassCache.java | 34 ++++++++++++
5 files changed, 202 insertions(+), 12 deletions(-)
create mode 100644 test/jdk/java/io/ClassCache/ContinuousGCTest.java
create mode 100644 test/jdk/java/io/ClassCache/NullValueTest.java
create mode 100644 test/jdk/java/io/ClassCache/java.base/java/io/NameClassCache.java
create mode 100644 test/jdk/java/io/ClassCache/java.base/java/io/NullClassCache.java
diff --git a/src/java.base/share/classes/java/io/ClassCache.java b/src/java.base/share/classes/java/io/ClassCache.java
index a3901d479ef..48e7a36c05a 100644
--- a/src/java.base/share/classes/java/io/ClassCache.java
+++ b/src/java.base/share/classes/java/io/ClassCache.java
@@ -28,6 +28,7 @@ package java.io;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
+import java.util.Objects;
// Maps Class instances to values of type T. Under memory pressure, the
// mapping is released (under soft references GC policy) and would be
@@ -38,19 +39,29 @@ abstract class ClassCache {
private static class CacheRef extends SoftReference {
private final Class> type;
+ private T strongReferent;
CacheRef(T referent, ReferenceQueue queue, Class> type) {
super(referent, queue);
this.type = type;
+ this.strongReferent = referent;
}
Class> getType() {
return type;
}
+
+ T getStrong() {
+ return strongReferent;
+ }
+
+ void clearStrong() {
+ strongReferent = null;
+ }
}
private final ReferenceQueue queue;
- private final ClassValue> map;
+ private final ClassValue> map;
protected abstract T computeValue(Class> cl);
@@ -58,23 +69,41 @@ abstract class ClassCache {
queue = new ReferenceQueue<>();
map = new ClassValue<>() {
@Override
- protected SoftReference computeValue(Class> type) {
- return new CacheRef<>(ClassCache.this.computeValue(type), queue, type);
+ protected CacheRef computeValue(Class> type) {
+ T v = ClassCache.this.computeValue(type);
+ Objects.requireNonNull(v);
+ return new CacheRef<>(v, queue, type);
}
};
}
T get(Class> cl) {
- processQueue();
- T val;
- do {
- SoftReference ref = map.get(cl);
- val = ref.get();
- if (val == null) {
- map.remove(cl);
+ while (true) {
+ processQueue();
+
+ CacheRef ref = map.get(cl);
+
+ // Case 1: A recently created CacheRef.
+ // We might still have strong referent, and can return it.
+ // This guarantees progress for at least one thread on every CacheRef.
+ // Clear the strong referent before returning to make the cache soft.
+ T strongVal = ref.getStrong();
+ if (strongVal != null) {
+ ref.clearStrong();
+ return strongVal;
+ }
+
+ // Case 2: Older or recently cleared CacheRef.
+ // Check if its soft referent is still available, and return it.
+ T val = ref.get();
+ if (val != null) {
+ return val;
}
- } while (val == null);
- return val;
+
+ // Case 3: The reference was cleared.
+ // Clear the mapping and retry.
+ map.remove(cl);
+ }
}
private void processQueue() {
diff --git a/test/jdk/java/io/ClassCache/ContinuousGCTest.java b/test/jdk/java/io/ClassCache/ContinuousGCTest.java
new file mode 100644
index 00000000000..681663029e4
--- /dev/null
+++ b/test/jdk/java/io/ClassCache/ContinuousGCTest.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2022, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.NameClassCache;
+
+/**
+ * @test
+ * @bug 8280041
+ * @summary Sanity test for ClassCache under continuous GC
+ * @compile/module=java.base java/io/NameClassCache.java
+ * @run main ContinuousGCTest
+ */
+public class ContinuousGCTest {
+ static final NameClassCache CACHE = new NameClassCache();
+ static final String VALUE = "ClassCache-ContinuousGCTest";
+
+ public static void main(String... args) throws Throwable {
+ for (int c = 0; c < 1000; c++) {
+ test();
+ System.gc();
+ }
+ }
+
+ public static void test() {
+ String cached = CACHE.get(ContinuousGCTest.class);
+ if (!cached.equals(VALUE)) {
+ throw new IllegalStateException("Cache failure, got: " + cached);
+ }
+ }
+}
diff --git a/test/jdk/java/io/ClassCache/NullValueTest.java b/test/jdk/java/io/ClassCache/NullValueTest.java
new file mode 100644
index 00000000000..22b41fa071d
--- /dev/null
+++ b/test/jdk/java/io/ClassCache/NullValueTest.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2022, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.NullClassCache;
+
+/**
+ * @test
+ * @bug 8280041
+ * @summary Test that ClassCache throws on trying to pass null value
+ * @compile/module=java.base java/io/NullClassCache.java
+ * @run main NullValueTest
+ */
+public class NullValueTest {
+ public static void main(String... args) throws Throwable {
+ try {
+ new NullClassCache().get(Object.class);
+ throw new IllegalStateException("Should have failed");
+ } catch (NullPointerException npe) {
+ // Expected
+ }
+ }
+}
diff --git a/test/jdk/java/io/ClassCache/java.base/java/io/NameClassCache.java b/test/jdk/java/io/ClassCache/java.base/java/io/NameClassCache.java
new file mode 100644
index 00000000000..ff2149fc6a2
--- /dev/null
+++ b/test/jdk/java/io/ClassCache/java.base/java/io/NameClassCache.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2022, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.io;
+
+public class NameClassCache extends ClassCache {
+ protected String computeValue(Class> cl) {
+ // Return string that is not interned and specific to class
+ return "ClassCache-" + cl.getName();
+ }
+
+ public String get(Class> cl) {
+ return super.get(cl);
+ }
+}
diff --git a/test/jdk/java/io/ClassCache/java.base/java/io/NullClassCache.java b/test/jdk/java/io/ClassCache/java.base/java/io/NullClassCache.java
new file mode 100644
index 00000000000..58c92ef1399
--- /dev/null
+++ b/test/jdk/java/io/ClassCache/java.base/java/io/NullClassCache.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2022, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.io;
+
+public class NullClassCache extends ClassCache