From e85d00f6c32c9938fbc9529b055d90082f565fa3 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Tue, 20 Dec 2022 21:33:53 +0000 Subject: [PATCH 1/7] 8299147: Minor accessibility errors in the specs and man index pages Reviewed-by: mchung, erikj --- make/Docs.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/Docs.gmk b/make/Docs.gmk index 416a83d2de3..33d531ee4d2 100644 --- a/make/Docs.gmk +++ b/make/Docs.gmk @@ -619,7 +619,7 @@ $(foreach n, 0 1 2, \ $(eval specs_bottom_rel_path := $(specs_bottom_rel_path)../) \ ) -SPECS_TOP := $(if $(filter true, $(IS_DRAFT)),
$(DRAFT_TEXT)
) +SPECS_TOP := $(if $(filter true, $(IS_DRAFT)), ) # For all html files in $module/share/specs directories, copy and add the # copyright footer. From 3d4d9fd6e6de037950f94482d4e33f178eb15daa Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Tue, 20 Dec 2022 22:02:34 +0000 Subject: [PATCH 2/7] 8298947: compiler/codecache/MHIntrinsicAllocFailureTest.java fails intermittently Reviewed-by: kvn, chagedorn --- .../jtreg/compiler/codecache/MHIntrinsicAllocFailureTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/jtreg/compiler/codecache/MHIntrinsicAllocFailureTest.java b/test/hotspot/jtreg/compiler/codecache/MHIntrinsicAllocFailureTest.java index 06fda8e2e91..1cbaaf0f52d 100644 --- a/test/hotspot/jtreg/compiler/codecache/MHIntrinsicAllocFailureTest.java +++ b/test/hotspot/jtreg/compiler/codecache/MHIntrinsicAllocFailureTest.java @@ -27,6 +27,7 @@ * @bug 8295724 * @requires vm.compMode == "Xmixed" * @requires vm.opt.TieredCompilation == null | vm.opt.TieredCompilation == true + * @requires vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel == 4 * @summary test allocation failure of method handle intrinsic in profiled/non-profiled space * @library /test/lib * @modules java.base/jdk.internal.misc From f7be5b530d10005ba928309870c9adc42afdf66a Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Tue, 20 Dec 2022 22:53:09 +0000 Subject: [PATCH 3/7] 8299156: Broken link in jdk.compiler/module-info.java Reviewed-by: iris --- src/jdk.compiler/share/classes/module-info.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jdk.compiler/share/classes/module-info.java b/src/jdk.compiler/share/classes/module-info.java index 46104743182..7974f8cd6a3 100644 --- a/src/jdk.compiler/share/classes/module-info.java +++ b/src/jdk.compiler/share/classes/module-info.java @@ -65,7 +65,7 @@ import javax.tools.StandardLocation; *

Options and Environment Variables

* * The full set of options and environment variables supported by javac - * is given in the javac Tool Guide. + * is given in the javac Tool Guide. * However, there are some restrictions when the compiler is invoked through * its API. * From 92fe304f08b406cb0f87cf32497aea2f5ce9c5ea Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Wed, 21 Dec 2022 10:57:24 +0000 Subject: [PATCH 4/7] 8298588: WebSockets: HandshakeUrlEncodingTest unnecessarily depends on a response body Backport-of: 909d0cb4d9475fd367b8bc64a6b50c5a324e9a01 --- .../websocket/HandshakeUrlEncodingTest.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java b/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java index e83381c17e3..969ab72be55 100644 --- a/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java +++ b/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java @@ -112,21 +112,22 @@ public class HandshakeUrlEncodingTest { .join(); fail("Expected to throw"); } catch (CompletionException ce) { - Throwable t = getCompletionCause(ce); + final Throwable t = getCompletionCause(ce); if (!(t instanceof WebSocketHandshakeException)) { throw new AssertionError("Unexpected exception", t); } - WebSocketHandshakeException wse = (WebSocketHandshakeException) t; + final WebSocketHandshakeException wse = (WebSocketHandshakeException) t; assertNotNull(wse.getResponse()); - assertNotNull(wse.getResponse().body()); - assertEquals(wse.getResponse().body().getClass(), String.class); - String body = (String)wse.getResponse().body(); - String expectedBody = "/?&raw=abc+def/ghi=xyz&encoded=abc%2Bdef%2Fghi%3Dxyz"; + assertNotNull(wse.getResponse().uri()); + assertNotNull(wse.getResponse().statusCode()); + final String rawQuery = wse.getResponse().uri().getRawQuery(); + final String expectedRawQuery = "&raw=abc+def/ghi=xyz&encoded=abc%2Bdef%2Fghi%3Dxyz"; + assertEquals(rawQuery, expectedRawQuery); + final String body = (String) wse.getResponse().body(); + final String expectedBody = "/?" + expectedRawQuery; assertEquals(body, expectedBody); out.println("Status code is " + wse.getResponse().statusCode()); - out.println("Response is " + body); - assertNotNull(wse.getResponse().statusCode()); - out.println("Status code is " + wse.getResponse().statusCode()); + out.println("Response is " + wse.getResponse()); assertEquals(wse.getResponse().statusCode(), 400); } } From 81933b7a927c1579eda7b6678901e5d2bc1c1aed Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Wed, 21 Dec 2022 11:00:48 +0000 Subject: [PATCH 5/7] 8298642: ParallelGC -XX:+UseNUMA eden spaces allocated on wrong node Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/parallel/mutableNUMASpace.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/parallel/mutableNUMASpace.cpp b/src/hotspot/share/gc/parallel/mutableNUMASpace.cpp index 9275b1c3190..4e11f60200e 100644 --- a/src/hotspot/share/gc/parallel/mutableNUMASpace.cpp +++ b/src/hotspot/share/gc/parallel/mutableNUMASpace.cpp @@ -314,9 +314,12 @@ void MutableNUMASpace::bias_region(MemRegion mr, int lgrp_id) { assert(region().contains(aligned_region), "Sanity"); // First we tell the OS which page size we want in the given range. The underlying // large page can be broken down if we require small pages. - os::realign_memory((char*)aligned_region.start(), aligned_region.byte_size(), page_size()); + const size_t os_align = UseLargePages ? page_size() : os::vm_page_size(); + os::realign_memory((char*)aligned_region.start(), aligned_region.byte_size(), os_align); // Then we uncommit the pages in the range. - os::free_memory((char*)aligned_region.start(), aligned_region.byte_size(), page_size()); + // The alignment_hint argument must be less than or equal to the small page + // size if not using large pages or else this function does nothing. + os::free_memory((char*)aligned_region.start(), aligned_region.byte_size(), os_align); // And make them local/first-touch biased. os::numa_make_local((char*)aligned_region.start(), aligned_region.byte_size(), lgrp_id); } From 9adc349cbb38ccc23096c4504c7b4b70009c660f Mon Sep 17 00:00:00 2001 From: Tyler Steele Date: Wed, 21 Dec 2022 18:17:42 +0000 Subject: [PATCH 6/7] 8298726: (fs) Change PollingWatchService to record last modified time as FileTime rather than milliseconds Backport-of: 5f63f7a742a1071a87ca69463bae6e04a44fe462 --- .../sun/nio/fs/PollingWatchService.java | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/java.base/share/classes/sun/nio/fs/PollingWatchService.java b/src/java.base/share/classes/sun/nio/fs/PollingWatchService.java index 582462c36c1..23de2788fe3 100644 --- a/src/java.base/share/classes/sun/nio/fs/PollingWatchService.java +++ b/src/java.base/share/classes/sun/nio/fs/PollingWatchService.java @@ -29,13 +29,13 @@ import java.nio.file.ClosedWatchServiceException; import java.nio.file.DirectoryIteratorException; import java.nio.file.DirectoryStream; import java.nio.file.Files; -import java.nio.file.LinkOption; import java.nio.file.NotDirectoryException; import java.nio.file.Path; import java.nio.file.StandardWatchEventKinds; import java.nio.file.WatchEvent; import java.nio.file.WatchKey; import java.nio.file.attribute.BasicFileAttributes; +import java.nio.file.attribute.FileTime; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; @@ -51,6 +51,7 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; +import static java.nio.file.LinkOption.NOFOLLOW_LINKS; /** * Simple WatchService implementation that uses periodic tasks to poll @@ -222,10 +223,10 @@ class PollingWatchService * Entry in directory cache to record file last-modified-time and tick-count */ private static class CacheEntry { - private long lastModified; + private FileTime lastModified; private int lastTickCount; - CacheEntry(long lastModified, int lastTickCount) { + CacheEntry(FileTime lastModified, int lastTickCount) { this.lastModified = lastModified; this.lastTickCount = lastTickCount; } @@ -234,11 +235,11 @@ class PollingWatchService return lastTickCount; } - long lastModified() { + FileTime lastModified() { return lastModified; } - void update(long lastModified, int tickCount) { + void update(FileTime lastModified, int tickCount) { this.lastModified = lastModified; this.lastTickCount = tickCount; } @@ -280,8 +281,7 @@ class PollingWatchService try (DirectoryStream stream = Files.newDirectoryStream(dir)) { for (Path entry: stream) { // don't follow links - long lastModified = - Files.getLastModifiedTime(entry, LinkOption.NOFOLLOW_LINKS).toMillis(); + FileTime lastModified = Files.getLastModifiedTime(entry, NOFOLLOW_LINKS); entries.put(entry.getFileName(), new CacheEntry(lastModified, tickCount)); } } catch (DirectoryIteratorException e) { @@ -358,10 +358,9 @@ class PollingWatchService // iterate over all entries in directory try { for (Path entry: stream) { - long lastModified = 0L; + FileTime lastModified; try { - lastModified = - Files.getLastModifiedTime(entry, LinkOption.NOFOLLOW_LINKS).toMillis(); + lastModified = Files.getLastModifiedTime(entry, NOFOLLOW_LINKS); } catch (IOException x) { // unable to get attributes of entry. If file has just // been deleted then we'll report it as deleted on the @@ -373,8 +372,7 @@ class PollingWatchService CacheEntry e = entries.get(entry.getFileName()); if (e == null) { // new file found - entries.put(entry.getFileName(), - new CacheEntry(lastModified, tickCount)); + entries.put(entry.getFileName(), new CacheEntry(lastModified, tickCount)); // queue ENTRY_CREATE if event enabled if (events.contains(StandardWatchEventKinds.ENTRY_CREATE)) { @@ -393,7 +391,7 @@ class PollingWatchService } // check if file has changed - if (e.lastModified != lastModified) { + if (!e.lastModified().equals(lastModified)) { if (events.contains(StandardWatchEventKinds.ENTRY_MODIFY)) { signalEvent(StandardWatchEventKinds.ENTRY_MODIFY, entry.getFileName()); From 22007a1e387a1b8e897c6fbb056377b7ddc6ec00 Mon Sep 17 00:00:00 2001 From: Volodymyr Paprotski Date: Wed, 21 Dec 2022 18:43:40 +0000 Subject: [PATCH 7/7] 8298893: Rename option UsePolyIntrinsics to UsePoly1305Intrinsics Reviewed-by: jnimeh, chagedorn, thartmann --- src/hotspot/cpu/x86/stubGenerator_x86_64.cpp | 2 +- src/hotspot/cpu/x86/vm_version_x86.cpp | 8 ++++---- src/hotspot/share/classfile/vmIntrinsics.cpp | 2 +- src/hotspot/share/opto/library_call.cpp | 2 +- src/hotspot/share/runtime/globals.hpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index 95dc03200eb..d7a613052a3 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -3709,7 +3709,7 @@ void StubGenerator::generate_initial() { StubRoutines::_updateBytesCRC32 = generate_updateBytesCRC32(); } - if (UsePolyIntrinsics) { + if (UsePoly1305Intrinsics) { StubRoutines::_poly1305_processBlocks = generate_poly1305_processBlocks(); } diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index 83979a60245..ba2da1fcd1a 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -1351,14 +1351,14 @@ void VM_Version::get_processor_features() { #ifdef _LP64 if (supports_avx512ifma() && supports_avx512vlbw() && MaxVectorSize >= 64) { - if (FLAG_IS_DEFAULT(UsePolyIntrinsics)) { - FLAG_SET_DEFAULT(UsePolyIntrinsics, true); + if (FLAG_IS_DEFAULT(UsePoly1305Intrinsics)) { + FLAG_SET_DEFAULT(UsePoly1305Intrinsics, true); } } else #endif - if (UsePolyIntrinsics) { + if (UsePoly1305Intrinsics) { warning("Intrinsics for Poly1305 crypto hash functions not available on this CPU."); - FLAG_SET_DEFAULT(UsePolyIntrinsics, false); + FLAG_SET_DEFAULT(UsePoly1305Intrinsics, false); } #ifdef _LP64 diff --git a/src/hotspot/share/classfile/vmIntrinsics.cpp b/src/hotspot/share/classfile/vmIntrinsics.cpp index 3dafc8f235f..81b442f713b 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.cpp +++ b/src/hotspot/share/classfile/vmIntrinsics.cpp @@ -483,7 +483,7 @@ bool vmIntrinsics::disabled_by_jvm_flags(vmIntrinsics::ID id) { if (!UseBASE64Intrinsics) return true; break; case vmIntrinsics::_poly1305_processBlocks: - if (!UsePolyIntrinsics) return true; + if (!UsePoly1305Intrinsics) return true; break; case vmIntrinsics::_updateBytesCRC32C: case vmIntrinsics::_updateDirectByteBufferCRC32C: diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index 0051bed3314..27d4f4b4a27 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -7003,7 +7003,7 @@ bool LibraryCallKit::inline_base64_decodeBlock() { bool LibraryCallKit::inline_poly1305_processBlocks() { address stubAddr; const char *stubName; - assert(UsePolyIntrinsics, "need Poly intrinsics support"); + assert(UsePoly1305Intrinsics, "need Poly intrinsics support"); assert(callee()->signature()->size() == 5, "poly1305_processBlocks has %d parameters", callee()->signature()->size()); stubAddr = StubRoutines::poly1305_processBlocks(); stubName = "poly1305_processBlocks"; diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 4e90449d78c..18a73fd1d59 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -238,7 +238,7 @@ const int ObjectAlignmentInBytes = 8; product(bool, UseBASE64Intrinsics, false, \ "Use intrinsics for java.util.Base64") \ \ - product(bool, UsePolyIntrinsics, false, DIAGNOSTIC, \ + product(bool, UsePoly1305Intrinsics, false, DIAGNOSTIC, \ "Use intrinsics for sun.security.util.math.intpoly") \ \ product(size_t, LargePageSizeInBytes, 0, \