From trebari at openjdk.java.net Mon Mar 1 09:42:53 2021 From: trebari at openjdk.java.net (Tejpal Rebari) Date: Mon, 1 Mar 2021 09:42:53 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262497: Delete unused utility methods in ICC_Profile class In-Reply-To: References: Message-ID: On Sun, 28 Feb 2021 04:59:48 GMT, Sergey Bylokhov wrote: > A few utility methods in the ICC_Profile class are unused since 1997, I think we can delete them. Marked as reviewed by trebari (Committer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2764 From aph at openjdk.java.net Mon Mar 1 10:33:59 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Mon, 1 Mar 2021 10:33:59 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v21] In-Reply-To: References: Message-ID: On Fri, 26 Feb 2021 19:17:12 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request incrementally with two additional commits since the last revision: > > - Merge remote-tracking branch 'origin/jdk/jdk-macos' into jdk-macos > - Minor fixes src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp line 62: > 60: > 61: #if defined(__APPLE__) || defined(_WIN64) > 62: #define R18_RESERVED #define R18_RESERVED true``` ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aph at openjdk.java.net Mon Mar 1 11:09:56 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Mon, 1 Mar 2021 11:09:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v10] In-Reply-To: References: Message-ID: On Thu, 4 Feb 2021 23:01:52 GMT, Gerard Ziemski wrote: >> Anton Kozlov has updated the pull request incrementally with six additional commits since the last revision: >> >> - Merge remote-tracking branch 'origin/jdk/jdk-macos' into jdk-macos >> - Add comments to WX transitions >> >> + minor change of placements >> - Use macro conditionals instead of empty functions >> - Add W^X to tests >> - Do not require known W^X state >> - Revert w^x in gtests > > src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 652: > >> 650: >> 651: void os::setup_fpu() { >> 652: } > > Is there really nothing to do here, or does still need to be implemented? A clarification comment here would help/. There is really nothing to do here. > src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 198: > >> 196: >> 197: NOINLINE frame os::current_frame() { >> 198: intptr_t *fp = *(intptr_t **)__builtin_frame_address(0); > > In the bsd_x86 counter part we initialize `fp` to `_get_previous_fp()` - do we need to implement it on aarch64 as well (and using address 0 is just a temp workaround) or is it doing the right thing here? (0)``` looks right to me. > src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 291: > >> 289: bool is_unsafe_arraycopy = (thread->doing_unsafe_access() && UnsafeCopyMemory::contains_pc(pc)); >> 290: if ((nm != NULL && nm->has_unsafe_access()) || is_unsafe_arraycopy) { >> 291: address next_pc = pc + NativeCall::instruction_size; > > Replace > > address next_pc = pc + NativeCall::instruction_size; > > with > > address next_pc = Assembler::locate_next_instruction(pc); > > there is at least one other place that needs it. Why is this change needed? AFAICS ```locate_next_instruction()``` is an x86 thing for variable-length instructions, and no other port uses it. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aph at openjdk.java.net Mon Mar 1 11:09:55 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Mon, 1 Mar 2021 11:09:55 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v21] In-Reply-To: References: Message-ID: <5l97Ac1W-JbLiCBJMoWut-c-RZEPN6wBHABym2nHeRE=.6d060249-e315-486b-a0ab-1992de6f54d5@github.com> On Fri, 26 Feb 2021 19:17:12 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request incrementally with two additional commits since the last revision: > > - Merge remote-tracking branch 'origin/jdk/jdk-macos' into jdk-macos > - Minor fixes Thanks. With this, I think we're done. ------------- Changes requested by aph (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2200 From aph at openjdk.java.net Mon Mar 1 11:09:57 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Mon, 1 Mar 2021 11:09:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: On Fri, 5 Feb 2021 17:20:55 GMT, Anton Kozlov wrote: >> src/hotspot/cpu/aarch64/vm_version_aarch64.hpp line 93: >> >>> 91: CPU_MARVELL = 'V', >>> 92: CPU_INTEL = 'i', >>> 93: CPU_APPLE = 'a', >> >> The `ARM Architecture Reference Manual ARMv8, for ARMv8-A architecture profile` has 8538 pages, can we be more specific and point to the particular section of the document where the CPU codes are defined? > > They are defined in 13.2.95. MIDR_EL1, Main ID Register. Apple's code is not there, but "Arm can assign codes that are not published in this manual. All values not assigned by Arm are reserved and must not be used.". I assume the value was obtained by digging around https://github.com/apple/darwin-xnu/blob/main/osfmk/arm/cpuid.h#L62 Anton, this paragraph looks like an excellent comment. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aph at openjdk.java.net Mon Mar 1 11:09:58 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Mon, 1 Mar 2021 11:09:58 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v10] In-Reply-To: References: <9Nasu4m7orJoGYjX4EYCuz5-aevYNno3Ru3jPHgwkvc=.168cfdf0-648b-46e4-9cb4-b24956eeba7d@github.com> Message-ID: On Fri, 12 Feb 2021 11:42:59 GMT, Vladimir Kempik wrote: >> src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 194: >> >>> 192: // may get turned off by -fomit-frame-pointer. >>> 193: frame os::get_sender_for_C_frame(frame* fr) { >>> 194: return frame(fr->link(), fr->link(), fr->sender_pc()); >> >> Why is it >> >> return frame(fr->link(), fr->link(), fr->sender_pc()); >> >> and not >> >> return frame(fr->sender_sp(), fr->link(), fr->sender_pc()); >> >> like in the bsd-x86 counter part? > > bsd_aarcb64 was based on linux_aarch64, with addition of bsd-specific things from bsd_x86 > You think the bsd-x86 way is better here ? There's no point copying x86. We don't have any way to know what the sender's SP was in a C frame without using unwind info. I think this is just used when trying to print the stack in a crash dump. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aghaisas at openjdk.java.net Mon Mar 1 11:17:39 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Mon, 1 Mar 2021 11:17:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: Message-ID: > **Description :** > This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) > It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. > The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) > > We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ > > A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. > > **Testing :** > This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) > > **Note to reviewers :** > 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. > > 2) To apply and test this PR - > To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) > > 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 36 additional commits since the last revision: - Lanai PR#206 - 8262729 - aghaisas - Lanai PR#205 - 8262496 - avu - Lanai PR#203 - 8262313 - jdv - Lanai PR#202 - 8262293 - avu - Lanai PR#201 - 8261891 - avu - Lanai PR#200 - 8262115 - aghaisas - Merge branch 'master' into 8260931_lanai_JEP_branch - Lanai PR#199 - 8262091 - aghaisas - Lanai PR#198 - 8261646 - avu - Lanai PR#197 - 8261960 - jdv - ... and 26 more: https://git.openjdk.java.net/jdk/compare/dd205a58...5cb1fd91 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2403/files - new: https://git.openjdk.java.net/jdk/pull/2403/files/614be056..5cb1fd91 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2403&range=09 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2403&range=08-09 Stats: 14064 lines in 640 files changed: 7890 ins; 3094 del; 3080 mod Patch: https://git.openjdk.java.net/jdk/pull/2403.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2403/head:pull/2403 PR: https://git.openjdk.java.net/jdk/pull/2403 From kizune at openjdk.java.net Mon Mar 1 11:33:46 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Mon, 1 Mar 2021 11:33:46 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262497: Delete unused utility methods in ICC_Profile class In-Reply-To: References: Message-ID: <-NnRRT1bOSmavf24LclPhtMbLgKDkJo9yCKtKcqE0jY=.e309576b-0f44-498f-8b46-91eb23b09ef1@github.com> On Sun, 28 Feb 2021 04:59:48 GMT, Sergey Bylokhov wrote: > A few utility methods in the ICC_Profile class are unused since 1997, I think we can delete them. Marked as reviewed by kizune (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2764 From serb at openjdk.java.net Mon Mar 1 19:34:39 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 1 Mar 2021 19:34:39 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8262497: Delete unused utility methods in ICC_Profile class In-Reply-To: References: Message-ID: On Sun, 28 Feb 2021 04:59:48 GMT, Sergey Bylokhov wrote: > A few utility methods in the ICC_Profile class are unused since 1997, I think we can delete them. This pull request has now been integrated. Changeset: 682e1202 Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/682e1202 Stats: 53 lines in 1 file changed: 0 ins; 51 del; 2 mod 8262497: Delete unused utility methods in ICC_Profile class Reviewed-by: azvegint, pbansal, trebari, kizune ------------- PR: https://git.openjdk.java.net/jdk/pull/2764 From akozlov at openjdk.java.net Tue Mar 2 07:48:33 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 07:48:33 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v22] In-Reply-To: References: Message-ID: > Please review the implementation of JEP 391: macOS/AArch64 Port. > > It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. > > Major changes are in: > * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) > * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) > * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. > * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: Update comments ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2200/files - new: https://git.openjdk.java.net/jdk/pull/2200/files/663cb4a1..e42b82db Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=21 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=20-21 Stats: 4 lines in 2 files changed: 4 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/2200.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2200/head:pull/2200 PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 07:48:34 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 07:48:34 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: On Mon, 1 Mar 2021 10:46:34 GMT, Andrew Haley wrote: >> They are defined in 13.2.95. MIDR_EL1, Main ID Register. Apple's code is not there, but "Arm can assign codes that are not published in this manual. All values not assigned by Arm are reserved and must not be used.". I assume the value was obtained by digging around https://github.com/apple/darwin-xnu/blob/main/osfmk/arm/cpuid.h#L62 > > Anton, this paragraph looks like an excellent comment. Thanks, I've added the comment. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 07:48:36 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 07:48:36 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: On Mon, 15 Feb 2021 17:59:54 GMT, Vladimir Kempik wrote: >> src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp line 810: >> >>> 808: #ifdef __APPLE__ >>> 809: // Less-than word types are stored one after another. >>> 810: // The code unable to handle this, bailout. >> >> Perhaps: // The code is unable to handle this so bailout. > > Hello, we have updated PR, now this bailout is used only by the code which can handle it (native wrapper generator), for the rest it will cause guarantee failed if this bailout is triggered I've fixed the spelling. Sorry for it to take so long :( >> src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 195: >> >>> 193: frame os::get_sender_for_C_frame(frame* fr) { >>> 194: return frame(fr->link(), fr->link(), fr->sender_pc()); >>> 195: } >> >> Is this file going to be built by GCC or just macOS compilers? > > there is no support for compiling java with gcc on macos since about jdk11, only clang. > considering this and the absence of gcc for macos_m1, the answer is - just macOS compilers. I've fixed the comment. Now it states `JVM compiled with -fno-omit-frame-pointer, so RFP is saved on the stack.` ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 08:06:49 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 08:06:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: On Fri, 12 Feb 2021 12:40:09 GMT, Florian Weimer wrote: >> only macos comiplers > > The comment is also wrong for glibc: The AArch64 ABI requires a 64 KiB guard region independently of page size, otherwise `-fstack-clash-protection` is not reliable. Thanks, I deleted the comment. It describes implementation distinguishing initial and regular thread http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/548cb3b7b713#l12.7. I'm not sure why the comment was preserved for the bsd_x86, but I don't think it makes sense here. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 08:14:46 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 08:14:46 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: On Fri, 12 Feb 2021 13:32:52 GMT, Vladimir Kempik wrote: >> src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 486: >> >>> 484: } >>> 485: } >>> 486: } >> >> This appears to be a mix for Mavericks (10.9) and 10.12 >> work arounds. Is this code needed by this project? > > I wasn't able to replicate JDK-8020753 and JDK-8186286. So will remove these workaround > @gerard-ziemski, 8020753 was originally your fix, do you know if it still needed on intel-mac ? The x86_bsd still carries the workaround https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp#L745. It's worth having macos ports to be aligned by features. I would propose to have this workaround for now, and decide on it later for macos/x86 and macos/aarch64 at once. Sorry for chiming in so late. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 09:02:10 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 09:02:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: On Tue, 2 Feb 2021 22:18:43 GMT, Daniel D. Daugherty wrote: >> Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: >> >> support macos_aarch64 in hsdis > > src/hotspot/os_cpu/bsd_aarch64/thread_bsd_aarch64.cpp line 43: > >> 41: assert(Thread::current() == this, "caller must be current thread"); >> 42: return pd_get_top_frame(fr_addr, ucontext, isInJava); >> 43: } > > Is AsyncGetCallTrace() being supported by this port? I assume answer to be yes (I have a little experience with AsyncGetCallTrace). This code is identical to one in bsd/x86 and linux/aarch64. After few changes in the build system, I got jtreg/serviceability/AsyncGetCallTrace test compiled and passed. I've filed JDK-8262839 to enable the test. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 09:36:51 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 09:36:51 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: <0dfmwagb4EGbnQnZIzpQ_36c9_fpvvebrgnKDW4E9Ps=.e54e9fb2-7500-40d8-8202-ce4903fd106f@github.com> On Tue, 2 Feb 2021 22:47:04 GMT, Daniel D. Daugherty wrote: >> Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: >> >> support macos_aarch64 in hsdis > > src/hotspot/share/prims/nativeEntryPoint.cpp line 45: > >> 43: guarantee(status == JNI_OK && !env->ExceptionOccurred(), >> 44: "register jdk.internal.invoke.NativeEntryPoint natives"); >> 45: JNI_END > > I thought that jcheck caught a missing new-line? It seems it did not https://github.com/openjdk/jdk/commit/0fb31dbf3a2adc0f7fb2f9924083908724dcde5a#diff-f39cd3f794a337734adf30863f702725ee04182fee2345b2669e59ebed17a2ccR44. Anyway I reverted this change as it is the only change in the file, thanks. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 11:07:56 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 11:07:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: On Tue, 2 Feb 2021 23:10:17 GMT, Daniel D. Daugherty wrote: > For platform files that were copied from other ports to this port, if the file wasn't > changed I presume the copyright years are left alone. If the file required changes > for this port, I expect the year to be updated to 2021. How are you verifying that > these copyright years are being properly managed on the new files? There are no exact copies, based on git -c diff.renameLimit=10000000 diff --find-copies-harder -C75% --name-status upstream/master... So every file changed in the branch potentially needs the copyright update. All file diffs are not trivial, IMHO. I'll run the copyright update after we fix a few remaining issues with the PR, to avoid updating copyright and changing/reverting the actual content. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 14:34:51 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 14:34:51 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v10] In-Reply-To: References: Message-ID: On Thu, 4 Feb 2021 22:15:47 GMT, Gerard Ziemski wrote: >> Anton Kozlov has updated the pull request incrementally with six additional commits since the last revision: >> >> - Merge remote-tracking branch 'origin/jdk/jdk-macos' into jdk-macos >> - Add comments to WX transitions >> >> + minor change of placements >> - Use macro conditionals instead of empty functions >> - Add W^X to tests >> - Do not require known W^X state >> - Revert w^x in gtests > > src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 322: > >> 320: #ifdef __APPLE__ >> 321: } else if (sig == SIGFPE && info->si_code == FPE_NOOP) { >> 322: Unimplemented(); > > Is there a follow up issue for this? Thanks, this is a leftover from the development phase, it will be removed. In macos/x86, this looks like a workaround. We've never met with this condition and it looks recent darwin kernel should correctly report the cause in si_code: https://github.com/apple/darwin-xnu/blob/33eb9835cd948dbbcdd8741aa52457cbe507c765/bsd/dev/arm/unix_signal.c#L436. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 20:32:49 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 20:32:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v10] In-Reply-To: <9bn80xM9g41OytCtH71-krOZtAgy27TbvTFJHmfmKrE=.e9d223d5-2922-4891-8f45-ee039d88ced6@github.com> References: <9bn80xM9g41OytCtH71-krOZtAgy27TbvTFJHmfmKrE=.e9d223d5-2922-4891-8f45-ee039d88ced6@github.com> Message-ID: On Thu, 4 Feb 2021 22:34:16 GMT, Gerard Ziemski wrote: >> Anton Kozlov has updated the pull request incrementally with six additional commits since the last revision: >> >> - Merge remote-tracking branch 'origin/jdk/jdk-macos' into jdk-macos >> - Add comments to WX transitions >> >> + minor change of placements >> - Use macro conditionals instead of empty functions >> - Add W^X to tests >> - Do not require known W^X state >> - Revert w^x in gtests > > src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 237: > >> 235: os::Posix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc)); >> 236: return true; >> 237: } > > Isn't this case already handled by `JVM_HANDLE_XXX_SIGNAL()` ? Why do we need it here again? Good point, thanks. We are missing a few fixes in os_cpu/bsd_aarch64. This was moved out recently. I'm going to align bsd_aarch64 with the rest of platforms. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 21:19:18 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 21:19:18 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v23] In-Reply-To: References: Message-ID: > Please review the implementation of JEP 391: macOS/AArch64 Port. > > It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. > > Major changes are in: > * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) > * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) > * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. > * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) Anton Kozlov has updated the pull request incrementally with five additional commits since the last revision: - Fix after JDK-8259539, partially revert preconditions - JDK-8260471: bsd_aarch64 part - JDK-8259539: bsd_aarch64 part - JDK-8257828: bsd_aarch64 part - Cleanup os_bsd_aarch64 signal handling ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2200/files - new: https://git.openjdk.java.net/jdk/pull/2200/files/e42b82db..4c37f068 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=22 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=21-22 Stats: 31 lines in 1 file changed: 15 ins; 11 del; 5 mod Patch: https://git.openjdk.java.net/jdk/pull/2200.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2200/head:pull/2200 PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 21:19:18 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 21:19:18 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v10] In-Reply-To: <-PhzrEcgREcbXuZ5GrxAfVa6Uwil9YoOkZULt1154rw=.9689a79e-cf61-4f79-9b36-a3295fecab7b@github.com> References: <-PhzrEcgREcbXuZ5GrxAfVa6Uwil9YoOkZULt1154rw=.9689a79e-cf61-4f79-9b36-a3295fecab7b@github.com> Message-ID: On Fri, 12 Feb 2021 15:21:06 GMT, Vladimir Kempik wrote: >> src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 302: >> >>> 300: const uint64_t *detail_msg_ptr >>> 301: = (uint64_t*)(pc + NativeInstruction::instruction_size); >>> 302: const char *detail_msg = (const char *)*detail_msg_ptr; >> >> Where is `detail_msg` used? > > Came from linux_arm64. was used in os_linux_aarch64.cpp on line 246 in report_and_die > But became unused on bsd_arm64. I agree this needs to be removed It seems we have merged master branch before JDK-8259539 was integrated. It brings back use of detail_msg. I reverted details_msg as well its following use. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 2 21:29:52 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 2 Mar 2021 21:29:52 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v10] In-Reply-To: References: Message-ID: On Thu, 4 Feb 2021 22:58:39 GMT, Gerard Ziemski wrote: >> Anton Kozlov has updated the pull request incrementally with six additional commits since the last revision: >> >> - Merge remote-tracking branch 'origin/jdk/jdk-macos' into jdk-macos >> - Add comments to WX transitions >> >> + minor change of placements >> - Use macro conditionals instead of empty functions >> - Add W^X to tests >> - Do not require known W^X state >> - Revert w^x in gtests > > src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 420: > >> 418: size_t os::Posix::_compiler_thread_min_stack_allowed = 72 * K; >> 419: size_t os::Posix::_java_thread_min_stack_allowed = 72 * K; >> 420: size_t os::Posix::_vm_internal_thread_min_stack_allowed = 72 * K; > > Those are slightly larger than their x86_64 counter parts. Are they conservative/aggressive values? How did we arrive at those? These values were copied from linux_aarch64. The motivation is that clang on macos/aarch64 will likely to produce stack frames for C++ functions similar to frames generates by gcc on linux/aarch64. And sizes of java stack frames should not change. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From dholmes at openjdk.java.net Tue Mar 2 23:25:08 2021 From: dholmes at openjdk.java.net (David Holmes) Date: Tue, 2 Mar 2021 23:25:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v23] In-Reply-To: References: Message-ID: On Tue, 2 Mar 2021 21:19:18 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request incrementally with five additional commits since the last revision: > > - Fix after JDK-8259539, partially revert preconditions > - JDK-8260471: bsd_aarch64 part > - JDK-8259539: bsd_aarch64 part > - JDK-8257828: bsd_aarch64 part > - Cleanup os_bsd_aarch64 signal handling src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 207: > 205: // Enable WXWrite: this function is called by the signal handler at arbitrary > 206: // point of execution. > 207: ThreadWXEnable wx(WXWrite, thread); Note that `thread` can be NULL here if the signal handler is running in a non-attached thread. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From serb at openjdk.java.net Wed Mar 3 06:08:05 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 3 Mar 2021 06:08:05 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262915: java.awt.color.ColorSpace.getName() is not thread-safe Message-ID: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> The java.awt.color.ColorSpace.getName() method does not use any kind of synchronization to properly initialize and use the static cache for the color components names. ------------- Commit messages: - Update ColorSpace.java Changes: https://git.openjdk.java.net/jdk/pull/2801/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2801&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8262915 Stats: 53 lines in 1 file changed: 5 ins; 24 del; 24 mod Patch: https://git.openjdk.java.net/jdk/pull/2801.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2801/head:pull/2801 PR: https://git.openjdk.java.net/jdk/pull/2801 From serb at openjdk.java.net Wed Mar 3 06:08:06 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 3 Mar 2021 06:08:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262915: java.awt.color.ColorSpace.getName() is not thread-safe In-Reply-To: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> References: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> Message-ID: On Wed, 3 Mar 2021 03:46:59 GMT, Sergey Bylokhov wrote: > The java.awt.color.ColorSpace.getName() method does not use any kind of synchronization to properly initialize and use the static cache for the color components names. src/java.desktop/share/classes/java/awt/color/ColorSpace.java line 115: > 113: * Lazy-initialized names of components in the color space. > 114: */ > 115: private transient volatile String [] compName; The volatile keyword is the only one necessary to fix this bug, everything else is a cleanup. src/java.desktop/share/classes/java/awt/color/ColorSpace.java line 454: > 452: * Returns the name of the component given the component index. > 453: * > 454: * @param component the component index All other methods use the "component" as a name of the component index. src/java.desktop/share/classes/java/awt/color/ColorSpace.java line 459: > 457: rangeCheck(idx); > 458: if (compName == null) { > 459: switch (type) { the "switch statement" is replaced by the "switch expression" ------------- PR: https://git.openjdk.java.net/jdk/pull/2801 From gziemski at openjdk.java.net Wed Mar 3 16:00:00 2021 From: gziemski at openjdk.java.net (Gerard Ziemski) Date: Wed, 3 Mar 2021 16:00:00 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v23] In-Reply-To: References: Message-ID: On Tue, 2 Mar 2021 23:21:28 GMT, David Holmes wrote: > Note that `thread` can be NULL here if the signal handler is running in a non-attached thread. If we then perform: > `ThreadWXEnable(WXMode new_mode, Thread* thread = NULL) : _thread(thread ? thread : Thread::current()),` > we call Thread::current() on a non-attached thread and that will assert/crash if we get NULL. Either avoid using WX when the thread is NULL, or else change to use Thread::current_or_null_safe() and ensure all uses have a NULL check. https://bugs.openjdk.java.net/browse/JDK-8262903 tracks this issue. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From gziemski at openjdk.java.net Wed Mar 3 17:56:15 2021 From: gziemski at openjdk.java.net (Gerard Ziemski) Date: Wed, 3 Mar 2021 17:56:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: On Tue, 2 Mar 2021 11:05:20 GMT, Anton Kozlov wrote: >> For platform files that were copied from other ports to this port, if the file wasn't >> changed I presume the copyright years are left alone. If the file required changes >> for this port, I expect the year to be updated to 2021. How are you verifying that >> these copyright years are being properly managed on the new files? >> >> For the new W^X helpers, e.g., WXWriteFromExecSetter, a short comment >> explaining why one was landed in a particular place would help reviewers. >> Also see my comment about creating a new ThreadToNativeWithWXExecFromVM >> helper. >> >> I'm stopping my review with all the src/hotspot files done for now. > >> For platform files that were copied from other ports to this port, if the file wasn't >> changed I presume the copyright years are left alone. If the file required changes >> for this port, I expect the year to be updated to 2021. How are you verifying that >> these copyright years are being properly managed on the new files? > > There are no exact copies, based on > git -c diff.renameLimit=10000000 diff --find-copies-harder -C75% --name-status upstream/master... > > So every file changed in the branch potentially needs the copyright update. All file diffs are not trivial, IMHO. > > I'll run the copyright update after we fix a few remaining issues with the PR, to avoid updating copyright and changing/reverting the actual content. A list of the bugs that our internal testing revealed so far: https://bugs.openjdk.java.net/browse/JDK-8262952 https://bugs.openjdk.java.net/browse/JDK-8262894 https://bugs.openjdk.java.net/browse/JDK-8262895 https://bugs.openjdk.java.net/browse/JDK-8262896 https://bugs.openjdk.java.net/browse/JDK-8262897 https://bugs.openjdk.java.net/browse/JDK-8262898 https://bugs.openjdk.java.net/browse/JDK-8262899 https://bugs.openjdk.java.net/browse/JDK-8262900 https://bugs.openjdk.java.net/browse/JDK-8262901 https://bugs.openjdk.java.net/browse/JDK-8262903 https://bugs.openjdk.java.net/browse/JDK-8262904 ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aph at openjdk.java.net Wed Mar 3 17:56:15 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Wed, 3 Mar 2021 17:56:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: <2vF8YcQ9CgnLxMus9tHTd4HmFITeH5wddBKzH-QNNEY=.dbfb2cd5-5997-4b79-88a5-d8292fc56965@github.com> On Wed, 3 Mar 2021 17:39:28 GMT, Gerard Ziemski wrote: > A list of the bugs that our internal testing revealed so far: Are any of these blockers for integration? Some of them are to do with things like features that aren't yet supported, and we can't fix what we can't see. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Wed Mar 3 19:13:59 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Wed, 3 Mar 2021 19:13:59 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: <2vF8YcQ9CgnLxMus9tHTd4HmFITeH5wddBKzH-QNNEY=.dbfb2cd5-5997-4b79-88a5-d8292fc56965@github.com> References: <2vF8YcQ9CgnLxMus9tHTd4HmFITeH5wddBKzH-QNNEY=.dbfb2cd5-5997-4b79-88a5-d8292fc56965@github.com> Message-ID: <_eNysRZporueV4wITFZra8ng_O6dvxAIc0moIWOh95U=.bd3e669d-8efc-41e1-8fb2-e9f2f8e4d1f8@github.com> On Wed, 3 Mar 2021 17:46:41 GMT, Andrew Haley wrote: > A list of the bugs that our internal testing revealed so far ... Thank you! Some of them look like test issues, but a few need more serious consideration. I want to resolve https://bugs.openjdk.java.net/browse/JDK-8262903 at least, along with a few remaining comments. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From azvegint at openjdk.java.net Wed Mar 3 19:47:49 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Wed, 3 Mar 2021 19:47:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262915: java.awt.color.ColorSpace.getName() is not thread-safe In-Reply-To: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> References: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> Message-ID: On Wed, 3 Mar 2021 03:46:59 GMT, Sergey Bylokhov wrote: > The java.awt.color.ColorSpace.getName() method does not use any kind of synchronization to properly initialize and use the static cache for the color components names. Marked as reviewed by azvegint (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2801 From azvegint at openjdk.java.net Wed Mar 3 19:47:49 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Wed, 3 Mar 2021 19:47:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262915: java.awt.color.ColorSpace.getName() is not thread-safe In-Reply-To: References: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> Message-ID: On Wed, 3 Mar 2021 03:55:42 GMT, Sergey Bylokhov wrote: >> The java.awt.color.ColorSpace.getName() method does not use any kind of synchronization to properly initialize and use the static cache for the color components names. > > src/java.desktop/share/classes/java/awt/color/ColorSpace.java line 454: > >> 452: * Returns the name of the component given the component index. >> 453: * >> 454: * @param component the component index > > All other methods use the "component" as a name of the component index. I guess it will require a CSR request. ------------- PR: https://git.openjdk.java.net/jdk/pull/2801 From aivanov at openjdk.java.net Wed Mar 3 20:12:50 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Wed, 3 Mar 2021 20:12:50 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262915: java.awt.color.ColorSpace.getName() is not thread-safe In-Reply-To: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> References: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> Message-ID: On Wed, 3 Mar 2021 03:46:59 GMT, Sergey Bylokhov wrote: > The java.awt.color.ColorSpace.getName() method does not use any kind of synchronization to properly initialize and use the static cache for the color components names. Marked as reviewed by aivanov (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2801 From serb at openjdk.java.net Wed Mar 3 20:15:42 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 3 Mar 2021 20:15:42 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262915: java.awt.color.ColorSpace.getName() is not thread-safe In-Reply-To: References: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> Message-ID: On Wed, 3 Mar 2021 19:44:33 GMT, Alexander Zvegintsev wrote: >> src/java.desktop/share/classes/java/awt/color/ColorSpace.java line 454: >> >>> 452: * Returns the name of the component given the component index. >>> 453: * >>> 454: * @param component the component index >> >> All other methods use the "component" as a name of the component index. > > I guess it will require a CSR request. nope, it is just renaming of the parameter ------------- PR: https://git.openjdk.java.net/jdk/pull/2801 From serb at openjdk.java.net Wed Mar 3 20:30:40 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 3 Mar 2021 20:30:40 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8262915: java.awt.color.ColorSpace.getName() is not thread-safe In-Reply-To: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> References: <8vwxNbOTZayhg5N87z9jNQXbnwEvTz__pqCZrXWyo8Y=.3767f178-fdd3-42f3-9896-0e5834fd92b7@github.com> Message-ID: On Wed, 3 Mar 2021 03:46:59 GMT, Sergey Bylokhov wrote: > The java.awt.color.ColorSpace.getName() method does not use any kind of synchronization to properly initialize and use the static cache for the color components names. This pull request has now been integrated. Changeset: b397472e Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/b397472e Stats: 53 lines in 1 file changed: 5 ins; 24 del; 24 mod 8262915: java.awt.color.ColorSpace.getName() is not thread-safe Reviewed-by: azvegint, aivanov ------------- PR: https://git.openjdk.java.net/jdk/pull/2801 From philip.race at oracle.com Wed Mar 3 21:51:05 2021 From: philip.race at oracle.com (Philip Race) Date: Wed, 3 Mar 2021 13:51:05 -0800 Subject: [OpenJDK 2D-Dev] Project Lanai (New Metal Java 2D Rendering pipeline for macOS) EA build 10 has been released Message-ID: All, We have prepared an EA 10 build of Project Lanai for JEP 382 [1] incorporating fixes to feed back during the ongoing code review [2] EA 10 can be downloaded from https://jdk.java.net/lanai/. Note the open issues and testing suggestions given there. Please test with your apps and hardware and provide feedback via the lanai-dev at openjdk.java.net mailing list. -Phil [1] https://openjdk.java.net/jeps/382 [2] https://mail.openjdk.java.net/pipermail/2d-dev/2021-February/011902.html From dmarkov at openjdk.java.net Thu Mar 4 10:41:47 2021 From: dmarkov at openjdk.java.net (Dmitry Markov) Date: Thu, 4 Mar 2021 10:41:47 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows Message-ID: The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. Fix: Introduce a new flag to indicate DND operation between Java and native app. Testing: mach5 green ------------- Commit messages: - 8262446: DragAndDrop hangs on Windows Changes: https://git.openjdk.java.net/jdk/pull/2825/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2825&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8262446 Stats: 10 lines in 3 files changed: 9 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2825.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2825/head:pull/2825 PR: https://git.openjdk.java.net/jdk/pull/2825 From gziemski at openjdk.java.net Thu Mar 4 15:29:59 2021 From: gziemski at openjdk.java.net (Gerard Ziemski) Date: Thu, 4 Mar 2021 15:29:59 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: <2vF8YcQ9CgnLxMus9tHTd4HmFITeH5wddBKzH-QNNEY=.dbfb2cd5-5997-4b79-88a5-d8292fc56965@github.com> References: <2vF8YcQ9CgnLxMus9tHTd4HmFITeH5wddBKzH-QNNEY=.dbfb2cd5-5997-4b79-88a5-d8292fc56965@github.com> Message-ID: On Wed, 3 Mar 2021 17:46:41 GMT, Andrew Haley wrote: > > A list of the bugs that our internal testing revealed so far: > > Are any of these blockers for integration? Some of them are to do with things like features that aren't yet supported, and we can't fix what we can't see. I don't personally think any of these issues are blockers. It's a great effort as it is and very much appreciated. Anything else can be fixed as a followup. There might be some legal requirements (i.e. JCK) that I'm not in position to comment on, however, so someone else might need to chime in here. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From github.com+4146708+a74nh at openjdk.java.net Thu Mar 4 17:39:01 2021 From: github.com+4146708+a74nh at openjdk.java.net (Alan Hayward) Date: Thu, 4 Mar 2021 17:39:01 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: <2vF8YcQ9CgnLxMus9tHTd4HmFITeH5wddBKzH-QNNEY=.dbfb2cd5-5997-4b79-88a5-d8292fc56965@github.com> Message-ID: On Thu, 4 Mar 2021 15:27:25 GMT, Gerard Ziemski wrote: >>> A list of the bugs that our internal testing revealed so far: >> >> Are any of these blockers for integration? Some of them are to do with things like features that aren't yet supported, and we can't fix what we can't see. > >> > A list of the bugs that our internal testing revealed so far: >> >> Are any of these blockers for integration? Some of them are to do with things like features that aren't yet supported, and we can't fix what we can't see. > > I don't personally think any of these issues are blockers. It's a great effort as it is and very much appreciated. Anything else can be fixed as a followup. > > There might be some legal requirements (i.e. JCK) that I'm not in position to comment on, however, so someone else might need to chime in here. I was building this PR on a new machine, and I now get the following error: > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:258:31: error: cast to smaller integer type 'MIDIClientRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] > static MIDIClientRef client = (MIDIClientRef) NULL; > ^~~~~~~~~~~~~~~~~~~~ > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:259:29: error: cast to smaller integer type 'MIDIPortRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] > static MIDIPortRef inPort = (MIDIPortRef) NULL; > ^~~~~~~~~~~~~~~~~~ > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:260:30: error: cast to smaller integer type 'MIDIPortRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] > static MIDIPortRef outPort = (MIDIPortRef) NULL; > ^~~~~~~~~~~~~~~~~~ > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:466:32: error: cast to smaller integer type 'MIDIEndpointRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] > MIDIEndpointRef endpoint = (MIDIEndpointRef) NULL; > ^~~~~~~~~~~~~~~~~~~~~~ > 4 errors generated. As far as I can tell the only difference between the two systems is the xcode version: New system (failing) % xcodebuild -version Xcode 12.5 Build version 12E5244e Old system (working) % xcodebuild -version Xcode 12.4 Build version 12D4e Looks like the newer version of Xcode is being a little stricter with casting? Replacing the NULL with 0 seems to fix the issue. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From vkempik at openjdk.java.net Thu Mar 4 18:22:51 2021 From: vkempik at openjdk.java.net (Vladimir Kempik) Date: Thu, 4 Mar 2021 18:22:51 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: <2vF8YcQ9CgnLxMus9tHTd4HmFITeH5wddBKzH-QNNEY=.dbfb2cd5-5997-4b79-88a5-d8292fc56965@github.com> Message-ID: On Thu, 4 Mar 2021 17:36:22 GMT, Alan Hayward wrote: > I was building this PR on a new machine, and I now get the following error: > > > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:258:31: error: cast to smaller integer type 'MIDIClientRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] > > static MIDIClientRef client = (MIDIClientRef) NULL; > > ^~~~~~~~~~~~~~~~~~~~ > > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:259:29: error: cast to smaller integer type 'MIDIPortRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] > > static MIDIPortRef inPort = (MIDIPortRef) NULL; > > ^~~~~~~~~~~~~~~~~~ > > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:260:30: error: cast to smaller integer type 'MIDIPortRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] > > static MIDIPortRef outPort = (MIDIPortRef) NULL; > > ^~~~~~~~~~~~~~~~~~ > > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:466:32: error: cast to smaller integer type 'MIDIEndpointRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] > > MIDIEndpointRef endpoint = (MIDIEndpointRef) NULL; > > ^~~~~~~~~~~~~~~~~~~~~~ > > 4 errors generated. > > As far as I can tell the only difference between the two systems is the xcode version: > > New system (failing) > % xcodebuild -version > Xcode 12.5 > Build version 12E5244e > > Old system (working) > % xcodebuild -version > Xcode 12.4 > Build version 12D4e > > Looks like the newer version of Xcode is being a little stricter with casting? > Replacing the NULL with 0 seems to fix the issue. Hello there is one issue with the info you provided, it's from Xcode12.5 beta. And beta license agreement forbids sharing output of beta version of compiler&co So we can't say we have issue with newer xcode beta until that beta went public & released. Fixing issues you found now will mean someone have violated xcode beta license agreement and made these issues public. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aivanov at openjdk.java.net Thu Mar 4 19:41:45 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Thu, 4 Mar 2021 19:41:45 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows In-Reply-To: References: Message-ID: <3AXLyReWRtjcMeVZpQZAO2VNpJDbCfzQ5sTcArhcj1A=.fc9957b9-3928-4f2a-a291-26ef03e82659@github.com> On Thu, 4 Mar 2021 10:36:56 GMT, Dmitry Markov wrote: > The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. > > Fix: > Introduce a new flag to indicate DND operation between Java and native app. > > Testing: > mach5 green Marked as reviewed by aivanov (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From aivanov at openjdk.java.net Thu Mar 4 21:42:53 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Thu, 4 Mar 2021 21:42:53 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() Message-ID: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> **Root cause:** `getPrinterNames()` has two calls to [`::EnumPrinters`](https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters). The first call is to get the required buffer size to contain the structures and any strings. The second call is to get the list of printers. Yet the list of printers or the names of printers can change between the two calls. If it happens, the second call to `EnumPrinters` fails but it is not checked. I couldn't reproduce the crash myself. However, I reproduced the failure in the second call to `::EnumPrinters` by adding `::Sleep(500)` and by renaming the printers so that the data doesn't fit into the allocated buffer: 1: bResult: 0, cbNeeded: 504, cReturned: 0 2: bResult: 0, cbNeeded: 512, cReturned: 0 !!! error During my testing, `cReturned` has always been zero whenever `EnumPrinters` fails. The crash dumps show that `cReturned` is non-zero but the `pPrinterEnum` buffer doesn't contain valid data. Reading `info4->pPrinterName` at the line utf_str = JNU_NewStringPlatform(env, info4->pPrinterName); raises Access Violation exception. **The fix:** Check the return value of `EnumPrinters` and allow for 5 retries. If the function still returns failure, make sure `cReturned` is set to zero. I'm going to close [JDK-6996051](https://bugs.openjdk.java.net/browse/JDK-6996051) and [JDK-8182683](https://bugs.openjdk.java.net/browse/JDK-8182683) reported previously about the same crash as duplicate of the current [JDK-8262829](https://bugs.openjdk.java.net/browse/JDK-8262829). **Testing:** I used [`RemotePrinterStatusRefresh.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java) for testing, it shows the list of currently available printers. In the background I ran `PrinterRename.ps1` PowerShell script which remains a printer, the script is attached to the JBS issue. Without the fix, the list of available printers was empty occasionally because `EnumPrinters` returned failure and set `cReturned` to zero. With the fix, the list of printers is always filled. ------------- Commit messages: - 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() Changes: https://git.openjdk.java.net/jdk/pull/2836/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2836&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8262829 Stats: 20 lines in 1 file changed: 13 ins; 0 del; 7 mod Patch: https://git.openjdk.java.net/jdk/pull/2836.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2836/head:pull/2836 PR: https://git.openjdk.java.net/jdk/pull/2836 From prr at openjdk.java.net Thu Mar 4 22:12:41 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 4 Mar 2021 22:12:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() In-Reply-To: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> References: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> Message-ID: On Thu, 4 Mar 2021 21:37:33 GMT, Alexey Ivanov wrote: > **Root cause:** > `getPrinterNames()` has two calls to [`::EnumPrinters`](https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters). The first call is to get the required buffer size to contain the structures and any strings. The second call is to get the list of printers. > > Yet the list of printers or the names of printers can change between the two calls. If it happens, the second call to `EnumPrinters` fails but it is not checked. > > I couldn't reproduce the crash myself. However, I reproduced the failure in the second call to `::EnumPrinters` by adding `::Sleep(500)` and by renaming the printers so that the data doesn't fit into the allocated buffer: > > 1: bResult: 0, cbNeeded: 504, cReturned: 0 > 2: bResult: 0, cbNeeded: 512, cReturned: 0 > !!! error > > During my testing, `cReturned` has always been zero whenever `EnumPrinters` fails. > > The crash dumps show that `cReturned` is non-zero but the `pPrinterEnum` buffer doesn't contain valid data. Reading `info4->pPrinterName` at the line > utf_str = JNU_NewStringPlatform(env, info4->pPrinterName); > raises Access Violation exception. > > **The fix:** > Check the return value of `EnumPrinters` and allow for 5 retries. If the function still returns failure, make sure `cReturned` is set to zero. > > I'm going to close [JDK-6996051](https://bugs.openjdk.java.net/browse/JDK-6996051) and [JDK-8182683](https://bugs.openjdk.java.net/browse/JDK-8182683) reported previously about the same crash as duplicate of the current [JDK-8262829](https://bugs.openjdk.java.net/browse/JDK-8262829). > > **Testing:** > I used [`RemotePrinterStatusRefresh.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java) for testing, it shows the list of currently available printers. In the background I ran `PrinterRename.ps1` PowerShell script which remains a printer, the script is attached to the JBS issue. > > Without the fix, the list of available printers was empty occasionally because `EnumPrinters` returned failure and set `cReturned` to zero. With the fix, the list of printers is always filled. I guess this is OK and yes we should have been checking this. Not sure we really got to the bottom of the real world problem because I'd expect the 2nd call just milliseconds after the first. But it could be that this happens during some system updates and we get one printer reconfigured message followed by another .. ------------- Marked as reviewed by prr (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2836 From serb at openjdk.java.net Fri Mar 5 01:30:52 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 5 Mar 2021 01:30:52 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() In-Reply-To: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> References: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> Message-ID: On Thu, 4 Mar 2021 21:37:33 GMT, Alexey Ivanov wrote: > **Root cause:** > `getPrinterNames()` has two calls to [`::EnumPrinters`](https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters). The first call is to get the required buffer size to contain the structures and any strings. The second call is to get the list of printers. > > Yet the list of printers or the names of printers can change between the two calls. If it happens, the second call to `EnumPrinters` fails but it is not checked. > > I couldn't reproduce the crash myself. However, I reproduced the failure in the second call to `::EnumPrinters` by adding `::Sleep(500)` and by renaming the printers so that the data doesn't fit into the allocated buffer: > > 1: bResult: 0, cbNeeded: 504, cReturned: 0 > 2: bResult: 0, cbNeeded: 512, cReturned: 0 > !!! error > > During my testing, `cReturned` has always been zero whenever `EnumPrinters` fails. > > The crash dumps show that `cReturned` is non-zero but the `pPrinterEnum` buffer doesn't contain valid data. Reading `info4->pPrinterName` at the line > utf_str = JNU_NewStringPlatform(env, info4->pPrinterName); > raises Access Violation exception. > > **The fix:** > Check the return value of `EnumPrinters` and allow for 5 retries. If the function still returns failure, make sure `cReturned` is set to zero. > > I'm going to close [JDK-6996051](https://bugs.openjdk.java.net/browse/JDK-6996051) and [JDK-8182683](https://bugs.openjdk.java.net/browse/JDK-8182683) reported previously about the same crash as duplicate of the current [JDK-8262829](https://bugs.openjdk.java.net/browse/JDK-8262829). > > **Testing:** > I used [`RemotePrinterStatusRefresh.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java) for testing, it shows the list of currently available printers. In the background I ran `PrinterRename.ps1` PowerShell script which remains a printer, the script is attached to the JBS issue. > > Without the fix, the list of available printers was empty occasionally because `EnumPrinters` returned failure and set `cReturned` to zero. With the fix, the list of printers is always filled. src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp line 136: > 134: > 135: try { > 136: ::EnumPrinters(flags, NULL, 4, NULL, Don't we need to check that this method call succeeds? Probably it is a crash reason when the EnumPrinters fails but we use cbNeeded anyway for array allocation? ------------- PR: https://git.openjdk.java.net/jdk/pull/2836 From serb at openjdk.java.net Fri Mar 5 01:36:43 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 5 Mar 2021 01:36:43 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows In-Reply-To: <3AXLyReWRtjcMeVZpQZAO2VNpJDbCfzQ5sTcArhcj1A=.fc9957b9-3928-4f2a-a291-26ef03e82659@github.com> References: <3AXLyReWRtjcMeVZpQZAO2VNpJDbCfzQ5sTcArhcj1A=.fc9957b9-3928-4f2a-a291-26ef03e82659@github.com> Message-ID: On Thu, 4 Mar 2021 19:38:34 GMT, Alexey Ivanov wrote: >> The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. >> >> Fix: >> Introduce a new flag to indicate DND operation between Java and native app. >> >> Testing: >> mach5 green > > Marked as reviewed by aivanov (Reviewer). Why we cannot reuse the old flag? "isInDoDragDropLoop"? I think the Robot.waitForIdle() will hang if isInDoDragDropLoop is not set to true while dragging something from the native app. ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From psadhukhan at openjdk.java.net Fri Mar 5 03:45:51 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 5 Mar 2021 03:45:51 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() In-Reply-To: References: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> Message-ID: On Fri, 5 Mar 2021 01:27:47 GMT, Sergey Bylokhov wrote: >> **Root cause:** >> `getPrinterNames()` has two calls to [`::EnumPrinters`](https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters). The first call is to get the required buffer size to contain the structures and any strings. The second call is to get the list of printers. >> >> Yet the list of printers or the names of printers can change between the two calls. If it happens, the second call to `EnumPrinters` fails but it is not checked. >> >> I couldn't reproduce the crash myself. However, I reproduced the failure in the second call to `::EnumPrinters` by adding `::Sleep(500)` and by renaming the printers so that the data doesn't fit into the allocated buffer: >> >> 1: bResult: 0, cbNeeded: 504, cReturned: 0 >> 2: bResult: 0, cbNeeded: 512, cReturned: 0 >> !!! error >> >> During my testing, `cReturned` has always been zero whenever `EnumPrinters` fails. >> >> The crash dumps show that `cReturned` is non-zero but the `pPrinterEnum` buffer doesn't contain valid data. Reading `info4->pPrinterName` at the line >> utf_str = JNU_NewStringPlatform(env, info4->pPrinterName); >> raises Access Violation exception. >> >> **The fix:** >> Check the return value of `EnumPrinters` and allow for 5 retries. If the function still returns failure, make sure `cReturned` is set to zero. >> >> I'm going to close [JDK-6996051](https://bugs.openjdk.java.net/browse/JDK-6996051) and [JDK-8182683](https://bugs.openjdk.java.net/browse/JDK-8182683) reported previously about the same crash as duplicate of the current [JDK-8262829](https://bugs.openjdk.java.net/browse/JDK-8262829). >> >> **Testing:** >> I used [`RemotePrinterStatusRefresh.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java) for testing, it shows the list of currently available printers. In the background I ran `PrinterRename.ps1` PowerShell script which remains a printer, the script is attached to the JBS issue. >> >> Without the fix, the list of available printers was empty occasionally because `EnumPrinters` returned failure and set `cReturned` to zero. With the fix, the list of printers is always filled. > > src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp line 136: > >> 134: >> 135: try { >> 136: ::EnumPrinters(flags, NULL, 4, NULL, > > Don't we need to check that this method call succeeds? Probably it is a crash reason when the EnumPrinters fails but we use cbNeeded anyway for array allocation? I guess since we are changing this method anyway, can we use PRINTER_ENUM_CONNECTIONS flag instead of hardcoded 4 so that it is more informative!! ------------- PR: https://git.openjdk.java.net/jdk/pull/2836 From psadhukhan at openjdk.java.net Fri Mar 5 03:51:47 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 5 Mar 2021 03:51:47 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() In-Reply-To: References: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> Message-ID: <0hcch0AQLe8r7klFBtxMgbGCymZgZs4I8XXi_htxEhg=.08f56689-263e-496f-9c16-60326ddc08f9@github.com> On Fri, 5 Mar 2021 03:42:29 GMT, Prasanta Sadhukhan wrote: >> src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp line 136: >> >>> 134: >>> 135: try { >>> 136: ::EnumPrinters(flags, NULL, 4, NULL, >> >> Don't we need to check that this method call succeeds? Probably it is a crash reason when the EnumPrinters fails but we use cbNeeded anyway for array allocation? > > I guess since we are changing this method anyway, can we use PRINTER_ENUM_CONNECTIONS flag instead of hardcoded 4 so that it is more informative!! ok, it is for flags and not for level. please ignore ------------- PR: https://git.openjdk.java.net/jdk/pull/2836 From itakiguchi at openjdk.java.net Fri Mar 5 07:02:50 2021 From: itakiguchi at openjdk.java.net (Ichiroh Takiguchi) Date: Fri, 5 Mar 2021 07:02:50 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows In-Reply-To: References: Message-ID: On Thu, 4 Mar 2021 10:36:56 GMT, Dmitry Markov wrote: > The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. > > Fix: > Introduce a new flag to indicate DND operation between Java and native app. > > Testing: > mach5 green @dmarkov20 I'd like to confirm this issue was not fixed by [JDK-8261231](https://bugs.openjdk.java.net/browse/JDK-8261231) #2448 ? ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From aivanov at openjdk.java.net Fri Mar 5 10:56:53 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 5 Mar 2021 10:56:53 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() In-Reply-To: <0hcch0AQLe8r7klFBtxMgbGCymZgZs4I8XXi_htxEhg=.08f56689-263e-496f-9c16-60326ddc08f9@github.com> References: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> <0hcch0AQLe8r7klFBtxMgbGCymZgZs4I8XXi_htxEhg=.08f56689-263e-496f-9c16-60326ddc08f9@github.com> Message-ID: On Fri, 5 Mar 2021 03:49:22 GMT, Prasanta Sadhukhan wrote: >> I guess since we are changing this method anyway, can we use PRINTER_ENUM_CONNECTIONS flag instead of hardcoded 4 so that it is more informative!! > > ok, it is for flags and not for level. please ignore > > > Don't we need to check that this method call succeeds? Probably it is a crash reason when the EnumPrinters fails but we use cbNeeded anyway for array allocation? `EnumPrinters` always returns failure here because zero-sized buffer is too small to contain any data. ------------- PR: https://git.openjdk.java.net/jdk/pull/2836 From aivanov at openjdk.java.net Fri Mar 5 11:14:39 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 5 Mar 2021 11:14:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() In-Reply-To: References: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> Message-ID: <7tAblZFGvqlEUVq6JiaAelhM-euv_OXcptNFMyEWU7w=.b133553b-79ea-4e1b-8570-2d083946cb77@github.com> On Thu, 4 Mar 2021 22:09:55 GMT, Phil Race wrote: > I guess this is OK and yes we should have been checking this. > Not sure we really got to the bottom of the real world problem because I'd expect the 2nd call just milliseconds after the first. But it could be that this happens during some system updates and we get one printer reconfigured message followed by another .. Most of the time, the crash happens when a client reconnects to their active session where a JVM is already running. On reconnect, the list of printers is synced with the local printers on the client. In such a scenario, other software could also update its list of printers as well as repaint its UI. If the system is under high load, it's not impossible to have a long enough pause between the calls. ------------- PR: https://git.openjdk.java.net/jdk/pull/2836 From github.com+4146708+a74nh at openjdk.java.net Fri Mar 5 11:14:49 2021 From: github.com+4146708+a74nh at openjdk.java.net (Alan Hayward) Date: Fri, 5 Mar 2021 11:14:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: <2vF8YcQ9CgnLxMus9tHTd4HmFITeH5wddBKzH-QNNEY=.dbfb2cd5-5997-4b79-88a5-d8292fc56965@github.com> Message-ID: On Thu, 4 Mar 2021 18:19:33 GMT, Vladimir Kempik wrote: > Hello > there is one issue with the info you provided, it's from Xcode12.5 beta. > And beta license agreement forbids sharing output of beta version of compiler&co > So we can't say we have issue with newer xcode beta until that beta went public & released. > Fixing issues you found now will mean someone have violated xcode beta license agreement and made these issues public. Ok, I wasn't aware of that. I'll downgrade back to the non-beta version. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From psadhukhan at openjdk.java.net Fri Mar 5 11:22:41 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 5 Mar 2021 11:22:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() In-Reply-To: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> References: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> Message-ID: On Thu, 4 Mar 2021 21:37:33 GMT, Alexey Ivanov wrote: > **Root cause:** > `getPrinterNames()` has two calls to [`::EnumPrinters`](https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters). The first call is to get the required buffer size to contain the structures and any strings. The second call is to get the list of printers. > > Yet the list of printers or the names of printers can change between the two calls. If it happens, the second call to `EnumPrinters` fails but it is not checked. > > I couldn't reproduce the crash myself. However, I reproduced the failure in the second call to `::EnumPrinters` by adding `::Sleep(500)` and by renaming the printers so that the data doesn't fit into the allocated buffer: > > 1: bResult: 0, cbNeeded: 504, cReturned: 0 > 2: bResult: 0, cbNeeded: 512, cReturned: 0 > !!! error > > During my testing, `cReturned` has always been zero whenever `EnumPrinters` fails. > > The crash dumps show that `cReturned` is non-zero but the `pPrinterEnum` buffer doesn't contain valid data. Reading `info4->pPrinterName` at the line > utf_str = JNU_NewStringPlatform(env, info4->pPrinterName); > raises Access Violation exception. > > **The fix:** > Check the return value of `EnumPrinters` and allow for 5 retries. If the function still returns failure, make sure `cReturned` is set to zero. > > I'm going to close [JDK-6996051](https://bugs.openjdk.java.net/browse/JDK-6996051) and [JDK-8182683](https://bugs.openjdk.java.net/browse/JDK-8182683) reported previously about the same crash as duplicate of the current [JDK-8262829](https://bugs.openjdk.java.net/browse/JDK-8262829). > > **Testing:** > I used [`RemotePrinterStatusRefresh.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java) for testing, it shows the list of currently available printers. In the background I ran `PrinterRename.ps1` PowerShell script which remains a printer, the script is attached to the JBS issue. > > Without the fix, the list of available printers was empty occasionally because `EnumPrinters` returned failure and set `cReturned` to zero. With the fix, the list of printers is always filled. Marked as reviewed by psadhukhan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2836 From dmarkov at openjdk.java.net Fri Mar 5 16:06:04 2021 From: dmarkov at openjdk.java.net (Dmitry Markov) Date: Fri, 5 Mar 2021 16:06:04 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v2] In-Reply-To: References: Message-ID: > The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. > > Fix: > Introduce a new flag to indicate DND operation between Java and native app. > > Testing: > mach5 green Dmitry Markov has updated the pull request incrementally with one additional commit since the last revision: reuse isInDoDragDropLoop ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2825/files - new: https://git.openjdk.java.net/jdk/pull/2825/files/6d7502a4..d9af9879 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2825&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2825&range=00-01 Stats: 11 lines in 3 files changed: 1 ins; 2 del; 8 mod Patch: https://git.openjdk.java.net/jdk/pull/2825.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2825/head:pull/2825 PR: https://git.openjdk.java.net/jdk/pull/2825 From dmarkov at openjdk.java.net Fri Mar 5 16:06:15 2021 From: dmarkov at openjdk.java.net (Dmitry Markov) Date: Fri, 5 Mar 2021 16:06:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v2] In-Reply-To: References: <3AXLyReWRtjcMeVZpQZAO2VNpJDbCfzQ5sTcArhcj1A=.fc9957b9-3928-4f2a-a291-26ef03e82659@github.com> Message-ID: On Fri, 5 Mar 2021 01:34:04 GMT, Sergey Bylokhov wrote: > Why we cannot reuse the old flag? "isInDoDragDropLoop"? I think the Robot.waitForIdle() will hang if isInDoDragDropLoop is not set to true while dragging something from the native app. Initially I didn?t want to touch that flag but after a closer look to ?isInDoDragDropLoop? I think it is OK to reuse the flag. I will update PR shortly. ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From dmarkov at openjdk.java.net Fri Mar 5 16:06:21 2021 From: dmarkov at openjdk.java.net (Dmitry Markov) Date: Fri, 5 Mar 2021 16:06:21 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v2] In-Reply-To: <0FK7NORAeG5R8F7Xv2OdslzNQE-hfozCyWM-KOE1NgU=.78b0f2b0-1a36-495a-9547-f1436d908c67@github.com> References: <3AXLyReWRtjcMeVZpQZAO2VNpJDbCfzQ5sTcArhcj1A=.fc9957b9-3928-4f2a-a291-26ef03e82659@github.com> <0FK7NORAeG5R8F7Xv2OdslzNQE-hfozCyWM-KOE1NgU=.78b0f2b0-1a36-495a-9547-f1436d908c67@github.com> Message-ID: On Fri, 5 Mar 2021 12:53:00 GMT, Dmitry Markov wrote: >>> Why we cannot reuse the old flag? "isInDoDragDropLoop"? I think the Robot.waitForIdle() will hang if isInDoDragDropLoop is not set to true while dragging something from the native app. >> >> Initially I didn?t want to touch that flag but after a closer look to ?isInDoDragDropLoop? I think it is OK to reuse the flag. I will update PR shortly. > >> @dmarkov20 >> I'd like to confirm this issue was not fixed by [JDK-8261231](https://bugs.openjdk.java.net/browse/JDK-8261231) #2448 ? > > That's right. This one and JDK-8261231 are two different issues. It is expected that the changes for JDK-8261231 do not fix this. I have update the fix: reuse isInDoDragDropLoop flag instead of introducing a new one. @mrserb @aivanov-jdk Could you take a look, please? ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From dmarkov at openjdk.java.net Fri Mar 5 16:06:15 2021 From: dmarkov at openjdk.java.net (Dmitry Markov) Date: Fri, 5 Mar 2021 16:06:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v2] In-Reply-To: References: <3AXLyReWRtjcMeVZpQZAO2VNpJDbCfzQ5sTcArhcj1A=.fc9957b9-3928-4f2a-a291-26ef03e82659@github.com> Message-ID: <0FK7NORAeG5R8F7Xv2OdslzNQE-hfozCyWM-KOE1NgU=.78b0f2b0-1a36-495a-9547-f1436d908c67@github.com> On Fri, 5 Mar 2021 12:51:15 GMT, Dmitry Markov wrote: >> Why we cannot reuse the old flag? "isInDoDragDropLoop"? I think the Robot.waitForIdle() will hang if isInDoDragDropLoop is not set to true while dragging something from the native app. > >> Why we cannot reuse the old flag? "isInDoDragDropLoop"? I think the Robot.waitForIdle() will hang if isInDoDragDropLoop is not set to true while dragging something from the native app. > > Initially I didn?t want to touch that flag but after a closer look to ?isInDoDragDropLoop? I think it is OK to reuse the flag. I will update PR shortly. > @dmarkov20 > I'd like to confirm this issue was not fixed by [JDK-8261231](https://bugs.openjdk.java.net/browse/JDK-8261231) #2448 ? That's right. This one and JDK-8261231 are two different issues. It is expected that the changes for JDK-8261231 do not fix this. ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From aivanov at openjdk.java.net Fri Mar 5 17:06:23 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 5 Mar 2021 17:06:23 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v2] In-Reply-To: References: Message-ID: On Fri, 5 Mar 2021 16:06:04 GMT, Dmitry Markov wrote: >> The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. >> >> Fix: >> Introduce a new flag to indicate DND operation between Java and native app. >> >> Testing: >> mach5 green > > Dmitry Markov has updated the pull request incrementally with one additional commit since the last revision: > > reuse isInDoDragDropLoop Marked as reviewed by aivanov (Reviewer). src/java.desktop/windows/native/libawt/windows/awt_DnDDT.cpp line 228: > 226: HRESULT __stdcall AwtDropTarget::DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) { > 227: TRY; > 228: AwtToolkit::GetInstance().isInDoDragDropLoop = TRUE; This is a new addition. Did you miss this function in previous iteration? ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From dmarkov at openjdk.java.net Fri Mar 5 17:21:37 2021 From: dmarkov at openjdk.java.net (Dmitry Markov) Date: Fri, 5 Mar 2021 17:21:37 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v2] In-Reply-To: References: Message-ID: On Fri, 5 Mar 2021 17:01:41 GMT, Alexey Ivanov wrote: >> Dmitry Markov has updated the pull request incrementally with one additional commit since the last revision: >> >> reuse isInDoDragDropLoop > > src/java.desktop/windows/native/libawt/windows/awt_DnDDT.cpp line 228: > >> 226: HRESULT __stdcall AwtDropTarget::DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) { >> 227: TRY; >> 228: AwtToolkit::GetInstance().isInDoDragDropLoop = TRUE; > > This is a new addition. Did you miss this function in previous iteration? Good catch! Actually that line is harmless but it is really unnecessary. I will update PR ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From dmarkov at openjdk.java.net Fri Mar 5 17:21:36 2021 From: dmarkov at openjdk.java.net (Dmitry Markov) Date: Fri, 5 Mar 2021 17:21:36 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v3] In-Reply-To: References: Message-ID: > The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. > > Fix: > Introduce a new flag to indicate DND operation between Java and native app. > > Testing: > mach5 green Dmitry Markov has updated the pull request incrementally with one additional commit since the last revision: Remove flag setting from DragOver ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2825/files - new: https://git.openjdk.java.net/jdk/pull/2825/files/d9af9879..dbc9dac7 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2825&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2825&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/2825.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2825/head:pull/2825 PR: https://git.openjdk.java.net/jdk/pull/2825 From rrich at openjdk.java.net Fri Mar 5 17:28:24 2021 From: rrich at openjdk.java.net (Richard Reingruber) Date: Fri, 5 Mar 2021 17:28:24 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: <2vF8YcQ9CgnLxMus9tHTd4HmFITeH5wddBKzH-QNNEY=.dbfb2cd5-5997-4b79-88a5-d8292fc56965@github.com> Message-ID: On Fri, 5 Mar 2021 11:11:44 GMT, Alan Hayward wrote: >>> I was building this PR on a new machine, and I now get the following error: >>> >>> > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:258:31: error: cast to smaller integer type 'MIDIClientRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] >>> > static MIDIClientRef client = (MIDIClientRef) NULL; >>> > ^~~~~~~~~~~~~~~~~~~~ >>> > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:259:29: error: cast to smaller integer type 'MIDIPortRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] >>> > static MIDIPortRef inPort = (MIDIPortRef) NULL; >>> > ^~~~~~~~~~~~~~~~~~ >>> > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:260:30: error: cast to smaller integer type 'MIDIPortRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] >>> > static MIDIPortRef outPort = (MIDIPortRef) NULL; >>> > ^~~~~~~~~~~~~~~~~~ >>> > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:466:32: error: cast to smaller integer type 'MIDIEndpointRef' (aka 'unsigned int') from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] >>> > MIDIEndpointRef endpoint = (MIDIEndpointRef) NULL; >>> > ^~~~~~~~~~~~~~~~~~~~~~ >>> > 4 errors generated. >>> >>> As far as I can tell the only difference between the two systems is the xcode version: >>> >>> New system (failing) >>> % xcodebuild -version >>> Xcode 12.5 >>> Build version 12E5244e >>> >>> Old system (working) >>> % xcodebuild -version >>> Xcode 12.4 >>> Build version 12D4e >>> >>> Looks like the newer version of Xcode is being a little stricter with casting? >>> Replacing the NULL with 0 seems to fix the issue. >> >> Hello >> there is one issue with the info you provided, it's from Xcode12.5 beta. >> And beta license agreement forbids sharing output of beta version of compiler&co >> So we can't say we have issue with newer xcode beta until that beta went public & released. >> Fixing issues you found now will mean someone have violated xcode beta license agreement and made these issues public. > >> Hello >> there is one issue with the info you provided, it's from Xcode12.5 beta. >> And beta license agreement forbids sharing output of beta version of compiler&co >> So we can't say we have issue with newer xcode beta until that beta went public & released. >> Fixing issues you found now will mean someone have violated xcode beta license agreement and made these issues public. > > Ok, I wasn't aware of that. I'll downgrade back to the non-beta version. Hi, @VladimirKempik reported failure of CompressedClassPointers.largeHeapAbove32GTest() with [JDK-8262895](https://bugs.openjdk.java.net/browse/JDK-8262895) on macos_aarch64. He also helped analyzing the issue (thanks!). Apparently the vm has difficulties mapping the heap of 31GB at one of the preferred addresses given in [`get_attach_addresses_for_disjoint_mode()`](https://github.com/openjdk/jdk/blob/8d3de4b1bdb5dc13bb7724596dc2123ba05bbb81/src/hotspot/share/memory/virtualspace.cpp#L477). This causes the test failure indirectly. IMO it could be worth the effort to find out why the heap cannot be mapped at the preferred addresses. Reviewers should decide on it. I wouldn't be able to do it myself though as I don't have access to a macos_aarch64 system. Alternatively I'd suggest to exlude macos_aarch64 from the subtest largeHeapAbove32GTest. Best regards, Richard. -- #### Details of the analysis In the following trace we see the vm trying to allocate the heap at addresses given in [`get_attach_addresses_for_disjoint_mode()`](https://github.com/openjdk/jdk/blob/8d3de4b1bdb5dc13bb7724596dc2123ba05bbb81/src/hotspot/share/memory/virtualspace.cpp#L477) without success: images/jdk/bin/java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx31g -XX:-UseAOT -Xlog:gc+metaspace=trace,cds=trace,heap+gc+exit=info,gc+heap+coops=trace -Xshare:off -XX:+VerifyBeforeGC -XX:HeapSearchSteps=40 -version OpenJDK 64-Bit Server VM warning: Shared spaces are not supported in this VM [0.005s][trace][gc,heap,coops] Trying to allocate at address 0x0000001000000000 heap of size 0x7c1000000 [0.005s][trace][gc,heap,coops] Trying to allocate at address 0x0000001800000000 heap of size 0x7c1000000 [0.005s][trace][gc,heap,coops] Trying to allocate at address 0x0000002000000000 heap of size 0x7c1000000 [0.005s][trace][gc,heap,coops] Trying to allocate at address 0x0000004000000000 heap of size 0x7c1000000 [0.005s][trace][gc,heap,coops] Trying to allocate at address 0x0000005000000000 heap of size 0x7c1000000 [0.005s][trace][gc,heap,coops] Trying to allocate at address 0x0008000000000000 heap of size 0x7c1000000 [0.005s][trace][gc,heap,coops] Trying to allocate at address 0x0010000000000000 heap of size 0x7c1000000 [0.006s][trace][gc,heap,coops] Trying to allocate at address 0x0018000000000000 heap of size 0x7c1000000 [0.006s][trace][gc,heap,coops] Trying to allocate at address 0x0020000000000000 heap of size 0x7c1000000 [0.006s][trace][gc,heap,coops] Trying to allocate at address 0x0080000000000000 heap of size 0x7c1000000 [0.006s][trace][gc,heap,coops] Trying to allocate at address 0x0100000000000000 heap of size 0x7c1000000 [0.006s][trace][gc,heap,coops] Trying to allocate at address 0x0110000000000000 heap of size 0x7c1000000 Finally it gives up and lets the os chose the address: [0.006s][trace][gc,heap,coops] Trying to allocate at address NULL heap of size 0x7c1000000 [0.006s][debug][gc,heap,coops] Protected page at the reserved heap base: 0x0000000280000000 / 16777216 bytes [0.006s][debug][gc,heap,coops] Heap address: 0x0000000281000000, size: 31744 MB, Compressed Oops mode: Non-zero based: 0x0000000280000000, Oop shift amount: 3 The os chooses to map the heap at 0x0000000281000000 that is at 10GB. This leaves not much room for a 4GB (*) aligned compressed class space below 32G for a zero based encoding. And indeed we get a compressed class space with an encoding base that is not zero and largeHeapAbove32GTest fails then [0.007s][info ][gc,metaspace ] Compressed class space mapped at: 0x0000007000000000-0x0000007040000000, reserved size: 1073741824 [0.007s][info ][gc,metaspace ] Narrow klass base: 0x0000007000000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 On macos 10.15 (x86_64) the vm succeeds first try mapping the heap at address 0x0000001000000000. (*) On aarch64 the encoding base has to be 4GB aligned. Unfortunately the 4GB alignment is enforced to strictly on the start address of the compressed class space instead of enforcing it on the encoding base. See [JDK-8258756](https://bugs.openjdk.java.net/browse/JDK-8258756) ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aivanov at openjdk.java.net Fri Mar 5 22:41:08 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 5 Mar 2021 22:41:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v3] In-Reply-To: References: Message-ID: On Fri, 5 Mar 2021 17:21:36 GMT, Dmitry Markov wrote: >> The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. >> >> Fix: >> Introduce a new flag to indicate DND operation between Java and native app. >> >> Testing: >> mach5 green > > Dmitry Markov has updated the pull request incrementally with one additional commit since the last revision: > > Remove flag setting from DragOver Marked as reviewed by aivanov (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From serb at openjdk.java.net Fri Mar 5 23:31:06 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 5 Mar 2021 23:31:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() In-Reply-To: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> References: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> Message-ID: <_I4AJrRT5_BNI9jtP8MTN0O5Kgw7P0DSV2Qd8cdgrMk=.502ac334-001d-4825-96d7-6ea8778a4753@github.com> On Thu, 4 Mar 2021 21:37:33 GMT, Alexey Ivanov wrote: > **Root cause:** > `getPrinterNames()` has two calls to [`::EnumPrinters`](https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters). The first call is to get the required buffer size to contain the structures and any strings. The second call is to get the list of printers. > > Yet the list of printers or the names of printers can change between the two calls. If it happens, the second call to `EnumPrinters` fails but it is not checked. > > I couldn't reproduce the crash myself. However, I reproduced the failure in the second call to `::EnumPrinters` by adding `::Sleep(500)` and by renaming the printers so that the data doesn't fit into the allocated buffer: > > 1: bResult: 0, cbNeeded: 504, cReturned: 0 > 2: bResult: 0, cbNeeded: 512, cReturned: 0 > !!! error > > During my testing, `cReturned` has always been zero whenever `EnumPrinters` fails. > > The crash dumps show that `cReturned` is non-zero but the `pPrinterEnum` buffer doesn't contain valid data. Reading `info4->pPrinterName` at the line > utf_str = JNU_NewStringPlatform(env, info4->pPrinterName); > raises Access Violation exception. > > **The fix:** > Check the return value of `EnumPrinters` and allow for 5 retries. If the function still returns failure, make sure `cReturned` is set to zero. > > I'm going to close [JDK-6996051](https://bugs.openjdk.java.net/browse/JDK-6996051) and [JDK-8182683](https://bugs.openjdk.java.net/browse/JDK-8182683) reported previously about the same crash as duplicate of the current [JDK-8262829](https://bugs.openjdk.java.net/browse/JDK-8262829). > > **Testing:** > I used [`RemotePrinterStatusRefresh.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java) for testing, it shows the list of currently available printers. In the background I ran `PrinterRename.ps1` PowerShell script which remains a printer, the script is attached to the JBS issue. > > Without the fix, the list of available printers was empty occasionally because `EnumPrinters` returned failure and set `cReturned` to zero. With the fix, the list of printers is always filled. Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2836 From serb at openjdk.java.net Fri Mar 5 23:33:07 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 5 Mar 2021 23:33:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v3] In-Reply-To: References: Message-ID: On Fri, 5 Mar 2021 17:21:36 GMT, Dmitry Markov wrote: >> The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. >> >> Fix: >> Introduce a new flag to indicate DND operation between Java and native app. >> >> Testing: >> mach5 green > > Dmitry Markov has updated the pull request incrementally with one additional commit since the last revision: > > Remove flag setting from DragOver Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From serb at openjdk.java.net Sat Mar 6 03:54:07 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 6 Mar 2021 03:54:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows In-Reply-To: References: Message-ID: On Fri, 26 Feb 2021 19:40:22 GMT, Alexander Scherbatiy wrote: > Printing text using GlyphVector outline has bad quality on printers with low DPI on Windows. > The GDI system used for text printing on Windows accepts only integer path coordinates. > Rounding GlyphVector outline coordinates leads to distorted printed text. > > The issue had been reported as JDK-8256264 but was reverted because of the regression JDK-8259007 "This test printed a blank page". > > The fix JDK-8256264 scaled coordinates in wPrinterJob.moveTo()/lineTo() methods up and scaled transforms in wPrinterJob.beginPath()/endPath() down. > > The regression was in the WPathGraphics.deviceDrawLine() method which uses wPrinterJob.moveTo()/lineTo() methods without surrounding them with wPrinterJob.beginPath()/endPath() so the line coordinates were only scaled up. > > I tried to put wPrinterJob.beginPath()/endPath() methods around wPrinterJob.moveTo()/lineTo() in the method WPathGraphics.deviceDrawLine() but the line was not drawn at all even without scaling coordinates up and transform down (without JDK-8256264 fix). It looks like GDI treats this case as an empty shape. > > The proposed fix applies path coordinates and transform scaling only in WPathGraphics.convertToWPath() method. > The one more PathPrecisionScaleFactorShapeTest.java manual test is added which checks that all methods that draw paths in WPathGraphics are used: line in WPathGraphics.deviceDrawLine() and SEG_LINETO/SEG_QUADTO/SEG_CUBICTO in WPathGraphics.convertToWPath() . > > The `java/awt/print` and `java/awt/PrintJob` automatic and manual tests were run on Windows 10 Pro with the fix. > > There are two failed automated tests which fail without the fix as well: > java/awt/print/PrinterJob/GlyphPositions.java > java/awt/print/PrinterJob/PSQuestionMark.java > > The following manual tests have issues on my system: > - `java/awt/print/Dialog/PrintDlgPageable.java` java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainThread cannot access a member of class PrintDlgPageable with modifiers "public static" > > - `java/awt/print/PrinterJob/PrintAttributeUpdateTest.java` I select pages radio button, press the print button but the test does not finish and I do not see any other dialogs with pass/fail buttons. > > - `java/awt/PrintJob/PrintCheckboxTest/PrintCheckboxManualTest.java` Tests that there is no ClassCastException thrown in printing checkbox and scrollbar with XAWT. Error. Can't find HTML file: test\jdk\java\awt\PrintJob\PrintCheckboxTest\PrintCheckboxManualTest.html > > > - `java/awt/print/PrinterJob/SecurityDialogTest.java` A windows with instructions is shown but it does not contain print/pass/fail buttons and it is not possible to close the window. > > - The tests below fail with "Error. Parse Exception: Arguments to `manual' option not supported: yesno" message: > java/awt/print/Dialog/DialogOrient.java > java/awt/print/Dialog/DialogType.java > java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java > java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java > java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java > java/awt/print/PrinterJob/PageDialogTest.java > java/awt/print/PrinterJob/PageRanges.java > java/awt/print/PrinterJob/PageRangesDlgTest.java > java/awt/print/PrinterJob/PrintGlyphVectorTest.java > java/awt/print/PrinterJob/PrintLatinCJKTest.java > java/awt/print/PrinterJob/PrintTextTest.java > java/awt/print/PrinterJob/SwingUIText.java > java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java > java/awt/PrintJob/PageSetupDlgBlockingTest/PageSetupDlgBlockingTest.java > java/awt/PrintJob/SaveDialogTitleTest.java I'll run the tests for this fix. ------------- PR: https://git.openjdk.java.net/jdk/pull/2756 From itakiguchi at openjdk.java.net Sat Mar 6 05:06:06 2021 From: itakiguchi at openjdk.java.net (Ichiroh Takiguchi) Date: Sat, 6 Mar 2021 05:06:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows In-Reply-To: References: Message-ID: On Thu, 4 Mar 2021 10:36:56 GMT, Dmitry Markov wrote: > The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. > > Fix: > Introduce a new flag to indicate DND operation between Java and native app. > > Testing: > mach5 green @dmarkov20 Sorry I'm not reviewer. It seems Copyright year is not changed. Is it OK ? ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From kizune at openjdk.java.net Sat Mar 6 05:11:06 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Sat, 6 Mar 2021 05:11:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v3] In-Reply-To: References: Message-ID: On Fri, 5 Mar 2021 17:21:36 GMT, Dmitry Markov wrote: >> The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. >> >> Fix: >> Introduce a new flag to indicate DND operation between Java and native app. >> >> Testing: >> mach5 green > > Dmitry Markov has updated the pull request incrementally with one additional commit since the last revision: > > Remove flag setting from DragOver Marked as reviewed by kizune (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From dmarkov at openjdk.java.net Sat Mar 6 09:25:17 2021 From: dmarkov at openjdk.java.net (Dmitry Markov) Date: Sat, 6 Mar 2021 09:25:17 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows In-Reply-To: References: Message-ID: On Thu, 4 Mar 2021 10:36:56 GMT, Dmitry Markov wrote: > The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. > > Fix: > Introduce a new flag to indicate DND operation between Java and native app. > > Testing: > mach5 green > @dmarkov20 > Sorry I'm not reviewer. > It seems Copyright year is not changed. Is it OK ? I have updated the copyright ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From dmarkov at openjdk.java.net Sat Mar 6 09:25:17 2021 From: dmarkov at openjdk.java.net (Dmitry Markov) Date: Sat, 6 Mar 2021 09:25:17 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v4] In-Reply-To: References: Message-ID: > The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. > > Fix: > Introduce a new flag to indicate DND operation between Java and native app. > > Testing: > mach5 green Dmitry Markov has updated the pull request incrementally with one additional commit since the last revision: Update copyright ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2825/files - new: https://git.openjdk.java.net/jdk/pull/2825/files/dbc9dac7..3810f1b0 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2825&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2825&range=02-03 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2825.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2825/head:pull/2825 PR: https://git.openjdk.java.net/jdk/pull/2825 From serb at openjdk.java.net Sat Mar 6 20:46:14 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 6 Mar 2021 20:46:14 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263051: Modernize the code in the java.awt.color package Message-ID: This is mostly the polish of the different methods in this package. Most changes are spacing and formatting, plus code simplification. No semantic changes, mach5 is green. ------------- Commit messages: - Unify theTagSignature vs tagSignature - Update ICC_Profile.java - Initial fix Changes: https://git.openjdk.java.net/jdk/pull/2855/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2855&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263051 Stats: 420 lines in 4 files changed: 9 ins; 255 del; 156 mod Patch: https://git.openjdk.java.net/jdk/pull/2855.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2855/head:pull/2855 PR: https://git.openjdk.java.net/jdk/pull/2855 From github.com+741251+turbanoff at openjdk.java.net Sun Mar 7 19:36:14 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Sun, 7 Mar 2021 19:36:14 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe Message-ID: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe ------------- Commit messages: - [PATCH] Thread-safe initialization of SunFontManager.platformFontMap - [PATCH] Thread-safe initialization of SunFontManager.platformFontMap Changes: https://git.openjdk.java.net/jdk/pull/2762/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2762&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263138 Stats: 7 lines in 1 file changed: 3 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/2762.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2762/head:pull/2762 PR: https://git.openjdk.java.net/jdk/pull/2762 From serb at openjdk.java.net Sun Mar 7 19:36:14 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sun, 7 Mar 2021 19:36:14 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: References: Message-ID: <2SZzwUvnnq3F2GQCzylYGwBEUXFlALggO67XbZVtiGU=.5c138090-51cd-4430-af0c-50c4c60ddf23@github.com> On Sat, 27 Feb 2021 18:33:52 GMT, Andrey Turbanov wrote: > 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe The bug: https://bugs.openjdk.java.net/browse/JDK-8263138 src/java.desktop/share/classes/sun/font/SunFontManager.java line 1452: > 1450: if (platformFontMap == null) { > 1451: platformFontMap = populateHardcodedFileNameMap(); > 1452: SunFontManager.platformFontMap = platformFontMap; I am not sure it is enough for "thread-safe initialization". The "platformFontMap" might not be null, but its content can be broken/incomplete at this point. ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From prr at openjdk.java.net Sun Mar 7 19:36:14 2021 From: prr at openjdk.java.net (Phil Race) Date: Sun, 7 Mar 2021 19:36:14 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: <2SZzwUvnnq3F2GQCzylYGwBEUXFlALggO67XbZVtiGU=.5c138090-51cd-4430-af0c-50c4c60ddf23@github.com> References: <2SZzwUvnnq3F2GQCzylYGwBEUXFlALggO67XbZVtiGU=.5c138090-51cd-4430-af0c-50c4c60ddf23@github.com> Message-ID: On Sun, 7 Mar 2021 03:32:01 GMT, Sergey Bylokhov wrote: >> 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe > > The bug: https://bugs.openjdk.java.net/browse/JDK-8263138 I don't know why making this volatile is doing anything. Let's discuss this further. ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From github.com+7806504+liach at openjdk.java.net Sun Mar 7 19:36:15 2021 From: github.com+7806504+liach at openjdk.java.net (liach) Date: Sun, 7 Mar 2021 19:36:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: <2SZzwUvnnq3F2GQCzylYGwBEUXFlALggO67XbZVtiGU=.5c138090-51cd-4430-af0c-50c4c60ddf23@github.com> References: <2SZzwUvnnq3F2GQCzylYGwBEUXFlALggO67XbZVtiGU=.5c138090-51cd-4430-af0c-50c4c60ddf23@github.com> Message-ID: On Sat, 27 Feb 2021 22:30:18 GMT, Sergey Bylokhov wrote: >> 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe > > src/java.desktop/share/classes/sun/font/SunFontManager.java line 1452: > >> 1450: if (platformFontMap == null) { >> 1451: platformFontMap = populateHardcodedFileNameMap(); >> 1452: SunFontManager.platformFontMap = platformFontMap; > > I am not sure it is enough for "thread-safe initialization". The "platformFontMap" might not be null, but its content can be broken/incomplete at this point. https://github.com/openjdk/jdk/pull/2691#issuecomment-784367127 In short, previously platformFontMap references were field set/gets and may be inconsistent due to concurrency. It is now moved to a local variable; also the map modifications have been moved to fields to avoid concurrency issues with hash map as far as I can see. ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From serb at openjdk.java.net Sun Mar 7 19:36:15 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sun, 7 Mar 2021 19:36:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: References: <2SZzwUvnnq3F2GQCzylYGwBEUXFlALggO67XbZVtiGU=.5c138090-51cd-4430-af0c-50c4c60ddf23@github.com> Message-ID: On Sun, 28 Feb 2021 03:50:13 GMT, liach wrote: >> src/java.desktop/share/classes/sun/font/SunFontManager.java line 1452: >> >>> 1450: if (platformFontMap == null) { >>> 1451: platformFontMap = populateHardcodedFileNameMap(); >>> 1452: SunFontManager.platformFontMap = platformFontMap; >> >> I am not sure it is enough for "thread-safe initialization". The "platformFontMap" might not be null, but its content can be broken/incomplete at this point. > > https://github.com/openjdk/jdk/pull/2691#issuecomment-784367127 > > In short, previously platformFontMap references were field set/gets and may be inconsistent due to concurrency. It is now moved to a local variable; also the map modifications have been moved to fields to avoid concurrency issues with hash map as far as I can see. One thread may create the local platformFontMap, then set the static SunFontManager.platformFontMap field, and then initialize the platformFontMap or mix these operations. The second thread may see non-null SunFontManager.platformFontMap which is not still initialized. ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From github.com+741251+turbanoff at openjdk.java.net Sun Mar 7 19:36:16 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Sun, 7 Mar 2021 19:36:16 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: References: <2SZzwUvnnq3F2GQCzylYGwBEUXFlALggO67XbZVtiGU=.5c138090-51cd-4430-af0c-50c4c60ddf23@github.com> Message-ID: On Sun, 28 Feb 2021 04:56:07 GMT, Sergey Bylokhov wrote: >> https://github.com/openjdk/jdk/pull/2691#issuecomment-784367127 >> >> In short, previously platformFontMap references were field set/gets and may be inconsistent due to concurrency. It is now moved to a local variable; also the map modifications have been moved to fields to avoid concurrency issues with hash map as far as I can see. > > One thread may create the local platformFontMap, then set the static SunFontManager.platformFontMap field, and then initialize the platformFontMap or mix these operations. The second thread may see non-null SunFontManager.platformFontMap which is not still initialized. Made `volatile` to guarantee memory visibility if thread saw non-null value. ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From serb at openjdk.java.net Sun Mar 7 19:36:16 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sun, 7 Mar 2021 19:36:16 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: References: <2SZzwUvnnq3F2GQCzylYGwBEUXFlALggO67XbZVtiGU=.5c138090-51cd-4430-af0c-50c4c60ddf23@github.com> Message-ID: On Sun, 28 Feb 2021 08:47:22 GMT, Andrey Turbanov wrote: >> One thread may create the local platformFontMap, then set the static SunFontManager.platformFontMap field, and then initialize the platformFontMap or mix these operations. The second thread may see non-null SunFontManager.platformFontMap which is not still initialized. > > Made `volatile` to guarantee memory visibility if thread saw non-null value. I don't have any other questions, will file a bug and run the tests. ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From serb at openjdk.java.net Sun Mar 7 23:07:40 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sun, 7 Mar 2021 23:07:40 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: Message-ID: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> On Mon, 1 Mar 2021 11:17:39 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 36 additional commits since the last revision: > > - Lanai PR#206 - 8262729 - aghaisas > - Lanai PR#205 - 8262496 - avu > - Lanai PR#203 - 8262313 - jdv > - Lanai PR#202 - 8262293 - avu > - Lanai PR#201 - 8261891 - avu > - Lanai PR#200 - 8262115 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#199 - 8262091 - aghaisas > - Lanai PR#198 - 8261646 - avu > - Lanai PR#197 - 8261960 - jdv > - ... and 26 more: https://git.openjdk.java.net/jdk/compare/49503c0d...5cb1fd91 src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java line 81: > 79: // Try falling back to OpenGL pipeline > 80: if (MacOSFlags.isMetalVerbose()) { > 81: System.out.println("Metal rendering pipeline initialization failed. Using OpenGL rendering pipeline."); Please split the long lines, here and there. Most of these files use 80 chars per line. src/java.desktop/macosx/classes/sun/java2d/metal/MTLBlitLoops.java line 499: > 497: } > 498: > 499: // We can convert argb_pre data from MTL surface in two places: Does anybody check that this is true for the metal pipeline? or It is just copied from the OGL? src/java.desktop/macosx/classes/sun/java2d/metal/MTLContext.java line 58: > 56: * Makes the given GraphicsConfig's context current to its associated > 57: * "scratch surface". Each GraphicsConfig maintains a native context > 58: * (MTLDevice) as well as a native pbuffer "pbuffer"? src/java.desktop/macosx/classes/sun/java2d/metal/MTLContext.java line 68: > 66: * when disposing a texture-based surface). > 67: */ > 68: public static void setScratchSurface(long pConfigInfo) { How the scratch surface is used in the metal pipeline? Why it is not enough to set the "context current"? src/java.desktop/macosx/classes/sun/java2d/metal/MTLGraphicsConfig.java line 168: > 166: } > 167: > 168: ContextCapabilities caps = new MTLContext.MTLContextCaps( CAPS_DOUBLEBUFFERED is not included? src/java.desktop/macosx/classes/sun/java2d/metal/MTLContext.java line 140: > 138: StringBuilder sb = new StringBuilder(super.toString()); > 139: if ((caps & CAPS_DOUBLEBUFFERED) != 0) { > 140: sb.append("CAPS_DOUBLEBUFFERED|"); Related to other questions, we do not include CAPS_DOUBLEBUFFERED, but anyway, report the surface as double buffered. src/java.desktop/macosx/classes/sun/java2d/metal/MTLLayer.java line 44: > 42: > 43: // Pass the insets to native code to make adjustments in blitTexture > 44: private static native void nativeSetInsets(long layerPtr, int top, int left); Probably I have asked this already, but why we need to use insets? Why insets is not necessary for ogl? src/java.desktop/macosx/classes/sun/java2d/metal/MTLRenderer.java line 25: > 23: * questions. > 24: */ > 25: package sun.java2d.metal; Looks like other files use blank line befor "package". src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 146: > 144: return MTLSurfaceRTT; > 145: default: > 146: return MTLSurface; Do we really support 3 different types of surface? I guess only two of them are different: textures used for manageable images, and surfaces used by the volatile image. src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 194: > 192: * Creates a SurfaceData object representing an off-screen buffer > 193: */ > 194: public static MTLOffScreenSurfaceData createData(MTLGraphicsConfig gc, Something wrong in the formatting. src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 221: > 219: protected native boolean initRTexture(long pData, boolean isOpaque, int width, int height); > 220: > 221: protected native boolean initFlipBackbuffer(long pData); flip back buffer is supported? src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java line 304: > 302: }; > 303: } > 304: public MTLLayer createMTLLayer() { TODO to test that this functionality works src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m line 36: > 34: #include "GraphicsPrimitiveMgr.h" > 35: > 36: #include // malloc malloc is unused in this file? src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m line 676: > 674: height = srcInfo.bounds.y2 - srcInfo.bounds.y1; > 675: > 676: pDst = PtrAddBytes(pDst, dstx * dstInfo.pixelStride); Here and in other places use the PtrPixelsRow instead, do not use multiplication, see the history of the OGLBlitLoops_SurfaceToSwBlit method. src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceData.m line 284: > 282: */ > 283: jboolean > 284: MTLSD_InitMTLWindow(JNIEnv *env, BMTLSDOps *bmtlsdo) When the MTLWindow is used? src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceData.m line 316: > 314: > 315: void > 316: MTLSD_SwapBuffers(JNIEnv *env, jlong pPeerData) Copied from OGL and can be removed? src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceDataBase.h line 109: > 107: #define MTLSD_TEXTURE sun_java2d_pipe_hw_AccelSurface_TEXTURE > 108: #define MTLSD_FLIP_BACKBUFFER sun_java2d_pipe_hw_AccelSurface_FLIP_BACKBUFFER > 109: #define MTLSD_RT_TEXTURE sun_java2d_pipe_hw_AccelSurface_RT_TEXTURE Only two of them are supported? MTLSD_TEXTURE and MTLSD_RT_TEXTURE? ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Sun Mar 7 23:07:18 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sun, 7 Mar 2021 23:07:18 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: <8YBuOeDAPN2osBnW5cyN-91hYtg7malBqDlJZsgWrPk=.6c99ab50-76a8-4686-85dd-5918abfdacf0@github.com> References: <8YBuOeDAPN2osBnW5cyN-91hYtg7malBqDlJZsgWrPk=.6c99ab50-76a8-4686-85dd-5918abfdacf0@github.com> Message-ID: On Fri, 5 Feb 2021 22:00:54 GMT, Kevin Rushforth wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 36 additional commits since the last revision: >> >> - Lanai PR#206 - 8262729 - aghaisas >> - Lanai PR#205 - 8262496 - avu >> - Lanai PR#203 - 8262313 - jdv >> - Lanai PR#202 - 8262293 - avu >> - Lanai PR#201 - 8261891 - avu >> - Lanai PR#200 - 8262115 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#199 - 8262091 - aghaisas >> - Lanai PR#198 - 8261646 - avu >> - Lanai PR#197 - 8261960 - jdv >> - ... and 26 more: https://git.openjdk.java.net/jdk/compare/f34bb8ed...5cb1fd91 > > src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLGraphicsConfig.m line 82: > >> 80: (JNIEnv *env, jclass mtlgc) >> 81: { >> 82: FILE *f = popen("/usr/sbin/system_profiler SPDisplaysDataType", "r"); > > How robust is this? It seems like the contents of this could be an implementation detail and subject to change. Is it documented by Apple? I suggest fixing this before the integration. > test/jdk/performance/client/RenderPerfTest/Makefile line 10: > >> 8: # - Redistributions of source code must retain the above copyright >> 9: # notice, this list of conditions and the following disclaimer. >> 10: # > > As mentioned in the preliminary review, this file and `build.xml` have a BSD copyright. I think that should be GPLv2 (without classpath exception since this is a test). Probably place it near J2Dbench? ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From Sergey.Bylokhov at oracle.com Mon Mar 8 04:59:58 2021 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Sun, 7 Mar 2021 20:59:58 -0800 Subject: [OpenJDK 2D-Dev] Rendering images from PDF files slower in OpenJDK In-Reply-To: References: <873cc9de-604f-8b11-a5ba-fcccf4337e81@oracle.com> <5BB68521.7040708@oracle.com> <5BB69B8A.3040106@oracle.com> <5BB6F64F.2080303@oracle.com> <5BB6FF4A.3090105@oracle.com> Message-ID: <6b7208d7-a528-882e-8f5a-920539c2b8ae@oracle.com> Hi, Laurent. On 04.10.2018 23:45, Laurent Bourg?s wrote: > I looks like a call to let me have a look. Maybe I could inspect what makes LCMS slow (lerp?) ... and optimize the C code or at least tune gcc options. Did you have a chance to look at it? =) > I would not make MT in lcms as it can affect MT in java. > Maybe PDFImage could convert tiles instead of the all image ? > > Anyway I will publish my lknux perf report showing time spent in kcms / lcms asap. > > PS: I tested OpenJDK8 and perf is on par with OpenJDK9. > > Laurent > > > > On 10/4/18, 10:47 PM, Daniel Persson wrote: >> Hi Phil. >> >> Well it seems like you've been in this discussion before >> >> https://bugs.openjdk.java.net/browse/JDK-8041125 >> >> Wasn't aware that PDFBox PDF2Image used the Kcms Provider per default. >> You may close this issue as we have figured out the reason. >> >> Best regards >> Daniel >> >> On Fri, Oct 5, 2018 at 7:27 AM Philip Race > wrote: >> >> >> >> On 10/4/18, 10:22 PM, Daniel Persson wrote: >>> Hi Laurent >>> >>> Well that seems like a reasonable assumption. >>> >>> https://github.com/kalaspuffar/ColorConvTest/blob/master/KCMSTest.md >>> >>> The test with a "blank" image has a 1 seconds difference. >>> >>> And the test with an image from the PDF in question have a 52 seconds difference. >> >> I tried playing with different image data but I didn't see a sensitivity to that. >> Maybe I needed to try something more complex. >>> >>> So why don't OpenJDK 9 and forward have KcmsServiceProvider bundled? >>> Does this provider make a worse result on the image? >>> >> It is not open source. It cannot be part of OpenJDK. Ever. >> And see my other email for the other reasons. >> So there is no quick or easy solution. >> >> FWIW the #1 reason I left KCMS in Oracle 8 and even 9 was because of the MT performance >> issue, but as we now converge Oracle JDK & OpenJDK that was a non-starter and it was >> removed along with other closed source components. >> >> -phil. >> >>> Best regards >>> Daniel >>> >>> >>> >>> >>> On Fri, Oct 5, 2018 at 6:55 AM Laurent Bourg?s > wrote: >>> >>> Phil, >>> I just gg a bit and got the PDFImage source: >>> >>> public static void main( String[] args ) throws IOException >>> 79 ? ? { >>> 80 try >>> 81 { >>> 82 ? ? // force KCMS (faster than LCMS) if available >>> 83 Class.forName("sun.java2d.cmm.kcms.KcmsServiceProvider"); >>> 84 ? ? System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider"); >>> 85 } >>> 86 catch (ClassNotFoundException e) >>> 87 { >>> 88 ? ? LOG.debug("KCMS service not found - using LCMS", e); >>> 89 } >>> 90 >>> >>> https://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/PDFToImage.java?revision=1829374&view=markup >>> >>> That's all folks ! >>> >>> Le ven. 5 oct. 2018 ? 01:00, Philip Race > a ?crit?: >>> >>> Yep. LCMS is the default in 8u. >>> >>> And although KCMS is a lot faster? on my CConv test ... >>> >>> ~/jdk8u181/bin/java CConv >>> 13289 >>> >>> ?~/jdk8u181/bin/java -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider CConv >>> 5131 >>> >>> >>> It makes no difference on the pdf conversion : >>> >>> ~/jdk8u181/bin/java -jar pdfbox-app-2.0.11.jar PDFToImage? -time test.pdf Rendered 1 page in 4985ms >>> >>> ~/jdk8u181/bin/java -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -jar pdfbox-app-2.0.11.jar PDFToImage? -time test.pdf >>> Rendered 1 page in 4723ms >>> >>> >>> Note: KCMS maybe faster on CConv but it has no support for modern ICC profiles >>> and I haven't checked if it is even applying the pdfbox one properly. >>> But it does have support to split a job into concurrent tasks for sub-images >>> which can help on the larger images like the one I am using in CConv. >>> >>> -phil. >>> >>> On 10/4/18, 2:24 PM, Philip Race wrote: >>>> I might be losing it, but I am 99% sure that LCMS is the color conversion engine in 8. >>>> KCMS was there only for backup. You'd have to know the magic flag to get it and >>>> no one has said anything to the effect that they are using it. >>>> >>>> -phil. >>>> >>>> On 10/4/18, 11:33 AM, Laurent Bourg?s wrote: >>>>> Phil, >>>>> I wondered if ang RenderingHint defaults changed since 8... >>>>> >>>>> Moreover I started playing with linux perf + jit agent and it is easy than before wigh oprofile + jvmtiagent. >>>>> >>>>> I noticed that OracleJDK8 uses KCMS and OpenJDK11 uses LCMS for color conversion as does OpenJDK8, that could explain the performance gap. >>>>> >>>>> Finally PDFImage test is run only once so the overhead may come from warmup (jit, g1)... >>>>> >>>>> More later, >>>>> Laurent >>>>> >>>>> Le jeu. 4 oct. 2018 ? 20:03, Phil Race > a ?crit?: >>>>> >>>>> >>>>> >>>>> On 10/03/2018 11:58 PM, Laurent Bourg?s wrote: >>>>>> Hi, >>>>>> I will get the code and add debugging logs: env & system properties and java2d RenderingHints. >>>>> >>>>> The code in pdfbox passes null for the hints. So there should be no difference attributable to that. >>>>> >>>>> -phil. >>>>>> >>>>>> I suspect these hints are different or have a noticiable impact: color interpolation & rendering quality. >>>>>> >>>>>> I suppose the backend corresponds to software loops but some 2d operations can be accelerated ? >>>>>> >>>>>> Anyway I will push any change in the code. >>>>>> >>>>>> PS: I can run linux perf to profile both java & native code.... >>>>>> >>>>>> Cheers, >>>>>> Laurent >>>>>> >>>>>> Le jeu. 4 oct. 2018 ? 07:50, Daniel Persson > a ?crit?: >>>>>> >>>>>> Hi Philip and Laurent. >>>>>> >>>>>> I've talked with Tilman and Andreas from the PDFBox team and they see similar connections to the ColorConvertOp filter but wanted to try with one of the images of the PDF as a raster. >>>>>> >>>>>> As we try different things I thought it good for collaboration to create a repository with the code so all can contribute. >>>>>> >>>>>> https://github.com/kalaspuffar/ColorConvTest >>>>>> >>>>>> I've run the 3 different tests on my Machine (Thinkpad P51s) with custom Gentoo installed, if important to the conversation. >>>>>> >>>>>> I tried to invite you all as collaborators to this repository if you think this is a bad Idea let me know. >>>>>> >>>>>> Best?regards >>>>>> Daniel >>>>>> >>>>>> On Wed, Oct 3, 2018 at 7:51 PM Laurent Bourg?s > wrote: >>>>>> >>>>>> Very good job, phil. >>>>>> >>>>>> I will try your CCONV test on my linux machine to see if it is platform dependent ... or hw ? >>>>>> >>>>>> Laurent >>>>>> >>>>>> Le mer. 3 oct. 2018 ? 19:19, Philip Race > a ?crit?: >>>>>> >>>>>> >>>>>> >>>>>> On 10/3/18, 1:15 AM, Laurent Bourg?s wrote: >>>>>>> Phil, >>>>>>> >>>>>>> If you look at the given pdf file, it has large images that exceed 2k so such ones may be more costly to convert. >>>>>> >>>>>> FWIW the one I profiled was by far the largest at 2577x1540. >>>>>> The rest are more like 100x100, 200x200 or 500x500 - all approximations. >>>>>>> >>>>>>> As jpeg decoder in openjdk11 is different than oraclejdk8, it may cause more ColorConvertOp filter operations ... if color profiles are different. >>>>>> >>>>>> That doesn't seem likely and in fact since I? instrumented ColorConvertOp in 8 & 11,? I know exactly how many times it was invoked >>>>>> by pdfbox, (11 times in both cases) and that all the image data is the same. SRC and DEST are the same types etc. >>>>>> >>>>>> Also the version of LCMS is the same in 8 and 11 (v2.9). >>>>>> >>>>>> -phil >>>>>>> >>>>>>> Anyway this performance is not related to Marlin renderer, so I can not help much except in its diagnostic. >>>>>>> >>>>>>> Cheers, >>>>>>> Laurent >>>>>>> >>>>>>> Le mar. 2 oct. 2018 ? 23:35, Philip Race > a ?crit?: >>>>>>> >>>>>>> I've spent some time examining what pdfbox is passing to ColorConvertOp >>>>>>> It is called about 10 or 11 times in this test with images typically 1-2K in each dimension. >>>>>>> The input image is a Custom BufferedImage which uses an ICC_ColorSpace constructed >>>>>>> from a color profile file that is embedded in pdfbox which is an open source equivalent >>>>>>> of what Acrobat uses. It has a 4 component raster and is opaque >>>>>>> >>>>>>> This is filtered into a 3 component standard INT_RGB ColorModel. >>>>>>> >>>>>>> I've distilled this down into a small program which has an copy of the method >>>>>>> that is defined in pdfbox and is invoking the supposedly slow ColorConvertOp. >>>>>>> >>>>>>> So I believe this is all exactly what is happening in pdfbox. >>>>>>> >>>>>>> What I find is that it is actually much faster on JDK11 than JDK 8. >>>>>>> >>>>>>> prrubuntu:~$ ~/jdk-11/bin/java CConv >>>>>>> 4881 >>>>>>> prrubuntu:~$ ~/jdk8u181/bin/java CConv >>>>>>> 12529 >>>>>>> >>>>>>> >>>>>>> I can't say why that would be but the results are clear. >>>>>>> So I am left to suppose that pdfbox really is doing something different in 8 vs 11. >>>>>>> Or that this not the real problem. What do others see ? >>>>>>> >>>>>>> I've attached the program. The 1Mb color profile file can be got from the pdfbox sources. >>>>>>> >>>>>>> -phil. >>>>>>> >>>>>>> >>>>>>> On 10/2/18, 9:35 AM, Laurent Bourg?s wrote: >>>>>>>> Hi Daniel, >>>>>>>> >>>>>>>> >>>>>>>> Let's not compare apples and oranges. What I can see it takes the same route and behave?similarly. >>>>>>>> >>>>>>>> >>>>>>>> ?I agree, I did not take enough time to get accurate profiles, sorry. >>>>>>>> >>>>>>>> >>>>>>>> If you look at >>>>>>>> http://uhash.com/java_reg/Call_Tree_java_8.html >>>>>>>> http://uhash.com/java_reg/Call_Tree_java_11.html >>>>>>>> >>>>>>>> You can see that ConvertOp.filter takes 1.5s longer on Java 11. >>>>>>>> >>>>>>>> >>>>>>>> I confirm: 1.8s vs 300ms. >>>>>>>> >>>>>>>> Philip, do you know what could have change in this 2d area ? >>>>>>>> >>>>>>>> I imagine ColorConvertOp delegates to native code so color profile (ICC) or hidpi support may have an impact here (or just compiler options may be different) ... >>>>>>>> >>>>>>>> If needed, I could profile native code using oprofile / perf. >>>>>>>> >>>>>>>> Laurent >>>>>>> >>>>> -- Best regards, Sergey. From aghaisas at openjdk.java.net Mon Mar 8 08:06:03 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Mon, 8 Mar 2021 08:06:03 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v11] In-Reply-To: References: Message-ID: <3XzbfpM41bmyAd3DCXAqrSEJaFlA5-CCd9PUO5fKpD8=.88284596-8b8d-48eb-bf69-6ef5c3f55037@github.com> > **Description :** > This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) > It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. > The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) > > We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ > > A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. > > **Testing :** > This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) > > **Note to reviewers :** > 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. > > 2) To apply and test this PR - > To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) > > 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 41 additional commits since the last revision: - Lanai PR#210 - 8263159 - jdv - Lanai PR#209 - 8262936 - jdv - Lanai PR#208 - 8262928 - jdv - Lanai PR#207 - 8262750 - jdv - Merge branch 'master' into 8260931_lanai_JEP_branch - Lanai PR#206 - 8262729 - aghaisas - Lanai PR#205 - 8262496 - avu - Lanai PR#203 - 8262313 - jdv - Lanai PR#202 - 8262293 - avu - Lanai PR#201 - 8261891 - avu - ... and 31 more: https://git.openjdk.java.net/jdk/compare/582d72a8...de456939 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2403/files - new: https://git.openjdk.java.net/jdk/pull/2403/files/5cb1fd91..de456939 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2403&range=10 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2403&range=09-10 Stats: 8128 lines in 291 files changed: 5147 ins; 1823 del; 1158 mod Patch: https://git.openjdk.java.net/jdk/pull/2403.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2403/head:pull/2403 PR: https://git.openjdk.java.net/jdk/pull/2403 From azvegint at openjdk.java.net Mon Mar 8 13:14:06 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Mon, 8 Mar 2021 13:14:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263051: Modernize the code in the java.awt.color package In-Reply-To: References: Message-ID: <8XzFmI1kMxV_QwfYYiEa6pDqz6Ovb68K7ZPd4Sqsogw=.b8cc005e-93df-4f25-b396-5b95ae8ffc40@github.com> On Sat, 6 Mar 2021 03:26:07 GMT, Sergey Bylokhov wrote: > This is mostly the polish of the different methods in this package. > > Most changes are spacing and formatting, plus code simplification. No semantic changes, mach5 is green. Marked as reviewed by azvegint (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2855 From kizune at openjdk.java.net Mon Mar 8 13:27:28 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Mon, 8 Mar 2021 13:27:28 GMT Subject: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons In-Reply-To: References: Message-ID: On Mon, 8 Mar 2021 13:22:07 GMT, Alexander Zuev wrote: > Fix updated after first round of review. Continuation of review at https://github.com/openjdk/jdk/pull/380 ------------- PR: https://git.openjdk.java.net/jdk/pull/2875 From kizune at openjdk.java.net Mon Mar 8 13:27:28 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Mon, 8 Mar 2021 13:27:28 GMT Subject: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons Message-ID: Fix updated after first round of review. ------------- Commit messages: - 8182043: Access to Windows Large Icons Changes: https://git.openjdk.java.net/jdk/pull/2875/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2875&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8182043 Stats: 335 lines in 6 files changed: 270 ins; 29 del; 36 mod Patch: https://git.openjdk.java.net/jdk/pull/2875.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2875/head:pull/2875 PR: https://git.openjdk.java.net/jdk/pull/2875 From dmarkov at openjdk.java.net Mon Mar 8 16:43:07 2021 From: dmarkov at openjdk.java.net (Dmitry Markov) Date: Mon, 8 Mar 2021 16:43:07 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8262446: DragAndDrop hangs on Windows In-Reply-To: References: Message-ID: On Thu, 4 Mar 2021 10:36:56 GMT, Dmitry Markov wrote: > The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That?s the root cause of the hang. > > Fix: > Introduce a new flag to indicate DND operation between Java and native app. > > Testing: > mach5 green This pull request has now been integrated. Changeset: bf9b74d1 Author: Dmitry Markov URL: https://git.openjdk.java.net/jdk/commit/bf9b74d1 Stats: 8 lines in 1 file changed: 7 ins; 0 del; 1 mod 8262446: DragAndDrop hangs on Windows Reviewed-by: aivanov, serb, kizune ------------- PR: https://git.openjdk.java.net/jdk/pull/2825 From github.com+741251+turbanoff at openjdk.java.net Tue Mar 9 01:40:07 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Tue, 9 Mar 2021 01:40:07 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8262161: Refactor manual I/O stream copying in java.desktop to use new convenience APIs In-Reply-To: References: Message-ID: <-jLk_NzWGP-TyHwzQnXyexoqtktQBH3wUO52Fx6XlHc=.9c023cb6-db0f-429c-abbd-d565db439826@github.com> On Mon, 21 Dec 2020 07:54:17 GMT, Andrey Turbanov wrote: > Cleanup code to use new handy methods in `java.io.InputStream`/`java.nio.file.Files` instead of manual stream copy: > 1. java.io.InputStream#readAllBytes > 2. java.io.InputStream#transferTo > 3. java.nio.file.Files#copy This pull request has now been integrated. Changeset: 39b11138 Author: Andrey Turbanov Committer: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/39b11138 Stats: 134 lines in 11 files changed: 3 ins; 102 del; 29 mod 8262161: Refactor manual I/O stream copying in java.desktop to use new convenience APIs Reviewed-by: serb, prr ------------- PR: https://git.openjdk.java.net/jdk/pull/1856 From serb at openjdk.java.net Tue Mar 9 06:14:07 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 9 Mar 2021 06:14:07 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263051: Modernize the code in the java.awt.color package In-Reply-To: References: Message-ID: <8RtC5E5PKR3yXNL_HGeua6483YxtQFdMeT_zYvtSdHA=.48c5342a-05f8-435a-8f66-bd5b6708ad4a@github.com> On Sat, 6 Mar 2021 03:26:07 GMT, Sergey Bylokhov wrote: > This is mostly the polish of the different methods in this package. > > Most changes are spacing and formatting, plus code simplification. No semantic changes, mach5 is green. This pull request has now been integrated. Changeset: 5bfc5fd3 Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/5bfc5fd3 Stats: 420 lines in 4 files changed: 9 ins; 255 del; 156 mod 8263051: Modernize the code in the java.awt.color package Reviewed-by: azvegint ------------- PR: https://git.openjdk.java.net/jdk/pull/2855 From aivanov at openjdk.java.net Tue Mar 9 11:39:07 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Tue, 9 Mar 2021 11:39:07 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() In-Reply-To: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> References: <_cLbmezA8NPc15e7YAOJxL1rGEfoybdYwYGw306qggg=.0147c018-53eb-460c-8c14-e8f7e71ff150@github.com> Message-ID: On Thu, 4 Mar 2021 21:37:33 GMT, Alexey Ivanov wrote: > **Root cause:** > `getPrinterNames()` has two calls to [`::EnumPrinters`](https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters). The first call is to get the required buffer size to contain the structures and any strings. The second call is to get the list of printers. > > Yet the list of printers or the names of printers can change between the two calls. If it happens, the second call to `EnumPrinters` fails but it is not checked. > > I couldn't reproduce the crash myself. However, I reproduced the failure in the second call to `::EnumPrinters` by adding `::Sleep(500)` and by renaming the printers so that the data doesn't fit into the allocated buffer: > > 1: bResult: 0, cbNeeded: 504, cReturned: 0 > 2: bResult: 0, cbNeeded: 512, cReturned: 0 > !!! error > > During my testing, `cReturned` has always been zero whenever `EnumPrinters` fails. > > The crash dumps show that `cReturned` is non-zero but the `pPrinterEnum` buffer doesn't contain valid data. Reading `info4->pPrinterName` at the line > utf_str = JNU_NewStringPlatform(env, info4->pPrinterName); > raises Access Violation exception. > > **The fix:** > Check the return value of `EnumPrinters` and allow for 5 retries. If the function still returns failure, make sure `cReturned` is set to zero. > > I'm going to close [JDK-6996051](https://bugs.openjdk.java.net/browse/JDK-6996051) and [JDK-8182683](https://bugs.openjdk.java.net/browse/JDK-8182683) reported previously about the same crash as duplicate of the current [JDK-8262829](https://bugs.openjdk.java.net/browse/JDK-8262829). > > **Testing:** > I used [`RemotePrinterStatusRefresh.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java) for testing, it shows the list of currently available printers. In the background I ran `PrinterRename.ps1` PowerShell script which remains a printer, the script is attached to the JBS issue. > > Without the fix, the list of available printers was empty occasionally because `EnumPrinters` returned failure and set `cReturned` to zero. With the fix, the list of printers is always filled. This pull request has now been integrated. Changeset: a6e34b3d Author: Alexey Ivanov URL: https://git.openjdk.java.net/jdk/commit/a6e34b3d Stats: 20 lines in 1 file changed: 13 ins; 0 del; 7 mod 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames() Reviewed-by: prr, psadhukhan, serb ------------- PR: https://git.openjdk.java.net/jdk/pull/2836 From akozlov at openjdk.java.net Tue Mar 9 16:12:36 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 9 Mar 2021 16:12:36 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v24] In-Reply-To: References: Message-ID: > Please review the implementation of JEP 391: macOS/AArch64 Port. > > It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. > > Major changes are in: > * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) > * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) > * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. > * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 105 commits: - Merge commit 'refs/pull/11/head' of https://github.com/AntonKozlov/jdk into jdk-macos - workaround JDK-8262895 by disabling subtest - Fix typo - Rename threadWXSetters.hpp -> threadWXSetters.inline.hpp - JDK-8259937: bsd_aarch64 part - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos - Fix after JDK-8259539, partially revert preconditions - JDK-8260471: bsd_aarch64 part - JDK-8259539: bsd_aarch64 part - JDK-8257828: bsd_aarch64 part - ... and 95 more: https://git.openjdk.java.net/jdk/compare/a6e34b3d...a72f6834 ------------- Changes: https://git.openjdk.java.net/jdk/pull/2200/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=23 Stats: 2873 lines in 73 files changed: 2787 ins; 27 del; 59 mod Patch: https://git.openjdk.java.net/jdk/pull/2200.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2200/head:pull/2200 PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 9 16:12:37 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 9 Mar 2021 16:12:37 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v12] In-Reply-To: <8MnBLkES1lapB4b01NDzU9nhOk8_9_V--NSCM5H_bg8=.7bdb576b-4acd-4e5b-be14-b363a2ef47bf@github.com> References: <8MnBLkES1lapB4b01NDzU9nhOk8_9_V--NSCM5H_bg8=.7bdb576b-4acd-4e5b-be14-b363a2ef47bf@github.com> Message-ID: On Tue, 9 Feb 2021 09:06:26 GMT, Stefan Karlsson wrote: >> Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: >> >> Update signal handler part for debugger > > src/hotspot/share/runtime/threadWXSetters.hpp line 28: > >> 26: #define SHARE_RUNTIME_THREADWXSETTERS_HPP >> 27: >> 28: #include "runtime/thread.inline.hpp" > > This breaks against our convention to forbid inline.hpp files from being included from being included from .hpp files. You need to rework this by either moving the implementation to a .cpp file, or convert this file into an .inline.hpp > > See the Source Files section in: > https://htmlpreview.github.io/?https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.html Thanks, I renamed the file to threadWXSetters.inline.hpp ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 9 16:58:19 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 9 Mar 2021 16:58:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v12] In-Reply-To: <8MnBLkES1lapB4b01NDzU9nhOk8_9_V--NSCM5H_bg8=.7bdb576b-4acd-4e5b-be14-b363a2ef47bf@github.com> References: <8MnBLkES1lapB4b01NDzU9nhOk8_9_V--NSCM5H_bg8=.7bdb576b-4acd-4e5b-be14-b363a2ef47bf@github.com> Message-ID: On Tue, 9 Feb 2021 09:12:13 GMT, Stefan Karlsson wrote: >> Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: >> >> Update signal handler part for debugger > > src/hotspot/share/runtime/thread.hpp line 848: > >> 846: void init_wx(); >> 847: WXMode enable_wx(WXMode new_state); >> 848: #endif // __APPLE__ && AARCH64 > > Now that this is only compiled into macOS/AArch64, could this be moved over to thread_bsd_aarch64.hpp? The same goes for the associated functions. The thread_bsd_aarch64.hpp describes a part of JavaThread, while this block belongs to Thread for now. Since W^X is an attribute of any operating system thread, I assumed Thread to be the right place for W^X bookkeeping. In most cases, we manage W^X state of JavaThread. But sometimes a GC thread needs the WXWrite state, or safefetch is called from non-JavaThread. Probably this can be dealt with (e.g. GCThread to always have the WXWrite state). But such change would be much more than a simple refactoring and it would require a significant amount of testing. Ideally, I would like to investigate this as a follow-up change, or at least after other fixes to this PR. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From avu at openjdk.java.net Tue Mar 9 17:29:19 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Tue, 9 Mar 2021 17:29:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Sun, 7 Mar 2021 22:24:54 GMT, Sergey Bylokhov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 36 additional commits since the last revision: >> >> - Lanai PR#206 - 8262729 - aghaisas >> - Lanai PR#205 - 8262496 - avu >> - Lanai PR#203 - 8262313 - jdv >> - Lanai PR#202 - 8262293 - avu >> - Lanai PR#201 - 8261891 - avu >> - Lanai PR#200 - 8262115 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#199 - 8262091 - aghaisas >> - Lanai PR#198 - 8261646 - avu >> - Lanai PR#197 - 8261960 - jdv >> - ... and 26 more: https://git.openjdk.java.net/jdk/compare/ffb3d48c...5cb1fd91 > > src/java.desktop/macosx/classes/sun/java2d/metal/MTLContext.java line 68: > >> 66: * when disposing a texture-based surface). >> 67: */ >> 68: public static void setScratchSurface(long pConfigInfo) { > > How the scratch surface is used in the metal pipeline? Why it is not enough to set the "context current"? In fact, we don't have any scratch surfaces. SET_SCRATCH_SURFACE effectively sets the new context. For better readability, we should add the new op SET_CONTEXT in BufferedOpCodes ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From avu at openjdk.java.net Tue Mar 9 17:33:24 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Tue, 9 Mar 2021 17:33:24 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: <-5I5uYhE9NCERNocgh3oBFzPxScyu2Una6NkCBfc9tA=.79311ac7-d4e4-407f-bc1a-95e088730b83@github.com> On Sun, 7 Mar 2021 22:29:50 GMT, Sergey Bylokhov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 36 additional commits since the last revision: >> >> - Lanai PR#206 - 8262729 - aghaisas >> - Lanai PR#205 - 8262496 - avu >> - Lanai PR#203 - 8262313 - jdv >> - Lanai PR#202 - 8262293 - avu >> - Lanai PR#201 - 8261891 - avu >> - Lanai PR#200 - 8262115 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#199 - 8262091 - aghaisas >> - Lanai PR#198 - 8261646 - avu >> - Lanai PR#197 - 8261960 - jdv >> - ... and 26 more: https://git.openjdk.java.net/jdk/compare/69ed64f1...5cb1fd91 > > src/java.desktop/macosx/classes/sun/java2d/metal/MTLContext.java line 140: > >> 138: StringBuilder sb = new StringBuilder(super.toString()); >> 139: if ((caps & CAPS_DOUBLEBUFFERED) != 0) { >> 140: sb.append("CAPS_DOUBLEBUFFERED|"); > > Related to other questions, we do not include CAPS_DOUBLEBUFFERED, but anyway, report the surface as double buffered. We can remove all the unused constants ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From akozlov at openjdk.java.net Tue Mar 9 17:58:21 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 9 Mar 2021 17:58:21 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v12] In-Reply-To: <8MnBLkES1lapB4b01NDzU9nhOk8_9_V--NSCM5H_bg8=.7bdb576b-4acd-4e5b-be14-b363a2ef47bf@github.com> References: <8MnBLkES1lapB4b01NDzU9nhOk8_9_V--NSCM5H_bg8=.7bdb576b-4acd-4e5b-be14-b363a2ef47bf@github.com> Message-ID: On Tue, 9 Feb 2021 09:23:50 GMT, Stefan Karlsson wrote: >> Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: >> >> Update signal handler part for debugger > > src/hotspot/share/runtime/thread.cpp line 2515: > >> 2513: void JavaThread::check_special_condition_for_native_trans(JavaThread *thread) { >> 2514: // Enable WXWrite: called directly from interpreter native wrapper. >> 2515: MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread)); > > FWIW, I personally think that adding these MACOS_AARCH64_ONLY usages at the call sites increase the line-noise in the affected functions. I think I would have preferred a version: > ThreadWXEnable(WXMode new_mode, Thread* thread = NULL) { > MACOS_AARCH64_ONLY(initialize(new_mode, thread);) {} > void initialize(...); // Implementation in thread_bsd_aarch64.cpp (alt. inline.hpp) > With that said, I'm fine with taking this discussion as a follow-up. The former version used no such macros. I like that now it's clear the W^X management is relevant to macos/aarch64 only. I see the point to move the pre-processor condition into the class implementation. But I think it will bring a bit of inconsistency, as the rest of W^X implementation is explicitly guarded by preprocessor conditionals. I've also tried to push macro conditionals as far as possible down to implementation, providing a kind of generalized W^X interface. That required a few artificial decisions, e.g. how would we call the mode we execute on the rest of platforms with write and execute allowed, WXWriteExec?.. I abandoned that attempt. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 9 18:04:19 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 9 Mar 2021 18:04:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v21] In-Reply-To: References: Message-ID: On Mon, 1 Mar 2021 10:31:19 GMT, Andrew Haley wrote: >> Anton Kozlov has updated the pull request incrementally with two additional commits since the last revision: >> >> - Merge remote-tracking branch 'origin/jdk/jdk-macos' into jdk-macos >> - Minor fixes > > src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp line 62: > >> 60: >> 61: #if defined(__APPLE__) || defined(_WIN64) >> 62: #define R18_RESERVED > > #define R18_RESERVED true``` We always check for `R18_RESERVED` with `#if(n)def`, is there any reason to define the value for the macro? ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From prr at openjdk.java.net Tue Mar 9 19:57:37 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 9 Mar 2021 19:57:37 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v11] In-Reply-To: <3XzbfpM41bmyAd3DCXAqrSEJaFlA5-CCd9PUO5fKpD8=.88284596-8b8d-48eb-bf69-6ef5c3f55037@github.com> References: <3XzbfpM41bmyAd3DCXAqrSEJaFlA5-CCd9PUO5fKpD8=.88284596-8b8d-48eb-bf69-6ef5c3f55037@github.com> Message-ID: On Mon, 8 Mar 2021 08:06:03 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 41 additional commits since the last revision: > > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#206 - 8262729 - aghaisas > - Lanai PR#205 - 8262496 - avu > - Lanai PR#203 - 8262313 - jdv > - Lanai PR#202 - 8262293 - avu > - Lanai PR#201 - 8261891 - avu > - ... and 31 more: https://git.openjdk.java.net/jdk/compare/32b236e4...de456939 test/jdk/performance/client/RenderPerfTest/build.xml line 72: > 70: > 71: > 72: This was presumably borrowed from J2DBench so this comment should be fixed ! ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From prr at openjdk.java.net Tue Mar 9 19:57:14 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 9 Mar 2021 19:57:14 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v8] In-Reply-To: References: Message-ID: On Mon, 15 Feb 2021 20:55:13 GMT, Phil Race wrote: >> Marked as reviewed by gziemski (Committer). > >> > > Thanks @gerard-ziemski for taking a detailed look at this. >> > > We do have an open bug to address this. Please refer [JDK-8259825](https://bugs.openjdk.java.net/browse/JDK-8259825). >> > >> > >> > Hi Gerard, expecting a process and parsing its output is definitely not ideal and that's why there's this open bug. >> > One thing that is under consideration is to equate >= 10.14 with Metal is available since as of 10.14 macOS won't install if a system does not support metal. We have no compelling reason to support metal on earlier releases anyway .. those are either already unsupported or barely supported and OGL will always be available there. >> >> I did not know that there already was a bug covering this issue. >> >> Your idea seems reasonable. >> >> More than just focusing on this immediate issue, however, I was hoping to raise the point of us starting adopting profiling tools to analyze our code (memory utilization, leaks, cpu/gpu profiling etc). A new feature that brings 10% benefit, but uses 50% more resources for example would probably not be a good investment. And to figure that we need to relay on some good tools and Xcode provides some. > > There were actually tasks to do profiling of the memory footprint and look for leaks. We did not think it possible to be able to assert "Metal must use less memory than OpenGL" or dig into tiny differences but it was intended to find the big issues. See https://bugs.openjdk.java.net/browse/JDK-8237856 > @prsadhuk maybe able to say how much of it was doing using Xcode. Regarding this comment from @mrserb > Probably place it near J2Dbench? I can't find the context but if it is suggesting moving RenderPerfTest to be co-located with J2Bench let's NOT do that. It is much more likely that J2DBench will be moved out of demo into test ... ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Tue Mar 9 20:21:41 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 9 Mar 2021 20:21:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v11] In-Reply-To: <3XzbfpM41bmyAd3DCXAqrSEJaFlA5-CCd9PUO5fKpD8=.88284596-8b8d-48eb-bf69-6ef5c3f55037@github.com> References: <3XzbfpM41bmyAd3DCXAqrSEJaFlA5-CCd9PUO5fKpD8=.88284596-8b8d-48eb-bf69-6ef5c3f55037@github.com> Message-ID: On Mon, 8 Mar 2021 08:06:03 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 41 additional commits since the last revision: > > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#206 - 8262729 - aghaisas > - Lanai PR#205 - 8262496 - avu > - Lanai PR#203 - 8262313 - jdv > - Lanai PR#202 - 8262293 - avu > - Lanai PR#201 - 8261891 - avu > - ... and 31 more: https://git.openjdk.java.net/jdk/compare/851d3def...de456939 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLGraphicsConfig.m line 185: > 183: > 184: NSRect contentRect = NSMakeRect(0, 0, 64, 64); > 185: NSWindow *window = Some remnant from the scratch surface initialization? ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Tue Mar 9 20:21:18 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 9 Mar 2021 20:21:18 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Sun, 7 Mar 2021 22:48:47 GMT, Sergey Bylokhov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 36 additional commits since the last revision: >> >> - Lanai PR#206 - 8262729 - aghaisas >> - Lanai PR#205 - 8262496 - avu >> - Lanai PR#203 - 8262313 - jdv >> - Lanai PR#202 - 8262293 - avu >> - Lanai PR#201 - 8261891 - avu >> - Lanai PR#200 - 8262115 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#199 - 8262091 - aghaisas >> - Lanai PR#198 - 8261646 - avu >> - Lanai PR#197 - 8261960 - jdv >> - ... and 26 more: https://git.openjdk.java.net/jdk/compare/af4701dd...5cb1fd91 > > src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m line 676: > >> 674: height = srcInfo.bounds.y2 - srcInfo.bounds.y1; >> 675: >> 676: pDst = PtrAddBytes(pDst, dstx * dstInfo.pixelStride); > > Here and in other places use the PtrPixelsRow instead, do not use multiplication, see the history of the OGLBlitLoops_SurfaceToSwBlit method. I think this at least should be investigated before integration. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From aivanov at openjdk.java.net Tue Mar 9 20:59:06 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Tue, 9 Mar 2021 20:59:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: References: Message-ID: On Sat, 27 Feb 2021 18:33:52 GMT, Andrey Turbanov wrote: > 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe Marked as reviewed by aivanov (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From avu at openjdk.java.net Tue Mar 9 22:21:31 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Tue, 9 Mar 2021 22:21:31 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: Message-ID: On Mon, 1 Mar 2021 11:17:39 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 36 additional commits since the last revision: > > - Lanai PR#206 - 8262729 - aghaisas > - Lanai PR#205 - 8262496 - avu > - Lanai PR#203 - 8262313 - jdv > - Lanai PR#202 - 8262293 - avu > - Lanai PR#201 - 8261891 - avu > - Lanai PR#200 - 8262115 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#199 - 8262091 - aghaisas > - Lanai PR#198 - 8261646 - avu > - Lanai PR#197 - 8261960 - jdv > - ... and 26 more: https://git.openjdk.java.net/jdk/compare/8f9013c3...5cb1fd91 Looks good, but a couple of things should be fixed (JDK-8263325, JDK-8263324) ------------- Changes requested by avu (no project role). PR: https://git.openjdk.java.net/jdk/pull/2403 From avu at openjdk.java.net Tue Mar 9 22:21:32 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Tue, 9 Mar 2021 22:21:32 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Tue, 9 Mar 2021 17:26:24 GMT, Alexey Ushakov wrote: >> src/java.desktop/macosx/classes/sun/java2d/metal/MTLContext.java line 68: >> >>> 66: * when disposing a texture-based surface). >>> 67: */ >>> 68: public static void setScratchSurface(long pConfigInfo) { >> >> How the scratch surface is used in the metal pipeline? Why it is not enough to set the "context current"? > > In fact, we don't have any scratch surfaces. SET_SCRATCH_SURFACE effectively sets the new context. For better readability, we should add the new op SET_CONTEXT in BufferedOpCodes Probably it's enough to set the context in SET_SURFACES, I'll double-check it. >> src/java.desktop/macosx/classes/sun/java2d/metal/MTLContext.java line 140: >> >>> 138: StringBuilder sb = new StringBuilder(super.toString()); >>> 139: if ((caps & CAPS_DOUBLEBUFFERED) != 0) { >>> 140: sb.append("CAPS_DOUBLEBUFFERED|"); >> >> Related to other questions, we do not include CAPS_DOUBLEBUFFERED, but anyway, report the surface as double buffered. > > We can remove all the unused constants JDK-8263306 ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From avu at openjdk.java.net Tue Mar 9 22:21:44 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Tue, 9 Mar 2021 22:21:44 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Sun, 7 Mar 2021 22:31:16 GMT, Sergey Bylokhov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 36 additional commits since the last revision: >> >> - Lanai PR#206 - 8262729 - aghaisas >> - Lanai PR#205 - 8262496 - avu >> - Lanai PR#203 - 8262313 - jdv >> - Lanai PR#202 - 8262293 - avu >> - Lanai PR#201 - 8261891 - avu >> - Lanai PR#200 - 8262115 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#199 - 8262091 - aghaisas >> - Lanai PR#198 - 8261646 - avu >> - Lanai PR#197 - 8261960 - jdv >> - ... and 26 more: https://git.openjdk.java.net/jdk/compare/2f09d382...5cb1fd91 > > src/java.desktop/macosx/classes/sun/java2d/metal/MTLLayer.java line 44: > >> 42: >> 43: // Pass the insets to native code to make adjustments in blitTexture >> 44: private static native void nativeSetInsets(long layerPtr, int top, int left); > > Probably I have asked this already, but why we need to use insets? Why insets is not necessary for ogl? We have different coordinate systems for OGL and Metal. Metal (0,0) for textures is the top-left corner whereas OGL (0,0) is the bottom-left one, so we need to have insets to perform blitting to drawable correctly. > src/java.desktop/macosx/classes/sun/java2d/metal/MTLBlitLoops.java line 499: > >> 497: } >> 498: >> 499: // We can convert argb_pre data from MTL surface in two places: > > Does anybody check that this is true for the metal pipeline? or It is just copied from the OGL? I fixed some conversion logic within JDK-8256331. > src/java.desktop/macosx/classes/sun/java2d/metal/MTLGraphicsConfig.java line 168: > >> 166: } >> 167: >> 168: ContextCapabilities caps = new MTLContext.MTLContextCaps( > > CAPS_DOUBLEBUFFERED is not included? JDK-8263306 > src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 146: > >> 144: return MTLSurfaceRTT; >> 145: default: >> 146: return MTLSurface; > > Do we really support 3 different types of surface? I guess only two of them are different: textures used for manageable images, and surfaces used by the volatile image. It's true but I don't see any problem returning a more generic type as a default here > src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 221: > >> 219: protected native boolean initRTexture(long pData, boolean isOpaque, int width, int height); >> 220: >> 221: protected native boolean initFlipBackbuffer(long pData); > > flip back buffer is supported? No, it should be removed (JDK-8263312) > src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceData.m line 284: > >> 282: */ >> 283: jboolean >> 284: MTLSD_InitMTLWindow(JNIEnv *env, BMTLSDOps *bmtlsdo) > > When the MTLWindow is used? MTLContext setSurfacesEnv > src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceDataBase.h line 109: > >> 107: #define MTLSD_TEXTURE sun_java2d_pipe_hw_AccelSurface_TEXTURE >> 108: #define MTLSD_FLIP_BACKBUFFER sun_java2d_pipe_hw_AccelSurface_FLIP_BACKBUFFER >> 109: #define MTLSD_RT_TEXTURE sun_java2d_pipe_hw_AccelSurface_RT_TEXTURE > > Only two of them are supported? MTLSD_TEXTURE and MTLSD_RT_TEXTURE? Also, MTLSD_WINDOW is supported ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From avu at openjdk.java.net Tue Mar 9 22:21:44 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Tue, 9 Mar 2021 22:21:44 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Tue, 9 Mar 2021 17:59:26 GMT, Alexey Ushakov wrote: >> In fact, we don't have any scratch surfaces. SET_SCRATCH_SURFACE effectively sets the new context. For better readability, we should add the new op SET_CONTEXT in BufferedOpCodes > > Probably it's enough to set the context in SET_SURFACES, I'll double-check it. Looks like it works even without SET_SCRATCH_SURFACE (I did some limited testing) but I don't think we should do such a huge change at this moment. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From avu at openjdk.java.net Tue Mar 9 22:21:59 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Tue, 9 Mar 2021 22:21:59 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v11] In-Reply-To: References: <3XzbfpM41bmyAd3DCXAqrSEJaFlA5-CCd9PUO5fKpD8=.88284596-8b8d-48eb-bf69-6ef5c3f55037@github.com> Message-ID: On Tue, 9 Mar 2021 19:52:35 GMT, Phil Race wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 41 additional commits since the last revision: >> >> - Lanai PR#210 - 8263159 - jdv >> - Lanai PR#209 - 8262936 - jdv >> - Lanai PR#208 - 8262928 - jdv >> - Lanai PR#207 - 8262750 - jdv >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#206 - 8262729 - aghaisas >> - Lanai PR#205 - 8262496 - avu >> - Lanai PR#203 - 8262313 - jdv >> - Lanai PR#202 - 8262293 - avu >> - Lanai PR#201 - 8261891 - avu >> - ... and 31 more: https://git.openjdk.java.net/jdk/compare/1bd8aea0...de456939 > > test/jdk/performance/client/RenderPerfTest/build.xml line 72: > >> 70: >> 71: >> 72: > > This was presumably borrowed from J2DBench so this comment should be fixed ! JDK-8263325 ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From avu at openjdk.java.net Tue Mar 9 22:21:45 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Tue, 9 Mar 2021 22:21:45 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Tue, 9 Mar 2021 20:13:03 GMT, Sergey Bylokhov wrote: >> src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m line 676: >> >>> 674: height = srcInfo.bounds.y2 - srcInfo.bounds.y1; >>> 675: >>> 676: pDst = PtrAddBytes(pDst, dstx * dstInfo.pixelStride); >> >> Here and in other places use the PtrPixelsRow instead, do not use multiplication, see the history of the OGLBlitLoops_SurfaceToSwBlit method. > > I think this at least should be investigated before integration. JDK-8263324 ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From avu at openjdk.java.net Tue Mar 9 22:21:44 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Tue, 9 Mar 2021 22:21:44 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Tue, 9 Mar 2021 20:04:17 GMT, Alexey Ushakov wrote: >> Probably it's enough to set the context in SET_SURFACES, I'll double-check it. > > Looks like it works even without SET_SCRATCH_SURFACE (I did some limited testing) but I don't think we should do such a huge change at this moment. JDK-8263309 ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Tue Mar 9 22:31:07 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 9 Mar 2021 22:31:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: References: Message-ID: On Tue, 9 Mar 2021 20:56:15 GMT, Alexey Ivanov wrote: >> 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe > > Marked as reviewed by aivanov (Reviewer). > I don't know why making this volatile is doing anything. > Let's discuss this further. It will prevent the possibility that one thread will store the non-null value to the SunFontManager.platformFontMap and only after that complete initialization of object stored in that field due to code optimizations. It is similar to the volatile DCL: see "broken multithreaded version" example: https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From serb at openjdk.java.net Tue Mar 9 23:19:16 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 9 Mar 2021 23:19:16 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Tue, 9 Mar 2021 22:11:20 GMT, Alexey Ushakov wrote: >> src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceDataBase.h line 109: >> >>> 107: #define MTLSD_TEXTURE sun_java2d_pipe_hw_AccelSurface_TEXTURE >>> 108: #define MTLSD_FLIP_BACKBUFFER sun_java2d_pipe_hw_AccelSurface_FLIP_BACKBUFFER >>> 109: #define MTLSD_RT_TEXTURE sun_java2d_pipe_hw_AccelSurface_RT_TEXTURE >> >> Only two of them are supported? MTLSD_TEXTURE and MTLSD_RT_TEXTURE? > > Also, MTLSD_WINDOW is supported How it is used? Can we really draw to the window directly? It looks like it copied from the OGL where it is unused since CLayer integration. Something is inconsistent here. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Wed Mar 10 00:58:06 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 10 Mar 2021 00:58:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons In-Reply-To: References: Message-ID: On Mon, 8 Mar 2021 13:23:00 GMT, Alexander Zuev wrote: >> Fix updated after first round of review. > > Continuation of review at https://github.com/openjdk/jdk/pull/380 Just to continue the thread from the old review, did you have a chance to look at the possibility of loading all existed icons embedded in the file? It was discussed here: https://github.com/openjdk/jdk/pull/380#issuecomment-702999573 ------------- PR: https://git.openjdk.java.net/jdk/pull/2875 From serb at openjdk.java.net Wed Mar 10 01:51:11 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 10 Mar 2021 01:51:11 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows In-Reply-To: References: Message-ID: On Fri, 26 Feb 2021 19:40:22 GMT, Alexander Scherbatiy wrote: > Printing text using GlyphVector outline has bad quality on printers with low DPI on Windows. > The GDI system used for text printing on Windows accepts only integer path coordinates. > Rounding GlyphVector outline coordinates leads to distorted printed text. > > The issue had been reported as JDK-8256264 but was reverted because of the regression JDK-8259007 "This test printed a blank page". > > The fix JDK-8256264 scaled coordinates in wPrinterJob.moveTo()/lineTo() methods up and scaled transforms in wPrinterJob.beginPath()/endPath() down. > > The regression was in the WPathGraphics.deviceDrawLine() method which uses wPrinterJob.moveTo()/lineTo() methods without surrounding them with wPrinterJob.beginPath()/endPath() so the line coordinates were only scaled up. > > I tried to put wPrinterJob.beginPath()/endPath() methods around wPrinterJob.moveTo()/lineTo() in the method WPathGraphics.deviceDrawLine() but the line was not drawn at all even without scaling coordinates up and transform down (without JDK-8256264 fix). It looks like GDI treats this case as an empty shape. > > The proposed fix applies path coordinates and transform scaling only in WPathGraphics.convertToWPath() method. > The one more PathPrecisionScaleFactorShapeTest.java manual test is added which checks that all methods that draw paths in WPathGraphics are used: line in WPathGraphics.deviceDrawLine() and SEG_LINETO/SEG_QUADTO/SEG_CUBICTO in WPathGraphics.convertToWPath() . > > The `java/awt/print` and `java/awt/PrintJob` automatic and manual tests were run on Windows 10 Pro with the fix. > > There are two failed automated tests which fail without the fix as well: > java/awt/print/PrinterJob/GlyphPositions.java > java/awt/print/PrinterJob/PSQuestionMark.java > > The following manual tests have issues on my system: > - `java/awt/print/Dialog/PrintDlgPageable.java` java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainThread cannot access a member of class PrintDlgPageable with modifiers "public static" > > - `java/awt/print/PrinterJob/PrintAttributeUpdateTest.java` I select pages radio button, press the print button but the test does not finish and I do not see any other dialogs with pass/fail buttons. > > - `java/awt/PrintJob/PrintCheckboxTest/PrintCheckboxManualTest.java` Tests that there is no ClassCastException thrown in printing checkbox and scrollbar with XAWT. Error. Can't find HTML file: test\jdk\java\awt\PrintJob\PrintCheckboxTest\PrintCheckboxManualTest.html > > > - `java/awt/print/PrinterJob/SecurityDialogTest.java` A windows with instructions is shown but it does not contain print/pass/fail buttons and it is not possible to close the window. > > - The tests below fail with "Error. Parse Exception: Arguments to `manual' option not supported: yesno" message: > java/awt/print/Dialog/DialogOrient.java > java/awt/print/Dialog/DialogType.java > java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java > java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java > java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java > java/awt/print/PrinterJob/PageDialogTest.java > java/awt/print/PrinterJob/PageRanges.java > java/awt/print/PrinterJob/PageRangesDlgTest.java > java/awt/print/PrinterJob/PrintGlyphVectorTest.java > java/awt/print/PrinterJob/PrintLatinCJKTest.java > java/awt/print/PrinterJob/PrintTextTest.java > java/awt/print/PrinterJob/SwingUIText.java > java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java > java/awt/PrintJob/PageSetupDlgBlockingTest/PageSetupDlgBlockingTest.java > java/awt/PrintJob/SaveDialogTitleTest.java Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2756 From serb at openjdk.java.net Wed Mar 10 01:51:11 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 10 Mar 2021 01:51:11 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows In-Reply-To: References: Message-ID: <_gyOC67AaHPv8HdVXHlnYRxJI5tE7C48m7O92zGhmLA=.7d446a78-55c5-4d4a-9646-19a9c2ee7c71@github.com> On Wed, 10 Mar 2021 01:48:28 GMT, Sergey Bylokhov wrote: >> Printing text using GlyphVector outline has bad quality on printers with low DPI on Windows. >> The GDI system used for text printing on Windows accepts only integer path coordinates. >> Rounding GlyphVector outline coordinates leads to distorted printed text. >> >> The issue had been reported as JDK-8256264 but was reverted because of the regression JDK-8259007 "This test printed a blank page". >> >> The fix JDK-8256264 scaled coordinates in wPrinterJob.moveTo()/lineTo() methods up and scaled transforms in wPrinterJob.beginPath()/endPath() down. >> >> The regression was in the WPathGraphics.deviceDrawLine() method which uses wPrinterJob.moveTo()/lineTo() methods without surrounding them with wPrinterJob.beginPath()/endPath() so the line coordinates were only scaled up. >> >> I tried to put wPrinterJob.beginPath()/endPath() methods around wPrinterJob.moveTo()/lineTo() in the method WPathGraphics.deviceDrawLine() but the line was not drawn at all even without scaling coordinates up and transform down (without JDK-8256264 fix). It looks like GDI treats this case as an empty shape. >> >> The proposed fix applies path coordinates and transform scaling only in WPathGraphics.convertToWPath() method. >> The one more PathPrecisionScaleFactorShapeTest.java manual test is added which checks that all methods that draw paths in WPathGraphics are used: line in WPathGraphics.deviceDrawLine() and SEG_LINETO/SEG_QUADTO/SEG_CUBICTO in WPathGraphics.convertToWPath() . >> >> The `java/awt/print` and `java/awt/PrintJob` automatic and manual tests were run on Windows 10 Pro with the fix. >> >> There are two failed automated tests which fail without the fix as well: >> java/awt/print/PrinterJob/GlyphPositions.java >> java/awt/print/PrinterJob/PSQuestionMark.java >> >> The following manual tests have issues on my system: >> - `java/awt/print/Dialog/PrintDlgPageable.java` java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainThread cannot access a member of class PrintDlgPageable with modifiers "public static" >> >> - `java/awt/print/PrinterJob/PrintAttributeUpdateTest.java` I select pages radio button, press the print button but the test does not finish and I do not see any other dialogs with pass/fail buttons. >> >> - `java/awt/PrintJob/PrintCheckboxTest/PrintCheckboxManualTest.java` Tests that there is no ClassCastException thrown in printing checkbox and scrollbar with XAWT. Error. Can't find HTML file: test\jdk\java\awt\PrintJob\PrintCheckboxTest\PrintCheckboxManualTest.html >> >> >> - `java/awt/print/PrinterJob/SecurityDialogTest.java` A windows with instructions is shown but it does not contain print/pass/fail buttons and it is not possible to close the window. >> >> - The tests below fail with "Error. Parse Exception: Arguments to `manual' option not supported: yesno" message: >> java/awt/print/Dialog/DialogOrient.java >> java/awt/print/Dialog/DialogType.java >> java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java >> java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java >> java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java >> java/awt/print/PrinterJob/PageDialogTest.java >> java/awt/print/PrinterJob/PageRanges.java >> java/awt/print/PrinterJob/PageRangesDlgTest.java >> java/awt/print/PrinterJob/PrintGlyphVectorTest.java >> java/awt/print/PrinterJob/PrintLatinCJKTest.java >> java/awt/print/PrinterJob/PrintTextTest.java >> java/awt/print/PrinterJob/SwingUIText.java >> java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java >> java/awt/PrintJob/PageSetupDlgBlockingTest/PageSetupDlgBlockingTest.java >> java/awt/PrintJob/SaveDialogTitleTest.java > > Marked as reviewed by serb (Reviewer). @prsadhuk please take a look ------------- PR: https://git.openjdk.java.net/jdk/pull/2756 From kizune at openjdk.java.net Wed Mar 10 05:39:06 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Wed, 10 Mar 2021 05:39:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 00:55:00 GMT, Sergey Bylokhov wrote: >> Continuation of review at https://github.com/openjdk/jdk/pull/380 > > Just to continue the thread from the old review, did you have a chance to look at the possibility of loading all existed icons embedded in the file? It was discussed here: > https://github.com/openjdk/jdk/pull/380#issuecomment-702999573 > Just to continue the thread from the old review, did you have a chance to look at the possibility of loading all existed icons embedded in the file? It was discussed here: > [#380 (comment)](https://github.com/openjdk/jdk/pull/380#issuecomment-702999573) Yes, i did. There were 3 shortcomings: 1. It works in about 10% of the cases in all other cases it reports only one icon available (32x32) even if there are other resolution icons. 2. It is quite slow, especially on network drives. 3. Does not work at all in files that are within AppData\Roaming folder - returning list is just empty. ------------- PR: https://git.openjdk.java.net/jdk/pull/2875 From kizune at openjdk.java.net Wed Mar 10 09:32:09 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Wed, 10 Mar 2021 09:32:09 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: References: Message-ID: On Sat, 27 Feb 2021 18:33:52 GMT, Andrey Turbanov wrote: > 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe Marked as reviewed by kizune (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From psadhukhan at openjdk.java.net Wed Mar 10 09:42:08 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 10 Mar 2021 09:42:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows In-Reply-To: References: Message-ID: On Fri, 26 Feb 2021 19:40:22 GMT, Alexander Scherbatiy wrote: > Printing text using GlyphVector outline has bad quality on printers with low DPI on Windows. > The GDI system used for text printing on Windows accepts only integer path coordinates. > Rounding GlyphVector outline coordinates leads to distorted printed text. > > The issue had been reported as JDK-8256264 but was reverted because of the regression JDK-8259007 "This test printed a blank page". > > The fix JDK-8256264 scaled coordinates in wPrinterJob.moveTo()/lineTo() methods up and scaled transforms in wPrinterJob.beginPath()/endPath() down. > > The regression was in the WPathGraphics.deviceDrawLine() method which uses wPrinterJob.moveTo()/lineTo() methods without surrounding them with wPrinterJob.beginPath()/endPath() so the line coordinates were only scaled up. > > I tried to put wPrinterJob.beginPath()/endPath() methods around wPrinterJob.moveTo()/lineTo() in the method WPathGraphics.deviceDrawLine() but the line was not drawn at all even without scaling coordinates up and transform down (without JDK-8256264 fix). It looks like GDI treats this case as an empty shape. > > The proposed fix applies path coordinates and transform scaling only in WPathGraphics.convertToWPath() method. > The one more PathPrecisionScaleFactorShapeTest.java manual test is added which checks that all methods that draw paths in WPathGraphics are used: line in WPathGraphics.deviceDrawLine() and SEG_LINETO/SEG_QUADTO/SEG_CUBICTO in WPathGraphics.convertToWPath() . > > The `java/awt/print` and `java/awt/PrintJob` automatic and manual tests were run on Windows 10 Pro with the fix. > > There are two failed automated tests which fail without the fix as well: > java/awt/print/PrinterJob/GlyphPositions.java > java/awt/print/PrinterJob/PSQuestionMark.java > > The following manual tests have issues on my system: > - `java/awt/print/Dialog/PrintDlgPageable.java` java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainThread cannot access a member of class PrintDlgPageable with modifiers "public static" > > - `java/awt/print/PrinterJob/PrintAttributeUpdateTest.java` I select pages radio button, press the print button but the test does not finish and I do not see any other dialogs with pass/fail buttons. > > - `java/awt/PrintJob/PrintCheckboxTest/PrintCheckboxManualTest.java` Tests that there is no ClassCastException thrown in printing checkbox and scrollbar with XAWT. Error. Can't find HTML file: test\jdk\java\awt\PrintJob\PrintCheckboxTest\PrintCheckboxManualTest.html > > > - `java/awt/print/PrinterJob/SecurityDialogTest.java` A windows with instructions is shown but it does not contain print/pass/fail buttons and it is not possible to close the window. > > - The tests below fail with "Error. Parse Exception: Arguments to `manual' option not supported: yesno" message: > java/awt/print/Dialog/DialogOrient.java > java/awt/print/Dialog/DialogType.java > java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java > java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java > java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java > java/awt/print/PrinterJob/PageDialogTest.java > java/awt/print/PrinterJob/PageRanges.java > java/awt/print/PrinterJob/PageRangesDlgTest.java > java/awt/print/PrinterJob/PrintGlyphVectorTest.java > java/awt/print/PrinterJob/PrintLatinCJKTest.java > java/awt/print/PrinterJob/PrintTextTest.java > java/awt/print/PrinterJob/SwingUIText.java > java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java > java/awt/PrintJob/PageSetupDlgBlockingTest/PageSetupDlgBlockingTest.java > java/awt/PrintJob/SaveDialogTitleTest.java src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java line 1025: > 1023: * {@code GM_COMPATIBLE} or {@code GM_ADVANCED}. > 1024: */ > 1025: private int setGraphicsMode(int mode) { Is there any need of "int" return value? I dont see it is used in restoreTransform() ------------- PR: https://git.openjdk.java.net/jdk/pull/2756 From psadhukhan at openjdk.java.net Wed Mar 10 09:46:08 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 10 Mar 2021 09:46:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows In-Reply-To: References: Message-ID: On Fri, 26 Feb 2021 19:40:22 GMT, Alexander Scherbatiy wrote: > Printing text using GlyphVector outline has bad quality on printers with low DPI on Windows. > The GDI system used for text printing on Windows accepts only integer path coordinates. > Rounding GlyphVector outline coordinates leads to distorted printed text. > > The issue had been reported as JDK-8256264 but was reverted because of the regression JDK-8259007 "This test printed a blank page". > > The fix JDK-8256264 scaled coordinates in wPrinterJob.moveTo()/lineTo() methods up and scaled transforms in wPrinterJob.beginPath()/endPath() down. > > The regression was in the WPathGraphics.deviceDrawLine() method which uses wPrinterJob.moveTo()/lineTo() methods without surrounding them with wPrinterJob.beginPath()/endPath() so the line coordinates were only scaled up. > > I tried to put wPrinterJob.beginPath()/endPath() methods around wPrinterJob.moveTo()/lineTo() in the method WPathGraphics.deviceDrawLine() but the line was not drawn at all even without scaling coordinates up and transform down (without JDK-8256264 fix). It looks like GDI treats this case as an empty shape. > > The proposed fix applies path coordinates and transform scaling only in WPathGraphics.convertToWPath() method. > The one more PathPrecisionScaleFactorShapeTest.java manual test is added which checks that all methods that draw paths in WPathGraphics are used: line in WPathGraphics.deviceDrawLine() and SEG_LINETO/SEG_QUADTO/SEG_CUBICTO in WPathGraphics.convertToWPath() . > > The `java/awt/print` and `java/awt/PrintJob` automatic and manual tests were run on Windows 10 Pro with the fix. > > There are two failed automated tests which fail without the fix as well: > java/awt/print/PrinterJob/GlyphPositions.java > java/awt/print/PrinterJob/PSQuestionMark.java > > The following manual tests have issues on my system: > - `java/awt/print/Dialog/PrintDlgPageable.java` java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainThread cannot access a member of class PrintDlgPageable with modifiers "public static" > > - `java/awt/print/PrinterJob/PrintAttributeUpdateTest.java` I select pages radio button, press the print button but the test does not finish and I do not see any other dialogs with pass/fail buttons. > > - `java/awt/PrintJob/PrintCheckboxTest/PrintCheckboxManualTest.java` Tests that there is no ClassCastException thrown in printing checkbox and scrollbar with XAWT. Error. Can't find HTML file: test\jdk\java\awt\PrintJob\PrintCheckboxTest\PrintCheckboxManualTest.html > > > - `java/awt/print/PrinterJob/SecurityDialogTest.java` A windows with instructions is shown but it does not contain print/pass/fail buttons and it is not possible to close the window. > > - The tests below fail with "Error. Parse Exception: Arguments to `manual' option not supported: yesno" message: > java/awt/print/Dialog/DialogOrient.java > java/awt/print/Dialog/DialogType.java > java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java > java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java > java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java > java/awt/print/PrinterJob/PageDialogTest.java > java/awt/print/PrinterJob/PageRanges.java > java/awt/print/PrinterJob/PageRangesDlgTest.java > java/awt/print/PrinterJob/PrintGlyphVectorTest.java > java/awt/print/PrinterJob/PrintLatinCJKTest.java > java/awt/print/PrinterJob/PrintTextTest.java > java/awt/print/PrinterJob/SwingUIText.java > java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java > java/awt/PrintJob/PageSetupDlgBlockingTest/PageSetupDlgBlockingTest.java > java/awt/PrintJob/SaveDialogTitleTest.java src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp line 2033: > 2031: xForm.eDy = (FLOAT) elems[5]; > 2032: > 2033: ::SetWorldTransform((HDC)printDC, &xForm); Probably we should check for the return value of all this system APIs SetGraphicsMode, GetWorldTransform, SetWorldTransform, ModifyWorldTransform to see if it succeeded? ------------- PR: https://git.openjdk.java.net/jdk/pull/2756 From aghaisas at openjdk.java.net Wed Mar 10 10:51:08 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Wed, 10 Mar 2021 10:51:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v12] In-Reply-To: References: Message-ID: > **Description :** > This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) > It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. > The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) > > We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ > > A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. > > **Testing :** > This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) > > **Note to reviewers :** > 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. > > 2) To apply and test this PR - > To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) > > 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 45 additional commits since the last revision: - Lanai PR#213 - 8263325 - avu - Lanai PR#212 - 8259825 - aghaisas - Lanai PR#211 - 8262882 - aghaisas - Merge branch 'master' into 8260931_lanai_JEP_branch - Lanai PR#210 - 8263159 - jdv - Lanai PR#209 - 8262936 - jdv - Lanai PR#208 - 8262928 - jdv - Lanai PR#207 - 8262750 - jdv - Merge branch 'master' into 8260931_lanai_JEP_branch - Lanai PR#206 - 8262729 - aghaisas - ... and 35 more: https://git.openjdk.java.net/jdk/compare/dfe037de...3980ecbd ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2403/files - new: https://git.openjdk.java.net/jdk/pull/2403/files/de456939..3980ecbd Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2403&range=11 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2403&range=10-11 Stats: 4881 lines in 177 files changed: 1767 ins; 2327 del; 787 mod Patch: https://git.openjdk.java.net/jdk/pull/2403.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2403/head:pull/2403 PR: https://git.openjdk.java.net/jdk/pull/2403 From aghaisas at openjdk.java.net Wed Mar 10 11:58:20 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Wed, 10 Mar 2021 11:58:20 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Sun, 7 Mar 2021 22:40:53 GMT, Sergey Bylokhov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 36 additional commits since the last revision: >> >> - Lanai PR#206 - 8262729 - aghaisas >> - Lanai PR#205 - 8262496 - avu >> - Lanai PR#203 - 8262313 - jdv >> - Lanai PR#202 - 8262293 - avu >> - Lanai PR#201 - 8261891 - avu >> - Lanai PR#200 - 8262115 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#199 - 8262091 - aghaisas >> - Lanai PR#198 - 8261646 - avu >> - Lanai PR#197 - 8261960 - jdv >> - ... and 26 more: https://git.openjdk.java.net/jdk/compare/33534417...5cb1fd91 > > src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java line 304: > >> 302: }; >> 303: } >> 304: public MTLLayer createMTLLayer() { > > TODO to test that this functionality works Testing was done under JDK-8261141. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From aghaisas at openjdk.java.net Wed Mar 10 11:58:32 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Wed, 10 Mar 2021 11:58:32 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v11] In-Reply-To: References: <3XzbfpM41bmyAd3DCXAqrSEJaFlA5-CCd9PUO5fKpD8=.88284596-8b8d-48eb-bf69-6ef5c3f55037@github.com> Message-ID: On Tue, 9 Mar 2021 20:18:08 GMT, Sergey Bylokhov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 41 additional commits since the last revision: >> >> - Lanai PR#210 - 8263159 - jdv >> - Lanai PR#209 - 8262936 - jdv >> - Lanai PR#208 - 8262928 - jdv >> - Lanai PR#207 - 8262750 - jdv >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#206 - 8262729 - aghaisas >> - Lanai PR#205 - 8262496 - avu >> - Lanai PR#203 - 8262313 - jdv >> - Lanai PR#202 - 8262293 - avu >> - Lanai PR#201 - 8261891 - avu >> - ... and 31 more: https://git.openjdk.java.net/jdk/compare/d65116dd...de456939 > > src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLGraphicsConfig.m line 185: > >> 183: >> 184: NSRect contentRect = NSMakeRect(0, 0, 64, 64); >> 185: NSWindow *window = > > Some remnant from the scratch surface initialization? This will be removed under - JDK-8263363 ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From bourges.laurent at gmail.com Wed Mar 10 12:19:16 2021 From: bourges.laurent at gmail.com (=?UTF-8?Q?Laurent_Bourg=C3=A8s?=) Date: Wed, 10 Mar 2021 13:19:16 +0100 Subject: [OpenJDK 2D-Dev] Rendering images from PDF files slower in OpenJDK In-Reply-To: <6b7208d7-a528-882e-8f5a-920539c2b8ae@oracle.com> References: <873cc9de-604f-8b11-a5ba-fcccf4337e81@oracle.com> <5BB68521.7040708@oracle.com> <5BB69B8A.3040106@oracle.com> <5BB6F64F.2080303@oracle.com> <5BB6FF4A.3090105@oracle.com> <6b7208d7-a528-882e-8f5a-920539c2b8ae@oracle.com> Message-ID: Hi Sergey, Le lun. 8 mars 2021 ? 06:00, Sergey Bylokhov a ?crit : > Hi, Laurent. > > On 04.10.2018 23:45, Laurent Bourg?s wrote: > > I looks like a call to let me have a look. Maybe I could inspect what > makes LCMS slow (lerp?) ... and optimize the C code or at least tune gcc > options. > > Did you have a chance to look at it? =) > No, I agreed with phil, it is more a LCMS optimization task, for anybody involved in this project. I could have a look since, but no time nor motivation, sorry. This ticket is closeable or stalled until someone rewrites LCMS to be more efficient. Cheers, Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbaesken at openjdk.java.net Wed Mar 10 12:36:18 2021 From: mbaesken at openjdk.java.net (Matthias Baesken) Date: Wed, 10 Mar 2021 12:36:18 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263362: Avoid division by 0 in java/awt/font/TextJustifier.java justify Message-ID: In java/awt/font/TextJustifier.java justify-method there is a potential code path where divison by zero might happen , see also the Sonar finding https://sonarcloud.io/project/issues?id=shipilev_jdk&open=AXcqMwpm8sPJZZzONu1k&resolved=false&severities=CRITICAL&types=BUG boolean hitLimit = (weight == 0) || (!lastPass && ((delta < 0) == (delta < gslimit))); boolean absorbing = hitLimit && absorbweight > 0; // predivide delta by weight float weightedDelta = delta / weight; // not used if weight == 0 In case of (weight == 0) the division should not be done because the value of weightedDelta is unused in this case anyway. ------------- Commit messages: - JDK-8263362 Changes: https://git.openjdk.java.net/jdk/pull/2912/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2912&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263362 Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2912.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2912/head:pull/2912 PR: https://git.openjdk.java.net/jdk/pull/2912 From psadhukhan at openjdk.java.net Wed Mar 10 12:44:10 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 10 Mar 2021 12:44:10 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263362: Avoid division by 0 in java/awt/font/TextJustifier.java justify In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 12:31:31 GMT, Matthias Baesken wrote: > In java/awt/font/TextJustifier.java justify-method there is a potential code path where divison by zero might happen , see also the Sonar finding > https://sonarcloud.io/project/issues?id=shipilev_jdk&open=AXcqMwpm8sPJZZzONu1k&resolved=false&severities=CRITICAL&types=BUG > > > boolean hitLimit = (weight == 0) || (!lastPass && ((delta < 0) == (delta < gslimit))); > boolean absorbing = hitLimit && absorbweight > 0; > // predivide delta by weight > float weightedDelta = delta / weight; // not used if weight == 0 > > In case of (weight == 0) the division should not be done because the value of weightedDelta is unused in this case anyway. src/java.desktop/share/classes/java/awt/font/TextJustifier.java line 159: > 157: // predivide delta by weight > 158: float weightedDelta = 0; > 159: if (weight != 0) { // not used if weight == 0 Can it ever be -ve? Maybe we can do weight > 0 check just as we do for absorbweight? ------------- PR: https://git.openjdk.java.net/jdk/pull/2912 From mbaesken at openjdk.java.net Wed Mar 10 12:58:08 2021 From: mbaesken at openjdk.java.net (Matthias Baesken) Date: Wed, 10 Mar 2021 12:58:08 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263362: Avoid division by 0 in java/awt/font/TextJustifier.java justify In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 12:41:05 GMT, Prasanta Sadhukhan wrote: >> In java/awt/font/TextJustifier.java justify-method there is a potential code path where divison by zero might happen , see also the Sonar finding >> https://sonarcloud.io/project/issues?id=shipilev_jdk&open=AXcqMwpm8sPJZZzONu1k&resolved=false&severities=CRITICAL&types=BUG >> >> >> boolean hitLimit = (weight == 0) || (!lastPass && ((delta < 0) == (delta < gslimit))); >> boolean absorbing = hitLimit && absorbweight > 0; >> // predivide delta by weight >> float weightedDelta = delta / weight; // not used if weight == 0 >> >> In case of (weight == 0) the division should not be done because the value of weightedDelta is unused in this case anyway. > > src/java.desktop/share/classes/java/awt/font/TextJustifier.java line 159: > >> 157: // predivide delta by weight >> 158: float weightedDelta = 0; >> 159: if (weight != 0) { // not used if weight == 0 > > Can it ever be -ve? Maybe we can do weight > 0 check just as we do for absorbweight? Hi, I am not sure about the weight > 0 check ; weight is initialized with 0: weight = 0; and later some values are potentially added up to weight: weight += gi.weight; I am not sure about those gi.weight values, maybe they can be negative too ? ------------- PR: https://git.openjdk.java.net/jdk/pull/2912 From kcr at openjdk.java.net Wed Mar 10 14:16:34 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Wed, 10 Mar 2021 14:16:34 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v12] In-Reply-To: References: Message-ID: <8X7UHwOUe93kdQadaAFIyuLU5Q0Z6lOKJLwaceNMgGg=.de725ee4-d235-4618-9b02-c82ac51855df@github.com> On Wed, 10 Mar 2021 10:51:08 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 45 additional commits since the last revision: > > - Lanai PR#213 - 8263325 - avu > - Lanai PR#212 - 8259825 - aghaisas > - Lanai PR#211 - 8262882 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#206 - 8262729 - aghaisas > - ... and 35 more: https://git.openjdk.java.net/jdk/compare/42b2f14b...3980ecbd Marked as reviewed by kcr (Author). ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From aivanov at openjdk.java.net Wed Mar 10 15:43:24 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Wed, 10 Mar 2021 15:43:24 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling Message-ID: [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented polling for remote printers. That bug description also mentions watching the registry for changes and links to the article which describes the method yet it does so in terms of WMI. Using WMI is not necessary to watch for the registry updates. It is possible to replace polling mechanism with registry change notifications. If the registry at `HKCU\Printers\Connections` is updated, refresh the list of print services. It works perfectly well in my own testing with sharing a Generic / Text Only printer from another laptop. The notification comes as soon as the printer is installed, it results in a new key created under `Connections`. If a remote printer is removed, the notification is also triggered as the key corresponding to that printer is removed from the registry. I updated the steps in the manual test: `RemotePrinterStatusRefresh.java`. ------------- Commit messages: - 8263311: Watch registry changes for remote printers update instead of polling Changes: https://git.openjdk.java.net/jdk/pull/2915/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2915&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263311 Stats: 207 lines in 3 files changed: 31 ins; 158 del; 18 mod Patch: https://git.openjdk.java.net/jdk/pull/2915.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2915/head:pull/2915 PR: https://git.openjdk.java.net/jdk/pull/2915 From prr at openjdk.java.net Wed Mar 10 18:52:07 2021 From: prr at openjdk.java.net (Phil Race) Date: Wed, 10 Mar 2021 18:52:07 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263362: Avoid division by 0 in java/awt/font/TextJustifier.java justify In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 12:55:34 GMT, Matthias Baesken wrote: >> src/java.desktop/share/classes/java/awt/font/TextJustifier.java line 159: >> >>> 157: // predivide delta by weight >>> 158: float weightedDelta = 0; >>> 159: if (weight != 0) { // not used if weight == 0 >> >> Can it ever be -ve? Maybe we can do weight > 0 check just as we do for absorbweight? > > Hi, I am not sure about the weight > 0 check ; weight is initialized with 0: weight = 0; and later some values are potentially added up to weight: weight += gi.weight; > I am not sure about those gi.weight values, maybe they can be negative too ? Nothing throws an exception or otherwise prevent this being negative but that would be a weird usage. Typically the weight is either zero or based on the font size .. which ought not to be negative but I don't think anything prevents it and I think we would treat it essentially as a transform. So If you really want to be careful here, then yes assume weight could be negative. ------------- PR: https://git.openjdk.java.net/jdk/pull/2912 From aivanov at openjdk.java.net Wed Mar 10 21:01:14 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Wed, 10 Mar 2021 21:01:14 GMT Subject: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons In-Reply-To: References: Message-ID: On Mon, 8 Mar 2021 13:22:07 GMT, Alexander Zuev wrote: > Fix updated after first round of review. src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1044: > 1042: new BufferedImage(iconSize, iconSize, BufferedImage.TYPE_INT_ARGB); > 1043: img.setRGB(0, 0, iconSize, iconSize, iconBits, 0, iconSize); > 1044: return img; There are cases where the size of the buffered image is different from the requested size. It could affect the layout because it breaks the assumption that the returned image has the requested size but it may be larger. (Or is it no longer possible?) I think it should be wrapped into `MultiResolutionIconImage` in this case. src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1114: > 1112: bothIcons.put(getLargeIcon? SMALL_ICON_SIZE : LARGE_ICON_SIZE, newIcon2); > 1113: newIcon = new MultiResolutionIconImage(getLargeIcon ? LARGE_ICON_SIZE > 1114: : SMALL_ICON_SIZE, bothIcons); I still propose to refactor this code to make it clearer. The code always returns two icons: _small + large_ or _large + small_ ? combined in `MultiResolutionIconImage`. You can get `smallIcon` and `largeIcon` and then wrap them into `MultiResolutionIconImage` in the correct order and store each icon in the cache. My opinion hasn't changed here. I still think there's not much value in getting smaller icon size in addition to larger one. Or does it provide an alternative image for the case where the system scaling is 200% and the window is moved to a monitor with scaling of 100%? src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1195: > 1193: */ > 1194: static Image getShell32Icon(int iconID, int size) { > 1195: boolean useVGAColors = true; // Will be ignored on XP and later I cannot see where `useVGAColors` is used. Since the supported OS are later than XP, it can be removed, can't it? src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp line 983: > 981: size = 16; > 982: } > 983: hres = pIcon->Extract(szBuf, index, &hIcon, NULL, (16 << 16) + size); Suggestion: hres = pIcon->Extract(szBuf, index, &hIcon, NULL, size); Now you request only one icon. test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconTest.java line 64: > 62: } > 63: > 64: if (icon.getIconWidth() != size) { Does it make sense to check that the icon is a multi-resolution image with the expected sizes? We know for sure `explorer.exe` contains the entire set of icons. src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java line 264: > 262: *

> 263: * The default implementation gets information from the > 264: * ShellFolder class. Whenever possible, the icon Do we continue using `` elements? I thought that {@code} is the preferred way to markup class names. src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1112: > 1110: Map bothIcons = new HashMap<>(2); > 1111: bothIcons.put(getLargeIcon? LARGE_ICON_SIZE : SMALL_ICON_SIZE, newIcon); > 1112: bothIcons.put(getLargeIcon? SMALL_ICON_SIZE : LARGE_ICON_SIZE, newIcon2); Suggestion: bothIcons.put(getLargeIcon ? LARGE_ICON_SIZE : SMALL_ICON_SIZE, newIcon); bothIcons.put(getLargeIcon ? SMALL_ICON_SIZE : LARGE_ICON_SIZE, newIcon2); src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1146: > 1144: } > 1145: Map multiResolutionIcon = new HashMap<>(); > 1146: int start = size > MAX_QUALITY_ICON ? ICON_RESOLUTIONS.length - 1 : 0; Does it make sense to always start at zero? The icons of smaller size will never be used, will they? Thus it's safe to start at the index which corresponds to the requested size if `size` matches, or the index such as `ICON_RESOLUTIONS[index] < size && ICON_RESOLUTIONS[index + 1] > size`. src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1149: > 1147: int increment = size > MAX_QUALITY_ICON ? -1 : 1; > 1148: int end = size > MAX_QUALITY_ICON ? -1 : ICON_RESOLUTIONS.length; > 1149: for (int i = start; i != end; i+=increment) { Suggestion: for (int i = start; i != end; i += increment) { src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1422: > 1420: int w = (int) width; > 1421: int retindex = 0; > 1422: for (Integer i: resolutionVariants.keySet()) { Suggestion: for (Integer i : resolutionVariants.keySet()) { ------------- PR: https://git.openjdk.java.net/jdk/pull/2875 From serb at openjdk.java.net Wed Mar 10 23:16:07 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 10 Mar 2021 23:16:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: References: Message-ID: On Sat, 27 Feb 2021 18:33:52 GMT, Andrey Turbanov wrote: > 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From psadhukhan at openjdk.java.net Thu Mar 11 04:27:07 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Thu, 11 Mar 2021 04:27:07 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263362: Avoid division by 0 in java/awt/font/TextJustifier.java justify In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 18:48:50 GMT, Phil Race wrote: >> Hi, I am not sure about the weight > 0 check ; weight is initialized with 0: weight = 0; and later some values are potentially added up to weight: weight += gi.weight; >> I am not sure about those gi.weight values, maybe they can be negative too ? > > Nothing throws an exception or otherwise prevent this being negative but that would be a weird usage. Typically the weight is either zero or based on the font size .. which ought not to be negative but I don't think anything prevents it and I think we would treat it essentially as a transform. So If you really want to be careful here, then yes assume weight could be negative. By that same logic, then shouldn't absorbweight also be checked as != 0 instead of > 0 as that also uses += gi.weight ------------- PR: https://git.openjdk.java.net/jdk/pull/2912 From mbaesken at openjdk.java.net Thu Mar 11 06:48:10 2021 From: mbaesken at openjdk.java.net (Matthias Baesken) Date: Thu, 11 Mar 2021 06:48:10 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263362: Avoid division by 0 in java/awt/font/TextJustifier.java justify In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 04:24:26 GMT, Prasanta Sadhukhan wrote: >> Nothing throws an exception or otherwise prevent this being negative but that would be a weird usage. Typically the weight is either zero or based on the font size .. which ought not to be negative but I don't think anything prevents it and I think we would treat it essentially as a transform. So If you really want to be careful here, then yes assume weight could be negative. > > By that same logic, then shouldn't absorbweight also be checked as != 0 instead of > 0 as that also uses += gi.weight Hi, I am not sure about the absorbweight check; but currently the calculated value weightedAbsorb is only used when absorbing is true. And there the > 0 check is present too boolean absorbing = hitLimit && absorbweight > 0; ------------- PR: https://git.openjdk.java.net/jdk/pull/2912 From avu at openjdk.java.net Thu Mar 11 07:43:34 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Thu, 11 Mar 2021 07:43:34 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v12] In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 10:51:08 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 45 additional commits since the last revision: > > - Lanai PR#213 - 8263325 - avu > - Lanai PR#212 - 8259825 - aghaisas > - Lanai PR#211 - 8262882 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#206 - 8262729 - aghaisas > - ... and 35 more: https://git.openjdk.java.net/jdk/compare/59142f88...3980ecbd Marked as reviewed by avu (no project role). ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From psadhukhan at openjdk.java.net Thu Mar 11 10:16:07 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Thu, 11 Mar 2021 10:16:07 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263362: Avoid division by 0 in java/awt/font/TextJustifier.java justify In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 06:45:05 GMT, Matthias Baesken wrote: >> By that same logic, then shouldn't absorbweight also be checked as != 0 instead of > 0 as that also uses += gi.weight > > Hi, I am not sure about the absorbweight check; but currently the calculated value weightedAbsorb is only used when absorbing is true. And there the > 0 check is present too > > boolean absorbing = hitLimit && absorbweight > 0; I meant that since we are dividing by weight and absorbweight ` weightedDelta = delta / weight;` and weightedAbsorb = (delta - gslimit) / absorbweight; where both weight and absorbweight uses += gi.weight values so if one is checking for >0 then to be consistent, in my opinion, other one should be same or absorbweight also probably should check !=0. ------------- PR: https://git.openjdk.java.net/jdk/pull/2912 From psadhukhan at openjdk.java.net Thu Mar 11 10:43:10 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Thu, 11 Mar 2021 10:43:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 15:38:27 GMT, Alexey Ivanov wrote: > [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented polling for remote printers. > That bug description also mentions watching the registry for changes and links to the article which describes the method yet it does so in terms of WMI. Using WMI is not necessary to watch for the registry updates. > > It is possible to replace polling mechanism with registry change notifications. If the registry at `HKCU\Printers\Connections` is updated, refresh the list of print services. > > It works perfectly well in my own testing with sharing a Generic / Text Only printer from another laptop. The notification comes as soon as the printer is installed, it results in a new key created under `Connections`. If a remote printer is removed, the notification is also triggered as the key corresponding to that printer is removed from the registry. > > I updated the steps in the manual test: `RemotePrinterStatusRefresh.java`. src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp line 259: > 257: NULL, > 258: FALSE); > 259: if (keepMonitoring) { I guess having "FALSE" as fAsynchronous value mean the function does not return until a change has occurred so do we still need this do-while monitoring loop? And if the function fails once, should we stop monitoring? ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From aivanov at openjdk.java.net Thu Mar 11 10:57:07 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Thu, 11 Mar 2021 10:57:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: References: Message-ID: <1JslPPm4UVa_ZCLCTMlTj7osfSYbLTxiNZYch71j9ro=.83f0ffee-150a-46f3-92f6-fdb6a83ad96f@github.com> On Thu, 11 Mar 2021 10:39:56 GMT, Prasanta Sadhukhan wrote: > I guess having "FALSE" as fAsynchronous value mean the function does not return until a change has occurred so do we still need this do-while monitoring loop? You're right, `FALSE` for `fAsynchronous` means the function doesn't return until a change occurred. If a change occurs, we refresh the list of print services and then start to wait again. If we exit the loop, we'll not catch other changes that may occur. > And if the function fails once, should we stop monitoring? I followed Sergey's approach in `notifyLocalPrinterChange`, namely if `FindNextPrinterChangeNotification` returns an error, we quit the loop. I can't see how we can fix the error if it occurs. Will it succeed the next time? Probably not. Thus I decided to quit the loop in case of an error. ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From psadhukhan at openjdk.java.net Thu Mar 11 11:34:23 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Thu, 11 Mar 2021 11:34:23 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: <1JslPPm4UVa_ZCLCTMlTj7osfSYbLTxiNZYch71j9ro=.83f0ffee-150a-46f3-92f6-fdb6a83ad96f@github.com> References: <1JslPPm4UVa_ZCLCTMlTj7osfSYbLTxiNZYch71j9ro=.83f0ffee-150a-46f3-92f6-fdb6a83ad96f@github.com> Message-ID: On Thu, 11 Mar 2021 10:54:12 GMT, Alexey Ivanov wrote: >> src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp line 259: >> >>> 257: NULL, >>> 258: FALSE); >>> 259: if (keepMonitoring) { >> >> I guess having "FALSE" as fAsynchronous value mean the function does not return until a change has occurred so do we still need this do-while monitoring loop? And if the function fails once, should we stop monitoring? > >> I guess having "FALSE" as fAsynchronous value mean the function does not return until a change has occurred so do we still need this do-while monitoring loop? > > You're right, `FALSE` for `fAsynchronous` means the function doesn't return until a change occurred. > > If a change occurs, we refresh the list of print services and then start to wait again. If we exit the loop, we'll not catch other changes that may occur. > >> And if the function fails once, should we stop monitoring? > I followed Sergey's approach in `notifyLocalPrinterChange`, namely if `FindNextPrinterChangeNotification` returns an error, we quit the loop. > > I can't see how we can fix the error if it occurs. Will it succeed the next time? Probably not. Thus I decided to quit the loop in case of an error. I also am not sure on this. But I think since this is for remote printer, sometimes network availability issue might be there so it may fail more compared to local printer so I guess we should give this method a fair chance, more than that of local printer change, and not bail out on one failure.....maybe try out after some duration...or 5 times spaced out...as you did for the other EnumPrinter fix.. ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From akozlov at openjdk.java.net Thu Mar 11 14:07:44 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Thu, 11 Mar 2021 14:07:44 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v23] In-Reply-To: References: Message-ID: <5oHOwsaj5Jpg7ukRTFk7MG--w0_bq2qSwH6FN0WOZNY=.e519c482-ba19-4e24-955d-07743ab92359@github.com> On Wed, 3 Mar 2021 15:57:13 GMT, Gerard Ziemski wrote: >> src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 207: >> >>> 205: // Enable WXWrite: this function is called by the signal handler at arbitrary >>> 206: // point of execution. >>> 207: ThreadWXEnable wx(WXWrite, thread); >> >> Note that `thread` can be NULL here if the signal handler is running in a non-attached thread. If we then perform: >> `ThreadWXEnable(WXMode new_mode, Thread* thread = NULL) : >> _thread(thread ? thread : Thread::current()),` >> we call Thread::current() on a non-attached thread and that will assert/crash if we get NULL. Either avoid using WX when the thread is NULL, or else change to use Thread::current_or_null_safe() and ensure all uses have a NULL check. > >> Note that `thread` can be NULL here if the signal handler is running in a non-attached thread. If we then perform: >> `ThreadWXEnable(WXMode new_mode, Thread* thread = NULL) : _thread(thread ? thread : Thread::current()),` >> we call Thread::current() on a non-attached thread and that will assert/crash if we get NULL. Either avoid using WX when the thread is NULL, or else change to use Thread::current_or_null_safe() and ensure all uses have a NULL check. > > https://bugs.openjdk.java.net/browse/JDK-8262903 tracks this issue. Thanks for report and analysis! I fixed this in https://github.com/openjdk/jdk/pull/2200/commits/f6fb01b24f525e578692a1c6f2ff0a55b8233576 ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Thu Mar 11 14:07:43 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Thu, 11 Mar 2021 14:07:43 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v25] In-Reply-To: References: Message-ID: > Please review the implementation of JEP 391: macOS/AArch64 Port. > > It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. > > Major changes are in: > * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) > * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) > * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. > * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: 8262903: [macos_aarch64] Thread::current() called on detached thread ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2200/files - new: https://git.openjdk.java.net/jdk/pull/2200/files/a72f6834..f6fb01b2 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=24 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=23-24 Stats: 13 lines in 5 files changed: 3 ins; 0 del; 10 mod Patch: https://git.openjdk.java.net/jdk/pull/2200.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2200/head:pull/2200 PR: https://git.openjdk.java.net/jdk/pull/2200 From aivanov at openjdk.java.net Thu Mar 11 14:53:11 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Thu, 11 Mar 2021 14:53:11 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: References: <1JslPPm4UVa_ZCLCTMlTj7osfSYbLTxiNZYch71j9ro=.83f0ffee-150a-46f3-92f6-fdb6a83ad96f@github.com> Message-ID: On Thu, 11 Mar 2021 11:30:52 GMT, Prasanta Sadhukhan wrote: >>> I guess having "FALSE" as fAsynchronous value mean the function does not return until a change has occurred so do we still need this do-while monitoring loop? >> >> You're right, `FALSE` for `fAsynchronous` means the function doesn't return until a change occurred. >> >> If a change occurs, we refresh the list of print services and then start to wait again. If we exit the loop, we'll not catch other changes that may occur. >> >>> And if the function fails once, should we stop monitoring? >> I followed Sergey's approach in `notifyLocalPrinterChange`, namely if `FindNextPrinterChangeNotification` returns an error, we quit the loop. >> >> I can't see how we can fix the error if it occurs. Will it succeed the next time? Probably not. Thus I decided to quit the loop in case of an error. > > I also am not sure on this. But I think since this is for remote printer, sometimes network availability issue might be there so it may fail more compared to local printer so I guess we should give this method a fair chance, more than that of local printer change, and not bail out on one failure.....maybe try out after some duration...or 5 times spaced out...as you did for the other EnumPrinter fix.. No, network connectivity cannot affect this. The function watches for registry changes, specifically keys created or removed under `HKCU\Printers\Connections`. If network is down, you won't be able to add a new printer. Yet you can still remove an existing printer. The case with `EnumPrinters` is very different. A printer may be renamed or a new printer may be added therefore the allocated buffer becomes to small to fit the updated data. Thus retrying with larger buffer makes perfect sense. In this case, `RegNotifyChangeKeyValue` could fail only because of invalid parameters. If it does, it will fail on the retry because the parameters haven't changed. In that sense, it's the same as with local printers. If the wait/notification function fails the first time, it will likely fail the second time and so on? ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From aivanov at openjdk.java.net Thu Mar 11 15:03:07 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Thu, 11 Mar 2021 15:03:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: References: Message-ID: <425OYVrQ8UldCi_4u-C5Q1RiYJJr5lrCT4mOmO-CDG4=.53915594-664a-4971-b04d-5097cec69028@github.com> On Wed, 10 Mar 2021 15:38:27 GMT, Alexey Ivanov wrote: > [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented polling for remote printers. > That bug description also mentions watching the registry for changes and links to the article which describes the method yet it does so in terms of WMI. Using WMI is not necessary to watch for the registry updates. > > It is possible to replace polling mechanism with registry change notifications. If the registry at `HKCU\Printers\Connections` is updated, refresh the list of print services. > > It works perfectly well in my own testing with sharing a Generic / Text Only printer from another laptop. The notification comes as soon as the printer is installed, it results in a new key created under `Connections`. If a remote printer is removed, the notification is also triggered as the key corresponding to that printer is removed from the registry. > > I updated the steps in the manual test: `RemotePrinterStatusRefresh.java`. src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp line 258: > 256: REG_NOTIFY_CHANGE_NAME, > 257: NULL, > 258: FALSE); [`RegNotifyChangeKeyValue`](https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regnotifychangekeyvalue) notifies the caller about changes to the attributes or contents of a specified registry key. ? `hKey`: A handle to `HKEY_CURRENT_USER\Printers\Connections` key which is opened above. ? `bWatchSubtree = TRUE`: The function reports changes in the specified key and its subkeys. ? `dwNotifyFilter = REG_NOTIFY_CHANGE_NAME`: Notify the caller if a subkey is added or deleted. ? `hEvent = NULL`: If `fAsynchronous` is FALSE, `hEvent` is ignored. ? `fAsynchronous = FALSE`: The function does not return until a change has occurred. When a new remote printer is added, a new key is created under `HKCU\Printers\Connections`; when an existing remote printer is removed, the key below `Connections` is removed; no values are added or removed in `Connections` key, thus `REG_NOTIFY_CHANGE_LAST_SET` filter is not needed. ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From avu at openjdk.java.net Thu Mar 11 16:53:12 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Thu, 11 Mar 2021 16:53:12 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Tue, 9 Mar 2021 23:15:57 GMT, Sergey Bylokhov wrote: >> Also, MTLSD_WINDOW is supported > > How it is used? Can we really draw to the window directly? It looks like it copied from the OGL where it is unused since CLayer integration. Something is inconsistent here. Here is a follow-up issue JDK-8263463 ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From aghaisas at openjdk.java.net Thu Mar 11 17:54:16 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Thu, 11 Mar 2021 17:54:16 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v12] In-Reply-To: References: <8YBuOeDAPN2osBnW5cyN-91hYtg7malBqDlJZsgWrPk=.6c99ab50-76a8-4686-85dd-5918abfdacf0@github.com> Message-ID: On Mon, 8 Feb 2021 18:47:09 GMT, Sergey Bylokhov wrote: >> src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLGraphicsConfig.m line 82: >> >>> 80: (JNIEnv *env, jclass mtlgc) >>> 81: { >>> 82: FILE *f = popen("/usr/sbin/system_profiler SPDisplaysDataType", "r"); >> >> How robust is this? It seems like the contents of this could be an implementation detail and subject to change. Is it documented by Apple? > > I suggest fixing this before the integration. Fixed with JDK-8259825. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From aghaisas at openjdk.java.net Thu Mar 11 18:00:15 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Thu, 11 Mar 2021 18:00:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: > **Description :** > This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) > It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. > The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) > > We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ > > A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. > > **Testing :** > This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) > > **Note to reviewers :** > 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. > > 2) To apply and test this PR - > To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) > > 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: - Lanai PR#214 - 8263324 - avu - Merge branch 'master' into 8260931_lanai_JEP_branch - Lanai PR#213 - 8263325 - avu - Lanai PR#212 - 8259825 - aghaisas - Lanai PR#211 - 8262882 - aghaisas - Merge branch 'master' into 8260931_lanai_JEP_branch - Lanai PR#210 - 8263159 - jdv - Lanai PR#209 - 8262936 - jdv - Lanai PR#208 - 8262928 - jdv - Lanai PR#207 - 8262750 - jdv - ... and 37 more: https://git.openjdk.java.net/jdk/compare/1c8fee73...369c3d21 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2403/files - new: https://git.openjdk.java.net/jdk/pull/2403/files/3980ecbd..369c3d21 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2403&range=12 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2403&range=11-12 Stats: 2420 lines in 128 files changed: 1246 ins; 368 del; 806 mod Patch: https://git.openjdk.java.net/jdk/pull/2403.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2403/head:pull/2403 PR: https://git.openjdk.java.net/jdk/pull/2403 From aghaisas at openjdk.java.net Thu Mar 11 18:10:23 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Thu, 11 Mar 2021 18:10:23 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v12] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 07:40:47 GMT, Alexey Ushakov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 45 additional commits since the last revision: >> >> - Lanai PR#213 - 8263325 - avu >> - Lanai PR#212 - 8259825 - aghaisas >> - Lanai PR#211 - 8262882 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#210 - 8263159 - jdv >> - Lanai PR#209 - 8262936 - jdv >> - Lanai PR#208 - 8262928 - jdv >> - Lanai PR#207 - 8262750 - jdv >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#206 - 8262729 - aghaisas >> - ... and 35 more: https://git.openjdk.java.net/jdk/compare/d1e5ff8f...3980ecbd > > Marked as reviewed by avu (no project role). We have addressed the review comments (except for a few minor follow-on issues) This version of the PR is the one which we are planning to integrate into the JDK. Please review and approve. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From shade at openjdk.java.net Thu Mar 11 19:20:24 2021 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Thu, 11 Mar 2021 19:20:24 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263467: Incorrect double-checked locking in sun.java2d.CRenderer Message-ID: SonarCloud reports multiple incorrect double-checked locking cases in `sun.java2d.CRenderer`. For example: Arc2D arcToShape; ... if (arcToShape == null) { synchronized (this) { if (arcToShape == null) { arcToShape = new Arc2D.Float(); } } } `Arc2D` contains fields that are not `final`. `arcToShape` is not `volatile`. This makes it an incorrect DCL. This code is used by Mac OS, do it would probably blow up some time later on M1. This is the candidate fix that preserves the semantics. I am doing this fix blindly so far, without testing on real Mac OS. But maybe there is no need to do any of this, because the setter methods overwrite the contents of all these objects under their own sync. So, maybe we can just allocate those objects without DCL-backed caching and pass them in? ------------- Commit messages: - JDK-8263467: Incorrect double-checked locking in sun.java2d.CRenderer Changes: https://git.openjdk.java.net/jdk/pull/2948/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2948&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263467 Stats: 50 lines in 1 file changed: 15 ins; 0 del; 35 mod Patch: https://git.openjdk.java.net/jdk/pull/2948.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2948/head:pull/2948 PR: https://git.openjdk.java.net/jdk/pull/2948 From prr at openjdk.java.net Thu Mar 11 19:45:36 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 11 Mar 2021 19:45:36 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 18:00:15 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: > > - Lanai PR#214 - 8263324 - avu > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#213 - 8263325 - avu > - Lanai PR#212 - 8259825 - aghaisas > - Lanai PR#211 - 8262882 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - ... and 37 more: https://git.openjdk.java.net/jdk/compare/ada1a022...369c3d21 Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From stefank at openjdk.java.net Thu Mar 11 20:31:16 2021 From: stefank at openjdk.java.net (Stefan Karlsson) Date: Thu, 11 Mar 2021 20:31:16 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v25] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 14:07:43 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: > > 8262903: [macos_aarch64] Thread::current() called on detached thread Marked as reviewed by stefank (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From stefank at openjdk.java.net Thu Mar 11 20:31:17 2021 From: stefank at openjdk.java.net (Stefan Karlsson) Date: Thu, 11 Mar 2021 20:31:17 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v12] In-Reply-To: References: <8MnBLkES1lapB4b01NDzU9nhOk8_9_V--NSCM5H_bg8=.7bdb576b-4acd-4e5b-be14-b363a2ef47bf@github.com> Message-ID: <3NYUmXmjyZFhGJwrHfEjSRX1VRaPjt5cCp9HRBxODbM=.4880b6d1-f6dd-45db-95f4-9064e9204d87@github.com> On Tue, 9 Mar 2021 17:55:12 GMT, Anton Kozlov wrote: >> src/hotspot/share/runtime/thread.cpp line 2515: >> >>> 2513: void JavaThread::check_special_condition_for_native_trans(JavaThread *thread) { >>> 2514: // Enable WXWrite: called directly from interpreter native wrapper. >>> 2515: MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread)); >> >> FWIW, I personally think that adding these MACOS_AARCH64_ONLY usages at the call sites increase the line-noise in the affected functions. I think I would have preferred a version: >> ThreadWXEnable(WXMode new_mode, Thread* thread = NULL) { >> MACOS_AARCH64_ONLY(initialize(new_mode, thread);) {} >> void initialize(...); // Implementation in thread_bsd_aarch64.cpp (alt. inline.hpp) >> With that said, I'm fine with taking this discussion as a follow-up. > > The former version used no such macros. I like that now it's clear the W^X management is relevant to macos/aarch64 only. I see the point to move the pre-processor condition into the class implementation. But I think it will bring a bit of inconsistency, as the rest of W^X implementation is explicitly guarded by preprocessor conditionals. I've also tried to push macro conditionals as far as possible down to implementation, providing a kind of generalized W^X interface. That required a few artificial decisions, e.g. how would we call the mode we execute on the rest of platforms with write and execute allowed, WXWriteExec?.. I abandoned that attempt. I think we would use the same names, but I haven't given it more thought. I might take a look at this after this has been integrated. >> src/hotspot/share/runtime/thread.hpp line 848: >> >>> 846: void init_wx(); >>> 847: WXMode enable_wx(WXMode new_state); >>> 848: #endif // __APPLE__ && AARCH64 >> >> Now that this is only compiled into macOS/AArch64, could this be moved over to thread_bsd_aarch64.hpp? The same goes for the associated functions. > > The thread_bsd_aarch64.hpp describes a part of JavaThread, while this block belongs to Thread for now. Since W^X is an attribute of any operating system thread, I assumed Thread to be the right place for W^X bookkeeping. > > In most cases, we manage W^X state of JavaThread. But sometimes a GC thread needs the WXWrite state, or safefetch is called from non-JavaThread. Probably this can be dealt with (e.g. GCThread to always have the WXWrite state). But such change would be much more than a simple refactoring and it would require a significant amount of testing. Ideally, I would like to investigate this as a follow-up change, or at least after other fixes to this PR. Good point about Thread vs JavaThread. Yes, this can be looked into as follow-up cleanups. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From kcr at openjdk.java.net Fri Mar 12 00:13:38 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Fri, 12 Mar 2021 00:13:38 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 18:00:15 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: > > - Lanai PR#214 - 8263324 - avu > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#213 - 8263325 - avu > - Lanai PR#212 - 8259825 - aghaisas > - Lanai PR#211 - 8262882 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - ... and 37 more: https://git.openjdk.java.net/jdk/compare/204b2bcc...369c3d21 Latest changes look good. I confirmed that this PR has all of the content from the lanai repo. ------------- Marked as reviewed by kcr (Author). PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Fri Mar 12 01:14:36 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 12 Mar 2021 01:14:36 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 18:00:15 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: > > - Lanai PR#214 - 8263324 - avu > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#213 - 8263325 - avu > - Lanai PR#212 - 8259825 - aghaisas > - Lanai PR#211 - 8262882 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - ... and 37 more: https://git.openjdk.java.net/jdk/compare/5e61bf57...369c3d21 src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 323: > 321: * more code just to support a few uncommon cases. > 322: */ > 323: public boolean canRenderLCDText(SunGraphics2D sg2d) { Just curious, can we render LCD on 10.14+ via metal? Does it work fine? src/java.desktop/macosx/native/libawt_lwawt/awt/AWTSurfaceLayers.m line 73: > 71: // Updates back buffer size of the layer if it's an OpenGL/Metal layer > 72: // including all OpenGL/Metal sublayers > 73: + (void) repaintLayersRecursively:(CALayer*)aLayer { The operation of this code is still being investigated. @prsadhuk please add a bugid here. src/java.desktop/macosx/classes/sun/java2d/metal/MTLGraphicsConfig.java line 148: > 146: rq.lock(); > 147: try { > 148: // getMTLConfigInfo() creates and destroys temporary Does it really create and destroy temporary surfaces/contexts? src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.m line 813: > 811: initTemplatePipelineDescriptors(); > 812: // This block is not reached in current implementation. > 813: // Texture paint XOR mode rendering uses a tile based rendering using a SW pipe (similar to OGL) Do we have a bugid to implement this later? src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceDataBase.h line 59: > 57: * The offset in pixels of the Metal viewport origin from the lower-left > 58: * corner of the heavyweight drawable. For example, a top-level frame on > 59: * Windows XP has lower-left insets of (4,4). The Metal viewport origin Do we really use these fields? "Windows XP"?? ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Fri Mar 12 01:14:08 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 12 Mar 2021 01:14:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Tue, 9 Mar 2021 20:16:25 GMT, Alexey Ushakov wrote: >> src/java.desktop/macosx/classes/sun/java2d/metal/MTLBlitLoops.java line 499: >> >>> 497: } >>> 498: >>> 499: // We can convert argb_pre data from MTL surface in two places: >> >> Does anybody check that this is true for the metal pipeline? or It is just copied from the OGL? > > I fixed some conversion logic within JDK-8256331. OK, just to confirm. I wrote that text for OGL because it was the fastest way to transfer+convert the data from the video card to the memory. And as far as I understand the metal has the same limitation? It is not possible to convert it to some non-ARGB/Pre format on the fly while transferring the pixles? >> src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 146: >> >>> 144: return MTLSurfaceRTT; >>> 145: default: >>> 146: return MTLSurface; >> >> Do we really support 3 different types of surface? I guess only two of them are different: textures used for manageable images, and surfaces used by the volatile image. > > It's true but I don't see any problem returning a more generic type as a default here tbd ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Fri Mar 12 01:14:37 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 12 Mar 2021 01:14:37 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Wed, 10 Mar 2021 11:43:43 GMT, Ajit Ghaisas wrote: >> src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java line 304: >> >>> 302: }; >>> 303: } >>> 304: public MTLLayer createMTLLayer() { >> >> TODO to test that this functionality works > > Testing was done under JDK-8261141. JDK-8261630 ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From jdv at openjdk.java.net Fri Mar 12 02:33:25 2021 From: jdv at openjdk.java.net (Jayathirth D V) Date: Fri, 12 Mar 2021 02:33:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 00:42:35 GMT, Sergey Bylokhov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: >> >> - Lanai PR#214 - 8263324 - avu >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#213 - 8263325 - avu >> - Lanai PR#212 - 8259825 - aghaisas >> - Lanai PR#211 - 8262882 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#210 - 8263159 - jdv >> - Lanai PR#209 - 8262936 - jdv >> - Lanai PR#208 - 8262928 - jdv >> - Lanai PR#207 - 8262750 - jdv >> - ... and 37 more: https://git.openjdk.java.net/jdk/compare/53b0bea8...369c3d21 > > src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 323: > >> 321: * more code just to support a few uncommon cases. >> 322: */ >> 323: public boolean canRenderLCDText(SunGraphics2D sg2d) { > > Just curious, can we render LCD on 10.14+ via metal? Does it work fine? Yes Sergey it works fine in 10.14+ systems via metal. Most of the JCK manual tests use LCD text on UI Components and it is recently verified in 10.14+ systems for EA10. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Fri Mar 12 02:53:10 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 12 Mar 2021 02:53:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 02:29:04 GMT, Jayathirth D V wrote: >> src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 323: >> >>> 321: * more code just to support a few uncommon cases. >>> 322: */ >>> 323: public boolean canRenderLCDText(SunGraphics2D sg2d) { >> >> Just curious, can we render LCD on 10.14+ via metal? Does it work fine? > > Yes Sergey it works fine in 10.14+ systems via metal. Most of the JCK manual tests use LCD text on UI Components and it is recently verified in 10.14+ systems for EA10. Ok, for some reason I thought that the new macOS stopped providing LCD glyphs. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Fri Mar 12 03:22:09 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 12 Mar 2021 03:22:09 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263467: Incorrect double-checked locking in sun.java2d.CRenderer In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 19:13:47 GMT, Aleksey Shipilev wrote: > SonarCloud reports multiple incorrect double-checked locking cases in `sun.java2d.CRenderer`. For example: > > Arc2D arcToShape; > > ... > if (arcToShape == null) { > synchronized (this) { > if (arcToShape == null) { > arcToShape = new Arc2D.Float(); > } > } > } > > `Arc2D` contains fields that are not `final`. `arcToShape` is not `volatile`. This makes it an incorrect DCL. > This code is used by Mac OS, do it would probably blow up some time later on M1. > > This is the candidate fix that preserves the semantics. I am doing this fix blindly so far, without testing on real Mac OS. But maybe there is no need to do any of this, because the setter methods overwrite the contents of all these objects under their own sync. So, maybe we can just allocate those objects without DCL-backed caching and pass them in? I guess "Incorrect double-checked" is a too strict description of this code, it just tried to eliminate the creation of one object and do not care about the content of that object, since it is immediately overridden. I think It will be more clear to just eliminate this DCL since overhead and code complexity seems too much to just cache five objects. Probably it was important in past(jdk6 and below) when this renderer was used for onscreen rendering. Currently, it is used for printing(if actually used at all). ------------- PR: https://git.openjdk.java.net/jdk/pull/2948 From serb at openjdk.java.net Fri Mar 12 03:48:06 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 12 Mar 2021 03:48:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 23:13:09 GMT, Sergey Bylokhov wrote: >> 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe > > Marked as reviewed by serb (Reviewer). @prrace Do you have any objections to integrating this change? ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From psadhukhan at openjdk.java.net Fri Mar 12 04:17:24 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 12 Mar 2021 04:17:24 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 00:48:58 GMT, Sergey Bylokhov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: >> >> - Lanai PR#214 - 8263324 - avu >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#213 - 8263325 - avu >> - Lanai PR#212 - 8259825 - aghaisas >> - Lanai PR#211 - 8262882 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#210 - 8263159 - jdv >> - Lanai PR#209 - 8262936 - jdv >> - Lanai PR#208 - 8262928 - jdv >> - Lanai PR#207 - 8262750 - jdv >> - ... and 37 more: https://git.openjdk.java.net/jdk/compare/aca5b193...369c3d21 > > src/java.desktop/macosx/native/libawt_lwawt/awt/AWTSurfaceLayers.m line 73: > >> 71: // Updates back buffer size of the layer if it's an OpenGL/Metal layer >> 72: // including all OpenGL/Metal sublayers >> 73: + (void) repaintLayersRecursively:(CALayer*)aLayer { > > The operation of this code is still being investigated. @prsadhuk please add a bugid here. JDK-8263485 ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From aghaisas at openjdk.java.net Fri Mar 12 04:20:26 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Fri, 12 Mar 2021 04:20:26 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 01:04:22 GMT, Sergey Bylokhov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: >> >> - Lanai PR#214 - 8263324 - avu >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#213 - 8263325 - avu >> - Lanai PR#212 - 8259825 - aghaisas >> - Lanai PR#211 - 8262882 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#210 - 8263159 - jdv >> - Lanai PR#209 - 8262936 - jdv >> - Lanai PR#208 - 8262928 - jdv >> - Lanai PR#207 - 8262750 - jdv >> - ... and 37 more: https://git.openjdk.java.net/jdk/compare/23f9642d...369c3d21 > > src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.m line 813: > >> 811: initTemplatePipelineDescriptors(); >> 812: // This block is not reached in current implementation. >> 813: // Texture paint XOR mode rendering uses a tile based rendering using a SW pipe (similar to OGL) > > Do we have a bugid to implement this later? This is not exactly a TODO which we intend to implement later. Hence, there is no bugid. Metal does not support XOR mode rendering. I have kept this code as to know the code path to take in case we need to implement it in future. > src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceDataBase.h line 59: > >> 57: * The offset in pixels of the Metal viewport origin from the lower-left >> 58: * corner of the heavyweight drawable. For example, a top-level frame on >> 59: * Windows XP has lower-left insets of (4,4). The Metal viewport origin > > Do we really use these fields? "Windows XP"?? This will be fixed as a follow-on issue - JDK-8263486. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From jayathirth.d.v at oracle.com Fri Mar 12 04:41:05 2021 From: jayathirth.d.v at oracle.com (Jayathirth D V) Date: Fri, 12 Mar 2021 04:41:05 +0000 Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: <5BB55AA4-04ED-4B6B-BB89-61DDD5D7EB53@gmail.com> References: <5BB55AA4-04ED-4B6B-BB89-61DDD5D7EB53@gmail.com> Message-ID: <31566D3F-22C4-4C12-96DC-E5158574C7D0@oracle.com> > On 12-Mar-2021, at 9:29 AM, Scott Palmer wrote: > > >> On Mar 11, 2021, at 9:53 PM, Sergey Bylokhov wrote: >> >> ?On Fri, 12 Mar 2021 02:29:04 GMT, Jayathirth D V wrote: >> >>>> src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 323: >>>> >>>>> 321: * more code just to support a few uncommon cases. >>>>> 322: */ >>>>> 323: public boolean canRenderLCDText(SunGraphics2D sg2d) { >>>> >>>> Just curious, can we render LCD on 10.14+ via metal? Does it work fine? >>> >>> Yes Sergey it works fine in 10.14+ systems via metal. Most of the JCK manual tests use LCD text on UI Components and it is recently verified in 10.14+ systems for EA10. >> >> Ok, for some reason I thought that the new macOS stopped providing LCD glyphs. >> > > Are the glyphs different or just the way they are rasterized? > > Newer versions of macOS don?t do LCD text and have gone back to plain grey-scale anti-aliasing. > Java 2D should default to NOT doing LCD anti-aliasing for text on macOS if it wants to fit in with the look of native applications. > (I?m not sure if that applies to non-retina displays.) > By default we don?t do LCD anti-aliasing for text, only when we set Text Rendering Hint to use LCD antialiasing we take sub-pixel rendering path. > Scott From psadhukhan at openjdk.java.net Fri Mar 12 04:58:12 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 12 Mar 2021 04:58:12 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: <425OYVrQ8UldCi_4u-C5Q1RiYJJr5lrCT4mOmO-CDG4=.53915594-664a-4971-b04d-5097cec69028@github.com> References: <425OYVrQ8UldCi_4u-C5Q1RiYJJr5lrCT4mOmO-CDG4=.53915594-664a-4971-b04d-5097cec69028@github.com> Message-ID: <1XWnbAUoXYd0shleNnct4uky2ZboVmUSvPJ5AXXsheM=.5bdbc41e-ab5b-4037-9872-7f4261d5a462@github.com> On Thu, 11 Mar 2021 14:59:55 GMT, Alexey Ivanov wrote: >> [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented polling for remote printers. >> That bug description also mentions watching the registry for changes and links to the article which describes the method yet it does so in terms of WMI. Using WMI is not necessary to watch for the registry updates. >> >> It is possible to replace polling mechanism with registry change notifications. If the registry at `HKCU\Printers\Connections` is updated, refresh the list of print services. >> >> It works perfectly well in my own testing with sharing a Generic / Text Only printer from another laptop. The notification comes as soon as the printer is installed, it results in a new key created under `Connections`. If a remote printer is removed, the notification is also triggered as the key corresponding to that printer is removed from the registry. >> >> I updated the steps in the manual test: `RemotePrinterStatusRefresh.java`. > > src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp line 258: > >> 256: REG_NOTIFY_CHANGE_NAME, >> 257: NULL, >> 258: FALSE); > > [`RegNotifyChangeKeyValue`](https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regnotifychangekeyvalue) notifies the caller about changes to the attributes or contents of a specified registry key. > > ? `hKey`: A handle to `HKEY_CURRENT_USER\Printers\Connections` key which is opened above. > ? `bWatchSubtree = TRUE`: The function reports changes in the specified key and its subkeys. > ? `dwNotifyFilter = REG_NOTIFY_CHANGE_NAME`: Notify the caller if a subkey is added or deleted. > ? `hEvent = NULL`: If `fAsynchronous` is FALSE, `hEvent` is ignored. > ? `fAsynchronous = FALSE`: The function does not return until a change has occurred. > > When a new remote printer is added, a new key is created under `HKCU\Printers\Connections`; when an existing remote printer is removed, the key below `Connections` is removed; no values are added or removed in `Connections` key, thus `REG_NOTIFY_CHANGE_LAST_SET` filter is not needed. Is this only about addition/removal? What about printer name change? Shouldn't we get notified in that case as trying to print on printer with old name will not find the printer!! If yes, in that regard I guess REG_NOTIFY_CHANGE_LAST_SET is the one to go for as it states `"Notify the caller of changes to a value of the key. This can include adding or deleting a value, or changing an existing value. "` ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From psadhukhan at openjdk.java.net Fri Mar 12 04:58:11 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 12 Mar 2021 04:58:11 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: References: <1JslPPm4UVa_ZCLCTMlTj7osfSYbLTxiNZYch71j9ro=.83f0ffee-150a-46f3-92f6-fdb6a83ad96f@github.com> Message-ID: On Thu, 11 Mar 2021 14:49:59 GMT, Alexey Ivanov wrote: >> I also am not sure on this. But I think since this is for remote printer, sometimes network availability issue might be there so it may fail more compared to local printer so I guess we should give this method a fair chance, more than that of local printer change, and not bail out on one failure.....maybe try out after some duration...or 5 times spaced out...as you did for the other EnumPrinter fix.. > > No, network connectivity cannot affect this. The function watches for registry changes, specifically keys created or removed under `HKCU\Printers\Connections`. If network is down, you won't be able to add a new printer. Yet you can still remove an existing printer. > > The case with `EnumPrinters` is very different. A printer may be renamed or a new printer may be added therefore the allocated buffer becomes to small to fit the updated data. Thus retrying with larger buffer makes perfect sense. > > In this case, `RegNotifyChangeKeyValue` could fail only because of invalid parameters. If it does, it will fail on the retry because the parameters haven't changed. > > In that sense, it's the same as with local printers. If the wait/notification function fails the first time, it will likely fail the second time and so on? Ok ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From serb at openjdk.java.net Fri Mar 12 05:00:30 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 12 Mar 2021 05:00:30 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 00:09:54 GMT, Kevin Rushforth wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: >> >> - Lanai PR#214 - 8263324 - avu >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#213 - 8263325 - avu >> - Lanai PR#212 - 8259825 - aghaisas >> - Lanai PR#211 - 8262882 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#210 - 8263159 - jdv >> - Lanai PR#209 - 8262936 - jdv >> - Lanai PR#208 - 8262928 - jdv >> - Lanai PR#207 - 8262750 - jdv >> - ... and 37 more: https://git.openjdk.java.net/jdk/compare/9d82be31...369c3d21 > > Latest changes look good. I confirmed that this PR has all of the content from the lanai repo. > By default we don?t do LCD anti-aliasing for text, only when we set Text Rendering Hint to use LCD antialiasing we take sub-pixel rendering path. And it actually produces LCD glyphs? not the grayscale? ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From jayathirth.d.v at oracle.com Fri Mar 12 05:09:56 2021 From: jayathirth.d.v at oracle.com (Jayathirth D V) Date: Fri, 12 Mar 2021 05:09:56 +0000 Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: <0C86C579-3AC4-4C0A-9B95-A9335276C4B2@oracle.com> > On 12-Mar-2021, at 10:30 AM, Sergey Bylokhov wrote: > > On Fri, 12 Mar 2021 00:09:54 GMT, Kevin Rushforth wrote: > >>> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: >>> >>> - Lanai PR#214 - 8263324 - avu >>> - Merge branch 'master' into 8260931_lanai_JEP_branch >>> - Lanai PR#213 - 8263325 - avu >>> - Lanai PR#212 - 8259825 - aghaisas >>> - Lanai PR#211 - 8262882 - aghaisas >>> - Merge branch 'master' into 8260931_lanai_JEP_branch >>> - Lanai PR#210 - 8263159 - jdv >>> - Lanai PR#209 - 8262936 - jdv >>> - Lanai PR#208 - 8262928 - jdv >>> - Lanai PR#207 - 8262750 - jdv >>> - ... and 37 more: https://git.openjdk.java.net/jdk/compare/9d82be31...369c3d21 >> >> Latest changes look good. I confirmed that this PR has all of the content from the lanai repo. > >> By default we don?t do LCD anti-aliasing for text, only when we set Text Rendering Hint to use LCD antialiasing we take sub-pixel rendering path. > > And it actually produces LCD glyphs? not the grayscale? We get glyphs which take more than a byte to represent each pixel. Based on which we take LCD sub-pixel rendering path. > > ------------- > > PR: https://git.openjdk.java.net/jdk/pull/2403 From dholmes at openjdk.java.net Fri Mar 12 05:27:17 2021 From: dholmes at openjdk.java.net (David Holmes) Date: Fri, 12 Mar 2021 05:27:17 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v25] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 14:07:43 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: > > 8262903: [macos_aarch64] Thread::current() called on detached thread src/hotspot/share/runtime/safefetch.inline.hpp line 35: > 33: inline int SafeFetch32(int* adr, int errValue) { > 34: assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated"); > 35: MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXExec, Thread::current())); I think you may have to use `Thread::current_or_null_safe()` here in case this gets called from a signal handling context - see vmError.cpp testing for TestSafeFetchInErrorHandler. Same possibly for SafeFetchN. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Fri Mar 12 07:12:17 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Fri, 12 Mar 2021 07:12:17 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v25] In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 05:24:10 GMT, David Holmes wrote: >> Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: >> >> 8262903: [macos_aarch64] Thread::current() called on detached thread > > src/hotspot/share/runtime/safefetch.inline.hpp line 35: > >> 33: inline int SafeFetch32(int* adr, int errValue) { >> 34: assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated"); >> 35: MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXExec, Thread::current())); > > I think you may have to use `Thread::current_or_null_safe()` here in case this gets called from a signal handling context - see vmError.cpp testing for TestSafeFetchInErrorHandler. Same possibly for SafeFetchN. I'm not sure about expected behavior then. We may crash trying to execute the generated code, since we may have no WXExec. If we switch to WXExec, we would need to go back to a previous W^X state, but we don't know which one without the thread. BTW, the test passes, probably that's why it didn't get attention. All non-trivial actions in the current implementation of `pd_hotspot_signal_handler` (hhttps://github.com/openjdk/jdk/pull/2200/files#diff-9dcc5bcf908e2f8eb00b2c2837d667687a7540936d8f538ee1ea14e31ad50b40R215-R324) assume non-NULL thread. So AFAICS, we should always have a thread when the SafeFetch is called. Probably a fix to the https://bugs.openjdk.java.net/browse/JDK-8262903 could just move ThreadWXEnable under the `if`. But now after https://github.com/openjdk/jdk/pull/2200/commits/f6fb01b24f525e578692a1c6f2ff0a55b8233576is ThreadWXEnable allows optional W^X state change, like `MutexLocker` allows optional locking. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From shade at openjdk.java.net Fri Mar 12 07:22:26 2021 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Fri, 12 Mar 2021 07:22:26 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263467: Incorrect double-checked locking in sun.java2d.CRenderer [v2] In-Reply-To: References: Message-ID: > SonarCloud reports multiple incorrect double-checked locking cases in `sun.java2d.CRenderer`. For example: > > Arc2D arcToShape; > > ... > if (arcToShape == null) { > synchronized (this) { > if (arcToShape == null) { > arcToShape = new Arc2D.Float(); > } > } > } > > `Arc2D` contains fields that are not `final`. `arcToShape` is not `volatile`. This makes it an incorrect DCL. > This code is used by Mac OS, do it would probably blow up some time later on M1. > > This is the candidate fix that preserves the semantics. I am doing this fix blindly so far, without testing on real Mac OS. But maybe there is no need to do any of this, because the setter methods overwrite the contents of all these objects under their own sync. So, maybe we can just allocate those objects without DCL-backed caching and pass them in? Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: Drop DCL and useless synchronization completely ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2948/files - new: https://git.openjdk.java.net/jdk/pull/2948/files/c81b9ea2..d912f559 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2948&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2948&range=00-01 Stats: 80 lines in 1 file changed: 0 ins; 70 del; 10 mod Patch: https://git.openjdk.java.net/jdk/pull/2948.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2948/head:pull/2948 PR: https://git.openjdk.java.net/jdk/pull/2948 From shade at openjdk.java.net Fri Mar 12 07:22:26 2021 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Fri, 12 Mar 2021 07:22:26 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263467: Incorrect double-checked locking in sun.java2d.CRenderer In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 03:19:12 GMT, Sergey Bylokhov wrote: >> SonarCloud reports multiple incorrect double-checked locking cases in `sun.java2d.CRenderer`. For example: >> >> Arc2D arcToShape; >> >> ... >> if (arcToShape == null) { >> synchronized (this) { >> if (arcToShape == null) { >> arcToShape = new Arc2D.Float(); >> } >> } >> } >> >> `Arc2D` contains fields that are not `final`. `arcToShape` is not `volatile`. This makes it an incorrect DCL. >> This code is used by Mac OS, do it would probably blow up some time later on M1. >> >> This is the candidate fix that preserves the semantics. I am doing this fix blindly so far, without testing on real Mac OS. But maybe there is no need to do any of this, because the setter methods overwrite the contents of all these objects under their own sync. So, maybe we can just allocate those objects without DCL-backed caching and pass them in? > > I guess "Incorrect double-checked" is a too strict description of this code, it just tried to eliminate the creation of one object and do not care about the content of that object, since it is immediately overridden. > > I think It will be more clear to just eliminate this DCL since overhead and code complexity seems too much to just cache five objects. > > Probably it was important in past(jdk6 and below) when this renderer was used for onscreen rendering. Currently, it is used for printing(if actually used at all). Ok, I removed the "DCL" from that code and used the objects directly. AFAICS, synchronization is redundant on those local objects. What would be a good test for this change? ------------- PR: https://git.openjdk.java.net/jdk/pull/2948 From aghaisas at openjdk.java.net Fri Mar 12 07:23:25 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Fri, 12 Mar 2021 07:23:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 01:01:09 GMT, Sergey Bylokhov wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: >> >> - Lanai PR#214 - 8263324 - avu >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#213 - 8263325 - avu >> - Lanai PR#212 - 8259825 - aghaisas >> - Lanai PR#211 - 8262882 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#210 - 8263159 - jdv >> - Lanai PR#209 - 8262936 - jdv >> - Lanai PR#208 - 8262928 - jdv >> - Lanai PR#207 - 8262750 - jdv >> - ... and 37 more: https://git.openjdk.java.net/jdk/compare/774f3477...369c3d21 > > src/java.desktop/macosx/classes/sun/java2d/metal/MTLGraphicsConfig.java line 148: > >> 146: rq.lock(); >> 147: try { >> 148: // getMTLConfigInfo() creates and destroys temporary > > Does it really create and destroy temporary surfaces/contexts? No, it doesn't. I have updated JDK-8263363 to include this correction. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From david.holmes at oracle.com Fri Mar 12 07:58:56 2021 From: david.holmes at oracle.com (David Holmes) Date: Fri, 12 Mar 2021 17:58:56 +1000 Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v25] In-Reply-To: References: Message-ID: <59c46a13-91d9-bd60-70dd-ff8fde81c0c7@oracle.com> On 12/03/2021 5:12 pm, Anton Kozlov wrote: > On Fri, 12 Mar 2021 05:24:10 GMT, David Holmes wrote: > >>> Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: >>> >>> 8262903: [macos_aarch64] Thread::current() called on detached thread >> >> src/hotspot/share/runtime/safefetch.inline.hpp line 35: >> >>> 33: inline int SafeFetch32(int* adr, int errValue) { >>> 34: assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated"); >>> 35: MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXExec, Thread::current())); >> >> I think you may have to use `Thread::current_or_null_safe()` here in case this gets called from a signal handling context - see vmError.cpp testing for TestSafeFetchInErrorHandler. Same possibly for SafeFetchN. > > I'm not sure about expected behavior then. We may crash trying to execute the generated code, since we may have no WXExec. If we switch to WXExec, we would need to go back to a previous W^X state, but we don't know which one without the thread. The NULL check is only part of it. In a signal handling context Thread::current() is not safe to call, you have to use Thread::current_or_null_safe(). > BTW, the test passes, probably that's why it didn't get attention. All non-trivial actions in the current implementation of `pd_hotspot_signal_handler` (hhttps://github.com/openjdk/jdk/pull/2200/files#diff-9dcc5bcf908e2f8eb00b2c2837d667687a7540936d8f538ee1ea14e31ad50b40R215-R324) assume non-NULL thread. So AFAICS, we should always have a thread when the SafeFetch is called. Okay but you still need to use Thread::current_or_null_safe(). Cheers, David > Probably a fix to the https://bugs.openjdk.java.net/browse/JDK-8262903 could just move ThreadWXEnable under the `if`. But now after https://github.com/openjdk/jdk/pull/2200/commits/f6fb01b24f525e578692a1c6f2ff0a55b8233576is ThreadWXEnable allows optional W^X state change, like `MutexLocker` allows optional locking. > > ------------- > > PR: https://git.openjdk.java.net/jdk/pull/2200 > From kizune at openjdk.java.net Fri Mar 12 08:35:40 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Fri, 12 Mar 2021 08:35:40 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 18:00:15 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: > > - Lanai PR#214 - 8263324 - avu > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#213 - 8263325 - avu > - Lanai PR#212 - 8259825 - aghaisas > - Lanai PR#211 - 8262882 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - ... and 37 more: https://git.openjdk.java.net/jdk/compare/392a1086...369c3d21 Marked as reviewed by kizune (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Fri Mar 12 08:39:21 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 12 Mar 2021 08:39:21 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263482: Make access to the ICC color profiles data multithread-friendly Message-ID: FYI: probably is better/simpler to review it via webrev. After migration to the lcms from the kcms the performance of some operations was regressed. One possible workaround was to split the operation into multiple threads. But unfortunately, we have too many bottlenecks which prevent using multithreading. This is the request to remove/minimize such bottlenecks(at least some of them), but it does not affect the single-threaded performance it should be handled separately. The main code pattern optimized here is this: activate(); byte[] theHeader = getData(cmmProfile, icSigHead); ----> CMSManager.getModule().getTagData(p, tagSignature); Notes about the code above: 1. Before the change "activate()" method checked that the "cmmProfile" field was not null. After that we usually used the "cmmProfile" as the parameter to some other method. This included two volatile reads, and also required to check when we need to call the "activate()" method before usage of the "cmmProfile" field. Solution: "activate()" renamed to the "cmmProfile()" which became an accessor for the field, so we will get one volatile read and can easily monitor the usage of the field itself(it is used directly only in this method). 2. The synchronized static method "CMSManager.getModule()" reimplemented to have only one volatile read. 3. The usage of locking in the "getTagData()" is changed. Instead of the synchronized instance methods, we now use the mix of "ConcurrentHashMap" and StampedLock. See some comments inline. Some numbers(small numbers are better): 1. Performance of ((ICC_ProfileRGB) ICC_Profile.getInstance(ColorSpace.CS_sRGB)).getMatrix(); jdk 15.0.2 Benchmark Mode Cnt Score Error Units CMMPerf.ThreadsMAX.testGetMatrix avgt 5 19,624 ? 0,059 us/op CMMPerf.testGetMatrix avgt 5 0,154 ? 0,001 us/op jdk - before the fix Benchmark Mode Cnt Score Error Units CMMPerf.ThreadsMAX.testGetMatrix avgt 5 12,935 ? 0,042 us/op CMMPerf.testGetMatrix avgt 5 0,127 ? 0,007 us/op jdk - after the fix Benchmark Mode Cnt Score Error Units CMMPerf.ThreadsMAX.testGetMatrix avgt 5 0,561 ? 0,005 us/op CMMPerf.testGetMatrix avgt 5 0,092 ? 0,001 us/op 2. Part of performance gain in jdk17 is from some other fixes, for example Performance of ICC_Profile.getInstance(ColorSpace.CS_sRGB); and ColorSpace.getInstance(ColorSpace.CS_sRGB); jdk 15.0.2 Benchmark Mode Cnt Score Error Units CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 2,299 ? 0,032 us/op CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 2,210 ? 0,051 us/op CMMPerf.testGetSRGBProfile avgt 5 0,019 ? 0,001 us/op CMMPerf.testGetSRGBSpace avgt 5 0,018 ? 0,001 us/op jdk - same before/ after the fix Benchmark Mode Cnt Score Error Units CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op CMMPerf.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op CMMPerf.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op note "ThreadsMAX" is 32 threads. ------------- Commit messages: - Update ICC_Profile.java - Merge branch 'master' into threads - Update LCMS.c - Initial fix Changes: https://git.openjdk.java.net/jdk/pull/2957/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2957&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263482 Stats: 212 lines in 5 files changed: 52 ins; 83 del; 77 mod Patch: https://git.openjdk.java.net/jdk/pull/2957.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2957/head:pull/2957 PR: https://git.openjdk.java.net/jdk/pull/2957 From serb at openjdk.java.net Fri Mar 12 08:39:22 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 12 Mar 2021 08:39:22 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263482: Make access to the ICC color profiles data multithread-friendly In-Reply-To: References: Message-ID: <5WELH-SPWiqcaWzFO7-DGbEt4LimbHFe0HTxcMVgF7c=.83e6fd99-5da7-4124-9344-c0fb2ec3b51a@github.com> On Fri, 12 Mar 2021 05:10:25 GMT, Sergey Bylokhov wrote: > FYI: probably is better/simpler to review it via webrev. > > After migration to the lcms from the kcms the performance of some operations was regressed. One possible workaround was to split the operation into multiple threads. But unfortunately, we have too many bottlenecks which prevent using multithreading. This is the request to remove/minimize such bottlenecks(at least some of them), but it does not affect the single-threaded performance it should be handled separately. > > The main code pattern optimized here is this: > activate(); > byte[] theHeader = getData(cmmProfile, icSigHead); > ----> CMSManager.getModule().getTagData(p, tagSignature); > Notes about the code above: > > 1. Before the change "activate()" method checked that the "cmmProfile" field was not null. After that we usually used the "cmmProfile" as the parameter to some other method. This included two volatile reads, and also required to check when we need to call the "activate()" method before usage of the "cmmProfile" field. > Solution: "activate()" renamed to the "cmmProfile()" which became an accessor for the field, so we will get one volatile read and can easily monitor the usage of the field itself(it is used directly only in this method). > > 2. The synchronized static method "CMSManager.getModule()" reimplemented to have only one volatile read. > > 3. The usage of locking in the "getTagData()" is changed. Instead of the synchronized instance methods, we now use the mix of "ConcurrentHashMap" and StampedLock. > > See some comments inline. > > Some numbers(small numbers are better): > > 1. Performance of ((ICC_ProfileRGB) ICC_Profile.getInstance(ColorSpace.CS_sRGB)).getMatrix(); > > jdk 15.0.2 > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 19,624 ? 0,059 us/op > CMMPerf.testGetMatrix avgt 5 0,154 ? 0,001 us/op > > jdk - before the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 12,935 ? 0,042 us/op > CMMPerf.testGetMatrix avgt 5 0,127 ? 0,007 us/op > > jdk - after the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 0,561 ? 0,005 us/op > CMMPerf.testGetMatrix avgt 5 0,092 ? 0,001 us/op > > 2. Part of performance gain in jdk17 is from some other fixes, for example > Performance of ICC_Profile.getInstance(ColorSpace.CS_sRGB); and ColorSpace.getInstance(ColorSpace.CS_sRGB); > > jdk 15.0.2 > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 2,299 ? 0,032 us/op > CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 2,210 ? 0,051 us/op > CMMPerf.testGetSRGBProfile avgt 5 0,019 ? 0,001 us/op > CMMPerf.testGetSRGBSpace avgt 5 0,018 ? 0,001 us/op > > jdk - same before/ after the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op > CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op > CMMPerf.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op > CMMPerf.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op > > note "ThreadsMAX" is 32 threads. src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMSProfile.java line 70: > 68: } finally { > 69: lock.unlockRead(stamp); > 70: } The comments about the change in this class and the changes in the "getTag()" method. 1. I have removed the TagData and TagCache classes and move the tag cache to the profile class directly. 2. I have moved synchronization logic from the LCMS.java to this class, so now we can use more "granular" synchronizations. The logic behind this change: 1. The StampedLock guards the access to the native lcms code, so when we change the tags via "LCMS.setTagDataNative" nobody will call "LCMS.getTagNative" and "LCMS.getProfileDataNative". I tried the "ReentrantReadWriteLock", but it is a little bit slower. 2. The cache itself is maintained by the ConcurrentHashMap, and the usage of "byte[] t = tags.get(sig);" w/o synchronization is a key for the performance. Note that it is possible to use "tags.computeIfAbsent" instead of "tags.get(sig)" and take care of "native access" synchronization in the "LCMS.getTagNative", but unfortuntly for some workload the "get()" is x10 times faster than computeIfAbsent() if the key is already exists in the map(common situation for the cache). src/java.desktop/share/classes/java/awt/color/ICC_Profile.java line 1103: > 1101: public byte[] getData(int tagSignature) { > 1102: byte[] t = getData(cmmProfile(), tagSignature); > 1103: return t != null ? t.clone() : null; I have moved the clone operation to the public "ICC_Profile.getData(int tagSignature)" method, so we do not clone it again again and again when we use this data internally. src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMS.java line 84: > 82: @Override > 83: public synchronized void setTagData(Profile p, int tagSignature, byte[] data) { > 84: getLcmsProfile(p).setTag(tagSignature, data); Note that this method is synchronized, I think it is not needed to be, because a long time ago(before the LCMSProfile class was implemented ) all method in this class was synchronized to guard information about tags. But later we changed all such synchronization methods to the per-profile locks. And only this method remains synchronized. But I leave it as is for now, since it might affect transforms which I am not touching in this fix. WIll remove that later. ------------- PR: https://git.openjdk.java.net/jdk/pull/2957 From jdv at openjdk.java.net Fri Mar 12 10:01:47 2021 From: jdv at openjdk.java.net (Jayathirth D V) Date: Fri, 12 Mar 2021 10:01:47 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 18:00:15 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: > > - Lanai PR#214 - 8263324 - avu > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#213 - 8263325 - avu > - Lanai PR#212 - 8259825 - aghaisas > - Lanai PR#211 - 8262882 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - ... and 37 more: https://git.openjdk.java.net/jdk/compare/46a8379b...369c3d21 Marked as reviewed by jdv (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From psadhukhan at openjdk.java.net Fri Mar 12 10:14:36 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 12 Mar 2021 10:14:36 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 18:00:15 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: > > - Lanai PR#214 - 8263324 - avu > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#213 - 8263325 - avu > - Lanai PR#212 - 8259825 - aghaisas > - Lanai PR#211 - 8262882 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - ... and 37 more: https://git.openjdk.java.net/jdk/compare/b163fb99...369c3d21 src/java.desktop/macosx/classes/sun/awt/CGraphicsConfig.java line 82: > 80: * Creates a new SurfaceData that will be associated with the given > 81: * CGLLayer. > 82: */ I guess we need to specify CGLLayer/MTLLayer as now we are implementing this method in both pipeline. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From psadhukhan at openjdk.java.net Fri Mar 12 10:17:40 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 12 Mar 2021 10:17:40 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 18:00:15 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: > > - Lanai PR#214 - 8263324 - avu > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#213 - 8263325 - avu > - Lanai PR#212 - 8259825 - aghaisas > - Lanai PR#211 - 8262882 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - ... and 37 more: https://git.openjdk.java.net/jdk/compare/d4addb43...369c3d21 Marked as reviewed by psadhukhan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From aghaisas at openjdk.java.net Fri Mar 12 10:57:23 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Fri, 12 Mar 2021 10:57:23 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: <0I8-1HTnTUMOkSlYrUoNgCEzQttHPHIoqVy0Jg34QGc=.bf4e9c8a-a6b6-4857-915b-0a7d4615a300@github.com> On Fri, 12 Mar 2021 10:11:27 GMT, Prasanta Sadhukhan wrote: >> Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: >> >> - Lanai PR#214 - 8263324 - avu >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#213 - 8263325 - avu >> - Lanai PR#212 - 8259825 - aghaisas >> - Lanai PR#211 - 8262882 - aghaisas >> - Merge branch 'master' into 8260931_lanai_JEP_branch >> - Lanai PR#210 - 8263159 - jdv >> - Lanai PR#209 - 8262936 - jdv >> - Lanai PR#208 - 8262928 - jdv >> - Lanai PR#207 - 8262750 - jdv >> - ... and 37 more: https://git.openjdk.java.net/jdk/compare/f5d78efb...369c3d21 > > src/java.desktop/macosx/classes/sun/awt/CGraphicsConfig.java line 82: > >> 80: * Creates a new SurfaceData that will be associated with the given >> 81: * CGLLayer. >> 82: */ > > I guess we need to specify CGLLayer/MTLLayer as now we are implementing this method in both pipeline. I have updated JDK-8263363 to include this. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From aivanov at openjdk.java.net Fri Mar 12 11:32:10 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 12 Mar 2021 11:32:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: <1XWnbAUoXYd0shleNnct4uky2ZboVmUSvPJ5AXXsheM=.5bdbc41e-ab5b-4037-9872-7f4261d5a462@github.com> References: <425OYVrQ8UldCi_4u-C5Q1RiYJJr5lrCT4mOmO-CDG4=.53915594-664a-4971-b04d-5097cec69028@github.com> <1XWnbAUoXYd0shleNnct4uky2ZboVmUSvPJ5AXXsheM=.5bdbc41e-ab5b-4037-9872-7f4261d5a462@github.com> Message-ID: On Fri, 12 Mar 2021 04:55:45 GMT, Prasanta Sadhukhan wrote: > Is this only about addition/removal? What about printer name change? You cannot change the name of a remote printer. Opening *Printer Properties* dialog from the printer context menu on the local host and editing its name changes the name of the printer on the remote host which shares it. Windows warns, ?This is a shared printer. If you rename a shared printer, existing connections to this printer from other computers will break and will have to be created again.? Nothing has been updated on the local system after renaming the printer. As the warning said, the printer does not work any more because it refers to a printer that does not exist. To fix this, one has to add a new remote printer which refers to the new name of the printer on the remote host. > Shouldn't we get notified in that case as trying to print on printer with old name will not find the printer!! I'm afraid there's nothing Java can do to mitigate renaming the printer. > If yes, in that regard I guess `REG_NOTIFY_CHANGE_LAST_SET` is the one to go for as it states > _"Notify the caller of changes to a value of the key. This can include adding or deleting a value, or changing an existing value. "_ Since no values are created, removed, or changed when a remote printer is added or removed under `Connections` key, adding `REG_NOTIFY_CHANGE_LAST_SET` to `dwNotifyFilter` is not required. There are some values stored in the printer key but Java does not use them directly; if any value is changed there, getting notifications about such an event only creates noise. So, as far as Java is concerned, getting notifications about new keys being created or removed under `Connections` is enough. This is what `REG_NOTIFY_CHANGE_NAME` filter does. ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From psadhukhan at openjdk.java.net Fri Mar 12 11:41:06 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 12 Mar 2021 11:41:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: References: <425OYVrQ8UldCi_4u-C5Q1RiYJJr5lrCT4mOmO-CDG4=.53915594-664a-4971-b04d-5097cec69028@github.com> <1XWnbAUoXYd0shleNnct4uky2ZboVmUSvPJ5AXXsheM=.5bdbc41e-ab5b-4037-9872-7f4261d5a462@github.com> Message-ID: <0aOvO_Sq5WlyJ9TyMx0srApvcxP5hZ9mkmXY2-wsx9I=.54dca08e-e4a9-41ab-af94-a454d988ffe8@github.com> On Fri, 12 Mar 2021 11:29:17 GMT, Alexey Ivanov wrote: >> Is this only about addition/removal? What about printer name change? Shouldn't we get notified in that case as trying to print on printer with old name will not find the printer!! >> If yes, in that regard I guess REG_NOTIFY_CHANGE_LAST_SET is the one to go for as it states >> `"Notify the caller of changes to a value of the key. This can include adding or deleting a value, or changing an existing value. "` > >> Is this only about addition/removal? What about printer name change? > > You cannot change the name of a remote printer. > > Opening *Printer Properties* dialog from the printer context menu on the local host and editing its name changes the name of the printer on the remote host which shares it. Windows warns, ?This is a shared printer. If you rename a shared printer, existing connections to this printer from other computers will break and will have to be created again.? > > Nothing has been updated on the local system after renaming the printer. As the warning said, the printer does not work any more because it refers to a printer that does not exist. > > To fix this, one has to add a new remote printer which refers to the new name of the printer on the remote host. > >> Shouldn't we get notified in that case as trying to print on printer with old name will not find the printer!! > > I'm afraid there's nothing Java can do to mitigate renaming the printer. > >> If yes, in that regard I guess `REG_NOTIFY_CHANGE_LAST_SET` is the one to go for as it states >> _"Notify the caller of changes to a value of the key. This can include adding or deleting a value, or changing an existing value. "_ > > Since no values are created, removed, or changed when a remote printer is added or removed under `Connections` key, adding `REG_NOTIFY_CHANGE_LAST_SET` to `dwNotifyFilter` is not required. There are some values stored in the printer key but Java does not use them directly; if any value is changed there, getting notifications about such an event only creates noise. > > So, as far as Java is concerned, getting notifications about new keys being created or removed under `Connections` is enough. This is what `REG_NOTIFY_CHANGE_NAME` filter does. I can understand that as a user, you cannot /shouldn't change the name of a remote network printer but a network admin can change the name, so shouldn't we get notification on that name change when this method gets called after the name change? or would it be notified as a new printer in that case? Then what will happen to the old stale printer in the registry? ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From akozlov at openjdk.java.net Fri Mar 12 12:17:39 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Fri, 12 Mar 2021 12:17:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v26] In-Reply-To: References: Message-ID: > Please review the implementation of JEP 391: macOS/AArch64 Port. > > It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. > > Major changes are in: > * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) > * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) > * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. > * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) Anton Kozlov has updated the pull request incrementally with three additional commits since the last revision: - Add Azul copyright - Update Oracle copyright years - Use Thread::current_or_null_safe in SafeFetch ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2200/files - new: https://git.openjdk.java.net/jdk/pull/2200/files/f6fb01b2..29991c92 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=25 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=24-25 Stats: 83 lines in 53 files changed: 41 ins; 0 del; 42 mod Patch: https://git.openjdk.java.net/jdk/pull/2200.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2200/head:pull/2200 PR: https://git.openjdk.java.net/jdk/pull/2200 From aivanov at openjdk.java.net Fri Mar 12 12:34:05 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 12 Mar 2021 12:34:05 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: <0aOvO_Sq5WlyJ9TyMx0srApvcxP5hZ9mkmXY2-wsx9I=.54dca08e-e4a9-41ab-af94-a454d988ffe8@github.com> References: <425OYVrQ8UldCi_4u-C5Q1RiYJJr5lrCT4mOmO-CDG4=.53915594-664a-4971-b04d-5097cec69028@github.com> <1XWnbAUoXYd0shleNnct4uky2ZboVmUSvPJ5AXXsheM=.5bdbc41e-ab5b-4037-9872-7f4261d5a462@github.com> <0aOvO_Sq5WlyJ9TyMx0srApvcxP5hZ9mkmXY2-wsx9I=.54dca08e-e4a9-41ab-af94-a454d988ffe8@github.com> Message-ID: <0ZsLW_DEUjTIkgIM6REXgeBd4c6LV-LNu08h384a2xc=.d2dcea8a-70e9-4819-9053-a03e16258df7@github.com> On Fri, 12 Mar 2021 11:38:08 GMT, Prasanta Sadhukhan wrote: >>> Is this only about addition/removal? What about printer name change? >> >> You cannot change the name of a remote printer. >> >> Opening *Printer Properties* dialog from the printer context menu on the local host and editing its name changes the name of the printer on the remote host which shares it. Windows warns, ?This is a shared printer. If you rename a shared printer, existing connections to this printer from other computers will break and will have to be created again.? >> >> Nothing has been updated on the local system after renaming the printer. As the warning said, the printer does not work any more because it refers to a printer that does not exist. >> >> To fix this, one has to add a new remote printer which refers to the new name of the printer on the remote host. >> >>> Shouldn't we get notified in that case as trying to print on printer with old name will not find the printer!! >> >> I'm afraid there's nothing Java can do to mitigate renaming the printer. >> >>> If yes, in that regard I guess `REG_NOTIFY_CHANGE_LAST_SET` is the one to go for as it states >>> _"Notify the caller of changes to a value of the key. This can include adding or deleting a value, or changing an existing value. "_ >> >> Since no values are created, removed, or changed when a remote printer is added or removed under `Connections` key, adding `REG_NOTIFY_CHANGE_LAST_SET` to `dwNotifyFilter` is not required. There are some values stored in the printer key but Java does not use them directly; if any value is changed there, getting notifications about such an event only creates noise. >> >> So, as far as Java is concerned, getting notifications about new keys being created or removed under `Connections` is enough. This is what `REG_NOTIFY_CHANGE_NAME` filter does. > > I can understand that as a user, you cannot /shouldn't change the name of a remote network printer but a network admin can change the name, so shouldn't we get notification on that name change when this method gets called after the name change? or would it be notified as a new printer in that case? Then what will happen to the old stale printer in the registry? You can't. Try it yourself. The printer connection is per-user, after all it's stored under HKCU. Windows displays the name of remote printers as ?Generic / Text Only on 192.168.1.18?: _the name of the printer_ and _the remote host_. If you open the *Printer Properties* dialog of a remote printer and edit its name, you change the name of the printer on the remote host which shares it. It changes *absolutely nothing* on the local system. > shouldn't we get notification on that name change when this method gets called after the name change? Yes, we should. But we cannot. For Windows, nothing has changed on the local system, it's the remote system that has been changed. > or would it be notified as a new printer in that case? No, it wouldn't _because nothing has changed on the local system_. > Then what will happen to the old stale printer in the registry? Nothing, again. It just stays there but Windows reports an error if you try to open its Printer Properties, Windows reports an error if you try to print to it. I tried printing with Java and Notepad: the behaviour is the same. The difference is that Notepad displays the error message whereas Java throws an exception (it depends on the Java app, I guess). The behaviour aligns to the one seen when the printer is unreachable because of, let's say, network issues. ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From psadhukhan at openjdk.java.net Fri Mar 12 12:42:06 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 12 Mar 2021 12:42:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 15:38:27 GMT, Alexey Ivanov wrote: > [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented polling for remote printers. > That bug description also mentions watching the registry for changes and links to the article which describes the method yet it does so in terms of WMI. Using WMI is not necessary to watch for the registry updates. > > It is possible to replace polling mechanism with registry change notifications. If the registry at `HKCU\Printers\Connections` is updated, refresh the list of print services. > > It works perfectly well in my own testing with sharing a Generic / Text Only printer from another laptop. The notification comes as soon as the printer is installed, it results in a new key created under `Connections`. If a remote printer is removed, the notification is also triggered as the key corresponding to that printer is removed from the registry. > > I updated the steps in the manual test: `RemotePrinterStatusRefresh.java`. Marked as reviewed by psadhukhan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From psadhukhan at openjdk.java.net Fri Mar 12 12:42:07 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 12 Mar 2021 12:42:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: <0ZsLW_DEUjTIkgIM6REXgeBd4c6LV-LNu08h384a2xc=.d2dcea8a-70e9-4819-9053-a03e16258df7@github.com> References: <425OYVrQ8UldCi_4u-C5Q1RiYJJr5lrCT4mOmO-CDG4=.53915594-664a-4971-b04d-5097cec69028@github.com> <1XWnbAUoXYd0shleNnct4uky2ZboVmUSvPJ5AXXsheM=.5bdbc41e-ab5b-4037-9872-7f4261d5a462@github.com> <0aOvO_Sq5WlyJ9TyMx0srApvcxP5hZ9mkmXY2-wsx9I=.54dca08e-e4a9-41ab-af94-a454d988ffe8@github.com> <0ZsLW_DEUjTIkgIM6REXgeBd4c6LV-LNu08h384a2xc=.d2dcea8a-70e9-4819-9053-a03e16258df7@github.com> Message-ID: <-X1FoTkGPAtEMTzCEgm_d8MQ4aP717IvmFne__v-fNA=.386ee0fa-80fb-4f0f-a8e6-aae50f1fcd28@github.com> On Fri, 12 Mar 2021 12:30:13 GMT, Alexey Ivanov wrote: >> I can understand that as a user, you cannot /shouldn't change the name of a remote network printer but a network admin can change the name, so shouldn't we get notification on that name change when this method gets called after the name change? or would it be notified as a new printer in that case? Then what will happen to the old stale printer in the registry? > > You can't. Try it yourself. The printer connection is per-user, after all it's stored under HKCU. > > Windows displays the name of remote printers as ?Generic / Text Only on 192.168.1.18?: _the name of the printer_ and _the remote host_. > > If you open the *Printer Properties* dialog of a remote printer and edit its name, you change the name of the printer on the remote host which shares it. It changes *absolutely nothing* on the local system. > >> shouldn't we get notification on that name change when this method gets called after the name change? > > Yes, we should. But we cannot. > > For Windows, nothing has changed on the local system, it's the remote system that has been changed. > >> or would it be notified as a new printer in that case? > > No, it wouldn't _because nothing has changed on the local system_. > >> Then what will happen to the old stale printer in the registry? > > Nothing, again. It just stays there but Windows reports an error if you try to open its Printer Properties, Windows reports an error if you try to print to it. I tried printing with Java and Notepad: the behaviour is the same. The difference is that Notepad displays the error message whereas Java throws an exception (it depends on the Java app, I guess). > > The behaviour aligns to the one seen when the printer is unreachable because of, let's say, network issues. OK. ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From vkempik at openjdk.java.net Fri Mar 12 13:38:17 2021 From: vkempik at openjdk.java.net (Vladimir Kempik) Date: Fri, 12 Mar 2021 13:38:17 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9] In-Reply-To: References: Message-ID: On Tue, 2 Mar 2021 08:12:10 GMT, Anton Kozlov wrote: >> I wasn't able to replicate JDK-8020753 and JDK-8186286. So will remove these workaround >> @gerard-ziemski, 8020753 was originally your fix, do you know if it still needed on intel-mac ? > > The x86_bsd still carries the workaround https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp#L745. It's worth having macos ports to be aligned by features. I would propose to have this workaround for now, and decide on it later for macos/x86 and macos/aarch64 at once. Sorry for chiming in so late. Hello Anton. Please keep JDK-8020753 away from this port, as JDK-8020753 was very intel-specific workaround and macos11.0 on aarch64 doesn't show any signs of original bug. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Fri Mar 12 14:10:18 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Fri, 12 Mar 2021 14:10:18 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v25] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 20:28:46 GMT, Stefan Karlsson wrote: >> Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: >> >> 8262903: [macos_aarch64] Thread::current() called on detached thread > > Marked as reviewed by stefank (Reviewer). > you still need to use Thread::current_or_null_safe() [for SafeFetch]. OK :) I fixed this in https://github.com/openjdk/jdk/pull/2200/commits/fd4812e585e0528010a8863df50956a3b64a6744 @dcubed-ojdk, I also updated copyrights, this concludes fixes for the review https://github.com/openjdk/jdk/pull/2200#pullrequestreview-581784107. @theRealAph, could you elaborate on what is need to be done for https://github.com/openjdk/jdk/pull/2200#pullrequestreview-600597066. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aph at openjdk.java.net Fri Mar 12 16:35:23 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Fri, 12 Mar 2021 16:35:23 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v24] In-Reply-To: References: Message-ID: On Tue, 9 Mar 2021 16:12:36 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 105 commits: > > - Merge commit 'refs/pull/11/head' of https://github.com/AntonKozlov/jdk into jdk-macos > - workaround JDK-8262895 by disabling subtest > - Fix typo > - Rename threadWXSetters.hpp -> threadWXSetters.inline.hpp > - JDK-8259937: bsd_aarch64 part > - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos > - Fix after JDK-8259539, partially revert preconditions > - JDK-8260471: bsd_aarch64 part > - JDK-8259539: bsd_aarch64 part > - JDK-8257828: bsd_aarch64 part > - ... and 95 more: https://git.openjdk.java.net/jdk/compare/a6e34b3d...a72f6834 > @theRealAph, could you elaborate on what is need to be done for [#2200 (review)](https://github.com/openjdk/jdk/pull/2200#pullrequestreview-600597066). I think that what you've got now is fine. ------------- Marked as reviewed by aph (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2200 From herrick at openjdk.java.net Fri Mar 12 16:13:36 2021 From: herrick at openjdk.java.net (Andy Herrick) Date: Fri, 12 Mar 2021 16:13:36 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations Message-ID: implementation of JDK-8256145: JEP 398: Deprecate the Applet API for Removal ------------- Commit messages: - 8189198: Add "forRemoval = true" to Applet API deprecations Changes: https://git.openjdk.java.net/jdk/pull/2920/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2920&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8189198 Stats: 74 lines in 22 files changed: 14 ins; 0 del; 60 mod Patch: https://git.openjdk.java.net/jdk/pull/2920.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2920/head:pull/2920 PR: https://git.openjdk.java.net/jdk/pull/2920 From aph at openjdk.java.net Fri Mar 12 16:35:24 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Fri, 12 Mar 2021 16:35:24 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v21] In-Reply-To: References: Message-ID: On Tue, 9 Mar 2021 18:01:11 GMT, Anton Kozlov wrote: >> src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp line 62: >> >>> 60: >>> 61: #if defined(__APPLE__) || defined(_WIN64) >>> 62: #define R18_RESERVED >> >> #define R18_RESERVED true``` > > We always check for `R18_RESERVED` with `#if(n)def`, is there any reason to define the value for the macro? Robustness, clarity, maintainability, convention. Why not? ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Fri Mar 12 16:44:38 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Fri, 12 Mar 2021 16:44:38 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v27] In-Reply-To: References: Message-ID: > Please review the implementation of JEP 391: macOS/AArch64 Port. > > It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. > > Major changes are in: > * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) > * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) > * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. > * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: Fix most of issues in java/foreign/ tests Failures related to va_args are tracked in JDK-8263512. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2200/files - new: https://git.openjdk.java.net/jdk/pull/2200/files/29991c92..5bfe0f08 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=26 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=25-26 Stats: 5 lines in 2 files changed: 4 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2200.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2200/head:pull/2200 PR: https://git.openjdk.java.net/jdk/pull/2200 From iris at openjdk.java.net Fri Mar 12 18:20:06 2021 From: iris at openjdk.java.net (Iris Clark) Date: Fri, 12 Mar 2021 18:20:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 18:33:37 GMT, Andy Herrick wrote: > implementation of > JDK-8256145: JEP 398: Deprecate the Applet API for Removal Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From serb at openjdk.java.net Sat Mar 13 00:21:07 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 13 Mar 2021 00:21:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: References: Message-ID: <82CenQod4D7T0Wz5Uat6u-RfFLW01xVOV69zkTpIca0=.aaf34fca-2af3-4387-988d-048eb87af868@github.com> On Wed, 10 Mar 2021 15:38:27 GMT, Alexey Ivanov wrote: > [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented polling for remote printers. > That bug description also mentions watching the registry for changes and links to the article which describes the method yet it does so in terms of WMI. Using WMI is not necessary to watch for the registry updates. > > It is possible to replace polling mechanism with registry change notifications. If the registry at `HKCU\Printers\Connections` is updated, refresh the list of print services. > > It works perfectly well in my own testing with sharing a Generic / Text Only printer from another laptop. The notification comes as soon as the printer is installed, it results in a new key created under `Connections`. If a remote printer is removed, the notification is also triggered as the key corresponding to that printer is removed from the registry. > > I updated the steps in the manual test: `RemotePrinterStatusRefresh.java`. @aivanov-jdk can you please check what that old comment was about: https://bugs.openjdk.java.net/browse/JDK-8153732?focusedCommentId=14188974&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14188974 Any idea why RegistryValueChange was rejected as a solution? ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From prr at openjdk.java.net Sat Mar 13 00:21:19 2021 From: prr at openjdk.java.net (Phil Race) Date: Sat, 13 Mar 2021 00:21:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux Message-ID: >From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. I ended up having to go this way because its is the least unsatisfactory solution. I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime because too many systems have to old a version of harfbuzz. This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 There are couple of incidental fixes in here too - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 ------------- Commit messages: - 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux Changes: https://git.openjdk.java.net/jdk/pull/2982/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2982&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8255790 Stats: 96 lines in 2 files changed: 7 ins; 57 del; 32 mod Patch: https://git.openjdk.java.net/jdk/pull/2982.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2982/head:pull/2982 PR: https://git.openjdk.java.net/jdk/pull/2982 From serb at openjdk.java.net Sat Mar 13 00:37:06 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 13 Mar 2021 00:37:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux In-Reply-To: References: Message-ID: On Sat, 13 Mar 2021 00:15:16 GMT, Phil Race wrote: > From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps > the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. > > I ended up having to go this way because its is the least unsatisfactory solution. > I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime > because too many systems have to old a version of harfbuzz. > > This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 > > There are couple of incidental fixes in here too > - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version > - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy > - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From almatvee at openjdk.java.net Sat Mar 13 00:46:07 2021 From: almatvee at openjdk.java.net (Alexander Matveev) Date: Sat, 13 Mar 2021 00:46:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 18:33:37 GMT, Andy Herrick wrote: > implementation of > JDK-8256145: JEP 398: Deprecate the Applet API for Removal Marked as reviewed by almatvee (Committer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From dholmes at openjdk.java.net Sat Mar 13 05:52:22 2021 From: dholmes at openjdk.java.net (David Holmes) Date: Sat, 13 Mar 2021 05:52:22 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v27] In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 16:44:38 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision: > > Fix most of issues in java/foreign/ tests > > Failures related to va_args are tracked in JDK-8263512. src/hotspot/share/runtime/safefetch.inline.hpp line 35: > 33: inline int SafeFetch32(int* adr, int errValue) { > 34: assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated"); > 35: Thread* thread = Thread::current_or_null_safe(); Sorry but this should be MACOS_AARCH64 only. All three lines need to be ifdef'd if you are going to include the assertion. Thanks, David ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aivanov at openjdk.java.net Sat Mar 13 12:02:06 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Sat, 13 Mar 2021 12:02:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: <82CenQod4D7T0Wz5Uat6u-RfFLW01xVOV69zkTpIca0=.aaf34fca-2af3-4387-988d-048eb87af868@github.com> References: <82CenQod4D7T0Wz5Uat6u-RfFLW01xVOV69zkTpIca0=.aaf34fca-2af3-4387-988d-048eb87af868@github.com> Message-ID: On Sat, 13 Mar 2021 00:18:25 GMT, Sergey Bylokhov wrote: > Any idea why RegistryValueChange was rejected as a solution? I've no idea. I read that comment, it's exactly the comment that was in the code above `RemotePrinterChangeListener` class in `PrintServiceLookupProvider.java`. > RegistryValueChange cannot be used in combination with WMI to get registry value change notification because of an error that may be generated because the scope of the query would be too big to handle(at times). It's very vague. I don't know what it really means. Neither do I know if a prototype was even tried. If fact, this comment cites portions of the article [How to listen for Printer Connections?](https://docs.microsoft.com/en-gb/archive/blogs/hmahrt/how-to-listen-for-printer-connections). The link to this article is in the description of [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732). The article discusses the subject with WMI and WQL. This is what it says: > There is no equivalent to `FindFirstPrinterChangeNotification`, which listens for new/changed Printer Connections ? and a polling mechanism was not an option. However, there is another way, using WMI. Note: _polling mechanism was not an option_. Yet it is what was implemented in Java. Then the articles describes the steps needed to monitor for printer changes. Close to the end, there's the quoted sentence: > Unfortunately, we cannot use the `RegistryValueChangeEvent` (because the scope of the query would be too big (we?d receive an error message), so we can only know **when** something changed below the `Printers\Connections` key, but not **what**. This is why we have to rely on **`EnumPrinters`**. This statement is a bit confusing. It says they cannot use `RegistryValueChangeEvent` (it's not a Windows API function, it's another WMI class) but the WQL query above _uses it_. I interpret the following statement this way: Registry notifications do not provide information on **what** changed under `Printers\Connections`, only that a change occurred. So `EnumPrinters` is used to enumerate the remote printers and update the stored list of printers after the change to the registry occurs. I used this article as the inspiration and the implementation I'm proposing in this PR is purely based on this article. Yet I'm using Windows API function [RegNotifyChangeKeyValue](https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regnotifychangekeyvalue) to watch for registry updates and to get notified as soon as a change under `HKCU\Printers\Connections` occurs. Then the list of printers is updated by the `refreshServices` upcall into Java which refreshes both _local_ and _remote_ printers. ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From serb at openjdk.java.net Sun Mar 14 08:41:06 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sun, 14 Mar 2021 08:41:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 15:38:27 GMT, Alexey Ivanov wrote: > [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented polling for remote printers. > That bug description also mentions watching the registry for changes and links to the article which describes the method yet it does so in terms of WMI. Using WMI is not necessary to watch for the registry updates. > > It is possible to replace polling mechanism with registry change notifications. If the registry at `HKCU\Printers\Connections` is updated, refresh the list of print services. > > It works perfectly well in my own testing with sharing a Generic / Text Only printer from another laptop. The notification comes as soon as the printer is installed, it results in a new key created under `Connections`. If a remote printer is removed, the notification is also triggered as the key corresponding to that printer is removed from the registry. > > I updated the steps in the manual test: `RemotePrinterStatusRefresh.java`. Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From alanb at openjdk.java.net Sun Mar 14 12:09:05 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Sun, 14 Mar 2021 12:09:05 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations In-Reply-To: References: Message-ID: On Sat, 13 Mar 2021 00:43:33 GMT, Alexander Matveev wrote: >> implementation of >> JDK-8256145: JEP 398: Deprecate the Applet API for Removal > > Marked as reviewed by almatvee (Committer). Have you looked at narrowing the use of the SuppressWarnings to local variable declarations to avoid adding it to some of these methods? ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From github.com+10835776+stsypanov at openjdk.java.net Sun Mar 14 17:09:21 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Sun, 14 Mar 2021 17:09:21 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream In-Reply-To: References: Message-ID: <9WzDHjb3E5Afwj-g73SsX2P2rSbsNk0HCflWjpi0Or4=.55abfbfe-9e91-445c-ad38-7afb169c3365@github.com> On Sun, 14 Mar 2021 07:51:24 GMT, Alan Bateman wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. >> >> Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. > > src/java.base/share/classes/jdk/internal/jmod/JmodFile.java line 57: > >> 55: // validate the header >> 56: byte[] magic = new byte[4]; >> 57: in.read(magic); > > While you are there, this can be changed to magic = in.readNBytes(4) and throw IOException if magic.length != 4. Done. ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From alanb at openjdk.java.net Sun Mar 14 17:09:20 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Sun, 14 Mar 2021 17:09:20 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream In-Reply-To: References: Message-ID: On Sat, 13 Mar 2021 22:29:23 GMT, ?????? ??????? wrote: > In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. src/java.base/share/classes/jdk/internal/jmod/JmodFile.java line 57: > 55: // validate the header > 56: byte[] magic = new byte[4]; > 57: in.read(magic); While you are there, this can be changed to magic = in.readNBytes(4) and throw IOException if magic.length != 4. src/java.base/share/classes/jdk/internal/jmod/JmodFile.java line 58: > 56: byte[] magic = in.readNBytes(4); > 57: if (magic.length != 4) { > 58: throw new IOException("Header expected to be of length 4, but was " + magic.length); Thanks for the update. If magic != 4 then it means the file is not a JMOD file or that it has been truncated. ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From github.com+10835776+stsypanov at openjdk.java.net Sun Mar 14 17:09:20 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Sun, 14 Mar 2021 17:09:20 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream Message-ID: In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. ------------- Commit messages: - Use InputStream.readNBytes() - Drop unnecessary BufferedInputStream-wrapping where possible Changes: https://git.openjdk.java.net/jdk/pull/2992/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263560 Stats: 14 lines in 3 files changed: 2 ins; 7 del; 5 mod Patch: https://git.openjdk.java.net/jdk/pull/2992.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2992/head:pull/2992 PR: https://git.openjdk.java.net/jdk/pull/2992 From github.com+10835776+stsypanov at openjdk.java.net Sun Mar 14 17:39:25 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Sun, 14 Mar 2021 17:39:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v2] In-Reply-To: References: Message-ID: <7MZ3DNHaLzsGrqQcbUo2l8Uj5hzlRMToZXF9_NoIAB0=.5fedbf9f-bf5d-4712-952f-82a02283d1e4@github.com> > In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: Revert usage of InputStream.readNBytes() ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2992/files - new: https://git.openjdk.java.net/jdk/pull/2992/files/4c608737..12505d05 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=00-01 Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/2992.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2992/head:pull/2992 PR: https://git.openjdk.java.net/jdk/pull/2992 From github.com+10835776+stsypanov at openjdk.java.net Sun Mar 14 17:39:26 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Sun, 14 Mar 2021 17:39:26 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v2] In-Reply-To: References: Message-ID: <-SbLgW2n90cLQIGHulyofX7nRzvFZxw_Hej14jTbJDQ=.a4942343-3dfb-459c-baed-bad73a1229c5@github.com> On Sun, 14 Mar 2021 11:16:13 GMT, Alan Bateman wrote: >> ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: >> >> Revert usage of InputStream.readNBytes() > > src/java.base/share/classes/jdk/internal/jmod/JmodFile.java line 58: > >> 56: byte[] magic = in.readNBytes(4); >> 57: if (magic.length != 4) { >> 58: throw new IOException("Header expected to be of length 4, but was " + magic.length); > > Thanks for the update. If magic != 4 then it means the file is not a JMOD file or that it has been truncated. It turned out, that with this latest update some of tier2_tools tests are failing, e.g. `JLinkNegativeTest`: test JLinkNegativeTest.testMalformedJmod(): failure java.lang.AssertionError: Output does not fit regexp: Error: java.io.IOException: Invalid JMOD file at tests.Result.assertFailure(Result.java:70) at JLinkNegativeTest.testMalformedJmod(JLinkNegativeTest.java:201) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at org.testng.TestRunner.privateRun(TestRunner.java:773) at org.testng.TestRunner.run(TestRunner.java:623) at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) at org.testng.SuiteRunner.run(SuiteRunner.java:259) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) at org.testng.TestNG.run(TestNG.java:1018) at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) at java.base/java.lang.Thread.run(Thread.java:831) ... java.lang.module.FindException: java.io.IOException: Invalid JMOD file: /home/s.tsypanov/IdeaProjects/jdk-github/build/linux-x86_64-server-release/test-support/jtreg_test_jdk_tier2/scratch/3/jmods/hacked4.jmod at java.base/jdk.internal.module.ModulePath.scan(ModulePath.java:253) at java.base/jdk.internal.module.ModulePath.scanNextEntry(ModulePath.java:190) at java.base/jdk.internal.module.ModulePath.find(ModulePath.java:154) at java.base/java.lang.module.Resolver.findWithBeforeFinder(Resolver.java:842) at java.base/java.lang.module.Resolver.resolve(Resolver.java:119) at java.base/java.lang.module.Configuration.resolve(Configuration.java:421) at java.base/java.lang.module.Configuration.resolve(Configuration.java:255) at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.limitFinder(JlinkTask.java:545) at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.newModuleFinder(JlinkTask.java:466) at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.initJlinkConfig(JlinkTask.java:374) at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.run(JlinkTask.java:267) at jdk.jlink/jdk.tools.jlink.internal.Main.run(Main.java:54) at jdk.jlink/jdk.tools.jlink.internal.Main$JlinkToolProvider.run(Main.java:65) at tests.JImageGenerator$JLinkTask.call(JImageGenerator.java:715) at tests.Helper.generateDefaultImage(Helper.java:257) at tests.Helper.generateDefaultImage(Helper.java:244) at JLinkNegativeTest.testSectionsAreFiles(JLinkNegativeTest.java:307) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at org.testng.TestRunner.privateRun(TestRunner.java:773) at org.testng.TestRunner.run(TestRunner.java:623) at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) at org.testng.SuiteRunner.run(SuiteRunner.java:259) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) at org.testng.TestNG.run(TestNG.java:1018) at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) at java.base/java.lang.Thread.run(Thread.java:831) Caused by: java.io.IOException: Invalid JMOD file: /home/s.tsypanov/IdeaProjects/jdk-github/build/linux-x86_64-server-release/test-support/jtreg_test_jdk_tier2/scratch/3/jmods/hacked4.jmod at java.base/jdk.internal.jmod.JmodFile.checkMagic(JmodFile.java:62) at java.base/jdk.internal.jmod.JmodFile.(JmodFile.java:180) at java.base/jdk.internal.module.ModulePath.readJMod(ModulePath.java:392) at java.base/jdk.internal.module.ModulePath.readModule(ModulePath.java:343) at java.base/jdk.internal.module.ModulePath.scanDirectory(ModulePath.java:284) at java.base/jdk.internal.module.ModulePath.scan(ModulePath.java:232) ... 44 more java.lang.Exception: failures: 1 at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:96) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) at java.base/java.lang.Thread.run(Thread.java:831) So if you don't mind, I'll revert the latest commit ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From alanb at openjdk.java.net Sun Mar 14 17:43:07 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Sun, 14 Mar 2021 17:43:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v2] In-Reply-To: <-SbLgW2n90cLQIGHulyofX7nRzvFZxw_Hej14jTbJDQ=.a4942343-3dfb-459c-baed-bad73a1229c5@github.com> References: <-SbLgW2n90cLQIGHulyofX7nRzvFZxw_Hej14jTbJDQ=.a4942343-3dfb-459c-baed-bad73a1229c5@github.com> Message-ID: <-D4lEMJ8ZdR4BK89uxgUfXDuoQI9qRsbYW6_5QS2-FY=.7f408f1d-fca1-48a4-b59f-a5fba532b94e@github.com> On Sun, 14 Mar 2021 17:34:12 GMT, ?????? ??????? wrote: >> src/java.base/share/classes/jdk/internal/jmod/JmodFile.java line 58: >> >>> 56: byte[] magic = in.readNBytes(4); >>> 57: if (magic.length != 4) { >>> 58: throw new IOException("Header expected to be of length 4, but was " + magic.length); >> >> Thanks for the update. If magic != 4 then it means the file is not a JMOD file or that it has been truncated. > > It turned out, that with this latest update some of tier2_tools tests are failing, e.g. `JLinkNegativeTest`: > test JLinkNegativeTest.testMalformedJmod(): failure > java.lang.AssertionError: Output does not fit regexp: Error: java.io.IOException: Invalid JMOD file > at tests.Result.assertFailure(Result.java:70) > at JLinkNegativeTest.testMalformedJmod(JLinkNegativeTest.java:201) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) > at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:568) > at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) > at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) > at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) > at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) > at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) > at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) > at org.testng.TestRunner.privateRun(TestRunner.java:773) > at org.testng.TestRunner.run(TestRunner.java:623) > at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) > at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) > at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) > at org.testng.SuiteRunner.run(SuiteRunner.java:259) > at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) > at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) > at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) > at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) > at org.testng.TestNG.run(TestNG.java:1018) > at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) > at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:568) > at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) > at java.base/java.lang.Thread.run(Thread.java:831) > ... > java.lang.module.FindException: java.io.IOException: Invalid JMOD file: /home/s.tsypanov/IdeaProjects/jdk-github/build/linux-x86_64-server-release/test-support/jtreg_test_jdk_tier2/scratch/3/jmods/hacked4.jmod > at java.base/jdk.internal.module.ModulePath.scan(ModulePath.java:253) > at java.base/jdk.internal.module.ModulePath.scanNextEntry(ModulePath.java:190) > at java.base/jdk.internal.module.ModulePath.find(ModulePath.java:154) > at java.base/java.lang.module.Resolver.findWithBeforeFinder(Resolver.java:842) > at java.base/java.lang.module.Resolver.resolve(Resolver.java:119) > at java.base/java.lang.module.Configuration.resolve(Configuration.java:421) > at java.base/java.lang.module.Configuration.resolve(Configuration.java:255) > at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.limitFinder(JlinkTask.java:545) > at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.newModuleFinder(JlinkTask.java:466) > at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.initJlinkConfig(JlinkTask.java:374) > at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.run(JlinkTask.java:267) > at jdk.jlink/jdk.tools.jlink.internal.Main.run(Main.java:54) > at jdk.jlink/jdk.tools.jlink.internal.Main$JlinkToolProvider.run(Main.java:65) > at tests.JImageGenerator$JLinkTask.call(JImageGenerator.java:715) > at tests.Helper.generateDefaultImage(Helper.java:257) > at tests.Helper.generateDefaultImage(Helper.java:244) > at JLinkNegativeTest.testSectionsAreFiles(JLinkNegativeTest.java:307) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) > at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:568) > at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) > at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) > at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) > at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) > at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) > at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) > at org.testng.TestRunner.privateRun(TestRunner.java:773) > at org.testng.TestRunner.run(TestRunner.java:623) > at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) > at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) > at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) > at org.testng.SuiteRunner.run(SuiteRunner.java:259) > at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) > at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) > at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) > at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) > at org.testng.TestNG.run(TestNG.java:1018) > at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) > at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:568) > at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) > at java.base/java.lang.Thread.run(Thread.java:831) > Caused by: java.io.IOException: Invalid JMOD file: /home/s.tsypanov/IdeaProjects/jdk-github/build/linux-x86_64-server-release/test-support/jtreg_test_jdk_tier2/scratch/3/jmods/hacked4.jmod > at java.base/jdk.internal.jmod.JmodFile.checkMagic(JmodFile.java:62) > at java.base/jdk.internal.jmod.JmodFile.(JmodFile.java:180) > at java.base/jdk.internal.module.ModulePath.readJMod(ModulePath.java:392) > at java.base/jdk.internal.module.ModulePath.readModule(ModulePath.java:343) > at java.base/jdk.internal.module.ModulePath.scanDirectory(ModulePath.java:284) > at java.base/jdk.internal.module.ModulePath.scan(ModulePath.java:232) > ... 44 more > > java.lang.Exception: failures: 1 > at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:96) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) > at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:568) > at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) > at java.base/java.lang.Thread.run(Thread.java:831) > > So if you don't mind, I'll revert the latest commit JLinkNegativeTest depends on the exception message, it should be easy to update. ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From github.com+10835776+stsypanov at openjdk.java.net Sun Mar 14 19:35:25 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Sun, 14 Mar 2021 19:35:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3] In-Reply-To: <-D4lEMJ8ZdR4BK89uxgUfXDuoQI9qRsbYW6_5QS2-FY=.7f408f1d-fca1-48a4-b59f-a5fba532b94e@github.com> References: <-SbLgW2n90cLQIGHulyofX7nRzvFZxw_Hej14jTbJDQ=.a4942343-3dfb-459c-baed-bad73a1229c5@github.com> <-D4lEMJ8ZdR4BK89uxgUfXDuoQI9qRsbYW6_5QS2-FY=.7f408f1d-fca1-48a4-b59f-a5fba532b94e@github.com> Message-ID: On Sun, 14 Mar 2021 17:40:27 GMT, Alan Bateman wrote: >> It turned out, that with this latest update some of tier2_tools tests are failing, e.g. `JLinkNegativeTest`: >> test JLinkNegativeTest.testMalformedJmod(): failure >> java.lang.AssertionError: Output does not fit regexp: Error: java.io.IOException: Invalid JMOD file >> at tests.Result.assertFailure(Result.java:70) >> at JLinkNegativeTest.testMalformedJmod(JLinkNegativeTest.java:201) >> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) >> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.base/java.lang.reflect.Method.invoke(Method.java:568) >> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) >> at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) >> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) >> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) >> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) >> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) >> at org.testng.TestRunner.privateRun(TestRunner.java:773) >> at org.testng.TestRunner.run(TestRunner.java:623) >> at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) >> at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) >> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) >> at org.testng.SuiteRunner.run(SuiteRunner.java:259) >> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) >> at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) >> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) >> at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) >> at org.testng.TestNG.run(TestNG.java:1018) >> at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94) >> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) >> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.base/java.lang.reflect.Method.invoke(Method.java:568) >> at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) >> at java.base/java.lang.Thread.run(Thread.java:831) >> ... >> java.lang.module.FindException: java.io.IOException: Invalid JMOD file: /home/s.tsypanov/IdeaProjects/jdk-github/build/linux-x86_64-server-release/test-support/jtreg_test_jdk_tier2/scratch/3/jmods/hacked4.jmod >> at java.base/jdk.internal.module.ModulePath.scan(ModulePath.java:253) >> at java.base/jdk.internal.module.ModulePath.scanNextEntry(ModulePath.java:190) >> at java.base/jdk.internal.module.ModulePath.find(ModulePath.java:154) >> at java.base/java.lang.module.Resolver.findWithBeforeFinder(Resolver.java:842) >> at java.base/java.lang.module.Resolver.resolve(Resolver.java:119) >> at java.base/java.lang.module.Configuration.resolve(Configuration.java:421) >> at java.base/java.lang.module.Configuration.resolve(Configuration.java:255) >> at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.limitFinder(JlinkTask.java:545) >> at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.newModuleFinder(JlinkTask.java:466) >> at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.initJlinkConfig(JlinkTask.java:374) >> at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.run(JlinkTask.java:267) >> at jdk.jlink/jdk.tools.jlink.internal.Main.run(Main.java:54) >> at jdk.jlink/jdk.tools.jlink.internal.Main$JlinkToolProvider.run(Main.java:65) >> at tests.JImageGenerator$JLinkTask.call(JImageGenerator.java:715) >> at tests.Helper.generateDefaultImage(Helper.java:257) >> at tests.Helper.generateDefaultImage(Helper.java:244) >> at JLinkNegativeTest.testSectionsAreFiles(JLinkNegativeTest.java:307) >> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) >> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.base/java.lang.reflect.Method.invoke(Method.java:568) >> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) >> at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) >> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) >> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) >> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) >> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) >> at org.testng.TestRunner.privateRun(TestRunner.java:773) >> at org.testng.TestRunner.run(TestRunner.java:623) >> at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) >> at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) >> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) >> at org.testng.SuiteRunner.run(SuiteRunner.java:259) >> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) >> at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) >> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) >> at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) >> at org.testng.TestNG.run(TestNG.java:1018) >> at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94) >> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) >> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.base/java.lang.reflect.Method.invoke(Method.java:568) >> at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) >> at java.base/java.lang.Thread.run(Thread.java:831) >> Caused by: java.io.IOException: Invalid JMOD file: /home/s.tsypanov/IdeaProjects/jdk-github/build/linux-x86_64-server-release/test-support/jtreg_test_jdk_tier2/scratch/3/jmods/hacked4.jmod >> at java.base/jdk.internal.jmod.JmodFile.checkMagic(JmodFile.java:62) >> at java.base/jdk.internal.jmod.JmodFile.(JmodFile.java:180) >> at java.base/jdk.internal.module.ModulePath.readJMod(ModulePath.java:392) >> at java.base/jdk.internal.module.ModulePath.readModule(ModulePath.java:343) >> at java.base/jdk.internal.module.ModulePath.scanDirectory(ModulePath.java:284) >> at java.base/jdk.internal.module.ModulePath.scan(ModulePath.java:232) >> ... 44 more >> >> java.lang.Exception: failures: 1 >> at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:96) >> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) >> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.base/java.lang.reflect.Method.invoke(Method.java:568) >> at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) >> at java.base/java.lang.Thread.run(Thread.java:831) >> >> So if you don't mind, I'll revert the latest commit > > JLinkNegativeTest depends on the exception message, it should be easy to update. Done ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From github.com+10835776+stsypanov at openjdk.java.net Sun Mar 14 19:35:25 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Sun, 14 Mar 2021 19:35:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3] In-Reply-To: References: Message-ID: > In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: Use InputStream.readNBytes() and fix JLinkNegativeTest ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2992/files - new: https://git.openjdk.java.net/jdk/pull/2992/files/12505d05..a016d2ac Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=01-02 Stats: 5 lines in 2 files changed: 2 ins; 0 del; 3 mod Patch: https://git.openjdk.java.net/jdk/pull/2992.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2992/head:pull/2992 PR: https://git.openjdk.java.net/jdk/pull/2992 From prr at openjdk.java.net Sun Mar 14 20:04:08 2021 From: prr at openjdk.java.net (Phil Race) Date: Sun, 14 Mar 2021 20:04:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3] In-Reply-To: References: Message-ID: On Sun, 14 Mar 2021 19:35:25 GMT, ?????? ??????? wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. >> >> Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. > > ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: > > Use InputStream.readNBytes() and fix JLinkNegativeTest 2d change is fine. ------------- Marked as reviewed by prr (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2992 From serb at openjdk.java.net Sun Mar 14 22:51:10 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sun, 14 Mar 2021 22:51:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3] In-Reply-To: References: Message-ID: On Sun, 14 Mar 2021 19:35:25 GMT, ?????? ??????? wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. >> >> Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. > > ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: > > Use InputStream.readNBytes() and fix JLinkNegativeTest src/java.desktop/share/classes/sun/awt/image/ByteArrayImageSource.java line 54: > 52: > 53: protected ImageDecoder getDecoder() { > 54: InputStream is = new ByteArrayInputStream(imagedata, imageoffset, imagelength); This file use 80 chars per line code style. ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From serb at openjdk.java.net Mon Mar 15 06:26:38 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 15 Mar 2021 06:26:38 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: On Thu, 11 Mar 2021 18:00:15 GMT, Ajit Ghaisas wrote: >> **Description :** >> This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) >> It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. >> The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) >> >> We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ >> >> A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. >> >> **Testing :** >> This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) >> >> **Note to reviewers :** >> 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. >> >> 2) To apply and test this PR - >> To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) >> >> 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 > > Ajit Ghaisas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 47 additional commits since the last revision: > > - Lanai PR#214 - 8263324 - avu > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#213 - 8263325 - avu > - Lanai PR#212 - 8259825 - aghaisas > - Lanai PR#211 - 8262882 - aghaisas > - Merge branch 'master' into 8260931_lanai_JEP_branch > - Lanai PR#210 - 8263159 - jdv > - Lanai PR#209 - 8262936 - jdv > - Lanai PR#208 - 8262928 - jdv > - Lanai PR#207 - 8262750 - jdv > - ... and 37 more: https://git.openjdk.java.net/jdk/compare/74f2d574...369c3d21 Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From aghaisas at openjdk.java.net Mon Mar 15 06:46:12 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Mon, 15 Mar 2021 06:46:12 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8260931: Implement JEP 382: New macOS Rendering Pipeline In-Reply-To: References: Message-ID: <73UylZ216N2glLW1mFF3E9mfpwCVrLm3MWXI-QlIXVU=.3dfd299b-127b-47a7-aba7-c842a4dc6c84@github.com> On Thu, 4 Feb 2021 10:35:02 GMT, Ajit Ghaisas wrote: > **Description :** > This is the implementation of [JEP 382 : New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8238361) > It implements a Java 2D internal rendering pipeline for macOS using the Apple Metal API. > The entire work on this was done under [OpenJDK Project - Lanai](http://openjdk.java.net/projects/lanai/) > > We iterated through several Early Access (EA) builds and have reached a stage where it is ready to be integrated to openjdk/jdk. The latest EA build is available at - https://jdk.java.net/lanai/ > > A new option -Dsun.java2d.metal=true | True needs to be used to use this pipeline. > > **Testing :** > This implementation has been tested with the tests present at - [Test Plan for JEP 382: New macOS Rendering Pipeline](https://bugs.openjdk.java.net/browse/JDK-8251396) > > **Note to reviewers :** > 1) Default rendering pipeline on macOS has not been changed by this PR. OpenGL still stays as the default rendering pipeline and Metal rendering pipeline is optional to choose. > > 2) To apply and test this PR - > To enable the metal pipeline you must specify on command line -Dsun.java2d.metal=true (No message will be printed in this case) or -Dsun.java2d.metal=True (A message indicating Metal rendering pipeline is enabled gets printed) > > 3) Review comments (including some preliminary informal review comments) are tracked with JBS issues - https://bugs.openjdk.java.net/issues/?filter=40598 This pull request has now been integrated. Changeset: 8afec70c Author: Ajit Ghaisas URL: https://git.openjdk.java.net/jdk/commit/8afec70c Stats: 17612 lines in 87 files changed: 17573 ins; 2 del; 37 mod 8260931: Implement JEP 382: New macOS Rendering Pipeline Co-authored-by: Jayathirth D V Co-authored-by: Alexey Ushakov Co-authored-by: Artem Bochkarev Co-authored-by: Prasanta Sadhukhan Co-authored-by: Denis Konoplev Co-authored-by: Phil Race Co-authored-by: Kevin Rushforth Co-authored-by: Magnus Ihse Bursie Co-authored-by: Ajit Ghaisas Reviewed-by: ihse, avu, kcr, gziemski, prr, kizune, jdv, psadhukhan, serb ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From serb at openjdk.java.net Mon Mar 15 07:04:10 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 15 Mar 2021 07:04:10 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8263467: Incorrect double-checked locking in sun.java2d.CRenderer In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 07:19:06 GMT, Aleksey Shipilev wrote: > Ok, I removed the "DCL" from that code and used the objects directly. AFAICS, synchronization is redundant on those local objects. What would be a good test for this change? I guess that synchronization became redundant because the field was moved to the local var. But before that, it guarded the method in question for multithreaded access and that was not part of the DCL. So it will be better to return those fields back. As the test I have run all automated tests and some manual tests, none of them triggered this code. ------------- PR: https://git.openjdk.java.net/jdk/pull/2948 From avu at openjdk.java.net Mon Mar 15 07:18:12 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Mon, 15 Mar 2021 07:18:12 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v10] In-Reply-To: References: <57_y3DUuOJ-FcWMueh_bCIt7LonAQW8l-guh_EQCv14=.bdcff4aa-e3b2-4f50-8e41-9b6ccf89c6fb@github.com> Message-ID: On Fri, 12 Mar 2021 00:36:34 GMT, Sergey Bylokhov wrote: >> I fixed some conversion logic within JDK-8256331. > > OK, just to confirm. I wrote that text for OGL because it was the fastest way to transfer+convert the data from the video card to the memory. And as far as I understand the metal has the same limitation? It is not possible to convert it to some non-ARGB/Pre format on the fly while transferring the pixles? If we're talking about metal blit operation, the answer is No. Also, it looks like we still need a blit operation from video memory even if we use compute shader. ------------- PR: https://git.openjdk.java.net/jdk/pull/2403 From github.com+10835776+stsypanov at openjdk.java.net Mon Mar 15 08:36:29 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Mon, 15 Mar 2021 08:36:29 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3] In-Reply-To: References: Message-ID: On Sun, 14 Mar 2021 22:48:18 GMT, Sergey Bylokhov wrote: >> ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: >> >> Use InputStream.readNBytes() and fix JLinkNegativeTest > > src/java.desktop/share/classes/sun/awt/image/ByteArrayImageSource.java line 54: > >> 52: >> 53: protected ImageDecoder getDecoder() { >> 54: InputStream is = new ByteArrayInputStream(imagedata, imageoffset, imagelength); > > This file use 80 chars per line code style. Fixed. ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From github.com+10835776+stsypanov at openjdk.java.net Mon Mar 15 08:36:28 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Mon, 15 Mar 2021 08:36:28 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v4] In-Reply-To: References: Message-ID: <1QWRbOB-L164PKNpRWeJ9pY5AILrguO6Dv-OLhBB8UI=.d879ff21-7338-466e-9635-b69d9e5dcc9c@github.com> > In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: Fix formatting ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2992/files - new: https://git.openjdk.java.net/jdk/pull/2992/files/a016d2ac..f69c8ff4 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=02-03 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2992.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2992/head:pull/2992 PR: https://git.openjdk.java.net/jdk/pull/2992 From dbatrak at openjdk.java.net Mon Mar 15 10:31:36 2021 From: dbatrak at openjdk.java.net (Dmitry Batrak) Date: Mon, 15 Mar 2021 10:31:36 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS Message-ID: This is the implementation used by JetBrains Runtime for the last 4 years, after some cleanup, and with one problem, found while preparing the pull request, fixed. Even though typical scenarios for a UI application should be covered, it's not a complete solution. In particular, emoji-s still won't be rendered for large font sizes (more than 100pt), and for non-trivial composite/painting modes. Notable implementation details are listed below. **Glyph image generation** Deprecated CGContextShowGlyphsAtPoint function, used by JDK on macOS to render text, cannot render emojis, CTFontDrawGlyphs is used instead. It ignores the scale component of text transformation matrix, so a 'real-sized' CTFont object should be passed to it. The same sizing procedure is done when calculating glyph metrics, because they are not scaled proportionally with font size (as they do for vector fonts). **Glyph image storage** Existing GlyphInfo structure is used to store color glyph image. Color glyph can be distinguished by having 4 bytes of storage per pixel. Color components are stored in pre-multiplied alpha format. **Glyph rendering** Previously, GlyphList instance always contained glyphs in the same format (solid, grayscale or LCD), determined by the effective rendering hint. Now the renderers must be prepared to GlyphList having 'normal' glyphs interspersed with color glyphs (they can appear due to font fallback). This isn't a problem for OpenGL renderer (used for on-screen painting), but GlyphListLoopPipe-based renderers (used for off-screen painting) needed an adjustment to be able to operate on specific segments of GlyphList. As an incidental optimization, calculation of GlyphList bounds ('getBounds' method) is performed now only when needed (most text renderers don't need this information). Speaking of the actual rendering of the glyph image, it's done by the straightforward glDrawPixels call in OpenGL renderer, and by re-using existing Blit primitive in off-screen renderers. **Testing** There's no good way to test the new functionality automatically, but I've added a test verifying that 'something' is rendered for the emoji character, when painting to BufferedImage. Existing tests pass after the change. ------------- Commit messages: - 8263583: Emoji rendering on macOS Changes: https://git.openjdk.java.net/jdk/pull/3007/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3007&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263583 Stats: 816 lines in 28 files changed: 677 ins; 29 del; 110 mod Patch: https://git.openjdk.java.net/jdk/pull/3007.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3007/head:pull/3007 PR: https://git.openjdk.java.net/jdk/pull/3007 From azvegint at openjdk.java.net Mon Mar 15 10:50:13 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Mon, 15 Mar 2021 10:50:13 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux In-Reply-To: References: Message-ID: On Sat, 13 Mar 2021 00:15:16 GMT, Phil Race wrote: > From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps > the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. > > I ended up having to go this way because its is the least unsatisfactory solution. > I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime > because too many systems have to old a version of harfbuzz. > > This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 > > There are couple of incidental fixes in here too > - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version > - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy > - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 make/modules/java.desktop/lib/Awt2dLibraries.gmk line 465: > 463: tautological-constant-out-of-range-compare int-to-pointer-cast \ > 464: undef missing-field-initializers range-loop-analysis > 465: HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138 Looks like that this block has extra indent of 1 space. make/modules/java.desktop/lib/Awt2dLibraries.gmk line 479: > 477: # when building libharfbuzz > 478: ifeq ($(call isTargetOs, aix), true) > 479: LIBHARFBUZZ_CFLAGS += -qdebug=necan I couldn't find the `-qdebug=necan` in the updated makefile. Does the [JDK-8258484](https://bugs.openjdk.java.net/browse/JDK-8258484) handled is some other way? ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From alanb at openjdk.java.net Mon Mar 15 11:45:09 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Mon, 15 Mar 2021 11:45:09 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v4] In-Reply-To: References: <-SbLgW2n90cLQIGHulyofX7nRzvFZxw_Hej14jTbJDQ=.a4942343-3dfb-459c-baed-bad73a1229c5@github.com> <-D4lEMJ8ZdR4BK89uxgUfXDuoQI9qRsbYW6_5QS2-FY=.7f408f1d-fca1-48a4-b59f-a5fba532b94e@github.com> Message-ID: On Sun, 14 Mar 2021 19:32:11 GMT, ?????? ??????? wrote: > Done I think I'd prefer if the exception message would say that the JMOD is invalid or that the JMOD file is truncated (because I don't think anyone seeing this exception will know anything about the header). ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From github.com+10835776+stsypanov at openjdk.java.net Mon Mar 15 12:19:19 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Mon, 15 Mar 2021 12:19:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5] In-Reply-To: References: Message-ID: <-sGRvFheVqAlzk64IjfZpMhR0-UDJunrr2HtzYZ3yCM=.3235f9f4-e8f2-44b8-9e20-b7904f53a5b6@github.com> > In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: Fix error message ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2992/files - new: https://git.openjdk.java.net/jdk/pull/2992/files/f69c8ff4..ff25cc4d Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=03-04 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/2992.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2992/head:pull/2992 PR: https://git.openjdk.java.net/jdk/pull/2992 From github.com+10835776+stsypanov at openjdk.java.net Mon Mar 15 12:19:20 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Mon, 15 Mar 2021 12:19:20 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5] In-Reply-To: References: <-SbLgW2n90cLQIGHulyofX7nRzvFZxw_Hej14jTbJDQ=.a4942343-3dfb-459c-baed-bad73a1229c5@github.com> <-D4lEMJ8ZdR4BK89uxgUfXDuoQI9qRsbYW6_5QS2-FY=.7f408f1d-fca1-48a4-b59f-a5fba532b94e@github.com> Message-ID: On Mon, 15 Mar 2021 11:41:07 GMT, Alan Bateman wrote: >> Done > >> Done > > I think I'd prefer if the exception message would say that the JMOD is invalid or that the JMOD file is truncated (because I don't think anyone seeing this exception will know anything about the header). Fixed ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From ihse at openjdk.java.net Mon Mar 15 12:29:15 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Mon, 15 Mar 2021 12:29:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux In-Reply-To: References: Message-ID: On Sat, 13 Mar 2021 00:34:33 GMT, Sergey Bylokhov wrote: >> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps >> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. >> >> I ended up having to go this way because its is the least unsatisfactory solution. >> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime >> because too many systems have to old a version of harfbuzz. >> >> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 >> >> There are couple of incidental fixes in here too >> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version >> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy >> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 > > Marked as reviewed by serb (Reviewer). It feels a bit unfortunate that we had to end up this way. :-( I've read through the bug report and unnderstand that this might be the least bad way... but still. Just thinking out loud, you don't think it would be better to build harfbuzz separately, but as a static library, that is then included in libfontmanager? The main win of doing that, I think, is the ability to have all the disabled warnings confined to the lower-quality upstream source. The resulting code would be the same. And from a build performance perspective I don't think any way of doing it matters. ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From alanb at openjdk.java.net Mon Mar 15 13:48:08 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Mon, 15 Mar 2021 13:48:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5] In-Reply-To: <-sGRvFheVqAlzk64IjfZpMhR0-UDJunrr2HtzYZ3yCM=.3235f9f4-e8f2-44b8-9e20-b7904f53a5b6@github.com> References: <-sGRvFheVqAlzk64IjfZpMhR0-UDJunrr2HtzYZ3yCM=.3235f9f4-e8f2-44b8-9e20-b7904f53a5b6@github.com> Message-ID: On Mon, 15 Mar 2021 12:19:19 GMT, ?????? ??????? wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. >> >> Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. > > ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: > > Fix error message Marked as reviewed by alanb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From dfuchs at openjdk.java.net Mon Mar 15 15:08:10 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Mon, 15 Mar 2021 15:08:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5] In-Reply-To: <-sGRvFheVqAlzk64IjfZpMhR0-UDJunrr2HtzYZ3yCM=.3235f9f4-e8f2-44b8-9e20-b7904f53a5b6@github.com> References: <-sGRvFheVqAlzk64IjfZpMhR0-UDJunrr2HtzYZ3yCM=.3235f9f4-e8f2-44b8-9e20-b7904f53a5b6@github.com> Message-ID: On Mon, 15 Mar 2021 12:19:19 GMT, ?????? ??????? wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. >> >> Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. > > ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: > > Fix error message Changes requested by dfuchs (Reviewer). src/java.base/share/classes/sun/net/www/http/HttpClient.java line 434: > 432: int r = tmpbuf.read(); > 433: if (r == -1) { > 434: logFinest("HttpClient.available(): " + There are some subtle things going on there. Using a `BufferedInputStream` ensures that all the bytes available on the socket will be read, up to the buffer capacity. Can you revert this change? I'd rather that this clean up be handled separately. I have logged https://bugs.openjdk.java.net/browse/JDK-8263599. ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From avu at openjdk.java.net Mon Mar 15 16:02:13 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Mon, 15 Mar 2021 16:02:13 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS In-Reply-To: References: Message-ID: On Mon, 15 Mar 2021 10:25:50 GMT, Dmitry Batrak wrote: > This is the implementation used by JetBrains Runtime for the last 4 years, after some cleanup, and with one problem, > found while preparing the pull request, fixed. > Even though typical scenarios for a UI application should be covered, it's not a complete solution. In particular, emoji-s > still won't be rendered for large font sizes (more than 100pt), and for non-trivial composite/painting modes. > Notable implementation details are listed below. > > **Glyph image generation** > > Deprecated CGContextShowGlyphsAtPoint function, used by JDK on macOS to render text, cannot render emojis, > CTFontDrawGlyphs is used instead. It ignores the scale component of text transformation matrix, so a 'real-sized' > CTFont object should be passed to it. The same sizing procedure is done when calculating glyph metrics, because they > are not scaled proportionally with font size (as they do for vector fonts). > > **Glyph image storage** > > Existing GlyphInfo structure is used to store color glyph image. Color glyph can be distinguished by having 4 bytes > of storage per pixel. Color components are stored in pre-multiplied alpha format. > > **Glyph rendering** > > Previously, GlyphList instance always contained glyphs in the same format (solid, grayscale or LCD), determined by the > effective rendering hint. Now the renderers must be prepared to GlyphList having 'normal' glyphs interspersed with > color glyphs (they can appear due to font fallback). This isn't a problem for OpenGL renderer (used for on-screen painting), > but GlyphListLoopPipe-based renderers (used for off-screen painting) needed an adjustment to be able to operate on > specific segments of GlyphList. > As an incidental optimization, calculation of GlyphList bounds ('getBounds' method) is performed now only when needed > (most text renderers don't need this information). > Speaking of the actual rendering of the glyph image, it's done by the straightforward glDrawPixels call in OpenGL renderer, > and by re-using existing Blit primitive in off-screen renderers. > > **Testing** > > There's no good way to test the new functionality automatically, but I've added a test verifying that 'something' is > rendered for the emoji character, when painting to BufferedImage. > > Existing tests pass after the change. Looks good ------------- PR: https://git.openjdk.java.net/jdk/pull/3007 From github.com+10835776+stsypanov at openjdk.java.net Mon Mar 15 17:56:11 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Mon, 15 Mar 2021 17:56:11 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5] In-Reply-To: References: <-sGRvFheVqAlzk64IjfZpMhR0-UDJunrr2HtzYZ3yCM=.3235f9f4-e8f2-44b8-9e20-b7904f53a5b6@github.com> Message-ID: On Mon, 15 Mar 2021 15:04:49 GMT, Daniel Fuchs wrote: >> ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix error message > > src/java.base/share/classes/sun/net/www/http/HttpClient.java line 434: > >> 432: int r = tmpbuf.read(); >> 433: if (r == -1) { >> 434: logFinest("HttpClient.available(): " + > > There are some subtle things going on there. Using a `BufferedInputStream` ensures that all the bytes available on the socket will be read, up to the buffer capacity. Can you revert this change? I'd rather that this clean up be handled separately. I have logged https://bugs.openjdk.java.net/browse/JDK-8263599. Sure, I'll revert this. ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From dfuchs at openjdk.java.net Mon Mar 15 18:04:27 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Mon, 15 Mar 2021 18:04:27 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v6] In-Reply-To: <12UOgMQ-mVVH7usEXj3a-GAW56QmG54t6chEIVQTJRI=.e7821199-ea42-4c0a-b1f8-27453fc8d02e@github.com> References: <12UOgMQ-mVVH7usEXj3a-GAW56QmG54t6chEIVQTJRI=.e7821199-ea42-4c0a-b1f8-27453fc8d02e@github.com> Message-ID: On Mon, 15 Mar 2021 18:01:20 GMT, ?????? ??????? wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. >> >> Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. > > ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: > > Revert HttpClient LGTM. Thanks! ------------- Marked as reviewed by dfuchs (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2992 From github.com+10835776+stsypanov at openjdk.java.net Mon Mar 15 18:04:26 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Mon, 15 Mar 2021 18:04:26 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v6] In-Reply-To: References: Message-ID: <12UOgMQ-mVVH7usEXj3a-GAW56QmG54t6chEIVQTJRI=.e7821199-ea42-4c0a-b1f8-27453fc8d02e@github.com> > In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: Revert HttpClient ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2992/files - new: https://git.openjdk.java.net/jdk/pull/2992/files/ff25cc4d..af4fcce4 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=05 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2992&range=04-05 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2992.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2992/head:pull/2992 PR: https://git.openjdk.java.net/jdk/pull/2992 From akozlov at openjdk.java.net Mon Mar 15 18:23:35 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Mon, 15 Mar 2021 18:23:35 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v28] In-Reply-To: References: Message-ID: > Please review the implementation of JEP 391: macOS/AArch64 Port. > > It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. > > Major changes are in: > * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) > * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) > * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. > * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 114 commits: - JDK-8262491: bsd_aarch64 part - JDK-8263002: bsd_aarch64 part - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos - Wider #ifdef block - Fix most of issues in java/foreign/ tests Failures related to va_args are tracked in JDK-8263512. - Add Azul copyright - Update Oracle copyright years - Use Thread::current_or_null_safe in SafeFetch - 8262903: [macos_aarch64] Thread::current() called on detached thread - Merge commit 'refs/pull/11/head' of https://github.com/AntonKozlov/jdk into jdk-macos - ... and 104 more: https://git.openjdk.java.net/jdk/compare/d825198e...806fc618 ------------- Changes: https://git.openjdk.java.net/jdk/pull/2200/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=27 Stats: 2949 lines in 75 files changed: 2839 ins; 27 del; 83 mod Patch: https://git.openjdk.java.net/jdk/pull/2200.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2200/head:pull/2200 PR: https://git.openjdk.java.net/jdk/pull/2200 From prr at openjdk.java.net Mon Mar 15 18:38:13 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 15 Mar 2021 18:38:13 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux In-Reply-To: References: Message-ID: <1pxtHEdYSkesEdKlPqRXRm3eMs0RuqUbqiyXpUpWadM=.4c8eb452-eceb-40a5-b9f3-dea309803765@github.com> On Mon, 15 Mar 2021 10:46:45 GMT, Alexander Zvegintsev wrote: >> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps >> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. >> >> I ended up having to go this way because its is the least unsatisfactory solution. >> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime >> because too many systems have to old a version of harfbuzz. >> >> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 >> >> There are couple of incidental fixes in here too >> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version >> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy >> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 > > make/modules/java.desktop/lib/Awt2dLibraries.gmk line 479: > >> 477: # when building libharfbuzz >> 478: ifeq ($(call isTargetOs, aix), true) >> 479: LIBHARFBUZZ_CFLAGS += -qdebug=necan > > I couldn't find the `-qdebug=necan` in the updated makefile. Is the [JDK-8258484](https://bugs.openjdk.java.net/browse/JDK-8258484) handled in some other way? I'll restore this. > make/modules/java.desktop/lib/Awt2dLibraries.gmk line 465: > >> 463: tautological-constant-out-of-range-compare int-to-pointer-cast \ >> 464: undef missing-field-initializers range-loop-analysis >> 465: HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138 > > Looks like that this block has extra indent of 1 space. Yes, I'll update it. ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From prr at openjdk.java.net Mon Mar 15 18:38:09 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 15 Mar 2021 18:38:09 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux In-Reply-To: References: Message-ID: On Sat, 13 Mar 2021 00:15:16 GMT, Phil Race wrote: > From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps > the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. > > I ended up having to go this way because its is the least unsatisfactory solution. > I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime > because too many systems have to old a version of harfbuzz. > > This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 > > There are couple of incidental fixes in here too > - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version > - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy > - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 > Just thinking out loud, you don't think it would be better to build harfbuzz separately, but as a static library, that is then included in libfontmanager? The main win of doing that, I think, is the ability to have all the disabled warnings confined to the lower-quality upstream source. The resulting code would be the same. And from a build performance perspective I don't think any way of doing it matters. I don't know that this would be worth such an effort. I've clearly separated the warnings we are disabling for HARFBUZZ and there's really not a lot of likelihood in my mind that these warnings will suddenly also start to apply to the small amount of JDK code that is in libfontmanager which is also much simpler code. BTW I noticed we are still disabling all warnings for sunFont.c and after this is done I'll likely see if I can make a source code change to resolve that. ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From akozlov at openjdk.java.net Mon Mar 15 18:56:18 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Mon, 15 Mar 2021 18:56:18 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v12] In-Reply-To: <3NYUmXmjyZFhGJwrHfEjSRX1VRaPjt5cCp9HRBxODbM=.4880b6d1-f6dd-45db-95f4-9064e9204d87@github.com> References: <8MnBLkES1lapB4b01NDzU9nhOk8_9_V--NSCM5H_bg8=.7bdb576b-4acd-4e5b-be14-b363a2ef47bf@github.com> <3NYUmXmjyZFhGJwrHfEjSRX1VRaPjt5cCp9HRBxODbM=.4880b6d1-f6dd-45db-95f4-9064e9204d87@github.com> Message-ID: On Thu, 11 Mar 2021 20:27:51 GMT, Stefan Karlsson wrote: >> The thread_bsd_aarch64.hpp describes a part of JavaThread, while this block belongs to Thread for now. Since W^X is an attribute of any operating system thread, I assumed Thread to be the right place for W^X bookkeeping. >> >> In most cases, we manage W^X state of JavaThread. But sometimes a GC thread needs the WXWrite state, or safefetch is called from non-JavaThread. Probably this can be dealt with (e.g. GCThread to always have the WXWrite state). But such change would be much more than a simple refactoring and it would require a significant amount of testing. Ideally, I would like to investigate this as a follow-up change, or at least after other fixes to this PR. > > Good point about Thread vs JavaThread. Yes, this can be looked into as follow-up cleanups. The enhancement is tracked in https://bugs.openjdk.java.net/browse/JDK-8263492 ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Mon Mar 15 18:56:17 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Mon, 15 Mar 2021 18:56:17 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v21] In-Reply-To: References: Message-ID: <4EryfweVy9Q97cbm7rAcsSIXuK2XImbIfuPeloJuXEA=.90a1f396-299c-43d2-922b-9af36ca43467@github.com> On Wed, 10 Mar 2021 11:21:44 GMT, Andrew Haley wrote: >> We always check for `R18_RESERVED` with `#if(n)def`, is there any reason to define the value for the macro? > > Robustness, clarity, maintainability, convention. Why not? I've tried to implement the suggestion, but it pulled more unnecessary changes. It makes the intended way to check the condition less clear (`#ifdef` and not `#if`). The rest of the defines in this file follows the pattern: a define without a value to be checked with `#ifdef` and define with a value to be checked with `#if`. To be consistent, I would need to add `#define R18_RESERVED false` to the `#else` clause and change every `#ifdef R18_RESERVED`/`#ifndef R18_RESERVED` to `#if R18_RESERVED`/`#if !R18_RESERVED`. I think we'll win in clarity in the long term if I will not implement the suggestion without related changes. (And related changes would introduce additional noise, which we are fighting with). ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Mon Mar 15 18:56:23 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Mon, 15 Mar 2021 18:56:23 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v28] In-Reply-To: References: Message-ID: <0dFnMCcGeahDTezdMqNQ2ZtipjeEaCpNezow6Kqy5xE=.ec72c0d8-8252-4abf-ab7a-8ce4b89ca527@github.com> On Sat, 13 Mar 2021 05:49:53 GMT, David Holmes wrote: >> Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 114 commits: >> >> - JDK-8262491: bsd_aarch64 part >> - JDK-8263002: bsd_aarch64 part >> - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos >> - Wider #ifdef block >> - Fix most of issues in java/foreign/ tests >> >> Failures related to va_args are tracked in JDK-8263512. >> - Add Azul copyright >> - Update Oracle copyright years >> - Use Thread::current_or_null_safe in SafeFetch >> - 8262903: [macos_aarch64] Thread::current() called on detached thread >> - Merge commit 'refs/pull/11/head' of https://github.com/AntonKozlov/jdk into jdk-macos >> - ... and 104 more: https://git.openjdk.java.net/jdk/compare/d825198e...806fc618 > > src/hotspot/share/runtime/safefetch.inline.hpp line 35: > >> 33: inline int SafeFetch32(int* adr, int errValue) { >> 34: assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated"); >> 35: Thread* thread = Thread::current_or_null_safe(); > > Sorry but this should be MACOS_AARCH64 only. All three lines need to be ifdef'd if you are going to include the assertion. > > Thanks, > David Right, thanks! Fixed in https://github.com/openjdk/jdk/pull/2200/commits/3d0f4d2342adc867eaf762fa83a9c3035d6439bd ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From ihse at openjdk.java.net Mon Mar 15 18:57:28 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Mon, 15 Mar 2021 18:57:28 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v2] In-Reply-To: References: Message-ID: On Mon, 15 Mar 2021 18:35:12 GMT, Phil Race wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux > >> Just thinking out loud, you don't think it would be better to build harfbuzz separately, but as a static library, that is then included in libfontmanager? The main win of doing that, I think, is the ability to have all the disabled warnings confined to the lower-quality upstream source. The resulting code would be the same. And from a build performance perspective I don't think any way of doing it matters. > > I don't know that this would be worth such an effort. I've clearly separated the warnings we are disabling for HARFBUZZ and there's really not a lot of likelihood in my mind that these warnings will suddenly also start to apply to the small amount of JDK code that is in libfontmanager which is also much simpler code. > > BTW I noticed we are still disabling all warnings for sunFont.c and after this is done I'll likely see if I can make a source code change to resolve that. I was actually thinking that such a change would be simpler; more or less amounting to changing from LIBRARY to STATIC_LIBRARY. But if you feel that it is too much work, fine... ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From prr at openjdk.java.net Mon Mar 15 18:57:28 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 15 Mar 2021 18:57:28 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v2] In-Reply-To: References: Message-ID: > From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps > the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. > > I ended up having to go this way because its is the least unsatisfactory solution. > I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime > because too many systems have to old a version of harfbuzz. > > This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 > > There are couple of incidental fixes in here too > - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version > - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy > - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2982/files - new: https://git.openjdk.java.net/jdk/pull/2982/files/29d3e4b2..f668b327 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2982&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2982&range=00-01 Stats: 10 lines in 1 file changed: 6 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/2982.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2982/head:pull/2982 PR: https://git.openjdk.java.net/jdk/pull/2982 From prr at openjdk.java.net Mon Mar 15 19:07:09 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 15 Mar 2021 19:07:09 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v2] In-Reply-To: References: Message-ID: On Mon, 15 Mar 2021 18:52:38 GMT, Magnus Ihse Bursie wrote: > I was actually thinking that such a change would be simpler; more or less amounting to changing from LIBRARY to STATIC_LIBRARY. But if you feel that it is too much work, fine... If you say so .. I have no idea what build changes would be needed. I'm just more familiar and comfortable with this and leaving aside the graal stuff I don't know if it is used like that anywhere by the main JDK build. ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From ihse at openjdk.java.net Mon Mar 15 20:17:08 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Mon, 15 Mar 2021 20:17:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v2] In-Reply-To: References: Message-ID: On Mon, 15 Mar 2021 18:57:28 GMT, Phil Race wrote: >> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps >> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. >> >> I ended up having to go this way because its is the least unsatisfactory solution. >> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime >> because too many systems have to old a version of harfbuzz. >> >> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 >> >> There are couple of incidental fixes in here too >> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version >> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy >> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux Marked as reviewed by ihse (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From prr at openjdk.java.net Mon Mar 15 23:50:13 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 15 Mar 2021 23:50:13 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS In-Reply-To: References: Message-ID: On Mon, 15 Mar 2021 15:59:36 GMT, Alexey Ushakov wrote: >> This is the implementation used by JetBrains Runtime for the last 4 years, after some cleanup, and with one problem, >> found while preparing the pull request, fixed. >> Even though typical scenarios for a UI application should be covered, it's not a complete solution. In particular, emoji-s >> still won't be rendered for large font sizes (more than 100pt), and for non-trivial composite/painting modes. >> Notable implementation details are listed below. >> >> **Glyph image generation** >> >> Deprecated CGContextShowGlyphsAtPoint function, used by JDK on macOS to render text, cannot render emojis, >> CTFontDrawGlyphs is used instead. It ignores the scale component of text transformation matrix, so a 'real-sized' >> CTFont object should be passed to it. The same sizing procedure is done when calculating glyph metrics, because they >> are not scaled proportionally with font size (as they do for vector fonts). >> >> **Glyph image storage** >> >> Existing GlyphInfo structure is used to store color glyph image. Color glyph can be distinguished by having 4 bytes >> of storage per pixel. Color components are stored in pre-multiplied alpha format. >> >> **Glyph rendering** >> >> Previously, GlyphList instance always contained glyphs in the same format (solid, grayscale or LCD), determined by the >> effective rendering hint. Now the renderers must be prepared to GlyphList having 'normal' glyphs interspersed with >> color glyphs (they can appear due to font fallback). This isn't a problem for OpenGL renderer (used for on-screen painting), >> but GlyphListLoopPipe-based renderers (used for off-screen painting) needed an adjustment to be able to operate on >> specific segments of GlyphList. >> As an incidental optimization, calculation of GlyphList bounds ('getBounds' method) is performed now only when needed >> (most text renderers don't need this information). >> Speaking of the actual rendering of the glyph image, it's done by the straightforward glDrawPixels call in OpenGL renderer, >> and by re-using existing Blit primitive in off-screen renderers. >> >> **Testing** >> >> There's no good way to test the new functionality automatically, but I've added a test verifying that 'something' is >> rendered for the emoji character, when painting to BufferedImage. >> >> Existing tests pass after the change. > > Looks good Initial testing it looks OK with OpenGL but it renders as garbage with the metal pipeline. I'd guess metal isn't expecting 4bpp and the stride is wrong. Since metal is now integrated this should be fixed before this change can be pushed. ------------- PR: https://git.openjdk.java.net/jdk/pull/3007 From serb at openjdk.java.net Tue Mar 16 00:35:08 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 16 Mar 2021 00:35:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS In-Reply-To: References: Message-ID: <_17q6oezauvliTJEyLver5e_sBQ4B12LC6p4rPakjhM=.6285b5a8-2171-4575-b9e8-2d17aa35e9f7@github.com> On Mon, 15 Mar 2021 10:25:50 GMT, Dmitry Batrak wrote: > This is the implementation used by JetBrains Runtime for the last 4 years, after some cleanup, and with one problem, > found while preparing the pull request, fixed. > Even though typical scenarios for a UI application should be covered, it's not a complete solution. In particular, emoji-s > still won't be rendered for large font sizes (more than 100pt), and for non-trivial composite/painting modes. > Notable implementation details are listed below. > > **Glyph image generation** > > Deprecated CGContextShowGlyphsAtPoint function, used by JDK on macOS to render text, cannot render emojis, > CTFontDrawGlyphs is used instead. It ignores the scale component of text transformation matrix, so a 'real-sized' > CTFont object should be passed to it. The same sizing procedure is done when calculating glyph metrics, because they > are not scaled proportionally with font size (as they do for vector fonts). > > **Glyph image storage** > > Existing GlyphInfo structure is used to store color glyph image. Color glyph can be distinguished by having 4 bytes > of storage per pixel. Color components are stored in pre-multiplied alpha format. > > **Glyph rendering** > > Previously, GlyphList instance always contained glyphs in the same format (solid, grayscale or LCD), determined by the > effective rendering hint. Now the renderers must be prepared to GlyphList having 'normal' glyphs interspersed with > color glyphs (they can appear due to font fallback). This isn't a problem for OpenGL renderer (used for on-screen painting), > but GlyphListLoopPipe-based renderers (used for off-screen painting) needed an adjustment to be able to operate on > specific segments of GlyphList. > As an incidental optimization, calculation of GlyphList bounds ('getBounds' method) is performed now only when needed > (most text renderers don't need this information). > Speaking of the actual rendering of the glyph image, it's done by the straightforward glDrawPixels call in OpenGL renderer, > and by re-using existing Blit primitive in off-screen renderers. > > **Testing** > > There's no good way to test the new functionality automatically, but I've added a test verifying that 'something' is > rendered for the emoji character, when painting to BufferedImage. > > Existing tests pass after the change. src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListColor.java line 71: > 69: static { > 70: GraphicsPrimitiveMgr.registerGeneral( > 71: new DrawGlyphListColor(null, null, null)); If it is a complete "General" loop which supports all possible combination of incoming src/comp/dst/transform/etc I suggest to confirm that in the test. ------------- PR: https://git.openjdk.java.net/jdk/pull/3007 From serb at openjdk.java.net Tue Mar 16 00:36:10 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 16 Mar 2021 00:36:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263560: Remove needless wrapping with BufferedInputStream [v6] In-Reply-To: <12UOgMQ-mVVH7usEXj3a-GAW56QmG54t6chEIVQTJRI=.e7821199-ea42-4c0a-b1f8-27453fc8d02e@github.com> References: <12UOgMQ-mVVH7usEXj3a-GAW56QmG54t6chEIVQTJRI=.e7821199-ea42-4c0a-b1f8-27453fc8d02e@github.com> Message-ID: On Mon, 15 Mar 2021 18:04:26 GMT, ?????? ??????? wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. >> >> Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. > > ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: > > Revert HttpClient Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From dbatrak at openjdk.java.net Tue Mar 16 05:13:07 2021 From: dbatrak at openjdk.java.net (Dmitry Batrak) Date: Tue, 16 Mar 2021 05:13:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS In-Reply-To: References: Message-ID: <9-0Gtuwqcg22dWmmXwr6eSOF_hSxEpA3J-F4Mc-rdYY=.12820f83-bf7e-453f-a262-da82c7001087@github.com> On Mon, 15 Mar 2021 23:47:16 GMT, Phil Race wrote: > Initial testing it looks OK with OpenGL but it renders as garbage with the metal pipeline. > I'd guess metal isn't expecting 4bpp and the stride is wrong. > I see updates in OGLTextRenderer so something similar likely needed for metal. > Since metal is now integrated this should be fixed before this change can be pushed. I'm going to add Metal implementation soon. ------------- PR: https://git.openjdk.java.net/jdk/pull/3007 From dbatrak at openjdk.java.net Tue Mar 16 08:53:15 2021 From: dbatrak at openjdk.java.net (Dmitry Batrak) Date: Tue, 16 Mar 2021 08:53:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS In-Reply-To: <9-0Gtuwqcg22dWmmXwr6eSOF_hSxEpA3J-F4Mc-rdYY=.12820f83-bf7e-453f-a262-da82c7001087@github.com> References: <9-0Gtuwqcg22dWmmXwr6eSOF_hSxEpA3J-F4Mc-rdYY=.12820f83-bf7e-453f-a262-da82c7001087@github.com> Message-ID: On Tue, 16 Mar 2021 05:10:05 GMT, Dmitry Batrak wrote: >> Initial testing it looks OK with OpenGL but it renders as garbage with the metal pipeline. >> I'd guess metal isn't expecting 4bpp and the stride is wrong. >> I see updates in OGLTextRenderer so something similar likely needed for metal. >> Since metal is now integrated this should be fixed before this change can be pushed. > >> Initial testing it looks OK with OpenGL but it renders as garbage with the metal pipeline. >> I'd guess metal isn't expecting 4bpp and the stride is wrong. >> I see updates in OGLTextRenderer so something similar likely needed for metal. >> Since metal is now integrated this should be fixed before this change can be pushed. > > I'm going to add Metal implementation soon. > If it is a complete "General" loop which supports all possible combination of incoming src/comp/dst/transform/etc I suggest to confirm that in the test. @mrserb This code is currently only used by GlyphListLoopPipe-based text renderers (SolidTextRenderer, AATextRenderer, LCDTextRenderer), so it won't be invoked for arbitrary composites and paint types. But different destination types (image formats) and transforms are supported. What kind of test are you having in mind? I can extend the added MacEmoji.java test, that will check that 'something' is painted to different types of BufferedImage-s and/or with transforms applied. Or you want me to add a manual test case? ------------- PR: https://git.openjdk.java.net/jdk/pull/3007 From azvegint at openjdk.java.net Tue Mar 16 10:42:10 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Tue, 16 Mar 2021 10:42:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v2] In-Reply-To: References: Message-ID: On Mon, 15 Mar 2021 18:57:28 GMT, Phil Race wrote: >> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps >> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. >> >> I ended up having to go this way because its is the least unsatisfactory solution. >> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime >> because too many systems have to old a version of harfbuzz. >> >> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 >> >> There are couple of incidental fixes in here too >> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version >> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy >> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux make/modules/java.desktop/lib/Awt2dLibraries.gmk line 456: > 454: # when building libharfbuzz > 455: ifeq ($(call isTargetOs, aix), true) > 456: LIBHARFBUZZ_CFLAGS += -qdebug=necan Should it be `HARFBUZZ_CFLAGS` instead of `LIBHARFBUZZ_CFLAGS`? I don't see any usage of `LIBHARFBUZZ_CFLAGS` in this makefile. ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From prr at openjdk.java.net Tue Mar 16 16:56:23 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 16 Mar 2021 16:56:23 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v2] In-Reply-To: References: Message-ID: On Tue, 16 Mar 2021 10:38:19 GMT, Alexander Zvegintsev wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux > > make/modules/java.desktop/lib/Awt2dLibraries.gmk line 456: > >> 454: # when building libharfbuzz >> 455: ifeq ($(call isTargetOs, aix), true) >> 456: LIBHARFBUZZ_CFLAGS += -qdebug=necan > > Should it be `HARFBUZZ_CFLAGS` instead of `LIBHARFBUZZ_CFLAGS`? I don't see any usage of `LIBHARFBUZZ_CFLAGS` in this makefile. D'oh. It was LIB* in the old code and I copy / pasted and of course can't test that. I've uploaded a fix. ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From prr at openjdk.java.net Tue Mar 16 16:56:22 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 16 Mar 2021 16:56:22 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v3] In-Reply-To: References: Message-ID: > From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps > the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. > > I ended up having to go this way because its is the least unsatisfactory solution. > I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime > because too many systems have to old a version of harfbuzz. > > This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 > > There are couple of incidental fixes in here too > - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version > - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy > - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2982/files - new: https://git.openjdk.java.net/jdk/pull/2982/files/f668b327..a92a146c Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2982&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2982&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2982.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2982/head:pull/2982 PR: https://git.openjdk.java.net/jdk/pull/2982 From ihse at openjdk.java.net Tue Mar 16 18:14:07 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Tue, 16 Mar 2021 18:14:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v3] In-Reply-To: References: Message-ID: On Tue, 16 Mar 2021 16:56:22 GMT, Phil Race wrote: >> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps >> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. >> >> I ended up having to go this way because its is the least unsatisfactory solution. >> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime >> because too many systems have to old a version of harfbuzz. >> >> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 >> >> There are couple of incidental fixes in here too >> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version >> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy >> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux Marked as reviewed by ihse (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From azvegint at openjdk.java.net Tue Mar 16 19:30:09 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Tue, 16 Mar 2021 19:30:09 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v3] In-Reply-To: References: Message-ID: On Tue, 16 Mar 2021 16:56:22 GMT, Phil Race wrote: >> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps >> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. >> >> I ended up having to go this way because its is the least unsatisfactory solution. >> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime >> because too many systems have to old a version of harfbuzz. >> >> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 >> >> There are couple of incidental fixes in here too >> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version >> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy >> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux Marked as reviewed by azvegint (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From prr at openjdk.java.net Tue Mar 16 19:39:11 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 16 Mar 2021 19:39:11 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux In-Reply-To: References: Message-ID: On Sat, 13 Mar 2021 00:15:16 GMT, Phil Race wrote: > From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps > the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux. > > I ended up having to go this way because its is the least unsatisfactory solution. > I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime > because too many systems have to old a version of harfbuzz. > > This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10 > > There are couple of incidental fixes in here too > - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version > - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy > - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502 This pull request has now been integrated. Changeset: 05fe06a6 Author: Phil Race URL: https://git.openjdk.java.net/jdk/commit/05fe06a6 Stats: 96 lines in 2 files changed: 7 ins; 51 del; 38 mod 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux Reviewed-by: serb, ihse, azvegint ------------- PR: https://git.openjdk.java.net/jdk/pull/2982 From serb at openjdk.java.net Tue Mar 16 19:49:09 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 16 Mar 2021 19:49:09 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS In-Reply-To: References: <9-0Gtuwqcg22dWmmXwr6eSOF_hSxEpA3J-F4Mc-rdYY=.12820f83-bf7e-453f-a262-da82c7001087@github.com> Message-ID: On Tue, 16 Mar 2021 08:50:27 GMT, Dmitry Batrak wrote: > What kind of test are you having in mind? I can extend the added MacEmoji.java test, that will check that 'something' is painted to different types of BufferedImage-s and/or with transforms applied. Or you want me to add a manual test case? The automated tests will be enough, not sure about 'something is painted' however, it is better to check that it works. ------------- PR: https://git.openjdk.java.net/jdk/pull/3007 From serb at openjdk.java.net Tue Mar 16 21:44:27 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 16 Mar 2021 21:44:27 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag Message-ID: The root cause is using the wrong endian, the ICC profile uses big-endian notation. We even have special methods to convert the data, but for some reason, their usage was dropped in the JDK-6523398. ------------- Commit messages: - test update - reformat - use built-in AdjustEndiannessXX - Initial version Changes: https://git.openjdk.java.net/jdk/pull/3037/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3037&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263622 Stats: 132 lines in 2 files changed: 88 ins; 35 del; 9 mod Patch: https://git.openjdk.java.net/jdk/pull/3037.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3037/head:pull/3037 PR: https://git.openjdk.java.net/jdk/pull/3037 From serb at openjdk.java.net Tue Mar 16 21:44:28 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 16 Mar 2021 21:44:28 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag In-Reply-To: References: Message-ID: On Tue, 16 Mar 2021 20:08:59 GMT, Sergey Bylokhov wrote: > The root cause is using the wrong endian, the ICC profile uses big-endian notation. We even have special methods to convert the data, but for some reason, their usage was dropped in the JDK-6523398. src/java.desktop/share/native/liblcms/LCMS.c line 46: > 44: ((int) SigMake ((a), (b), (c), (d))) > 45: > 46: #define SigHead TagIdConst('h','e','a','d') The logic of this method is the same as _cmsAdjustEndianess32 from the "lcms2_plugin.h" https://github.com/openjdk/jdk/blob/9cb9af68659eaa60c9523c23a85ea37af57a5280/src/java.desktop/share/native/liblcms/cmsplugin.c#L87 ------------- PR: https://git.openjdk.java.net/jdk/pull/3037 From dbatrak at openjdk.java.net Wed Mar 17 10:47:47 2021 From: dbatrak at openjdk.java.net (Dmitry Batrak) Date: Wed, 17 Mar 2021 10:47:47 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS In-Reply-To: References: <9-0Gtuwqcg22dWmmXwr6eSOF_hSxEpA3J-F4Mc-rdYY=.12820f83-bf7e-453f-a262-da82c7001087@github.com> Message-ID: On Tue, 16 Mar 2021 19:46:16 GMT, Sergey Bylokhov wrote: >>> If it is a complete "General" loop which supports all possible combination of incoming src/comp/dst/transform/etc I suggest to confirm that in the test. >> >> @mrserb This code is currently only used by GlyphListLoopPipe-based text renderers (SolidTextRenderer, AATextRenderer, LCDTextRenderer), so it won't be invoked for arbitrary composites and paint types. But different destination types (image formats) and transforms are supported. >> >> What kind of test are you having in mind? I can extend the added MacEmoji.java test, that will check that 'something' is painted to different types of BufferedImage-s and/or with transforms applied. Or you want me to add a manual test case? > >> What kind of test are you having in mind? I can extend the added MacEmoji.java test, that will check that 'something' is painted to different types of BufferedImage-s and/or with transforms applied. Or you want me to add a manual test case? > > The automated tests will be enough, not sure about 'something is painted' however, it is better to check that it works. @mrserb I don't know how to check automatically that glyph painting works correctly. Could you please suggest a way to do it? In JetBrains Runtime we have a test that checks that rendered emoji glyph matches one of stored 'golden images', but I don't think that's suitable for OpenJDK, unless someone will volunteer to update that list when the need arises (e.g. when newer version of macOS changes the font, or rendering details). At the moment, we have already 7 golden images for a single glyph in our repository. ------------- PR: https://git.openjdk.java.net/jdk/pull/3007 From azvegint at openjdk.java.net Wed Mar 17 14:32:48 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Wed, 17 Mar 2021 14:32:48 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag In-Reply-To: References: Message-ID: On Tue, 16 Mar 2021 20:08:59 GMT, Sergey Bylokhov wrote: > The root cause is using the wrong endian, the ICC profile uses big-endian notation. We even have special methods to convert the data, but for some reason, their usage was dropped in the JDK-6523398. Marked as reviewed by azvegint (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3037 From herrick at openjdk.java.net Wed Mar 17 15:35:49 2021 From: herrick at openjdk.java.net (Andy Herrick) Date: Wed, 17 Mar 2021 15:35:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations In-Reply-To: References: Message-ID: <4WfIqOQTCLxtbCQnD2xn4Doku9I1K5cnZ3FOv_JfeJQ=.09c24289-7e79-4592-9043-36b3b790701f@github.com> On Sun, 14 Mar 2021 12:06:08 GMT, Alan Bateman wrote: > the ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From herrick at openjdk.java.net Wed Mar 17 15:35:49 2021 From: herrick at openjdk.java.net (Andy Herrick) Date: Wed, 17 Mar 2021 15:35:49 GMT Subject: [OpenJDK 2D-Dev] Withdrawn: 8189198: Add "forRemoval = true" to Applet API deprecations In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 18:33:37 GMT, Andy Herrick wrote: > implementation of > JDK-8256145: JEP 398: Deprecate the Applet API for Removal This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From herrick at openjdk.java.net Wed Mar 17 16:46:49 2021 From: herrick at openjdk.java.net (Andy Herrick) Date: Wed, 17 Mar 2021 16:46:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations In-Reply-To: References: Message-ID: On Sun, 14 Mar 2021 12:06:08 GMT, Alan Bateman wrote: > > > Have you looked at narrowing the use of the SuppressWarnings to local variable declarations to avoid adding it to some of these methods? in all cases either: - the class or method itself is being deprecated - the method takes a deprecated arg . - there is no local variable involved, such as testing if something is an instanceOf a class being deprecated, or calling a deprecated method. I cannot find any instances where the scope can be narrowed ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From alanb at openjdk.java.net Wed Mar 17 19:05:52 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Wed, 17 Mar 2021 19:05:52 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations In-Reply-To: References: Message-ID: On Wed, 17 Mar 2021 16:44:19 GMT, Andy Herrick wrote: > I cannot find any instances where the scope can be narrowed Are you about AquaInternalFrameUI.mouseRelased, BasicPopupMenuUI. stateChanged, and other non-trivial methods? ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From prr at openjdk.java.net Wed Mar 17 19:31:00 2021 From: prr at openjdk.java.net (Phil Race) Date: Wed, 17 Mar 2021 19:31:00 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263439: getSupportedAttributeValues() throws NPE for Finishings attribute Message-ID: This seems to be a code path that has has not been exercised. We need to check for null values in the array. ------------- Commit messages: - 8263439: getSupportedAttributeValues() throws NPE for Finishings attribute Changes: https://git.openjdk.java.net/jdk/pull/3055/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3055&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263439 Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/3055.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3055/head:pull/3055 PR: https://git.openjdk.java.net/jdk/pull/3055 From herrick at openjdk.java.net Wed Mar 17 20:35:54 2021 From: herrick at openjdk.java.net (Andy Herrick) Date: Wed, 17 Mar 2021 20:35:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations In-Reply-To: References: Message-ID: On Wed, 17 Mar 2021 19:02:39 GMT, Alan Bateman wrote: > > > > I cannot find any instances where the scope can be narrowed > > Are you about AquaInternalFrameUI.mouseRelased, BasicPopupMenuUI. stateChanged, and other non-trivial methods? These have the code pattern such as: } else if (c instanceof JApplet) { putting '@SuppressWarnings("removal")' before the declaration of 'c' does not help, because the code is not an assignment to 'c' ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From azvegint at openjdk.java.net Wed Mar 17 20:46:54 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Wed, 17 Mar 2021 20:46:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263482: Make access to the ICC color profiles data multithread-friendly In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 05:10:25 GMT, Sergey Bylokhov wrote: > FYI: probably is better/simpler to review it via webrev. > > After migration to the lcms from the kcms the performance of some operations was regressed. One possible workaround was to split the operation into multiple threads. But unfortunately, we have too many bottlenecks which prevent using multithreading. This is the request to remove/minimize such bottlenecks(at least some of them), but it does not affect the single-threaded performance it should be handled separately. > > The main code pattern optimized here is this: > activate(); > byte[] theHeader = getData(cmmProfile, icSigHead); > ----> CMSManager.getModule().getTagData(p, tagSignature); > Notes about the code above: > > 1. Before the change "activate()" method checked that the "cmmProfile" field was not null. After that we usually used the "cmmProfile" as the parameter to some other method. This included two volatile reads, and also required to check when we need to call the "activate()" method before usage of the "cmmProfile" field. > Solution: "activate()" renamed to the "cmmProfile()" which became an accessor for the field, so we will get one volatile read and can easily monitor the usage of the field itself(it is used directly only in this method). > > 2. The synchronized static method "CMSManager.getModule()" reimplemented to have only one volatile read. > > 3. The usage of locking in the "getTagData()" is changed. Instead of the synchronized instance methods, we now use the mix of "ConcurrentHashMap" and StampedLock. > > See some comments inline. > > Some numbers(small numbers are better): > > 1. Performance of ((ICC_ProfileRGB) ICC_Profile.getInstance(ColorSpace.CS_sRGB)).getMatrix(); > > jdk 15.0.2 > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 19,624 ? 0,059 us/op > CMMPerf.testGetMatrix avgt 5 0,154 ? 0,001 us/op > > jdk - before the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 12,935 ? 0,042 us/op > CMMPerf.testGetMatrix avgt 5 0,127 ? 0,007 us/op > > jdk - after the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 0,561 ? 0,005 us/op > CMMPerf.testGetMatrix avgt 5 0,092 ? 0,001 us/op > > 2. Part of performance gain in jdk17 is from some other fixes, for example > Performance of ICC_Profile.getInstance(ColorSpace.CS_sRGB); and ColorSpace.getInstance(ColorSpace.CS_sRGB); > > jdk 15.0.2 > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 2,299 ? 0,032 us/op > CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 2,210 ? 0,051 us/op > CMMPerf.testGetSRGBProfile avgt 5 0,019 ? 0,001 us/op > CMMPerf.testGetSRGBSpace avgt 5 0,018 ? 0,001 us/op > > jdk - same before/ after the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op > CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op > CMMPerf.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op > CMMPerf.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op > > note "ThreadsMAX" is 32 threads. src/java.desktop/share/native/liblcms/LCMS.c line 644: > 642: return cmmProfile; > 643: } > 644: return NULL; Why do we need to do this from native code? (except easing of access to a private method of a class in another package.) Will it give some noticeable performance boost if we implement it on java side? ------------- PR: https://git.openjdk.java.net/jdk/pull/2957 From serb at openjdk.java.net Wed Mar 17 23:00:49 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 17 Mar 2021 23:00:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263482: Make access to the ICC color profiles data multithread-friendly In-Reply-To: References: Message-ID: On Wed, 17 Mar 2021 20:41:47 GMT, Alexander Zvegintsev wrote: >> FYI: probably is better/simpler to review it via webrev. >> >> After migration to the lcms from the kcms the performance of some operations was regressed. One possible workaround was to split the operation into multiple threads. But unfortunately, we have too many bottlenecks which prevent using multithreading. This is the request to remove/minimize such bottlenecks(at least some of them), but it does not affect the single-threaded performance it should be handled separately. >> >> The main code pattern optimized here is this: >> activate(); >> byte[] theHeader = getData(cmmProfile, icSigHead); >> ----> CMSManager.getModule().getTagData(p, tagSignature); >> Notes about the code above: >> >> 1. Before the change "activate()" method checked that the "cmmProfile" field was not null. After that we usually used the "cmmProfile" as the parameter to some other method. This included two volatile reads, and also required to check when we need to call the "activate()" method before usage of the "cmmProfile" field. >> Solution: "activate()" renamed to the "cmmProfile()" which became an accessor for the field, so we will get one volatile read and can easily monitor the usage of the field itself(it is used directly only in this method). >> >> 2. The synchronized static method "CMSManager.getModule()" reimplemented to have only one volatile read. >> >> 3. The usage of locking in the "getTagData()" is changed. Instead of the synchronized instance methods, we now use the mix of "ConcurrentHashMap" and StampedLock. >> >> See some comments inline. >> >> Some numbers(small numbers are better): >> >> 1. Performance of ((ICC_ProfileRGB) ICC_Profile.getInstance(ColorSpace.CS_sRGB)).getMatrix(); >> >> jdk 15.0.2 >> Benchmark Mode Cnt Score Error Units >> CMMPerf.ThreadsMAX.testGetMatrix avgt 5 19,624 ? 0,059 us/op >> CMMPerf.testGetMatrix avgt 5 0,154 ? 0,001 us/op >> >> jdk - before the fix >> Benchmark Mode Cnt Score Error Units >> CMMPerf.ThreadsMAX.testGetMatrix avgt 5 12,935 ? 0,042 us/op >> CMMPerf.testGetMatrix avgt 5 0,127 ? 0,007 us/op >> >> jdk - after the fix >> Benchmark Mode Cnt Score Error Units >> CMMPerf.ThreadsMAX.testGetMatrix avgt 5 0,561 ? 0,005 us/op >> CMMPerf.testGetMatrix avgt 5 0,092 ? 0,001 us/op >> >> 2. Part of performance gain in jdk17 is from some other fixes, for example >> Performance of ICC_Profile.getInstance(ColorSpace.CS_sRGB); and ColorSpace.getInstance(ColorSpace.CS_sRGB); >> >> jdk 15.0.2 >> Benchmark Mode Cnt Score Error Units >> CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 2,299 ? 0,032 us/op >> CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 2,210 ? 0,051 us/op >> CMMPerf.testGetSRGBProfile avgt 5 0,019 ? 0,001 us/op >> CMMPerf.testGetSRGBSpace avgt 5 0,018 ? 0,001 us/op >> >> jdk - same before/ after the fix >> Benchmark Mode Cnt Score Error Units >> CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op >> CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op >> CMMPerf.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op >> CMMPerf.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op >> >> note "ThreadsMAX" is 32 threads. > > src/java.desktop/share/native/liblcms/LCMS.c line 644: > >> 642: return cmmProfile; >> 643: } >> 644: return NULL; > > Why do we need to do this from native code? (except easing of access to a private method of a class in another package.) > Will it give some noticeable performance boost if we implement it on java side? Yes, this is the only reason. I have a todo to check what access will be better, AWTAccessor/methodhandle/reflection vs jni. ------------- PR: https://git.openjdk.java.net/jdk/pull/2957 From azvegint at openjdk.java.net Wed Mar 17 23:39:47 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Wed, 17 Mar 2021 23:39:47 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263482: Make access to the ICC color profiles data multithread-friendly In-Reply-To: References: Message-ID: On Fri, 12 Mar 2021 05:10:25 GMT, Sergey Bylokhov wrote: > FYI: probably is better/simpler to review it via webrev. > > After migration to the lcms from the kcms the performance of some operations was regressed. One possible workaround was to split the operation into multiple threads. But unfortunately, we have too many bottlenecks which prevent using multithreading. This is the request to remove/minimize such bottlenecks(at least some of them), but it does not affect the single-threaded performance it should be handled separately. > > The main code pattern optimized here is this: > activate(); > byte[] theHeader = getData(cmmProfile, icSigHead); > ----> CMSManager.getModule().getTagData(p, tagSignature); > Notes about the code above: > > 1. Before the change "activate()" method checked that the "cmmProfile" field was not null. After that we usually used the "cmmProfile" as the parameter to some other method. This included two volatile reads, and also required to check when we need to call the "activate()" method before usage of the "cmmProfile" field. > Solution: "activate()" renamed to the "cmmProfile()" which became an accessor for the field, so we will get one volatile read and can easily monitor the usage of the field itself(it is used directly only in this method). > > 2. The synchronized static method "CMSManager.getModule()" reimplemented to have only one volatile read. > > 3. The usage of locking in the "getTagData()" is changed. Instead of the synchronized instance methods, we now use the mix of "ConcurrentHashMap" and StampedLock. > > See some comments inline. > > Some numbers(small numbers are better): > > 1. Performance of ((ICC_ProfileRGB) ICC_Profile.getInstance(ColorSpace.CS_sRGB)).getMatrix(); > > jdk 15.0.2 > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 19,624 ? 0,059 us/op > CMMPerf.testGetMatrix avgt 5 0,154 ? 0,001 us/op > > jdk - before the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 12,935 ? 0,042 us/op > CMMPerf.testGetMatrix avgt 5 0,127 ? 0,007 us/op > > jdk - after the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 0,561 ? 0,005 us/op > CMMPerf.testGetMatrix avgt 5 0,092 ? 0,001 us/op > > 2. Part of performance gain in jdk17 is from some other fixes, for example > Performance of ICC_Profile.getInstance(ColorSpace.CS_sRGB); and ColorSpace.getInstance(ColorSpace.CS_sRGB); > > jdk 15.0.2 > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 2,299 ? 0,032 us/op > CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 2,210 ? 0,051 us/op > CMMPerf.testGetSRGBProfile avgt 5 0,019 ? 0,001 us/op > CMMPerf.testGetSRGBSpace avgt 5 0,018 ? 0,001 us/op > > jdk - same before/ after the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op > CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op > CMMPerf.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op > CMMPerf.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op > > note "ThreadsMAX" is 32 threads. Marked as reviewed by azvegint (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2957 From psadhukhan at openjdk.java.net Thu Mar 18 05:08:47 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Thu, 18 Mar 2021 05:08:47 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263439: getSupportedAttributeValues() throws NPE for Finishings attribute In-Reply-To: References: Message-ID: On Wed, 17 Mar 2021 19:25:50 GMT, Phil Race wrote: > This seems to be a code path that has has not been exercised. > We need to check for null values in the array. Marked as reviewed by psadhukhan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3055 From serb at openjdk.java.net Thu Mar 18 10:04:38 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Thu, 18 Mar 2021 10:04:38 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS In-Reply-To: References: <9-0Gtuwqcg22dWmmXwr6eSOF_hSxEpA3J-F4Mc-rdYY=.12820f83-bf7e-453f-a262-da82c7001087@github.com> Message-ID: On Wed, 17 Mar 2021 10:45:00 GMT, Dmitry Batrak wrote: >>> What kind of test are you having in mind? I can extend the added MacEmoji.java test, that will check that 'something' is painted to different types of BufferedImage-s and/or with transforms applied. Or you want me to add a manual test case? >> >> The automated tests will be enough, not sure about 'something is painted' however, it is better to check that it works. > > @mrserb I don't know how to check automatically that glyph painting works correctly. Could you please suggest a way to do it? In JetBrains Runtime we have a test that checks that rendered emoji glyph matches one of stored 'golden images', but I don't think that's suitable for OpenJDK, unless someone will volunteer to update that list when the need arises (e.g. when newer version of macOS changes the font, or rendering details). At the moment, we have already 7 golden images for a single glyph in our repository. You the current image from the MacEmoji test as a golden image for other formats/transforms/extraalpha/etc. For example, if DST type is changed then it is unlikely the shape of the emoji will be changed as well, or if it is too big/ too small. BTW It will be good if the test will fail on the current metal implementation. ------------- PR: https://git.openjdk.java.net/jdk/pull/3007 From alexsch at openjdk.java.net Thu Mar 18 12:29:01 2021 From: alexsch at openjdk.java.net (Alexander Scherbatiy) Date: Thu, 18 Mar 2021 12:29:01 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows [v2] In-Reply-To: References: Message-ID: > Printing text using GlyphVector outline has bad quality on printers with low DPI on Windows. > The GDI system used for text printing on Windows accepts only integer path coordinates. > Rounding GlyphVector outline coordinates leads to distorted printed text. > > The issue had been reported as JDK-8256264 but was reverted because of the regression JDK-8259007 "This test printed a blank page". > > The fix JDK-8256264 scaled coordinates in wPrinterJob.moveTo()/lineTo() methods up and scaled transforms in wPrinterJob.beginPath()/endPath() down. > > The regression was in the WPathGraphics.deviceDrawLine() method which uses wPrinterJob.moveTo()/lineTo() methods without surrounding them with wPrinterJob.beginPath()/endPath() so the line coordinates were only scaled up. > > I tried to put wPrinterJob.beginPath()/endPath() methods around wPrinterJob.moveTo()/lineTo() in the method WPathGraphics.deviceDrawLine() but the line was not drawn at all even without scaling coordinates up and transform down (without JDK-8256264 fix). It looks like GDI treats this case as an empty shape. > > The proposed fix applies path coordinates and transform scaling only in WPathGraphics.convertToWPath() method. > The one more PathPrecisionScaleFactorShapeTest.java manual test is added which checks that all methods that draw paths in WPathGraphics are used: line in WPathGraphics.deviceDrawLine() and SEG_LINETO/SEG_QUADTO/SEG_CUBICTO in WPathGraphics.convertToWPath() . > > The `java/awt/print` and `java/awt/PrintJob` automatic and manual tests were run on Windows 10 Pro with the fix. > > There are two failed automated tests which fail without the fix as well: > java/awt/print/PrinterJob/GlyphPositions.java > java/awt/print/PrinterJob/PSQuestionMark.java > > The following manual tests have issues on my system: > - `java/awt/print/Dialog/PrintDlgPageable.java` java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainThread cannot access a member of class PrintDlgPageable with modifiers "public static" > > - `java/awt/print/PrinterJob/PrintAttributeUpdateTest.java` I select pages radio button, press the print button but the test does not finish and I do not see any other dialogs with pass/fail buttons. > > - `java/awt/PrintJob/PrintCheckboxTest/PrintCheckboxManualTest.java` Tests that there is no ClassCastException thrown in printing checkbox and scrollbar with XAWT. Error. Can't find HTML file: test\jdk\java\awt\PrintJob\PrintCheckboxTest\PrintCheckboxManualTest.html > > > - `java/awt/print/PrinterJob/SecurityDialogTest.java` A windows with instructions is shown but it does not contain print/pass/fail buttons and it is not possible to close the window. > > - The tests below fail with "Error. Parse Exception: Arguments to `manual' option not supported: yesno" message: > java/awt/print/Dialog/DialogOrient.java > java/awt/print/Dialog/DialogType.java > java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java > java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java > java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java > java/awt/print/PrinterJob/PageDialogTest.java > java/awt/print/PrinterJob/PageRanges.java > java/awt/print/PrinterJob/PageRangesDlgTest.java > java/awt/print/PrinterJob/PrintGlyphVectorTest.java > java/awt/print/PrinterJob/PrintLatinCJKTest.java > java/awt/print/PrinterJob/PrintTextTest.java > java/awt/print/PrinterJob/SwingUIText.java > java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java > java/awt/PrintJob/PageSetupDlgBlockingTest/PageSetupDlgBlockingTest.java > java/awt/PrintJob/SaveDialogTitleTest.java Alexander Scherbatiy has updated the pull request incrementally with two additional commits since the last revision: - Use DASSERT to check SetGraphicsMode and WorldTransform results - Change setGraphicsMode() type to void ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2756/files - new: https://git.openjdk.java.net/jdk/pull/2756/files/e0278acd..8105885f Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2756&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2756&range=00-01 Stats: 21 lines in 2 files changed: 8 ins; 2 del; 11 mod Patch: https://git.openjdk.java.net/jdk/pull/2756.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2756/head:pull/2756 PR: https://git.openjdk.java.net/jdk/pull/2756 From alexsch at openjdk.java.net Thu Mar 18 12:29:02 2021 From: alexsch at openjdk.java.net (Alexander Scherbatiy) Date: Thu, 18 Mar 2021 12:29:02 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows [v2] In-Reply-To: References: Message-ID: On Wed, 10 Mar 2021 09:31:32 GMT, Prasanta Sadhukhan wrote: >> Alexander Scherbatiy has updated the pull request incrementally with two additional commits since the last revision: >> >> - Use DASSERT to check SetGraphicsMode and WorldTransform results >> - Change setGraphicsMode() type to void > > src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java line 1025: > >> 1023: * {@code GM_COMPATIBLE} or {@code GM_ADVANCED}. >> 1024: */ >> 1025: private int setGraphicsMode(int mode) { > > Is there any need of "int" return value? I dont see it is used in restoreTransform() I updated the code to return void from setGraphicsMode() method. > src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp line 2033: > >> 2031: xForm.eDy = (FLOAT) elems[5]; >> 2032: >> 2033: ::SetWorldTransform((HDC)printDC, &xForm); > > Probably we should check for the return value of all this system APIs SetGraphicsMode, GetWorldTransform, SetWorldTransform, ModifyWorldTransform to see if it succeeded? I added DASSERT to check SetGraphicsMode and Get/Set/ModifyWorldTransform results. ------------- PR: https://git.openjdk.java.net/jdk/pull/2756 From aivanov at openjdk.java.net Thu Mar 18 13:29:42 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Thu, 18 Mar 2021 13:29:42 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263311: Watch registry changes for remote printers update instead of polling In-Reply-To: References: Message-ID: <3uCeqTMz_Wpfdgn4c08Os6yCFLR5fSYwtearX8_WnYE=.840861ee-07a9-496c-b066-8b3fabc7df4b@github.com> On Wed, 10 Mar 2021 15:38:27 GMT, Alexey Ivanov wrote: > [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented polling for remote printers. > That bug description also mentions watching the registry for changes and links to the article which describes the method yet it does so in terms of WMI. Using WMI is not necessary to watch for the registry updates. > > It is possible to replace polling mechanism with registry change notifications. If the registry at `HKCU\Printers\Connections` is updated, refresh the list of print services. > > It works perfectly well in my own testing with sharing a Generic / Text Only printer from another laptop. The notification comes as soon as the printer is installed, it results in a new key created under `Connections`. If a remote printer is removed, the notification is also triggered as the key corresponding to that printer is removed from the registry. > > I updated the steps in the manual test: `RemotePrinterStatusRefresh.java`. This pull request has now been integrated. Changeset: a85dc557 Author: Alexey Ivanov URL: https://git.openjdk.java.net/jdk/commit/a85dc557 Stats: 207 lines in 3 files changed: 31 ins; 158 del; 18 mod 8263311: Watch registry changes for remote printers update instead of polling Reviewed-by: psadhukhan, serb ------------- PR: https://git.openjdk.java.net/jdk/pull/2915 From prr at openjdk.java.net Thu Mar 18 17:30:06 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 18 Mar 2021 17:30:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263439: getSupportedAttributeValues() throws NPE for Finishings attribute [v2] In-Reply-To: References: Message-ID: <1-e7kW75Cs3zGnL9ocVpcQRJ6p-GlNzWyDUwWNB-QQo=.da13a37d-bc7a-46eb-a3d5-1f9881b02624@github.com> > This seems to be a code path that has has not been exercised. > We need to check for null values in the array. Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8263439: getSupportedAttributeValues() throws NPE for Finishings attribute ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/3055/files - new: https://git.openjdk.java.net/jdk/pull/3055/files/c7b30e53..f333515f Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3055&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3055&range=00-01 Stats: 64 lines in 1 file changed: 64 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/3055.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3055/head:pull/3055 PR: https://git.openjdk.java.net/jdk/pull/3055 From azvegint at openjdk.java.net Thu Mar 18 18:44:40 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Thu, 18 Mar 2021 18:44:40 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263439: getSupportedAttributeValues() throws NPE for Finishings attribute [v2] In-Reply-To: <1-e7kW75Cs3zGnL9ocVpcQRJ6p-GlNzWyDUwWNB-QQo=.da13a37d-bc7a-46eb-a3d5-1f9881b02624@github.com> References: <1-e7kW75Cs3zGnL9ocVpcQRJ6p-GlNzWyDUwWNB-QQo=.da13a37d-bc7a-46eb-a3d5-1f9881b02624@github.com> Message-ID: On Thu, 18 Mar 2021 17:30:06 GMT, Phil Race wrote: >> This seems to be a code path that has has not been exercised. >> We need to check for null values in the array. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8263439: getSupportedAttributeValues() throws NPE for Finishings attribute Marked as reviewed by azvegint (Reviewer). src/java.desktop/unix/classes/sun/print/IPPPrintService.java line 572: > 570: (new ExtFinishing(100)).getAll(); > 571: for (int j=0; j 572: if (fAll[j] == null) { Are we still insisting on copyright's year update? ------------- PR: https://git.openjdk.java.net/jdk/pull/3055 From prr at openjdk.java.net Thu Mar 18 20:03:40 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 18 Mar 2021 20:03:40 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263439: getSupportedAttributeValues() throws NPE for Finishings attribute In-Reply-To: References: Message-ID: On Wed, 17 Mar 2021 19:25:50 GMT, Phil Race wrote: > This seems to be a code path that has has not been exercised. > We need to check for null values in the array. This pull request has now been integrated. Changeset: 2173fedd Author: Phil Race URL: https://git.openjdk.java.net/jdk/commit/2173fedd Stats: 67 lines in 2 files changed: 67 ins; 0 del; 0 mod 8263439: getSupportedAttributeValues() throws NPE for Finishings attribute Reviewed-by: psadhukhan, azvegint ------------- PR: https://git.openjdk.java.net/jdk/pull/3055 From serb at openjdk.java.net Thu Mar 18 20:10:40 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Thu, 18 Mar 2021 20:10:40 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag In-Reply-To: References: Message-ID: <_L4Clr30gcmjdLjCxg6eW6OeR6Bahg6iN9rwCy5HNWw=.941fa68e-a377-4b1b-9cec-df2a4bfa5810@github.com> On Tue, 16 Mar 2021 20:08:59 GMT, Sergey Bylokhov wrote: > The root cause is using the wrong endian, the ICC profile uses big-endian notation. We even have special methods to convert the data, but for some reason, their usage was dropped in the JDK-6523398. This pull request has now been integrated. Changeset: 01ddf3d2 Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/01ddf3d2 Stats: 132 lines in 2 files changed: 88 ins; 35 del; 9 mod 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag Reviewed-by: azvegint ------------- PR: https://git.openjdk.java.net/jdk/pull/3037 From prr at openjdk.java.net Thu Mar 18 21:00:50 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 18 Mar 2021 21:00:50 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263833: Stop disabling warnings for sunFont.c with gcc Message-ID: As per the bug report the code that was the reason for disabling warnings on this file was removed in November 2019 as part of https://bugs.openjdk.java.net/browse/JDK-8220231 so we can get rid of the need to disable warnings. Longer history in the bug report. ------------- Commit messages: - 8263833: Stop disabling warnings for sunFont.c with gcc Changes: https://git.openjdk.java.net/jdk/pull/3081/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3081&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263833 Stats: 6 lines in 1 file changed: 0 ins; 6 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/3081.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3081/head:pull/3081 PR: https://git.openjdk.java.net/jdk/pull/3081 From erikj at openjdk.java.net Thu Mar 18 21:47:39 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Thu, 18 Mar 2021 21:47:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263833: Stop disabling warnings for sunFont.c with gcc In-Reply-To: References: Message-ID: On Thu, 18 Mar 2021 20:54:27 GMT, Phil Race wrote: > As per the bug report the code that was the reason for disabling warnings on this file was removed in November 2019 > as part of https://bugs.openjdk.java.net/browse/JDK-8220231 so we can get rid of the need to disable warnings. > > Longer history in the bug report. Marked as reviewed by erikj (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3081 From prr at openjdk.java.net Thu Mar 18 21:55:39 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 18 Mar 2021 21:55:39 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263833: Stop disabling warnings for sunFont.c with gcc In-Reply-To: References: Message-ID: On Thu, 18 Mar 2021 20:54:27 GMT, Phil Race wrote: > As per the bug report the code that was the reason for disabling warnings on this file was removed in November 2019 > as part of https://bugs.openjdk.java.net/browse/JDK-8220231 so we can get rid of the need to disable warnings. > > Longer history in the bug report. This pull request has now been integrated. Changeset: ed1e25d5 Author: Phil Race URL: https://git.openjdk.java.net/jdk/commit/ed1e25d5 Stats: 6 lines in 1 file changed: 0 ins; 6 del; 0 mod 8263833: Stop disabling warnings for sunFont.c with gcc Reviewed-by: erikj ------------- PR: https://git.openjdk.java.net/jdk/pull/3081 From prr at openjdk.java.net Thu Mar 18 23:05:46 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 18 Mar 2021 23:05:46 GMT Subject: [OpenJDK 2D-Dev] RFR: 8247370: Clean up unused printing code in awt_PrintJob.cpp Message-ID: <91SED6lpn5sTusWtKDpsfECjI4PBPGAe3CdF9uYRsgk=.93533363-2e60-4172-8a41-f62c3df0ec83@github.com> This removes a long time un-used code path. ------------- Commit messages: - 8247370: Clean up unused printing code in awt_PrintJob.cpp Changes: https://git.openjdk.java.net/jdk/pull/3083/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3083&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8247370 Stats: 29 lines in 1 file changed: 0 ins; 19 del; 10 mod Patch: https://git.openjdk.java.net/jdk/pull/3083.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3083/head:pull/3083 PR: https://git.openjdk.java.net/jdk/pull/3083 From serb at openjdk.java.net Fri Mar 19 02:51:38 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 19 Mar 2021 02:51:38 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263482: Make access to the ICC color profiles data multithread-friendly In-Reply-To: References: Message-ID: <3NHsCVboGu1I1PCtY4_FIX5mV-UFs5gDS7XpkqHVb3c=.ce65ca97-7c6b-4918-91e5-6b6be3dfdfda@github.com> On Fri, 12 Mar 2021 05:10:25 GMT, Sergey Bylokhov wrote: > FYI: probably is better/simpler to review it via webrev. > > After migration to the lcms from the kcms the performance of some operations was regressed. One possible workaround was to split the operation into multiple threads. But unfortunately, we have too many bottlenecks which prevent using multithreading. This is the request to remove/minimize such bottlenecks(at least some of them), but it does not affect the single-threaded performance it should be handled separately. > > The main code pattern optimized here is this: > activate(); > byte[] theHeader = getData(cmmProfile, icSigHead); > ----> CMSManager.getModule().getTagData(p, tagSignature); > Notes about the code above: > > 1. Before the change "activate()" method checked that the "cmmProfile" field was not null. After that we usually used the "cmmProfile" as the parameter to some other method. This included two volatile reads, and also required to check when we need to call the "activate()" method before usage of the "cmmProfile" field. > Solution: "activate()" renamed to the "cmmProfile()" which became an accessor for the field, so we will get one volatile read and can easily monitor the usage of the field itself(it is used directly only in this method). > > 2. The synchronized static method "CMSManager.getModule()" reimplemented to have only one volatile read. > > 3. The usage of locking in the "getTagData()" is changed. Instead of the synchronized instance methods, we now use the mix of "ConcurrentHashMap" and StampedLock. > > See some comments inline. > > Some numbers(small numbers are better): > > 1. Performance of ((ICC_ProfileRGB) ICC_Profile.getInstance(ColorSpace.CS_sRGB)).getMatrix(); > > jdk 15.0.2 > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 19,624 ? 0,059 us/op > CMMPerf.testGetMatrix avgt 5 0,154 ? 0,001 us/op > > jdk - before the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 12,935 ? 0,042 us/op > CMMPerf.testGetMatrix avgt 5 0,127 ? 0,007 us/op > > jdk - after the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetMatrix avgt 5 0,561 ? 0,005 us/op > CMMPerf.testGetMatrix avgt 5 0,092 ? 0,001 us/op > > 2. Part of performance gain in jdk17 is from some other fixes, for example > Performance of ICC_Profile.getInstance(ColorSpace.CS_sRGB); and ColorSpace.getInstance(ColorSpace.CS_sRGB); > > jdk 15.0.2 > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 2,299 ? 0,032 us/op > CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 2,210 ? 0,051 us/op > CMMPerf.testGetSRGBProfile avgt 5 0,019 ? 0,001 us/op > CMMPerf.testGetSRGBSpace avgt 5 0,018 ? 0,001 us/op > > jdk - same before/ after the fix > Benchmark Mode Cnt Score Error Units > CMMPerf.ThreadsMAX.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op > CMMPerf.ThreadsMAX.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op > CMMPerf.testGetSRGBProfile avgt 5 0,005 ? 0,001 us/op > CMMPerf.testGetSRGBSpace avgt 5 0,005 ? 0,001 us/op > > note "ThreadsMAX" is 32 threads. This pull request has now been integrated. Changeset: 1a21f779 Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/1a21f779 Stats: 212 lines in 5 files changed: 52 ins; 83 del; 77 mod 8263482: Make access to the ICC color profiles data multithread-friendly Reviewed-by: azvegint ------------- PR: https://git.openjdk.java.net/jdk/pull/2957 From serb at openjdk.java.net Fri Mar 19 03:01:39 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 19 Mar 2021 03:01:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8247370: Clean up unused printing code in awt_PrintJob.cpp In-Reply-To: <91SED6lpn5sTusWtKDpsfECjI4PBPGAe3CdF9uYRsgk=.93533363-2e60-4172-8a41-f62c3df0ec83@github.com> References: <91SED6lpn5sTusWtKDpsfECjI4PBPGAe3CdF9uYRsgk=.93533363-2e60-4172-8a41-f62c3df0ec83@github.com> Message-ID: On Thu, 18 Mar 2021 22:59:57 GMT, Phil Race wrote: > This removes a long time un-used code path. Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3083 From psadhukhan at openjdk.java.net Fri Mar 19 04:48:38 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Fri, 19 Mar 2021 04:48:38 GMT Subject: [OpenJDK 2D-Dev] RFR: 8247370: Clean up unused printing code in awt_PrintJob.cpp In-Reply-To: <91SED6lpn5sTusWtKDpsfECjI4PBPGAe3CdF9uYRsgk=.93533363-2e60-4172-8a41-f62c3df0ec83@github.com> References: <91SED6lpn5sTusWtKDpsfECjI4PBPGAe3CdF9uYRsgk=.93533363-2e60-4172-8a41-f62c3df0ec83@github.com> Message-ID: On Thu, 18 Mar 2021 22:59:57 GMT, Phil Race wrote: > This removes a long time un-used code path. Maybe we should put noreg-cleanup in JBS. ------------- Marked as reviewed by psadhukhan (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/3083 From aghaisas at openjdk.java.net Fri Mar 19 10:22:48 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Fri, 19 Mar 2021 10:22:48 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263488: Verify CWarningWindow works with metal rendering pipeline Message-ID: Root cause : CWarningWindow creates a MTLLayer with null peer. In MTLLayer.replaceSurfaceData() method, insets should be set only if peer is not null. Fix : Added the required null check. ------------- Commit messages: - set native insets only if peer is not null Changes: https://git.openjdk.java.net/jdk/pull/3086/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3086&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263488 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/3086.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3086/head:pull/3086 PR: https://git.openjdk.java.net/jdk/pull/3086 From dbatrak at openjdk.java.net Fri Mar 19 13:48:12 2021 From: dbatrak at openjdk.java.net (Dmitry Batrak) Date: Fri, 19 Mar 2021 13:48:12 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS [v2] In-Reply-To: References: Message-ID: <3q5Im_Hh45tOK9VTt5A2nrRxvgHFB_j3wfsBQlq_jgg=.5ec0eced-845e-4883-bc08-539209ece792@github.com> > This is the implementation used by JetBrains Runtime for the last 4 years, after some cleanup, and with one problem, > found while preparing the pull request, fixed. > Even though typical scenarios for a UI application should be covered, it's not a complete solution. In particular, emoji-s > still won't be rendered for large font sizes (more than 100pt), and for non-trivial composite/painting modes. > Notable implementation details are listed below. > > **Glyph image generation** > > Deprecated CGContextShowGlyphsAtPoint function, used by JDK on macOS to render text, cannot render emojis, > CTFontDrawGlyphs is used instead. It ignores the scale component of text transformation matrix, so a 'real-sized' > CTFont object should be passed to it. The same sizing procedure is done when calculating glyph metrics, because they > are not scaled proportionally with font size (as they do for vector fonts). > > **Glyph image storage** > > Existing GlyphInfo structure is used to store color glyph image. Color glyph can be distinguished by having 4 bytes > of storage per pixel. Color components are stored in pre-multiplied alpha format. > > **Glyph rendering** > > Previously, GlyphList instance always contained glyphs in the same format (solid, grayscale or LCD), determined by the > effective rendering hint. Now the renderers must be prepared to GlyphList having 'normal' glyphs interspersed with > color glyphs (they can appear due to font fallback). This isn't a problem for OpenGL renderer (used for on-screen painting), > but GlyphListLoopPipe-based renderers (used for off-screen painting) needed an adjustment to be able to operate on > specific segments of GlyphList. > As an incidental optimization, calculation of GlyphList bounds ('getBounds' method) is performed now only when needed > (most text renderers don't need this information). > Speaking of the actual rendering of the glyph image, it's done by the straightforward glDrawPixels call in OpenGL renderer, > and by re-using existing Blit primitive in off-screen renderers. > > **Testing** > > There's no good way to test the new functionality automatically, but I've added a test verifying that 'something' is > rendered for the emoji character, when painting to BufferedImage. > > Existing tests pass after the change. Dmitry Batrak has updated the pull request incrementally with two additional commits since the last revision: - 8263583: Emoji rendering on macOS extended test case to cover different types of target surfaces - 8263583: Emoji rendering on macOS implementation for Metal rendering pipeline ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/3007/files - new: https://git.openjdk.java.net/jdk/pull/3007/files/3865b397..a9b2e9c3 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3007&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3007&range=00-01 Stats: 132 lines in 2 files changed: 118 ins; 2 del; 12 mod Patch: https://git.openjdk.java.net/jdk/pull/3007.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3007/head:pull/3007 PR: https://git.openjdk.java.net/jdk/pull/3007 From dbatrak at openjdk.java.net Fri Mar 19 13:57:37 2021 From: dbatrak at openjdk.java.net (Dmitry Batrak) Date: Fri, 19 Mar 2021 13:57:37 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS In-Reply-To: References: <9-0Gtuwqcg22dWmmXwr6eSOF_hSxEpA3J-F4Mc-rdYY=.12820f83-bf7e-453f-a262-da82c7001087@github.com> Message-ID: On Thu, 18 Mar 2021 10:02:11 GMT, Sergey Bylokhov wrote: >> @mrserb I don't know how to check automatically that glyph painting works correctly. Could you please suggest a way to do it? In JetBrains Runtime we have a test that checks that rendered emoji glyph matches one of stored 'golden images', but I don't think that's suitable for OpenJDK, unless someone will volunteer to update that list when the need arises (e.g. when newer version of macOS changes the font, or rendering details). At the moment, we have already 7 golden images for a single glyph in our repository. > > You the current image from the MacEmoji test as a golden image for other formats/transforms/extraalpha/etc. For example, if DST type is changed then it is unlikely the shape of the emoji will be changed as well, or if it is too big/ too small. > > BTW It will be good if the test will fail on the current metal implementation. Implementation for Metal pipeline has been added. I've also updated the test case to check rendering into different types of images, including VolatileImage. The test will fail now, if corresponding OpenGL (or Metal, if it's explicitly enabled) implementation part would be rolled back. ------------- PR: https://git.openjdk.java.net/jdk/pull/3007 From avu at openjdk.java.net Fri Mar 19 16:49:42 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Fri, 19 Mar 2021 16:49:42 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS In-Reply-To: References: <9-0Gtuwqcg22dWmmXwr6eSOF_hSxEpA3J-F4Mc-rdYY=.12820f83-bf7e-453f-a262-da82c7001087@github.com> Message-ID: On Fri, 19 Mar 2021 13:54:34 GMT, Dmitry Batrak wrote: >> You the current image from the MacEmoji test as a golden image for other formats/transforms/extraalpha/etc. For example, if DST type is changed then it is unlikely the shape of the emoji will be changed as well, or if it is too big/ too small. >> >> BTW It will be good if the test will fail on the current metal implementation. > > Implementation for Metal pipeline has been added. > > I've also updated the test case to check rendering into different types of images, including VolatileImage. The test will fail now, if corresponding OpenGL (or Metal, if it's explicitly enabled) implementation part would be rolled back. Looks good! ------------- PR: https://git.openjdk.java.net/jdk/pull/3007 From prr at openjdk.java.net Fri Mar 19 18:15:39 2021 From: prr at openjdk.java.net (Phil Race) Date: Fri, 19 Mar 2021 18:15:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8247370: Clean up unused printing code in awt_PrintJob.cpp In-Reply-To: References: <91SED6lpn5sTusWtKDpsfECjI4PBPGAe3CdF9uYRsgk=.93533363-2e60-4172-8a41-f62c3df0ec83@github.com> Message-ID: On Fri, 19 Mar 2021 04:45:46 GMT, Prasanta Sadhukhan wrote: > Maybe we should put noreg-cleanup in JBS. done ------------- PR: https://git.openjdk.java.net/jdk/pull/3083 From prr at openjdk.java.net Fri Mar 19 18:15:40 2021 From: prr at openjdk.java.net (Phil Race) Date: Fri, 19 Mar 2021 18:15:40 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8247370: Clean up unused printing code in awt_PrintJob.cpp In-Reply-To: <91SED6lpn5sTusWtKDpsfECjI4PBPGAe3CdF9uYRsgk=.93533363-2e60-4172-8a41-f62c3df0ec83@github.com> References: <91SED6lpn5sTusWtKDpsfECjI4PBPGAe3CdF9uYRsgk=.93533363-2e60-4172-8a41-f62c3df0ec83@github.com> Message-ID: <7er2qh_ZyHJBUwbWKCuY2ndtj3lXQ2Q9uhByM34YAB8=.3b2f8903-ce28-4bb1-9edf-e00ebef99bef@github.com> On Thu, 18 Mar 2021 22:59:57 GMT, Phil Race wrote: > This removes a long time un-used code path. This pull request has now been integrated. Changeset: d41f7512 Author: Phil Race URL: https://git.openjdk.java.net/jdk/commit/d41f7512 Stats: 29 lines in 1 file changed: 0 ins; 19 del; 10 mod 8247370: Clean up unused printing code in awt_PrintJob.cpp Reviewed-by: serb, psadhukhan ------------- PR: https://git.openjdk.java.net/jdk/pull/3083 From aivanov at openjdk.java.net Fri Mar 19 20:40:53 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 19 Mar 2021 20:40:53 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263894: Convert defaultPrinter and printers fields to local variables Message-ID: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> `PrintServiceLookupProvider` has `defaultPrinter` and `printers` fields but they are used only in `getDefaultPrintService()` and `refreshServices()` correspondingly. Thus these two fields can be converted to local variables in the corresponding methods. ------------- Commit messages: - 8263894: Convert defaultPrinter and printers fields to local variables Changes: https://git.openjdk.java.net/jdk/pull/3095/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3095&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263894 Stats: 5 lines in 1 file changed: 0 ins; 2 del; 3 mod Patch: https://git.openjdk.java.net/jdk/pull/3095.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3095/head:pull/3095 PR: https://git.openjdk.java.net/jdk/pull/3095 From aivanov at openjdk.java.net Fri Mar 19 20:42:46 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 19 Mar 2021 20:42:46 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263893: getPrinterNames() leaks nameArray if Java String allocation fails Message-ID: If `JNU_NewStringPlatform` fails to allocate new Java String object for printer name, `std::bad_alloc` is thrown. The handler for the exception does not release the local reference to the `nameArray`, thus it will be leaked. ------------- Commit messages: - 8263893: getPrinterNames() leaks nameArray if Java String allocation fails Changes: https://git.openjdk.java.net/jdk/pull/3096/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3096&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263893 Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/3096.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3096/head:pull/3096 PR: https://git.openjdk.java.net/jdk/pull/3096 From prr at openjdk.java.net Fri Mar 19 21:02:38 2021 From: prr at openjdk.java.net (Phil Race) Date: Fri, 19 Mar 2021 21:02:38 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263893: getPrinterNames() leaks nameArray if Java String allocation fails In-Reply-To: References: Message-ID: On Fri, 19 Mar 2021 20:36:57 GMT, Alexey Ivanov wrote: > If `JNU_NewStringPlatform` fails to allocate new Java String object for printer name, `std::bad_alloc` is thrown. The handler for the exception does not release the local reference to the `nameArray`, thus it will be leaked. This is fine but there's not really a leak since when the caller returns to Java localrefs are released anyway. ------------- Marked as reviewed by prr (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/3096 From prr at openjdk.java.net Fri Mar 19 21:08:39 2021 From: prr at openjdk.java.net (Phil Race) Date: Fri, 19 Mar 2021 21:08:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263894: Convert defaultPrinter and printers fields to local variables In-Reply-To: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> References: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> Message-ID: On Fri, 19 Mar 2021 20:35:03 GMT, Alexey Ivanov wrote: > `PrintServiceLookupProvider` has `defaultPrinter` and `printers` fields but they are used only in `getDefaultPrintService()` and `refreshServices()` correspondingly. Thus these two fields can be converted to local variables in the corresponding methods. Why did you delete the comments ? ------------- PR: https://git.openjdk.java.net/jdk/pull/3095 From aivanov at openjdk.java.net Fri Mar 19 21:28:54 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 19 Mar 2021 21:28:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263894: Convert defaultPrinter and printers fields to local variables [v2] In-Reply-To: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> References: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> Message-ID: > `PrintServiceLookupProvider` has `defaultPrinter` and `printers` fields but they are used only in `getDefaultPrintService()` and `refreshServices()` correspondingly. Thus these two fields can be converted to local variables in the corresponding methods. Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision: Bring back the comment for printServices ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/3095/files - new: https://git.openjdk.java.net/jdk/pull/3095/files/cfe460c2..2b98fec2 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3095&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3095&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/3095.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3095/head:pull/3095 PR: https://git.openjdk.java.net/jdk/pull/3095 From aivanov at openjdk.java.net Fri Mar 19 21:28:54 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 19 Mar 2021 21:28:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263894: Convert defaultPrinter and printers fields to local variables [v2] In-Reply-To: References: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> Message-ID: On Fri, 19 Mar 2021 21:05:57 GMT, Phil Race wrote: > Why did you delete the comments ? The comments highlighted the difference between what is stored in `printers` and in `printServices`: _excludes_ vs. _includes_ the default printer. However, according to the code, `printers` _included_ the default printer too. Now there's only `printServices` which contains all print services. I decided the comment didn't have much value now. Yet, upon thinking about it, the comment for `printServices` still provides additional insight: the array also contains the `defaultPrintService`. ------------- PR: https://git.openjdk.java.net/jdk/pull/3095 From prr at openjdk.java.net Fri Mar 19 21:51:42 2021 From: prr at openjdk.java.net (Phil Race) Date: Fri, 19 Mar 2021 21:51:42 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263894: Convert defaultPrinter and printers fields to local variables [v2] In-Reply-To: References: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> Message-ID: On Fri, 19 Mar 2021 21:28:54 GMT, Alexey Ivanov wrote: >> `PrintServiceLookupProvider` has `defaultPrinter` and `printers` fields but they are used only in `getDefaultPrintService()` and `refreshServices()` correspondingly. Thus these two fields can be converted to local variables in the corresponding methods. > > Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision: > > Bring back the comment for printServices Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3095 From azvegint at openjdk.java.net Fri Mar 19 21:57:41 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Fri, 19 Mar 2021 21:57:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263894: Convert defaultPrinter and printers fields to local variables [v2] In-Reply-To: References: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> Message-ID: On Fri, 19 Mar 2021 21:28:54 GMT, Alexey Ivanov wrote: >> `PrintServiceLookupProvider` has `defaultPrinter` and `printers` fields but they are used only in `getDefaultPrintService()` and `refreshServices()` correspondingly. Thus these two fields can be converted to local variables in the corresponding methods. > > Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision: > > Bring back the comment for printServices Marked as reviewed by azvegint (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3095 From azvegint at openjdk.java.net Fri Mar 19 21:58:41 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Fri, 19 Mar 2021 21:58:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263893: getPrinterNames() leaks nameArray if Java String allocation fails In-Reply-To: References: Message-ID: <2gV1q9oyFreMu5yNxu8c7tFbQl1CdEPP-acegpmxurc=.c55fe678-b594-4490-9f1f-3fa4d9451f5e@github.com> On Fri, 19 Mar 2021 20:36:57 GMT, Alexey Ivanov wrote: > If `JNU_NewStringPlatform` fails to allocate new Java String object for printer name, `std::bad_alloc` is thrown. The handler for the exception does not release the local reference to the `nameArray`, thus it will be leaked. Marked as reviewed by azvegint (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3096 From serb at openjdk.java.net Fri Mar 19 22:34:39 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 19 Mar 2021 22:34:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263893: getPrinterNames() leaks nameArray if Java String allocation fails In-Reply-To: References: Message-ID: On Fri, 19 Mar 2021 20:36:57 GMT, Alexey Ivanov wrote: > If `JNU_NewStringPlatform` fails to allocate new Java String object for printer name, `std::bad_alloc` is thrown. The handler for the exception does not release the local reference to the `nameArray`, thus it will be leaked. src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp line 178: > 176: } catch (std::bad_alloc&) { > 177: delete [] pPrinterEnum; > 178: if (nameArray != NULL) { Not sure that we usually clean the local refs in the native JNI methods, that only required in the native loop which are never returned to the java(I have check that by the grep of env->NewObjectArray) ------------- PR: https://git.openjdk.java.net/jdk/pull/3096 From github.com+741251+turbanoff at openjdk.java.net Sat Mar 20 07:48:39 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Sat, 20 Mar 2021 07:48:39 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe In-Reply-To: References: Message-ID: On Sat, 27 Feb 2021 18:33:52 GMT, Andrey Turbanov wrote: > 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe This pull request has now been integrated. Changeset: ab66d699 Author: Andrey Turbanov Committer: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/ab66d699 Stats: 7 lines in 1 file changed: 3 ins; 0 del; 4 mod 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe Reviewed-by: aivanov, kizune, serb ------------- PR: https://git.openjdk.java.net/jdk/pull/2762 From serb at openjdk.java.net Sat Mar 20 07:50:41 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 20 Mar 2021 07:50:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263488: Verify CWarningWindow works with metal rendering pipeline In-Reply-To: References: Message-ID: On Fri, 19 Mar 2021 10:17:57 GMT, Ajit Ghaisas wrote: > Root cause : > CWarningWindow creates a MTLLayer with null peer. > In MTLLayer.replaceSurfaceData() method, insets should be set only if peer is not null. > > Fix : > Added the required null check. Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3086 From pbansal at openjdk.java.net Sat Mar 20 10:55:39 2021 From: pbansal at openjdk.java.net (Pankaj Bansal) Date: Sat, 20 Mar 2021 10:55:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263488: Verify CWarningWindow works with metal rendering pipeline In-Reply-To: References: Message-ID: On Fri, 19 Mar 2021 10:17:57 GMT, Ajit Ghaisas wrote: > Root cause : > CWarningWindow creates a MTLLayer with null peer. > In MTLLayer.replaceSurfaceData() method, insets should be set only if peer is not null. > > Fix : > Added the required null check. Marked as reviewed by pbansal (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3086 From avu at openjdk.java.net Sat Mar 20 14:56:39 2021 From: avu at openjdk.java.net (Alexey Ushakov) Date: Sat, 20 Mar 2021 14:56:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263488: Verify CWarningWindow works with metal rendering pipeline In-Reply-To: References: Message-ID: On Fri, 19 Mar 2021 10:17:57 GMT, Ajit Ghaisas wrote: > Root cause : > CWarningWindow creates a MTLLayer with null peer. > In MTLLayer.replaceSurfaceData() method, insets should be set only if peer is not null. > > Fix : > Added the required null check. Marked as reviewed by avu (no project role). ------------- PR: https://git.openjdk.java.net/jdk/pull/3086 From kizune at openjdk.java.net Sat Mar 20 18:15:37 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Sat, 20 Mar 2021 18:15:37 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263893: getPrinterNames() leaks nameArray if Java String allocation fails In-Reply-To: References: Message-ID: On Fri, 19 Mar 2021 20:36:57 GMT, Alexey Ivanov wrote: > If `JNU_NewStringPlatform` fails to allocate new Java String object for printer name, `std::bad_alloc` is thrown. The handler for the exception does not release the local reference to the `nameArray`, thus it will be leaked. Marked as reviewed by kizune (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3096 From kizune at openjdk.java.net Sat Mar 20 18:16:41 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Sat, 20 Mar 2021 18:16:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263488: Verify CWarningWindow works with metal rendering pipeline In-Reply-To: References: Message-ID: On Fri, 19 Mar 2021 10:17:57 GMT, Ajit Ghaisas wrote: > Root cause : > CWarningWindow creates a MTLLayer with null peer. > In MTLLayer.replaceSurfaceData() method, insets should be set only if peer is not null. > > Fix : > Added the required null check. Marked as reviewed by kizune (Reviewer). Marked as reviewed by kizune (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3086 From kizune at openjdk.java.net Sat Mar 20 18:16:40 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Sat, 20 Mar 2021 18:16:40 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263894: Convert defaultPrinter and printers fields to local variables [v2] In-Reply-To: References: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> Message-ID: On Fri, 19 Mar 2021 21:28:54 GMT, Alexey Ivanov wrote: >> `PrintServiceLookupProvider` has `defaultPrinter` and `printers` fields but they are used only in `getDefaultPrintService()` and `refreshServices()` correspondingly. Thus these two fields can be converted to local variables in the corresponding methods. > > Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision: > > Bring back the comment for printServices Marked as reviewed by kizune (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3095 From aghaisas at openjdk.java.net Mon Mar 22 02:48:42 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Mon, 22 Mar 2021 02:48:42 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263488: Verify CWarningWindow works with metal rendering pipeline In-Reply-To: References: Message-ID: On Fri, 19 Mar 2021 10:17:57 GMT, Ajit Ghaisas wrote: > Root cause : > CWarningWindow creates a MTLLayer with null peer. > In MTLLayer.replaceSurfaceData() method, insets should be set only if peer is not null. > > Fix : > Added the required null check. This pull request has now been integrated. Changeset: 42104e55 Author: Ajit Ghaisas URL: https://git.openjdk.java.net/jdk/commit/42104e55 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod 8263488: Verify CWarningWindow works with metal rendering pipeline Reviewed-by: serb, pbansal, avu, kizune ------------- PR: https://git.openjdk.java.net/jdk/pull/3086 From akozlov at openjdk.java.net Mon Mar 22 12:50:14 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Mon, 22 Mar 2021 12:50:14 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: > Please review the implementation of JEP 391: macOS/AArch64 Port. > > It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. > > Major changes are in: > * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) > * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) > * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. > * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 115 commits: - Merge branch 'master' into jdk-macos - JDK-8262491: bsd_aarch64 part - JDK-8263002: bsd_aarch64 part - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos - Wider #ifdef block - Fix most of issues in java/foreign/ tests Failures related to va_args are tracked in JDK-8263512. - Add Azul copyright - Update Oracle copyright years - Use Thread::current_or_null_safe in SafeFetch - 8262903: [macos_aarch64] Thread::current() called on detached thread - ... and 105 more: https://git.openjdk.java.net/jdk/compare/a9d2267f...5add9269 ------------- Changes: https://git.openjdk.java.net/jdk/pull/2200/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=28 Stats: 2947 lines in 75 files changed: 2838 ins; 27 del; 82 mod Patch: https://git.openjdk.java.net/jdk/pull/2200.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2200/head:pull/2200 PR: https://git.openjdk.java.net/jdk/pull/2200 From aivanov at openjdk.java.net Mon Mar 22 15:58:39 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Mon, 22 Mar 2021 15:58:39 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263894: Convert defaultPrinter and printers fields to local variables In-Reply-To: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> References: <4rlGExbaSVVhKUUJRt27cMchZPp_4DJYRBfqZwwm93M=.0a987230-d810-422e-b400-48d20e8bf39a@github.com> Message-ID: On Fri, 19 Mar 2021 20:35:03 GMT, Alexey Ivanov wrote: > `PrintServiceLookupProvider` has `defaultPrinter` and `printers` fields but they are used only in `getDefaultPrintService()` and `refreshServices()` correspondingly. Thus these two fields can be converted to local variables in the corresponding methods. This pull request has now been integrated. Changeset: 840ab7bf Author: Alexey Ivanov URL: https://git.openjdk.java.net/jdk/commit/840ab7bf Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod 8263894: Convert defaultPrinter and printers fields to local variables Reviewed-by: prr, azvegint, kizune ------------- PR: https://git.openjdk.java.net/jdk/pull/3095 From shade at openjdk.java.net Mon Mar 22 16:01:54 2021 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Mon, 22 Mar 2021 16:01:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice Message-ID: SonarCloud reports the problem in ComponentSampleModel.equals: Correct one of the identical sub-expressions on both sides of operator "&&" ...near "this.numBands == that.numBands". It is checked twice. hashCode also processes it twice. ------------- Commit messages: - Update copyright line - JDK-8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice Changes: https://git.openjdk.java.net/jdk/pull/3125/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3125&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263981 Stats: 4 lines in 1 file changed: 0 ins; 3 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/3125.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3125/head:pull/3125 PR: https://git.openjdk.java.net/jdk/pull/3125 From serb at openjdk.java.net Mon Mar 22 17:46:42 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 22 Mar 2021 17:46:42 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice In-Reply-To: References: Message-ID: <4Bi_Pk9Wlm_Qv5vPRITz_9OKGbUijJrKwfMSElj3OJQ=.bbabb34a-79b4-4bb1-8a25-aa76d984ca39@github.com> On Mon, 22 Mar 2021 15:55:16 GMT, Aleksey Shipilev wrote: > SonarCloud reports the problem in ComponentSampleModel.equals: > Correct one of the identical sub-expressions on both sides of operator "&&" > > ...near "this.numBands == that.numBands". It is checked twice. hashCode also processes it twice. Marked as reviewed by serb (Reviewer). src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java line 1228: > 1226: } > 1227: hash ^= numBands; > 1228: hash <<= 8; Since this mistake was done in two places I think this is a typo here and not an intentional thing. ------------- PR: https://git.openjdk.java.net/jdk/pull/3125 From shade at openjdk.java.net Mon Mar 22 17:51:46 2021 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Mon, 22 Mar 2021 17:51:46 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice In-Reply-To: <4Bi_Pk9Wlm_Qv5vPRITz_9OKGbUijJrKwfMSElj3OJQ=.bbabb34a-79b4-4bb1-8a25-aa76d984ca39@github.com> References: <4Bi_Pk9Wlm_Qv5vPRITz_9OKGbUijJrKwfMSElj3OJQ=.bbabb34a-79b4-4bb1-8a25-aa76d984ca39@github.com> Message-ID: On Mon, 22 Mar 2021 17:44:03 GMT, Sergey Bylokhov wrote: >> SonarCloud reports the problem in ComponentSampleModel.equals: >> Correct one of the identical sub-expressions on both sides of operator "&&" >> >> ...near "this.numBands == that.numBands". It is checked twice. hashCode also processes it twice. > > src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java line 1228: > >> 1226: } >> 1227: hash ^= numBands; >> 1228: hash <<= 8; > > Since this mistake was done in two places I think this is a typo here and not an intentional thing. I am a bit confused by this comment :) I suspect that `equals` got duplicated `numBands` first, and then whoever did the `hashcode` just hashed the same fields in the same order, duplicating it again. ------------- PR: https://git.openjdk.java.net/jdk/pull/3125 From serb at openjdk.java.net Mon Mar 22 18:04:42 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 22 Mar 2021 18:04:42 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice In-Reply-To: References: <4Bi_Pk9Wlm_Qv5vPRITz_9OKGbUijJrKwfMSElj3OJQ=.bbabb34a-79b4-4bb1-8a25-aa76d984ca39@github.com> Message-ID: On Mon, 22 Mar 2021 17:48:21 GMT, Aleksey Shipilev wrote: >> src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java line 1228: >> >>> 1226: } >>> 1227: hash ^= numBands; >>> 1228: hash <<= 8; >> >> Since this mistake was done in two places I think this is a typo here and not an intentional thing. > > I am a bit confused by this comment :) I suspect that `equals` got duplicated `numBands` first, and then whoever did the `hashcode` just hashed the same fields in the same order, duplicating it again. I hope so, and not in the opposite order. I'll try to check the history f this file. ------------- PR: https://git.openjdk.java.net/jdk/pull/3125 From azvegint at openjdk.java.net Mon Mar 22 18:07:38 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Mon, 22 Mar 2021 18:07:38 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice In-Reply-To: References: Message-ID: On Mon, 22 Mar 2021 15:55:16 GMT, Aleksey Shipilev wrote: > SonarCloud reports the problem in ComponentSampleModel.equals: > Correct one of the identical sub-expressions on both sides of operator "&&" > > ...near "this.numBands == that.numBands". It is checked twice. hashCode also processes it twice. Marked as reviewed by azvegint (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3125 From rajat.m.mahajan at oracle.com Mon Mar 22 20:55:03 2021 From: rajat.m.mahajan at oracle.com (Rajat Mahajan) Date: Mon, 22 Mar 2021 20:55:03 +0000 Subject: [OpenJDK 2D-Dev] Clarification regarding PageFormat and Paper getImageable* functions orientation consideration Message-ID: Hi all, Issue: I am working on https://bugs.openjdk.java.net/browse/JDK-8203395 and this bug is about "PageFormat showing wrong printer margins in LANDSCAPE orientation" . Application code it trying to print in Landscape and Portrait but both show same margins: Margins default : 12,12,17,17 Margins OrientationRequested.LANDSCAPE : 12,12,17,17 The code of the application uses Paper object for getting margins : PageFormat pf = printerJob.getPageFormat(aset); Paper paper = pf.getPaper(); long paperTopMargin = Math.round(paper.getImageableY()); long paperLeftMargin = Math.round(paper.getImageableX()); long paperRightMargin = Math.round(paper.getWidth() - paper.getImageableWidth() - paperLeftMargin); long paperBottomMargin = Math.round(paper.getHeight() - paper.getImageableHeight() - paperTopMargin); When I looked at the latest JDK code, PageFormat getImageable functions are taking into account Orientation and Paper getImageable functions are not , and hence we see the same output. Using Page format object instead of Paper shows the correct output: Margins default : 12,12,17,17 Margins OrientationRequested.LANDSCAPE : 17,17,12,12 Question: My question is that should Paper getImageable* functions also need take into account orientation as per spec ?, or is the current behavior of them not considering orientation correct and why ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.race at oracle.com Mon Mar 22 21:54:46 2021 From: philip.race at oracle.com (Philip Race) Date: Mon, 22 Mar 2021 14:54:46 -0700 Subject: [OpenJDK 2D-Dev] Clarification regarding PageFormat and Paper getImageable* functions orientation consideration In-Reply-To: References: Message-ID: There's no bug here from what I am being shown. >"PageFormat showing wrong printer margins in LANDSCAPE orientation? . Really ? But I don't see anywhere the PageFormat is queried for this. Instead the test case digs inside the PageFormat and retrieves the Paper and asks for *its* margins I see a comment in the bug : > All getImageable methodes javadoc say "This method takes into account the orientation of the page" but It's not true before printing. The methods that say that, are the ones on PageFormat, not the ones on Paper. So wrong. -phil On 3/22/21 1:55 PM, Rajat Mahajan wrote: > > Hi all, > > *_Issue:_* > > *__* > > I am working on https://bugs.openjdk.java.net/browse/JDK-8203395 > ?and this bug is > about *?PageFormat showing wrong printer margins in LANDSCAPE > orientation? .* > > ** > > *Application code it trying to print in Landscape and Portrait but > both show same margins:* > > Margins default : 12,12,17,17 > > Margins OrientationRequested.LANDSCAPE : 12,12,17,17 > > ** > > *The code of the application uses Paper object for getting margins :* > > PageFormat pf = printerJob.getPageFormat(aset); > > ???????Paper paper = pf.getPaper(); > > ???????long paperTopMargin = Math.round(paper.getImageableY()); > ???????long paperLeftMargin = Math.round(paper.getImageableX()); > ???????long paperRightMargin = Math.round(paper.getWidth() - > paper.getImageableWidth() - paperLeftMargin); > ???????long paperBottomMargin = Math.round(paper.getHeight() - > paper.getImageableHeight() - paperTopMargin); > > When I looked at the latest JDK code, PageFormat getImageable > functions are taking into account Orientation and Paper getImageable > functions are not , and hence we see the same output. > > Using Page format object instead of Paper shows the correct output: > > Margins default : 12,12,17,17 > > Margins OrientationRequested.LANDSCAPE : 17,17,12,12 > > *_Question:_* > > My question is that should Paper getImageable* functions also need > take into account orientation as per spec ?, or is the current > behavior of them not considering orientation correct and why ? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serb at openjdk.java.net Tue Mar 23 05:00:49 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 23 Mar 2021 05:00:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264002: Delete outdated assumptions about ColorSpace initialization Message-ID: Some codes have outdated assumptions about the initialization of ColorSpace class. - The ColorSpace.getInstance() will never throw an IllegalArgumentException for the builtin profiles - The ColorSpace.getInstance() will not trigger initialisation of the CMM classes ------------- Commit messages: - Initial version Changes: https://git.openjdk.java.net/jdk/pull/3140/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3140&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8264002 Stats: 168 lines in 6 files changed: 45 ins; 94 del; 29 mod Patch: https://git.openjdk.java.net/jdk/pull/3140.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3140/head:pull/3140 PR: https://git.openjdk.java.net/jdk/pull/3140 From serb at openjdk.java.net Tue Mar 23 05:00:50 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 23 Mar 2021 05:00:50 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264002: Delete outdated assumptions about ColorSpace initialization In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 00:14:59 GMT, Sergey Bylokhov wrote: > Some codes have outdated assumptions about the initialization of ColorSpace class. > - The ColorSpace.getInstance() will never throw an IllegalArgumentException for the builtin profiles > - The ColorSpace.getInstance() will not trigger initialisation of the CMM classes src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java line 1175: > 1173: && !cs.equals(ColorSpace.getInstance(ColorSpace.CS_CIEXYZ)) > 1174: && !cs.equals(ColorSpace.getInstance(ColorSpace.CS_PYCC)); > 1175: } The method above was added by the tiff implementation in jdk9 and it is mostly a copy of the older code in the jpeg plugin. I merged two methods and leave it here in the "common" code. src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java line 205: > 203: * of the CMM class until someone actually needs it. > 204: * (e.g. do not init CMM on the request for jpeg mime types) > 205: */ It is not necessary to delay the usage of ColorSpace, it itself defers the usage of cmm. ------------- PR: https://git.openjdk.java.net/jdk/pull/3140 From shade at openjdk.java.net Tue Mar 23 06:52:48 2021 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Tue, 23 Mar 2021 06:52:48 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice In-Reply-To: References: <4Bi_Pk9Wlm_Qv5vPRITz_9OKGbUijJrKwfMSElj3OJQ=.bbabb34a-79b4-4bb1-8a25-aa76d984ca39@github.com> Message-ID: On Mon, 22 Mar 2021 18:01:49 GMT, Sergey Bylokhov wrote: >> I am a bit confused by this comment :) I suspect that `equals` got duplicated `numBands` first, and then whoever did the `hashcode` just hashed the same fields in the same order, duplicating it again. > > I hope so, and not in the opposite order. I'll try to check the history f this file. Please do. I'll wait for a bit. ------------- PR: https://git.openjdk.java.net/jdk/pull/3125 From aph at openjdk.java.net Tue Mar 23 09:56:56 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Tue, 23 Mar 2021 09:56:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v24] In-Reply-To: References: Message-ID: <3fAiKgcWOdYNUYMfY0LSvyMswzjlKJWJaxZgGf7tdYE=.aa5e7ae8-2744-4c2c-9e66-b72e19d9ebec@github.com> On Fri, 12 Mar 2021 16:32:10 GMT, Andrew Haley wrote: >> Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 105 commits: >> >> - Merge commit 'refs/pull/11/head' of https://github.com/AntonKozlov/jdk into jdk-macos >> - workaround JDK-8262895 by disabling subtest >> - Fix typo >> - Rename threadWXSetters.hpp -> threadWXSetters.inline.hpp >> - JDK-8259937: bsd_aarch64 part >> - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos >> - Fix after JDK-8259539, partially revert preconditions >> - JDK-8260471: bsd_aarch64 part >> - JDK-8259539: bsd_aarch64 part >> - JDK-8257828: bsd_aarch64 part >> - ... and 95 more: https://git.openjdk.java.net/jdk/compare/a6e34b3d...a72f6834 > >> @theRealAph, could you elaborate on what is need to be done for [#2200 (review)](https://github.com/openjdk/jdk/pull/2200#pullrequestreview-600597066). > > I think that what you've got now is fine. > _Mailing list message from [Andrew Haley](mailto:aph at redhat.com) on [build-dev](mailto:build-dev at openjdk.java.net):_ > > On 3/15/21 6:56 PM, Anton Kozlov wrote: > > > On Wed, 10 Mar 2021 11:21:44 GMT, Andrew Haley wrote: > > > > We always check for `R18_RESERVED` with `#if(n)def`, is there any reason to define the value for the macro? > > > > > > > > > Robustness, clarity, maintainability, convention. Why not? > > > > > > I've tried to implement the suggestion, but it pulled more unnecessary changes. It makes the intended way to check the condition less clear (`#ifdef` and not `#if`). > > No, no, no! I am not suggesting you change anything else, just that > you do not define contentless macros. You might as well define it > to be something, and true is a reasonable default, that's all. It's > not terribly important, it's just good practice. I'm quite prepared to drop this if it's holding up the port. It's a style thing, but it's not critical. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aph at openjdk.java.net Tue Mar 23 09:56:57 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Tue, 23 Mar 2021 09:56:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v24] In-Reply-To: <3fAiKgcWOdYNUYMfY0LSvyMswzjlKJWJaxZgGf7tdYE=.aa5e7ae8-2744-4c2c-9e66-b72e19d9ebec@github.com> References: <3fAiKgcWOdYNUYMfY0LSvyMswzjlKJWJaxZgGf7tdYE=.aa5e7ae8-2744-4c2c-9e66-b72e19d9ebec@github.com> Message-ID: On Tue, 23 Mar 2021 09:53:54 GMT, Andrew Haley wrote: >>> @theRealAph, could you elaborate on what is need to be done for [#2200 (review)](https://github.com/openjdk/jdk/pull/2200#pullrequestreview-600597066). >> >> I think that what you've got now is fine. > >> _Mailing list message from [Andrew Haley](mailto:aph at redhat.com) on [build-dev](mailto:build-dev at openjdk.java.net):_ >> >> On 3/15/21 6:56 PM, Anton Kozlov wrote: >> >> > On Wed, 10 Mar 2021 11:21:44 GMT, Andrew Haley wrote: >> > > > We always check for `R18_RESERVED` with `#if(n)def`, is there any reason to define the value for the macro? >> > > >> > > >> > > Robustness, clarity, maintainability, convention. Why not? >> > >> > >> > I've tried to implement the suggestion, but it pulled more unnecessary changes. It makes the intended way to check the condition less clear (`#ifdef` and not `#if`). >> >> No, no, no! I am not suggesting you change anything else, just that >> you do not define contentless macros. You might as well define it >> to be something, and true is a reasonable default, that's all. It's >> not terribly important, it's just good practice. > > I'm quite prepared to drop this if it's holding up the port. It's a style thing, but it's not critical. So, where are we up to now? Are we done yet? ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From vkempik at openjdk.java.net Tue Mar 23 11:20:52 2021 From: vkempik at openjdk.java.net (Vladimir Kempik) Date: Tue, 23 Mar 2021 11:20:52 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v24] In-Reply-To: References: <3fAiKgcWOdYNUYMfY0LSvyMswzjlKJWJaxZgGf7tdYE=.aa5e7ae8-2744-4c2c-9e66-b72e19d9ebec@github.com> Message-ID: On Tue, 23 Mar 2021 09:54:16 GMT, Andrew Haley wrote: > So, where are we up to now? Are we done yet? Hello we would like to get approval for the final version we have now and then integrate this pr as soon as Mark will target it to jdk17 ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From ihse at openjdk.java.net Tue Mar 23 12:52:56 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Tue, 23 Mar 2021 12:52:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Mon, 22 Mar 2021 12:50:14 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 115 commits: > > - Merge branch 'master' into jdk-macos > - JDK-8262491: bsd_aarch64 part > - JDK-8263002: bsd_aarch64 part > - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos > - Wider #ifdef block > - Fix most of issues in java/foreign/ tests > > Failures related to va_args are tracked in JDK-8263512. > - Add Azul copyright > - Update Oracle copyright years > - Use Thread::current_or_null_safe in SafeFetch > - 8262903: [macos_aarch64] Thread::current() called on detached thread > - ... and 105 more: https://git.openjdk.java.net/jdk/compare/a9d2267f...5add9269 Build changes still look good. Hope you can get this done now! :) ------------- Marked as reviewed by ihse (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2200 From erikj at openjdk.java.net Tue Mar 23 12:52:55 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Tue, 23 Mar 2021 12:52:55 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Mon, 22 Mar 2021 12:50:14 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 115 commits: > > - Merge branch 'master' into jdk-macos > - JDK-8262491: bsd_aarch64 part > - JDK-8263002: bsd_aarch64 part > - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos > - Wider #ifdef block > - Fix most of issues in java/foreign/ tests > > Failures related to va_args are tracked in JDK-8263512. > - Add Azul copyright > - Update Oracle copyright years > - Use Thread::current_or_null_safe in SafeFetch > - 8262903: [macos_aarch64] Thread::current() called on detached thread > - ... and 105 more: https://git.openjdk.java.net/jdk/compare/a9d2267f...5add9269 Build changes look good. ------------- Marked as reviewed by erikj (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Tue Mar 23 13:28:52 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Tue, 23 Mar 2021 13:28:52 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 12:49:34 GMT, Magnus Ihse Bursie wrote: >> Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 115 commits: >> >> - Merge branch 'master' into jdk-macos >> - JDK-8262491: bsd_aarch64 part >> - JDK-8263002: bsd_aarch64 part >> - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos >> - Wider #ifdef block >> - Fix most of issues in java/foreign/ tests >> >> Failures related to va_args are tracked in JDK-8263512. >> - Add Azul copyright >> - Update Oracle copyright years >> - Use Thread::current_or_null_safe in SafeFetch >> - 8262903: [macos_aarch64] Thread::current() called on detached thread >> - ... and 105 more: https://git.openjdk.java.net/jdk/compare/a9d2267f...5add9269 > > Build changes still look good. Hope you can get this done now! :) > > No, no, no! I am not suggesting you change anything else, just that > > you do not define contentless macros. You might as well define it > > to be something, and true is a reasonable default, that's all. It's > > not terribly important, it's just good practice. > > I'm quite prepared to drop this if it's holding up the port. It's a style thing, but it's not critical. Sorry, I missed your reply. R18_RESERVED is also defined in https://github.com/openjdk/jdk/blob/master/make/hotspot/gensrc/GensrcAdlc.gmk#L96. I think changing the value here and there would be slightly out of the scope of this PR, so I would prefer to avoid the suggested change. The biggest argument from my side is that the current macro value is consistent with the rest of the macros in this file. For example https://github.com/openjdk/jdk/blob/8c1ab38ee20ed61fefbb64b6a9ee605c52d2cb4e/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp#L35 and https://github.com/openjdk/jdk/blob/b7b391b2ac4208eabdee4e93acd5b0e364953f94/src/hotspot/share/runtime/mutexLocker.cpp#L137 But https://github.com/openjdk/jdk/blob/8c1ab38ee20ed61fefbb64b6a9ee605c52d2cb4e/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp#L59 and https://github.com/openjdk/jdk/blob/b23228d152ff8fa27bd32d9ef1307bf315039dea/src/hotspot/share/runtime/arguments.cpp#L1540 ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From alexey.ivanov at oracle.com Tue Mar 23 13:36:40 2021 From: alexey.ivanov at oracle.com (Alexey Ivanov) Date: Tue, 23 Mar 2021 13:36:40 +0000 Subject: [OpenJDK 2D-Dev] Clarification regarding PageFormat and Paper getImageable* functions orientation consideration In-Reply-To: References: Message-ID: <63e42cfd-1783-efc3-543d-74db3f18fb30@oracle.com> Hi Rajat, I agree with Phil. Both PageFormat [1] and Paper [2] have getImageable*() methods. The spec for each of these methods in PageFormat states, ?This method takes into account the orientation of the page.? The implementation confirms this statement. Yet the spec for Paper does not have this statement. The test case in JDK-8203395 [3] gets the margins from Paper object and it gets the same results, irrespective of the page orientation. This is *expected* because Paper does not take into account the orientation. As you noticed, getting the margins from PageFormat object directly produces the expected result: the margins are different in portrait (default) and landscape orientation. Thus both classes ? PageFormat and Paper ? behave exactly as specified. As for the question: > My question is that should Paper getImageable* functions also need > take into account orientation as per spec ?, or is the current > behavior of them not considering orientation correct and why ? The Paper object doesn't have orientation. So I believe the current behaviour is correct. -- Regards, Alexey [1] https://docs.oracle.com/javase/8/docs/api/java/awt/print/PageFormat.html#getImageableX-- https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/print/PageFormat.html#getImageableX() [2] https://docs.oracle.com/javase/8/docs/api/java/awt/print/Paper.html#getImageableX-- https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/print/Paper.html#getImageableX() [3]? https://bugs.openjdk.java.net/browse/JDK-8203395 On 22/03/2021 21:54, Philip Race wrote: > There's no bug here from what I am being shown. > > >"PageFormat showing wrong printer margins in LANDSCAPE orientation? . > > Really ? But I don't see anywhere the PageFormat is queried for this. > Instead the test case digs inside the PageFormat and retrieves the > Paper and asks for *its* margins > > I see a comment in the bug : > > All getImageable methodes javadoc say "This method takes into > account the orientation of the page" but It's not true before printing. > > The methods that say that, are the ones on PageFormat, not the ones on > Paper. So wrong. > > > -phil > > On 3/22/21 1:55 PM, Rajat Mahajan wrote: >> >> Hi all, >> >> *_Issue:_* >> >> *__* >> >> I am working on https://bugs.openjdk.java.net/browse/JDK-8203395 >> ?and this bug is >> about *?PageFormat showing wrong printer margins in LANDSCAPE >> orientation? .* >> >> ** >> >> *Application code it trying to print in Landscape and Portrait but >> both show same margins:* >> >> Margins default : 12,12,17,17 >> >> Margins OrientationRequested.LANDSCAPE : 12,12,17,17 >> >> ** >> >> *The code of the application uses Paper object for getting margins :* >> >> PageFormat pf = printerJob.getPageFormat(aset); >> >> ???????Paper paper = pf.getPaper(); >> >> ???????long paperTopMargin = Math.round(paper.getImageableY()); >> ???????long paperLeftMargin = Math.round(paper.getImageableX()); >> ???????long paperRightMargin = Math.round(paper.getWidth() - >> paper.getImageableWidth() - paperLeftMargin); >> ???????long paperBottomMargin = Math.round(paper.getHeight() - >> paper.getImageableHeight() - paperTopMargin); >> >> When I looked at the latest JDK code, PageFormat getImageable >> functions are taking into account Orientation and Paper getImageable >> functions are not , and hence we see the same output. >> >> Using Page format object instead of Paper shows the correct output: >> >> Margins default : 12,12,17,17 >> >> Margins OrientationRequested.LANDSCAPE : 17,17,12,12 >> >> *_Question:_* >> >> My question is that should Paper getImageable* functions also need >> take into account orientation as per spec ?, or is the current >> behavior of them not considering orientation correct and why ? >> > From vkempik at openjdk.java.net Tue Mar 23 13:47:49 2021 From: vkempik at openjdk.java.net (Vladimir Kempik) Date: Tue, 23 Mar 2021 13:47:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 13:26:19 GMT, Anton Kozlov wrote: >> Build changes still look good. Hope you can get this done now! :) > >> > No, no, no! I am not suggesting you change anything else, just that >> > you do not define contentless macros. You might as well define it >> > to be something, and true is a reasonable default, that's all. It's >> > not terribly important, it's just good practice. >> >> I'm quite prepared to drop this if it's holding up the port. It's a style thing, but it's not critical. > > Sorry, I missed your reply. > > R18_RESERVED is also defined in https://github.com/openjdk/jdk/blob/master/make/hotspot/gensrc/GensrcAdlc.gmk#L96. I think changing the value here and there would be slightly out of the scope of this PR, so I would prefer to avoid the suggested change. > > The biggest argument from my side is that the current macro value is consistent with the rest of the macros in this file. For example https://github.com/openjdk/jdk/blob/8c1ab38ee20ed61fefbb64b6a9ee605c52d2cb4e/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp#L35 > and https://github.com/openjdk/jdk/blob/b7b391b2ac4208eabdee4e93acd5b0e364953f94/src/hotspot/share/runtime/mutexLocker.cpp#L137 > > But https://github.com/openjdk/jdk/blob/8c1ab38ee20ed61fefbb64b6a9ee605c52d2cb4e/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp#L59 > and > https://github.com/openjdk/jdk/blob/b23228d152ff8fa27bd32d9ef1307bf315039dea/src/hotspot/share/runtime/arguments.cpp#L1540 Hello That depends on the will of openjdk11 maintainers to accept this (and few other, like jep-388, as we depend on it) contribution. > 23 ????? 2021 ?., ? 16:39, drej1 ***@***.***> ???????(?): > > > So, where are we up to now? Are we done yet? > > Hello > we would like to get approval for the final version we have now and then integrate this pr as soon as Mark will target it to jdk17 > > Hi there, will this be also supported backwards? To support java11 LTS version? > > ? > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub , or unsubscribe . > ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aivanov at openjdk.java.net Tue Mar 23 13:51:52 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Tue, 23 Mar 2021 13:51:52 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers Message-ID: When `getAllPrinterNames()` returns null, the list of `printServices` is assigned a new empty array without invalidating old services which were in the array before. The old print services should be invalidated. ------------- Commit messages: - 8263984: Invalidate printServices when there are no printers Changes: https://git.openjdk.java.net/jdk/pull/3151/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3151&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263984 Stats: 8 lines in 1 file changed: 6 ins; 1 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/3151.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3151/head:pull/3151 PR: https://git.openjdk.java.net/jdk/pull/3151 From aivanov at openjdk.java.net Tue Mar 23 13:54:40 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Tue, 23 Mar 2021 13:54:40 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers In-Reply-To: References: Message-ID: <9tdpjbSGnLHFKCepG9in8FdsVRRnBs_eFw0jHiLaiqY=.39d27368-2b34-4ecc-bf89-f56090a38821@github.com> On Tue, 23 Mar 2021 13:45:33 GMT, Alexey Ivanov wrote: > When `getAllPrinterNames()` returns null, the list of `printServices` is assigned a new empty array without invalidating old services which were in the array before. > > The old print services should be invalidated. src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java line 116: > 114: private synchronized void refreshServices() { > 115: String[] printers = getAllPrinterNames(); > 116: if (printers == null) { `getAllPrinterNames` returns null when an error occurs or when there are no printers in the system. Up for discussion: If an error occurs, we may leave the old services without invalidating them. In this case, it is necessary to distinguish between the error and the lack of printers in the system. Does this make any sense? ------------- PR: https://git.openjdk.java.net/jdk/pull/3151 From aph at openjdk.java.net Tue Mar 23 13:56:59 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Tue, 23 Mar 2021 13:56:59 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Mon, 22 Mar 2021 12:50:14 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 115 commits: > > - Merge branch 'master' into jdk-macos > - JDK-8262491: bsd_aarch64 part > - JDK-8263002: bsd_aarch64 part > - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos > - Wider #ifdef block > - Fix most of issues in java/foreign/ tests > > Failures related to va_args are tracked in JDK-8263512. > - Add Azul copyright > - Update Oracle copyright years > - Use Thread::current_or_null_safe in SafeFetch > - 8262903: [macos_aarch64] Thread::current() called on detached thread > - ... and 105 more: https://git.openjdk.java.net/jdk/compare/a9d2267f...5add9269 Marked as reviewed by aph (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aph at openjdk.java.net Tue Mar 23 14:00:58 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Tue, 23 Mar 2021 14:00:58 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 13:54:24 GMT, Andrew Haley wrote: >> Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 115 commits: >> >> - Merge branch 'master' into jdk-macos >> - JDK-8262491: bsd_aarch64 part >> - JDK-8263002: bsd_aarch64 part >> - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos >> - Wider #ifdef block >> - Fix most of issues in java/foreign/ tests >> >> Failures related to va_args are tracked in JDK-8263512. >> - Add Azul copyright >> - Update Oracle copyright years >> - Use Thread::current_or_null_safe in SafeFetch >> - 8262903: [macos_aarch64] Thread::current() called on detached thread >> - ... and 105 more: https://git.openjdk.java.net/jdk/compare/a9d2267f...5add9269 > > Marked as reviewed by aph (Reviewer). > [ Back-porting this patch to JDK 11] depends on the will of openjdk11 maintainers to accept this (and few other, like jep-388, as we depend on it) contribution. To the extent that 11u has fixed policies :) we definitely have a policy of accepting patches to keep 11u working on current hardware. So yes. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aivanov at openjdk.java.net Tue Mar 23 14:02:41 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Tue, 23 Mar 2021 14:02:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers In-Reply-To: References: Message-ID: <_tzSAlqGwvdnxNQOwbjyodFgbxJvkAlDMX9Mi3qOkrM=.b0fcf1b1-61b9-40b1-8e30-74edae00e9d4@github.com> On Tue, 23 Mar 2021 13:45:33 GMT, Alexey Ivanov wrote: > When `getAllPrinterNames()` returns null, the list of `printServices` is assigned a new empty array without invalidating old services which were in the array before. > > The old print services should be invalidated. src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java line 119: > 117: // In Windows it is safe to assume no default if printers == null so we > 118: // don't get the default. > 119: invalidateServices(); The default printer service, `defaultPrintService`, is usually in `printServices` array. It's possible that it's not in the array; in this case getDefaultPrintService() will reset it to `null` when accessed. ------------- PR: https://git.openjdk.java.net/jdk/pull/3151 From vkempik at openjdk.java.net Tue Mar 23 14:03:52 2021 From: vkempik at openjdk.java.net (Vladimir Kempik) Date: Tue, 23 Mar 2021 14:03:52 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 13:58:03 GMT, Andrew Haley wrote: > > [ Back-porting this patch to JDK 11] depends on the will of openjdk11 maintainers to accept this (and few other, like jep-388, as we depend on it) contribution. > > To the extent that 11u has fixed policies :) we definitely have a policy of accepting patches to keep 11u working on current hardware. So yes. @lewurm That sounds like a green flag for you and jep-388 (with its R18_RESERVED functionality) ;) ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From mbeckwit at openjdk.java.net Tue Mar 23 14:27:53 2021 From: mbeckwit at openjdk.java.net (Monica Beckwith) Date: Tue, 23 Mar 2021 14:27:53 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 14:01:12 GMT, Vladimir Kempik wrote: > > > [ Back-porting this patch to JDK 11] depends on the will of openjdk11 maintainers to accept this (and few other, like jep-388, as we depend on it) contribution. > > > > > > To the extent that 11u has fixed policies :) we definitely have a policy of accepting patches to keep 11u working on current hardware. So yes. > > @lewurm That sounds like a green flag for you and jep-388 (with its R18_RESERVED functionality) ;) Thanks, @theRealAph, and @VladimirKempik . We are on it! ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From sgehwolf at openjdk.java.net Tue Mar 23 15:23:53 2021 From: sgehwolf at openjdk.java.net (Severin Gehwolf) Date: Tue, 23 Mar 2021 15:23:53 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt Message-ID: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> The suggestion is to rename 'jvm' variable in `libjavajpeg` to `the_jvm` so this conflict no longer occurs when `libjavajpeg.a` and `libawt.a` are being linked into one native image. Testing: test/jdk/javax/imageio jtreg tests. GHA pre-integration tests running too. Thoughts? ------------- Commit messages: - 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt Changes: https://git.openjdk.java.net/jdk/pull/3155/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3155&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8264047 Stats: 14 lines in 2 files changed: 0 ins; 0 del; 14 mod Patch: https://git.openjdk.java.net/jdk/pull/3155.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3155/head:pull/3155 PR: https://git.openjdk.java.net/jdk/pull/3155 From mbeckwit at openjdk.java.net Tue Mar 23 15:27:56 2021 From: mbeckwit at openjdk.java.net (Monica Beckwith) Date: Tue, 23 Mar 2021 15:27:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: <8y8WYVmVF_qrroxDo516Ucz1qWX5kMpPQHeqZgJNI2Q=.004fe86c-2b18-4a90-8499-1a34e64da3db@github.com> On Mon, 22 Mar 2021 12:50:14 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 115 commits: > > - Merge branch 'master' into jdk-macos > - JDK-8262491: bsd_aarch64 part > - JDK-8263002: bsd_aarch64 part > - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos > - Wider #ifdef block > - Fix most of issues in java/foreign/ tests > > Failures related to va_args are tracked in JDK-8263512. > - Add Azul copyright > - Update Oracle copyright years > - Use Thread::current_or_null_safe in SafeFetch > - 8262903: [macos_aarch64] Thread::current() called on detached thread > - ... and 105 more: https://git.openjdk.java.net/jdk/compare/a9d2267f...5add9269 Marked as reviewed by mbeckwit (Author). ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From luhenry at openjdk.java.net Tue Mar 23 16:23:54 2021 From: luhenry at openjdk.java.net (Ludovic Henry) Date: Tue, 23 Mar 2021 16:23:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Mon, 22 Mar 2021 12:50:14 GMT, Anton Kozlov wrote: >> Please review the implementation of JEP 391: macOS/AArch64 Port. >> >> It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. >> >> Major changes are in: >> * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) >> * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) >> * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. >> * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) > > Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 115 commits: > > - Merge branch 'master' into jdk-macos > - JDK-8262491: bsd_aarch64 part > - JDK-8263002: bsd_aarch64 part > - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos > - Wider #ifdef block > - Fix most of issues in java/foreign/ tests > > Failures related to va_args are tracked in JDK-8263512. > - Add Azul copyright > - Update Oracle copyright years > - Use Thread::current_or_null_safe in SafeFetch > - 8262903: [macos_aarch64] Thread::current() called on detached thread > - ... and 105 more: https://git.openjdk.java.net/jdk/compare/a9d2267f...5add9269 Marked as reviewed by luhenry (Author). ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aph at openjdk.java.net Tue Mar 23 16:36:55 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Tue, 23 Mar 2021 16:36:55 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 16:20:47 GMT, Ludovic Henry wrote: >> Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 115 commits: >> >> - Merge branch 'master' into jdk-macos >> - JDK-8262491: bsd_aarch64 part >> - JDK-8263002: bsd_aarch64 part >> - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos >> - Wider #ifdef block >> - Fix most of issues in java/foreign/ tests >> >> Failures related to va_args are tracked in JDK-8263512. >> - Add Azul copyright >> - Update Oracle copyright years >> - Use Thread::current_or_null_safe in SafeFetch >> - 8262903: [macos_aarch64] Thread::current() called on detached thread >> - ... and 105 more: https://git.openjdk.java.net/jdk/compare/a9d2267f...5add9269 > > Marked as reviewed by luhenry (Author). > > > > [ Back-porting this patch to JDK 11] depends on the will of openjdk11 maintainers to accept this (and few other, like jep-388, as we depend on it) contribution. > > > > > > > > > To the extent that 11u has fixed policies :) we definitely have a policy of accepting patches to keep 11u working on current hardware. So yes. > > > > > > @lewurm That sounds like a green flag for you and jep-388 (with its R18_RESERVED functionality) ;) > > Thanks, @theRealAph, and @VladimirKempik . We are on it! It's going to be tricky to do in a really clean way, given some of the weirdnesses of the ABI. However, I think there's probably a need for it ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From serb at openjdk.java.net Tue Mar 23 22:20:39 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 23 Mar 2021 22:20:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice In-Reply-To: References: <4Bi_Pk9Wlm_Qv5vPRITz_9OKGbUijJrKwfMSElj3OJQ=.bbabb34a-79b4-4bb1-8a25-aa76d984ca39@github.com> Message-ID: On Tue, 23 Mar 2021 06:50:26 GMT, Aleksey Shipilev wrote: >> I hope so, and not in the opposite order. I'll try to check the history f this file. > > Please do. I'll wait for a bit. I have found this bug, and the fix for it just implemented both methods at once, so this is a typo. https://bugs.openjdk.java.net/browse/JDK-4430788 ------------- PR: https://git.openjdk.java.net/jdk/pull/3125 From psadhukhan at openjdk.java.net Wed Mar 24 05:26:38 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 24 Mar 2021 05:26:38 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows [v2] In-Reply-To: References: Message-ID: On Thu, 18 Mar 2021 12:29:01 GMT, Alexander Scherbatiy wrote: >> Printing text using GlyphVector outline has bad quality on printers with low DPI on Windows. >> The GDI system used for text printing on Windows accepts only integer path coordinates. >> Rounding GlyphVector outline coordinates leads to distorted printed text. >> >> The issue had been reported as JDK-8256264 but was reverted because of the regression JDK-8259007 "This test printed a blank page". >> >> The fix JDK-8256264 scaled coordinates in wPrinterJob.moveTo()/lineTo() methods up and scaled transforms in wPrinterJob.beginPath()/endPath() down. >> >> The regression was in the WPathGraphics.deviceDrawLine() method which uses wPrinterJob.moveTo()/lineTo() methods without surrounding them with wPrinterJob.beginPath()/endPath() so the line coordinates were only scaled up. >> >> I tried to put wPrinterJob.beginPath()/endPath() methods around wPrinterJob.moveTo()/lineTo() in the method WPathGraphics.deviceDrawLine() but the line was not drawn at all even without scaling coordinates up and transform down (without JDK-8256264 fix). It looks like GDI treats this case as an empty shape. >> >> The proposed fix applies path coordinates and transform scaling only in WPathGraphics.convertToWPath() method. >> The one more PathPrecisionScaleFactorShapeTest.java manual test is added which checks that all methods that draw paths in WPathGraphics are used: line in WPathGraphics.deviceDrawLine() and SEG_LINETO/SEG_QUADTO/SEG_CUBICTO in WPathGraphics.convertToWPath() . >> >> The `java/awt/print` and `java/awt/PrintJob` automatic and manual tests were run on Windows 10 Pro with the fix. >> >> There are two failed automated tests which fail without the fix as well: >> java/awt/print/PrinterJob/GlyphPositions.java >> java/awt/print/PrinterJob/PSQuestionMark.java >> >> The following manual tests have issues on my system: >> - `java/awt/print/Dialog/PrintDlgPageable.java` java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainThread cannot access a member of class PrintDlgPageable with modifiers "public static" >> >> - `java/awt/print/PrinterJob/PrintAttributeUpdateTest.java` I select pages radio button, press the print button but the test does not finish and I do not see any other dialogs with pass/fail buttons. >> >> - `java/awt/PrintJob/PrintCheckboxTest/PrintCheckboxManualTest.java` Tests that there is no ClassCastException thrown in printing checkbox and scrollbar with XAWT. Error. Can't find HTML file: test\jdk\java\awt\PrintJob\PrintCheckboxTest\PrintCheckboxManualTest.html >> >> >> - `java/awt/print/PrinterJob/SecurityDialogTest.java` A windows with instructions is shown but it does not contain print/pass/fail buttons and it is not possible to close the window. >> >> - The tests below fail with "Error. Parse Exception: Arguments to `manual' option not supported: yesno" message: >> java/awt/print/Dialog/DialogOrient.java >> java/awt/print/Dialog/DialogType.java >> java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java >> java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java >> java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java >> java/awt/print/PrinterJob/PageDialogTest.java >> java/awt/print/PrinterJob/PageRanges.java >> java/awt/print/PrinterJob/PageRangesDlgTest.java >> java/awt/print/PrinterJob/PrintGlyphVectorTest.java >> java/awt/print/PrinterJob/PrintLatinCJKTest.java >> java/awt/print/PrinterJob/PrintTextTest.java >> java/awt/print/PrinterJob/SwingUIText.java >> java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java >> java/awt/PrintJob/PageSetupDlgBlockingTest/PageSetupDlgBlockingTest.java >> java/awt/PrintJob/SaveDialogTitleTest.java > > Alexander Scherbatiy has updated the pull request incrementally with two additional commits since the last revision: > > - Use DASSERT to check SetGraphicsMode and WorldTransform results > - Change setGraphicsMode() type to void Marked as reviewed by psadhukhan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2756 From shade at openjdk.java.net Wed Mar 24 07:04:41 2021 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Wed, 24 Mar 2021 07:04:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice In-Reply-To: References: <4Bi_Pk9Wlm_Qv5vPRITz_9OKGbUijJrKwfMSElj3OJQ=.bbabb34a-79b4-4bb1-8a25-aa76d984ca39@github.com> Message-ID: <_EoyPo3iaecEH-l31WooBWigx87smQ_yGwzLJJdn_VU=.70af01ff-23d9-4ae1-8489-fdd3b3eccc61@github.com> On Tue, 23 Mar 2021 22:17:56 GMT, Sergey Bylokhov wrote: >> Please do. I'll wait for a bit. > > I have found this bug, and the fix for it just implemented both methods at once, so this is a typo. > https://bugs.openjdk.java.net/browse/JDK-4430788 Brilliant, thanks. I'll integrate now. ------------- PR: https://git.openjdk.java.net/jdk/pull/3125 From shade at openjdk.java.net Wed Mar 24 07:04:42 2021 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Wed, 24 Mar 2021 07:04:42 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice In-Reply-To: References: Message-ID: On Mon, 22 Mar 2021 15:55:16 GMT, Aleksey Shipilev wrote: > SonarCloud reports the problem in ComponentSampleModel.equals: > Correct one of the identical sub-expressions on both sides of operator "&&" > > ...near "this.numBands == that.numBands". It is checked twice. hashCode also processes it twice. This pull request has now been integrated. Changeset: cb776edf Author: Aleksey Shipilev URL: https://git.openjdk.java.net/jdk/commit/cb776edf Stats: 4 lines in 1 file changed: 0 ins; 3 del; 1 mod 8263981: java.awt.image.ComponentSampleModel equals/hashcode use numBands twice Reviewed-by: serb, azvegint ------------- PR: https://git.openjdk.java.net/jdk/pull/3125 From psadhukhan at openjdk.java.net Wed Mar 24 09:19:42 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 24 Mar 2021 09:19:42 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 13:45:33 GMT, Alexey Ivanov wrote: > When `getAllPrinterNames()` returns null, the list of `printServices` is assigned a new empty array without invalidating old services which were in the array before. > > The old print services should be invalidated. src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java line 120: > 118: // don't get the default. > 119: invalidateServices(); > 120: printServices = new PrintService[0]; I am not sure this call to invalidateServices() is needed as we are creating a new `printServices` object of 0 length so making the old printServices invalid is redundant as it is same global variable. ------------- PR: https://git.openjdk.java.net/jdk/pull/3151 From aivanov at openjdk.java.net Wed Mar 24 09:28:39 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Wed, 24 Mar 2021 09:28:39 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers In-Reply-To: References: Message-ID: On Wed, 24 Mar 2021 09:16:33 GMT, Prasanta Sadhukhan wrote: >> When `getAllPrinterNames()` returns null, the list of `printServices` is assigned a new empty array without invalidating old services which were in the array before. >> >> The old print services should be invalidated. > > src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java line 120: > >> 118: // don't get the default. >> 119: invalidateServices(); >> 120: printServices = new PrintService[0]; > > I am not sure this call to invalidateServices() is needed as we are creating a new `printServices` object of 0 length so making the old printServices invalid is redundant as it is same global variable. That's exactly the problem I am addressing. In the regular case, the existing services left in `printServices` are invalidated before `newServices` is assigned to it. Yet no existing services are invalidated if all the printers were removed from the system. Why is it needed to invalidate deleted services if the list of printers is updated and if at least one printer is left in the system? Why is it not needed to invalidate deleted services if all the printers are removed from the system? ------------- PR: https://git.openjdk.java.net/jdk/pull/3151 From psadhukhan at openjdk.java.net Wed Mar 24 13:10:41 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 24 Mar 2021 13:10:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers In-Reply-To: References: Message-ID: <-nssXzOVh4I__oMQjsjYlvgqtQQKm78fr3Xcd_yT0eY=.2a5f9dcd-e2c1-448e-aa41-29f8700385c1@github.com> On Wed, 24 Mar 2021 09:25:56 GMT, Alexey Ivanov wrote: >> src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java line 120: >> >>> 118: // don't get the default. >>> 119: invalidateServices(); >>> 120: printServices = new PrintService[0]; >> >> I am not sure this call to invalidateServices() is needed as we are creating a new `printServices` object of 0 length so making the old printServices invalid is redundant as it is same global variable. > > That's exactly the problem I am addressing. > > In the regular case, the existing services left in `printServices` are invalidated before `newServices` is assigned to it. Yet no existing services are invalidated if all the printers were removed from the system. > > Why is it needed to invalidate deleted services if the list of printers is updated and if at least one printer is left in the system? Why is it not needed to invalidate deleted services if all the printers are removed from the system? Since this is windows specific code, I am not sure if system will not have any printers. I guess by default, Microsoft XPS Document Writer, Microsoft Print-to-PDF, Fax are present in printers list. That is the reason we do not have getPrintService() return 0 printer although there may not be any real printer present in windows system...reason for some failure in jtreg test which caused us to use `@key printer `tag in those tests to make real printers are configured. ------------- PR: https://git.openjdk.java.net/jdk/pull/3151 From azvegint at openjdk.java.net Wed Mar 24 17:16:40 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Wed, 24 Mar 2021 17:16:40 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264002: Delete outdated assumptions about ColorSpace initialization In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 00:14:59 GMT, Sergey Bylokhov wrote: > Some codes have outdated assumptions about the initialization of ColorSpace class. > - The ColorSpace.getInstance() will never throw an IllegalArgumentException for the builtin profiles > - The ColorSpace.getInstance() will not trigger initialisation of the CMM classes Looks good to me. ------------- Marked as reviewed by azvegint (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/3140 From aivanov at openjdk.java.net Wed Mar 24 20:16:41 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Wed, 24 Mar 2021 20:16:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263893: getPrinterNames() leaks nameArray if Java String allocation fails In-Reply-To: References: Message-ID: On Fri, 19 Mar 2021 22:31:48 GMT, Sergey Bylokhov wrote: >> If `JNU_NewStringPlatform` fails to allocate new Java String object for printer name, `std::bad_alloc` is thrown. The handler for the exception does not release the local reference to the `nameArray`, thus it will be leaked. > > src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp line 178: > >> 176: } catch (std::bad_alloc&) { >> 177: delete [] pPrinterEnum; >> 178: if (nameArray != NULL) { > > Not sure that we usually clean the local refs in the native JNI methods, that only required in the native loop which are never returned to the java(I have check that by the grep of env->NewObjectArray) You're right. It's not required: all local refs are cleared when the JNI method exits. My reasoning was that `env->DeleteLocalRef(utf_str)` is called in the loop. Strictly, it's not required either. Yet if there's a large number of elements in the array, it could cause a problem. I'm going to withdraw the PR as the fix is not necessary. ------------- PR: https://git.openjdk.java.net/jdk/pull/3096 From aivanov at openjdk.java.net Wed Mar 24 20:47:40 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Wed, 24 Mar 2021 20:47:40 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers In-Reply-To: <-nssXzOVh4I__oMQjsjYlvgqtQQKm78fr3Xcd_yT0eY=.2a5f9dcd-e2c1-448e-aa41-29f8700385c1@github.com> References: <-nssXzOVh4I__oMQjsjYlvgqtQQKm78fr3Xcd_yT0eY=.2a5f9dcd-e2c1-448e-aa41-29f8700385c1@github.com> Message-ID: On Wed, 24 Mar 2021 13:07:21 GMT, Prasanta Sadhukhan wrote: > Since this is windows specific code, I am not sure if system will not have any printers. I guess by default, Microsoft XPS Document Writer, Microsoft Print-to-PDF, Fax are present in printers list. Yes, that's correct. But you can remove them. You can also configure the image so that these are not installed by default. > That is the reason we do not have getPrintService() return 0 printer although there may not be any real printer present in windows system...reason for some failure in jtreg test which caused us to use `@key printer `tag in those tests to make real printers are configured. I agree that getting zero printers in Windows is unlikely. But it's still possible. Consider the following scenario: Let's assume there are 10 printers in the system. The user removes 5 of them. In this case, `invalidateService()` is called on the instances of `Win32PrintService` which were removed from the system. Then the user removes the remaining 5 printers. In this case, `invalidateService()` is not called at all. If an application has references to any of these instances, they will continue to appear operational. However, the flag `isInvalid` in `Win32PrintService` is used in two methods only: `getPrinterState` and `getPrinterStateReasons`. This fix is minor, probably this situation never occurs in the real life. The difference in handling the deleted services caught my attention. If everyone agrees it's not problem, I'll withdraw the PR and close the bug as _Not an Issue_. ------------- PR: https://git.openjdk.java.net/jdk/pull/3151 From serb at openjdk.java.net Wed Mar 24 21:36:40 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 24 Mar 2021 21:36:40 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8264002: Delete outdated assumptions about ColorSpace initialization In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 00:14:59 GMT, Sergey Bylokhov wrote: > Some codes have outdated assumptions about the initialization of ColorSpace class. > - The ColorSpace.getInstance() will never throw an IllegalArgumentException for the builtin profiles > - The ColorSpace.getInstance() will not trigger initialisation of the CMM classes This pull request has now been integrated. Changeset: cfc9aa34 Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/cfc9aa34 Stats: 168 lines in 6 files changed: 45 ins; 94 del; 29 mod 8264002: Delete outdated assumptions about ColorSpace initialization Reviewed-by: azvegint ------------- PR: https://git.openjdk.java.net/jdk/pull/3140 From sgehwolf at openjdk.java.net Thu Mar 25 17:57:26 2021 From: sgehwolf at openjdk.java.net (Severin Gehwolf) Date: Thu, 25 Mar 2021 17:57:26 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt In-Reply-To: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> References: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> Message-ID: On Tue, 23 Mar 2021 15:18:13 GMT, Severin Gehwolf wrote: > The suggestion is to rename 'jvm' variable in `libjavajpeg` to `the_jvm` so this conflict no longer occurs when `libjavajpeg.a` and `libawt.a` are being linked into one native image. > > Testing: test/jdk/javax/imageio jtreg tests. GHA pre-integration tests running too. > > Thoughts? Anyone? ------------- PR: https://git.openjdk.java.net/jdk/pull/3155 From akozlov at openjdk.java.net Thu Mar 25 18:14:06 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Thu, 25 Mar 2021 18:14:06 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8253795: Implementation of JEP 391: macOS/AArch64 Port In-Reply-To: References: Message-ID: On Fri, 22 Jan 2021 18:49:42 GMT, Anton Kozlov wrote: > Please review the implementation of JEP 391: macOS/AArch64 Port. > > It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. > > Major changes are in: > * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) > * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) > * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. > * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) This pull request has now been integrated. Changeset: dbc9e4b5 Author: Anton Kozlov Committer: Vladimir Kempik URL: https://git.openjdk.java.net/jdk/commit/dbc9e4b5 Stats: 2960 lines in 75 files changed: 2851 ins; 27 del; 82 mod 8253795: Implementation of JEP 391: macOS/AArch64 Port 8253816: Support macOS W^X 8253817: Support macOS Aarch64 ABI in Interpreter 8253818: Support macOS Aarch64 ABI for compiled wrappers 8253819: Implement os/cpu for macOS/AArch64 8253839: Update tests and JDK code for macOS/Aarch64 8254941: Implement Serviceability Agent for macOS/AArch64 8255776: Change build system for macOS/AArch64 8262903: [macos_aarch64] Thread::current() called on detached thread Co-authored-by: Vladimir Kempik Co-authored-by: Bernhard Urban-Forster Co-authored-by: Ludovic Henry Co-authored-by: Monica Beckwith Reviewed-by: erikj, ihse, prr, cjplummer, stefank, gziemski, aph, mbeckwit, luhenry ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Thu Mar 25 18:14:03 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Thu, 25 Mar 2021 18:14:03 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v30] In-Reply-To: References: Message-ID: > Please review the implementation of JEP 391: macOS/AArch64 Port. > > It's heavily based on existing ports to linux/aarch64, macos/x86_64, and windows/aarch64. > > Major changes are in: > * src/hotspot/cpu/aarch64: support of the new calling convention (subtasks JDK-8253817, JDK-8253818) > * src/hotspot/os_cpu/bsd_aarch64: copy of os_cpu/linux_aarch64 with necessary adjustments (JDK-8253819) > * src/hotspot/share, test/hotspot/gtest: support of write-xor-execute (W^X), required on macOS/AArch64 platform. It's implemented with pthread_jit_write_protect_np provided by Apple. The W^X mode is local to a thread, so W^X mode change relates to the java thread state change (for java threads). In most cases, JVM executes in write-only mode, except when calling a generated stub like SafeFetch, which requires a temporary switch to execute-only mode. The same execute-only mode is enabled when a java thread executes in java or native states. This approach of managing W^X mode turned out to be simple and efficient enough. > * src/jdk.hotspot.agent: serviceability agent implementation (JDK-8254941) Anton Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 117 commits: - JDK-8261397: bsd_aarch64 part - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos - Merge branch 'master' into jdk-macos - JDK-8262491: bsd_aarch64 part - JDK-8263002: bsd_aarch64 part - Merge remote-tracking branch 'upstream/jdk/master' into jdk-macos - Wider #ifdef block - Fix most of issues in java/foreign/ tests Failures related to va_args are tracked in JDK-8263512. - Add Azul copyright - Update Oracle copyright years - ... and 107 more: https://git.openjdk.java.net/jdk/compare/b006f22f...d3629967 ------------- Changes: https://git.openjdk.java.net/jdk/pull/2200/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=29 Stats: 2960 lines in 75 files changed: 2851 ins; 27 del; 82 mod Patch: https://git.openjdk.java.net/jdk/pull/2200.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2200/head:pull/2200 PR: https://git.openjdk.java.net/jdk/pull/2200 From akozlov at openjdk.java.net Thu Mar 25 18:14:03 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Thu, 25 Mar 2021 18:14:03 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v29] In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 16:33:50 GMT, Andrew Haley wrote: >> Marked as reviewed by luhenry (Author). > >> > > > [ Back-porting this patch to JDK 11] depends on the will of openjdk11 maintainers to accept this (and few other, like jep-388, as we depend on it) contribution. >> > > >> > > >> > > To the extent that 11u has fixed policies :) we definitely have a policy of accepting patches to keep 11u working on current hardware. So yes. >> > >> > >> > @lewurm That sounds like a green flag for you and jep-388 (with its R18_RESERVED functionality) ;) >> >> Thanks, @theRealAph, and @VladimirKempik . We are on it! > > It's going to be tricky to do in a really clean way, given some of the weirdnesses of the ABI. However, I think there's probably a need for it The JEP was targeted to JDK17. So I propose to integrate this. Thank you all for the reviews, suggestions, discussions, and support! ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From prr at openjdk.java.net Thu Mar 25 18:23:25 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 25 Mar 2021 18:23:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt In-Reply-To: References: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> Message-ID: On Thu, 25 Mar 2021 17:54:35 GMT, Severin Gehwolf wrote: > Anyone? I guess I don't understand why this is the right solution. If the symbol -in both cases - is made internal won't that be better ? I can't think why it needs to be exported. Is the AWT one being used by some other client library ? If so may be that other library needs its own. And calling it "jvm" is common so are these the only two ? ------------- PR: https://git.openjdk.java.net/jdk/pull/3155 From kcr at openjdk.java.net Thu Mar 25 20:19:27 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Thu, 25 Mar 2021 20:19:27 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations In-Reply-To: References: Message-ID: <8Vo0sYp5M4FNk6DKP2URAChl60rTHV-MpMsSUQi0-Nk=.c1f6ac22-cc67-4072-8d75-80032979db2f@github.com> On Wed, 10 Mar 2021 18:33:37 GMT, Andy Herrick wrote: > implementation of > JDK-8256145: JEP 398: Deprecate the Applet API for Removal src/java.desktop/share/classes/java/applet/package-info.java line 39: > 37: * applet development environment. > 38: *

> 39: * @deprecated. This package has been deprecated and may be removed in Package declarations cannot have `@deprecated` tags, so `make docs` fails with this change. Also, since there is a tag here, the previous `

` is now empty and causes a warning. Both problems will be fixed by removing the `@deprecated` tag, while leaving the added text. ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From herrick at openjdk.java.net Thu Mar 25 22:58:53 2021 From: herrick at openjdk.java.net (Andy Herrick) Date: Thu, 25 Mar 2021 22:58:53 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations [v2] In-Reply-To: References: Message-ID: <-CtgNrXO36S532ldbcltqkgdva_l7Oaam8rBgC7yBQY=.b56cd831-56f3-4573-8a67-e4b835c677c9@github.com> > implementation of > JDK-8256145: JEP 398: Deprecate the Applet API for Removal Andy Herrick has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 301 additional commits since the last revision: - 8189198: Add "forRemoval = true" to Applet API deprecations - Merge branch 'master' into 8189198 - 8260862: JFR: New configure command for the jfr tool Reviewed-by: mgronlun - 8264161: BigDecimal#stripTrailingZeros can throw undocumented ArithmeticException Reviewed-by: bpb - 8262081: vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001/TestDescription.java failed with "ERROR: eventSet1.size() != 3 :: 2" Reviewed-by: cjplummer, lmesnik, sspitsyn - 8261502: ECDHKeyAgreement: Allows alternate ECPrivateKey impl and revised exception handling Reviewed-by: jnimeh - 8253795: Implementation of JEP 391: macOS/AArch64 Port 8253816: Support macOS W^X 8253817: Support macOS Aarch64 ABI in Interpreter 8253818: Support macOS Aarch64 ABI for compiled wrappers 8253819: Implement os/cpu for macOS/AArch64 8253839: Update tests and JDK code for macOS/Aarch64 8254941: Implement Serviceability Agent for macOS/AArch64 8255776: Change build system for macOS/AArch64 8262903: [macos_aarch64] Thread::current() called on detached thread Co-authored-by: Vladimir Kempik Co-authored-by: Bernhard Urban-Forster Co-authored-by: Ludovic Henry Co-authored-by: Monica Beckwith Reviewed-by: erikj, ihse, prr, cjplummer, stefank, gziemski, aph, mbeckwit, luhenry - 4833719: (bf) Views of MappedByteBuffers are not MappedByteBuffers, and cannot be forced Reviewed-by: adinn - 8264165: jpackage BasicTest fails after JDK-8220266: Check help text contains plaform specific parameters Reviewed-by: herrick, dcubed - 8263454: com.apple.laf.AquaFileChooserUI ignores the result of String.trim() Reviewed-by: serb, pbansal, kizune, trebari, psadhukhan - ... and 291 more: https://git.openjdk.java.net/jdk/compare/ddfe8ec5...026f09c8 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2920/files - new: https://git.openjdk.java.net/jdk/pull/2920/files/1148f208..026f09c8 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2920&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2920&range=00-01 Stats: 64315 lines in 2948 files changed: 41333 ins; 13022 del; 9960 mod Patch: https://git.openjdk.java.net/jdk/pull/2920.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2920/head:pull/2920 PR: https://git.openjdk.java.net/jdk/pull/2920 From herrick at openjdk.java.net Thu Mar 25 22:58:53 2021 From: herrick at openjdk.java.net (Andy Herrick) Date: Thu, 25 Mar 2021 22:58:53 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations [v2] In-Reply-To: References: Message-ID: On Wed, 17 Mar 2021 20:33:09 GMT, Andy Herrick wrote: >>> I cannot find any instances where the scope can be narrowed >> >> Are you about AquaInternalFrameUI.mouseRelased, BasicPopupMenuUI. stateChanged, and other non-trivial methods? > >> >> >> > I cannot find any instances where the scope can be narrowed >> >> Are you about AquaInternalFrameUI.mouseRelased, BasicPopupMenuUI. stateChanged, and other non-trivial methods? > > These have the code pattern such as: > } else if (c instanceof JApplet) { > putting '@SuppressWarnings("removal")' before the declaration of 'c' does not help, because the code is not an assignment to 'c' pushed minor change to src/java.desktop/share/classes/java/applet/package-info.java as well as merge with master. ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From kcr at openjdk.java.net Thu Mar 25 23:27:37 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Thu, 25 Mar 2021 23:27:37 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations [v2] In-Reply-To: <-CtgNrXO36S532ldbcltqkgdva_l7Oaam8rBgC7yBQY=.b56cd831-56f3-4573-8a67-e4b835c677c9@github.com> References: <-CtgNrXO36S532ldbcltqkgdva_l7Oaam8rBgC7yBQY=.b56cd831-56f3-4573-8a67-e4b835c677c9@github.com> Message-ID: On Thu, 25 Mar 2021 22:58:53 GMT, Andy Herrick wrote: >> implementation of >> JDK-8256145: JEP 398: Deprecate the Applet API for Removal > > Andy Herrick has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 301 additional commits since the last revision: > > - 8189198: Add "forRemoval = true" to Applet API deprecations > - Merge branch 'master' into 8189198 > - 8260862: JFR: New configure command for the jfr tool > > Reviewed-by: mgronlun > - 8264161: BigDecimal#stripTrailingZeros can throw undocumented ArithmeticException > > Reviewed-by: bpb > - 8262081: vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001/TestDescription.java failed with "ERROR: eventSet1.size() != 3 :: 2" > > Reviewed-by: cjplummer, lmesnik, sspitsyn > - 8261502: ECDHKeyAgreement: Allows alternate ECPrivateKey impl and revised exception handling > > Reviewed-by: jnimeh > - 8253795: Implementation of JEP 391: macOS/AArch64 Port > 8253816: Support macOS W^X > 8253817: Support macOS Aarch64 ABI in Interpreter > 8253818: Support macOS Aarch64 ABI for compiled wrappers > 8253819: Implement os/cpu for macOS/AArch64 > 8253839: Update tests and JDK code for macOS/Aarch64 > 8254941: Implement Serviceability Agent for macOS/AArch64 > 8255776: Change build system for macOS/AArch64 > 8262903: [macos_aarch64] Thread::current() called on detached thread > > Co-authored-by: Vladimir Kempik > Co-authored-by: Bernhard Urban-Forster > Co-authored-by: Ludovic Henry > Co-authored-by: Monica Beckwith > Reviewed-by: erikj, ihse, prr, cjplummer, stefank, gziemski, aph, mbeckwit, luhenry > - 4833719: (bf) Views of MappedByteBuffers are not MappedByteBuffers, and cannot be forced > > Reviewed-by: adinn > - 8264165: jpackage BasicTest fails after JDK-8220266: Check help text contains plaform specific parameters > > Reviewed-by: herrick, dcubed > - 8263454: com.apple.laf.AquaFileChooserUI ignores the result of String.trim() > > Reviewed-by: serb, pbansal, kizune, trebari, psadhukhan > - ... and 291 more: https://git.openjdk.java.net/jdk/compare/e2285595...026f09c8 Looks good. ------------- Marked as reviewed by kcr (Author). PR: https://git.openjdk.java.net/jdk/pull/2920 From iris at openjdk.java.net Thu Mar 25 23:38:33 2021 From: iris at openjdk.java.net (Iris Clark) Date: Thu, 25 Mar 2021 23:38:33 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations [v2] In-Reply-To: <-CtgNrXO36S532ldbcltqkgdva_l7Oaam8rBgC7yBQY=.b56cd831-56f3-4573-8a67-e4b835c677c9@github.com> References: <-CtgNrXO36S532ldbcltqkgdva_l7Oaam8rBgC7yBQY=.b56cd831-56f3-4573-8a67-e4b835c677c9@github.com> Message-ID: On Thu, 25 Mar 2021 22:58:53 GMT, Andy Herrick wrote: >> implementation of >> JDK-8256145: JEP 398: Deprecate the Applet API for Removal > > Andy Herrick has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 301 additional commits since the last revision: > > - 8189198: Add "forRemoval = true" to Applet API deprecations > - Merge branch 'master' into 8189198 > - 8260862: JFR: New configure command for the jfr tool > > Reviewed-by: mgronlun > - 8264161: BigDecimal#stripTrailingZeros can throw undocumented ArithmeticException > > Reviewed-by: bpb > - 8262081: vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001/TestDescription.java failed with "ERROR: eventSet1.size() != 3 :: 2" > > Reviewed-by: cjplummer, lmesnik, sspitsyn > - 8261502: ECDHKeyAgreement: Allows alternate ECPrivateKey impl and revised exception handling > > Reviewed-by: jnimeh > - 8253795: Implementation of JEP 391: macOS/AArch64 Port > 8253816: Support macOS W^X > 8253817: Support macOS Aarch64 ABI in Interpreter > 8253818: Support macOS Aarch64 ABI for compiled wrappers > 8253819: Implement os/cpu for macOS/AArch64 > 8253839: Update tests and JDK code for macOS/Aarch64 > 8254941: Implement Serviceability Agent for macOS/AArch64 > 8255776: Change build system for macOS/AArch64 > 8262903: [macos_aarch64] Thread::current() called on detached thread > > Co-authored-by: Vladimir Kempik > Co-authored-by: Bernhard Urban-Forster > Co-authored-by: Ludovic Henry > Co-authored-by: Monica Beckwith > Reviewed-by: erikj, ihse, prr, cjplummer, stefank, gziemski, aph, mbeckwit, luhenry > - 4833719: (bf) Views of MappedByteBuffers are not MappedByteBuffers, and cannot be forced > > Reviewed-by: adinn > - 8264165: jpackage BasicTest fails after JDK-8220266: Check help text contains plaform specific parameters > > Reviewed-by: herrick, dcubed > - 8263454: com.apple.laf.AquaFileChooserUI ignores the result of String.trim() > > Reviewed-by: serb, pbansal, kizune, trebari, psadhukhan > - ... and 291 more: https://git.openjdk.java.net/jdk/compare/8fcfe0bd...026f09c8 Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From prr at openjdk.java.net Thu Mar 25 23:51:33 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 25 Mar 2021 23:51:33 GMT Subject: [OpenJDK 2D-Dev] RFR: 8189198: Add "forRemoval = true" to Applet API deprecations [v2] In-Reply-To: <-CtgNrXO36S532ldbcltqkgdva_l7Oaam8rBgC7yBQY=.b56cd831-56f3-4573-8a67-e4b835c677c9@github.com> References: <-CtgNrXO36S532ldbcltqkgdva_l7Oaam8rBgC7yBQY=.b56cd831-56f3-4573-8a67-e4b835c677c9@github.com> Message-ID: On Thu, 25 Mar 2021 22:58:53 GMT, Andy Herrick wrote: >> implementation of >> JDK-8256145: JEP 398: Deprecate the Applet API for Removal > > Andy Herrick has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 301 additional commits since the last revision: > > - 8189198: Add "forRemoval = true" to Applet API deprecations > - Merge branch 'master' into 8189198 > - 8260862: JFR: New configure command for the jfr tool > > Reviewed-by: mgronlun > - 8264161: BigDecimal#stripTrailingZeros can throw undocumented ArithmeticException > > Reviewed-by: bpb > - 8262081: vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001/TestDescription.java failed with "ERROR: eventSet1.size() != 3 :: 2" > > Reviewed-by: cjplummer, lmesnik, sspitsyn > - 8261502: ECDHKeyAgreement: Allows alternate ECPrivateKey impl and revised exception handling > > Reviewed-by: jnimeh > - 8253795: Implementation of JEP 391: macOS/AArch64 Port > 8253816: Support macOS W^X > 8253817: Support macOS Aarch64 ABI in Interpreter > 8253818: Support macOS Aarch64 ABI for compiled wrappers > 8253819: Implement os/cpu for macOS/AArch64 > 8253839: Update tests and JDK code for macOS/Aarch64 > 8254941: Implement Serviceability Agent for macOS/AArch64 > 8255776: Change build system for macOS/AArch64 > 8262903: [macos_aarch64] Thread::current() called on detached thread > > Co-authored-by: Vladimir Kempik > Co-authored-by: Bernhard Urban-Forster > Co-authored-by: Ludovic Henry > Co-authored-by: Monica Beckwith > Reviewed-by: erikj, ihse, prr, cjplummer, stefank, gziemski, aph, mbeckwit, luhenry > - 4833719: (bf) Views of MappedByteBuffers are not MappedByteBuffers, and cannot be forced > > Reviewed-by: adinn > - 8264165: jpackage BasicTest fails after JDK-8220266: Check help text contains plaform specific parameters > > Reviewed-by: herrick, dcubed > - 8263454: com.apple.laf.AquaFileChooserUI ignores the result of String.trim() > > Reviewed-by: serb, pbansal, kizune, trebari, psadhukhan > - ... and 291 more: https://git.openjdk.java.net/jdk/compare/00b7b36f...026f09c8 Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From sgehwolf at openjdk.java.net Fri Mar 26 10:07:26 2021 From: sgehwolf at openjdk.java.net (Severin Gehwolf) Date: Fri, 26 Mar 2021 10:07:26 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt In-Reply-To: References: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> Message-ID: <63cmJkj__FGjLXAILexJtIJ5SjOsFbOX1AXMnvmng0g=.f1ee24f8-41cc-451a-ac62-1f18f752af1f@github.com> On Thu, 25 Mar 2021 18:20:36 GMT, Phil Race wrote: > > Anyone? > > I guess I don't understand why this is the right solution. Thanks for the feedback. I'm open to other approaches. I'm by no means an expert in this area, so you probably know better what the best solution would be. > If the symbol -in both cases - is made internal won't that be better ? I can't think why it needs to be exported. I don't know if that'll help the static linking case, I'll give it a try. > Is the AWT one being used by some other client library ? If so may be that other library needs its own. I don't think it is. `libawt.so` and `libjavajpeg.so` have each their own. The problem starts when static libraries of them `libawt.a` and `libjavajpeg.a` get linked into one executable. Then we end up with a name clash on the `jvm` symbol. See the bug for some details. > And calling it "jvm" is common so are these the only two ? Apparently so. At least no other conflicts were noticed when the following client libraries are in the mix: libjavajpeg.a liblcms.a libfontmanager.a libawt_headless.a libawt.a libharfbuzz.a ------------- PR: https://git.openjdk.java.net/jdk/pull/3155 From prr at openjdk.java.net Fri Mar 26 14:51:26 2021 From: prr at openjdk.java.net (Phil Race) Date: Fri, 26 Mar 2021 14:51:26 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt In-Reply-To: <63cmJkj__FGjLXAILexJtIJ5SjOsFbOX1AXMnvmng0g=.f1ee24f8-41cc-451a-ac62-1f18f752af1f@github.com> References: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> <63cmJkj__FGjLXAILexJtIJ5SjOsFbOX1AXMnvmng0g=.f1ee24f8-41cc-451a-ac62-1f18f752af1f@github.com> Message-ID: On Fri, 26 Mar 2021 10:04:07 GMT, Severin Gehwolf wrote: >>> Anyone? >> >> I guess I don't understand why this is the right solution. >> If the symbol -in both cases - is made internal won't that be better ? I can't think why it needs to be exported. >> Is the AWT one being used by some other client library ? If so may be that other library needs its own. >> And calling it "jvm" is common so are these the only two ? > >> > Anyone? >> >> I guess I don't understand why this is the right solution. > > Thanks for the feedback. I'm open to other approaches. I'm by no means an expert in this area, so you probably know better what the best solution would be. > >> If the symbol -in both cases - is made internal won't that be better ? I can't think why it needs to be exported. > > I don't know if that'll help the static linking case, I'll give it a try. > >> Is the AWT one being used by some other client library ? If so may be that other library needs its own. > > I don't think it is. `libawt.so` and `libjavajpeg.so` have each their own. The problem starts when static libraries of them `libawt.a` and `libjavajpeg.a` get linked into one executable. Then we end up with a name clash on the `jvm` symbol. See the bug for some details. > >> And calling it "jvm" is common so are these the only two ? > > Apparently so. At least no other conflicts were noticed when the following client libraries are in the mix: > > libjavajpeg.a > liblcms.a > libfontmanager.a > libawt_headless.a > libawt.a > libharfbuzz.a The list of libraries doesn't seem to include xawt. Although I'd be astonished if it defined one since it links with awt. But it also suggests you are only looking at one platform and perhaps that is because the problem is very specific to your toolchain ? Actually why are you seeing it now and it has not been a problem before ? ------------- PR: https://git.openjdk.java.net/jdk/pull/3155 From herrick at openjdk.java.net Fri Mar 26 14:51:28 2021 From: herrick at openjdk.java.net (Andy Herrick) Date: Fri, 26 Mar 2021 14:51:28 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8189198: Add "forRemoval = true" to Applet API deprecations In-Reply-To: References: Message-ID: <4WWT8Ziy2C8n3V8-SQqJ_SNHpYlyB1uO26I-Szzm29c=.d2041dca-362a-4285-a961-7f71635df559@github.com> On Wed, 10 Mar 2021 18:33:37 GMT, Andy Herrick wrote: > implementation of > JDK-8256145: JEP 398: Deprecate the Applet API for Removal This pull request has now been integrated. Changeset: 57115fa2 Author: Andy Herrick URL: https://git.openjdk.java.net/jdk/commit/57115fa2 Stats: 73 lines in 22 files changed: 14 ins; 0 del; 59 mod 8189198: Add "forRemoval = true" to Applet API deprecations Reviewed-by: iris, almatvee, kcr, prr ------------- PR: https://git.openjdk.java.net/jdk/pull/2920 From sgehwolf at openjdk.java.net Fri Mar 26 15:02:25 2021 From: sgehwolf at openjdk.java.net (Severin Gehwolf) Date: Fri, 26 Mar 2021 15:02:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt In-Reply-To: References: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> <63cmJkj__FGjLXAILexJtIJ5SjOsFbOX1AXMnvmng0g=.f1ee24f8-41cc-451a-ac62-1f18f752af1f@github.com> Message-ID: <75CbTnQk86-Fp0xcJ86QSa7l6eQCjMXBA_e8oxmLn78=.19a8dff9-f2a5-4933-a116-cc13b7a9b9b0@github.com> On Fri, 26 Mar 2021 14:49:02 GMT, Phil Race wrote: > The list of libraries doesn't seem to include xawt. Yes. This is in context of Graal VM's native images. AFAIK there is no full xawt support yet. This is about the conflict of libawt and libjavajpeg. There are probably more. > But it also suggests you are only looking at one platform and perhaps that is because the problem is very specific > to your toolchain ? Actually why are you seeing it now and it has not been a problem before ? Yes. This is on Linux x86_64 and with an OpenJDK built with GCC 10+. With gcc 10+ `-fno-common` is default: https://gcc.gnu.org/gcc-10/porting_to.html So the `libjavajpeg.a`, and `libawt.a` got compiled with `-fno-common`. Then when being linked into an executable together, the linker screams with this: collect2: error: ld returned 1 exit status ------------- PR: https://git.openjdk.java.net/jdk/pull/3155 From prr at openjdk.java.net Fri Mar 26 19:58:34 2021 From: prr at openjdk.java.net (Phil Race) Date: Fri, 26 Mar 2021 19:58:34 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255800: Raster creation methods need some specification clean up Message-ID: https://bugs.openjdk.java.net/browse/JDK-8255800 could have been a one line spec clean up but it didn't take a lot of looking to realize there were many more inconsistencies between spec and implementation. I've spent a lot of time on what is just small number of factory methods in Raster because there are so many possible exceptions and in some cases they rely on other API they call to generate exceptions and these may have not been documented or documented acc. to some long lost behavior. I've mostly tried to ONLY change spec. But I couldn't help myself when some checks were missed that ended up with bizarre and dubious behavior - throwing NegativeArrayIndexException which just about always has to be an internal bug ! The supplied test passes on JDK 16 as well as this code, because the (relatively) small number of cases where JDK 16 threw NegativeArrayIndexException are caught and allowed only for releases < 17 So where you see those in the test it corresponds to the behavioral changes from NegativeArrayIndexException to IllegalArgumentException. JCK conformance tests still pass so they must not test those conditions. ------------- Commit messages: - 8255800: Raster creation methods need some specification clean up Changes: https://git.openjdk.java.net/jdk/pull/3223/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3223&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8255800 Stats: 1469 lines in 5 files changed: 1399 ins; 35 del; 35 mod Patch: https://git.openjdk.java.net/jdk/pull/3223.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3223/head:pull/3223 PR: https://git.openjdk.java.net/jdk/pull/3223 From prr at openjdk.java.net Fri Mar 26 20:18:25 2021 From: prr at openjdk.java.net (Phil Race) Date: Fri, 26 Mar 2021 20:18:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255800: Raster creation methods need some specification clean up In-Reply-To: References: Message-ID: On Fri, 26 Mar 2021 19:53:44 GMT, Phil Race wrote: > https://bugs.openjdk.java.net/browse/JDK-8255800 could have been a one line spec clean up but > it didn't take a lot of looking to realize there were many more inconsistencies between spec and implementation. > I've spent a lot of time on what is just small number of factory methods in Raster because there are so > many possible exceptions and in some cases they rely on other API they call to generate exceptions and > these may have not been documented or documented acc. to some long lost behavior. > I've mostly tried to ONLY change spec. But I couldn't help myself when some checks were missed that > ended up with bizarre and dubious behavior - throwing NegativeArrayIndexException which just about > always has to be an internal bug ! > > The supplied test passes on JDK 16 as well as this code, because the (relatively) small number of > cases where JDK 16 threw NegativeArrayIndexException are caught and allowed only for releases < 17 > So where you see those in the test it corresponds to the behavioral changes from NegativeArrayIndexException > to IllegalArgumentException. > JCK conformance tests still pass so they must not test those conditions. oh and yes I know this requires a CSR ! But I want to do the code review first and then submit a CSR based on the approved version. ------------- PR: https://git.openjdk.java.net/jdk/pull/3223 From serb at openjdk.java.net Fri Mar 26 20:51:26 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 26 Mar 2021 20:51:26 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255800: Raster creation methods need some specification clean up In-Reply-To: References: Message-ID: <-0wFDhzgacQic6ii8fKr9N3HLDcQi5AjF-sNNznUGxg=.dabe42bd-2f95-4f12-be90-2a4a35be3234@github.com> On Fri, 26 Mar 2021 19:53:44 GMT, Phil Race wrote: > https://bugs.openjdk.java.net/browse/JDK-8255800 could have been a one line spec clean up but > it didn't take a lot of looking to realize there were many more inconsistencies between spec and implementation. > I've spent a lot of time on what is just small number of factory methods in Raster because there are so > many possible exceptions and in some cases they rely on other API they call to generate exceptions and > these may have not been documented or documented acc. to some long lost behavior. > I've mostly tried to ONLY change spec. But I couldn't help myself when some checks were missed that > ended up with bizarre and dubious behavior - throwing NegativeArrayIndexException which just about > always has to be an internal bug ! > > The supplied test passes on JDK 16 as well as this code, because the (relatively) small number of > cases where JDK 16 threw NegativeArrayIndexException are caught and allowed only for releases < 17 > So where you see those in the test it corresponds to the behavioral changes from NegativeArrayIndexException > to IllegalArgumentException. > JCK conformance tests still pass so they must not test those conditions. src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java line 127: > 125: * @throws IllegalArgumentException if {@code pixelStride} is less than 0 > 126: * @throws IllegalArgumentException if {@code scanlineStride} is less than 0 > 127: * @throws NullPointerException if {@code bandOffsets} is {@code null} I like the NPE here, but probably it makes sense to use the same exception for all errors? "IllegalArgumentException " ------------- PR: https://git.openjdk.java.net/jdk/pull/3223 From serb at openjdk.java.net Fri Mar 26 20:53:25 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 26 Mar 2021 20:53:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers In-Reply-To: References: Message-ID: On Tue, 23 Mar 2021 13:45:33 GMT, Alexey Ivanov wrote: > When `getAllPrinterNames()` returns null, the list of `printServices` is assigned a new empty array without invalidating old services which were in the array before. > > The old print services should be invalidated. Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3151 From prr at openjdk.java.net Fri Mar 26 22:48:25 2021 From: prr at openjdk.java.net (Phil Race) Date: Fri, 26 Mar 2021 22:48:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255800: Raster creation methods need some specification clean up In-Reply-To: <-0wFDhzgacQic6ii8fKr9N3HLDcQi5AjF-sNNznUGxg=.dabe42bd-2f95-4f12-be90-2a4a35be3234@github.com> References: <-0wFDhzgacQic6ii8fKr9N3HLDcQi5AjF-sNNznUGxg=.dabe42bd-2f95-4f12-be90-2a4a35be3234@github.com> Message-ID: On Fri, 26 Mar 2021 20:48:19 GMT, Sergey Bylokhov wrote: >> https://bugs.openjdk.java.net/browse/JDK-8255800 could have been a one line spec clean up but >> it didn't take a lot of looking to realize there were many more inconsistencies between spec and implementation. >> I've spent a lot of time on what is just small number of factory methods in Raster because there are so >> many possible exceptions and in some cases they rely on other API they call to generate exceptions and >> these may have not been documented or documented acc. to some long lost behavior. >> I've mostly tried to ONLY change spec. But I couldn't help myself when some checks were missed that >> ended up with bizarre and dubious behavior - throwing NegativeArrayIndexException which just about >> always has to be an internal bug ! >> >> The supplied test passes on JDK 16 as well as this code, because the (relatively) small number of >> cases where JDK 16 threw NegativeArrayIndexException are caught and allowed only for releases < 17 >> So where you see those in the test it corresponds to the behavioral changes from NegativeArrayIndexException >> to IllegalArgumentException. >> JCK conformance tests still pass so they must not test those conditions. > > src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java line 127: > >> 125: * @throws IllegalArgumentException if {@code pixelStride} is less than 0 >> 126: * @throws IllegalArgumentException if {@code scanlineStride} is less than 0 >> 127: * @throws NullPointerException if {@code bandOffsets} is {@code null} > > I like the NPE here, but probably it makes sense to use the same exception for all errors? "IllegalArgumentException " Meaning even though you like the NPE you would change it to IAE like the rest ? ------------- PR: https://git.openjdk.java.net/jdk/pull/3223 From serb at openjdk.java.net Sat Mar 27 01:00:28 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 27 Mar 2021 01:00:28 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt In-Reply-To: <75CbTnQk86-Fp0xcJ86QSa7l6eQCjMXBA_e8oxmLn78=.19a8dff9-f2a5-4933-a116-cc13b7a9b9b0@github.com> References: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> <63cmJkj__FGjLXAILexJtIJ5SjOsFbOX1AXMnvmng0g=.f1ee24f8-41cc-451a-ac62-1f18f752af1f@github.com> <75CbTnQk86-Fp0xcJ86QSa7l6eQCjMXBA_e8oxmLn78=.19a8dff9-f2a5-4933-a116-cc13b7a9b9b0@github.com> Message-ID: On Fri, 26 Mar 2021 14:59:14 GMT, Severin Gehwolf wrote: >> The list of libraries doesn't seem to include xawt. Although I'd be astonished if it defined one since it links with awt. >> But it also suggests you are only looking at one platform and perhaps that is because the problem is very specific >> to your toolchain ? Actually why are you seeing it now and it has not been a problem before ? > >> The list of libraries doesn't seem to include xawt. > > Yes. This is in context of Graal VM's native images. AFAIK there is no full xawt support yet. This is about the conflict of libawt and libjavajpeg. There are probably more. > >> But it also suggests you are only looking at one platform and perhaps that is because the problem is very specific >> to your toolchain ? Actually why are you seeing it now and it has not been a problem before ? > > Yes. This is on Linux x86_64 and with an OpenJDK built with GCC 10+. With gcc 10+ `-fno-common` is default: > https://gcc.gnu.org/gcc-10/porting_to.html > > So the `libjavajpeg.a`, and `libawt.a` got compiled with `-fno-common`. Then when being linked into an executable together, the linker screams with this: > > > collect2: error: ld returned 1 exit status Probably it will be easy to remove this "jvm" variable in the jpeg library? Looks like it is used to call JNU_GetEnv, but the JNIEnv could be accessed from the first parameter of the jni method. ------------- PR: https://git.openjdk.java.net/jdk/pull/3155 From serb at openjdk.java.net Sat Mar 27 01:12:26 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 27 Mar 2021 01:12:26 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt In-Reply-To: References: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> <63cmJkj__FGjLXAILexJtIJ5SjOsFbOX1AXMnvmng0g=.f1ee24f8-41cc-451a-ac62-1f18f752af1f@github.com> <75CbTnQk86-Fp0xcJ86QSa7l6eQCjMXBA_e8oxmLn78=.19a8dff9-f2a5-4933-a116-cc13b7a9b9b0@github.com> Message-ID: On Sat, 27 Mar 2021 00:57:34 GMT, Sergey Bylokhov wrote: > Probably it will be easy to remove this "jvm" variable in the jpeg library? Looks like it is used to call JNU_GetEnv, but the JNIEnv could be accessed from the first parameter of the jni method. Seems these methods are used as callbacks... ------------- PR: https://git.openjdk.java.net/jdk/pull/3155 From sgehwolf at openjdk.java.net Mon Mar 29 13:53:25 2021 From: sgehwolf at openjdk.java.net (Severin Gehwolf) Date: Mon, 29 Mar 2021 13:53:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt In-Reply-To: References: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> <63cmJkj__FGjLXAILexJtIJ5SjOsFbOX1AXMnvmng0g=.f1ee24f8-41cc-451a-ac62-1f18f752af1f@github.com> <75CbTnQk86-Fp0xcJ86QSa7l6eQCjMXBA_e8oxmLn78=.19a8dff9-f2a5-4933-a116-cc13b7a9b9b0@github.com> Message-ID: On Sat, 27 Mar 2021 01:09:40 GMT, Sergey Bylokhov wrote: >> Probably it will be easy to remove this "jvm" variable in the jpeg library? Looks like it is used to call JNU_GetEnv, but the JNIEnv could be accessed from the first parameter of the jni method. > >> Probably it will be easy to remove this "jvm" variable in the jpeg library? Looks like it is used to call JNU_GetEnv, but the JNIEnv could be accessed from the first parameter of the jni method. > > Seems these methods are used as callbacks... So what's the verdict with this one? OK to rename the variable or go a different route? ------------- PR: https://git.openjdk.java.net/jdk/pull/3155 From philip.race at oracle.com Mon Mar 29 16:41:51 2021 From: philip.race at oracle.com (Philip Race) Date: Mon, 29 Mar 2021 09:41:51 -0700 Subject: [OpenJDK 2D-Dev] libfontmanager.so: undefined symbol: hb_font_destroy in openjdk17~14 In-Reply-To: References: Message-ID: <2548be46-db99-8242-c04c-ac98a939a6f0@oracle.com> Moving this to the right list. There's lots of missing information in your email. 1) I don't know what a debian sid is. Internet suggests it is some upstream dev version Is this reproducible on any shipping distro ? 2) Where exactly did you get the openjdk build 17 ? Was it from https://jdk.java.net/17/ or somewhere else ? Please show the output of "java -version" to help confirm it. 3) What does? "ls -l lib/libfontmanager.so" show ? 4) What was the JDK version you had immediately before this and where did you get that ? 5) Does either JDK 11u or JDK15u work in this respect on that system ? -phil On 3/19/21 6:03 AM, mc36 wrote: > hi, > just upgraded from openjdk17~11 to openjdk17~14 > (https://packages.debian.org/sid/main/openjdk-17-jdk) on my debian > sid. i quickly noticed that something is wrong so i ended up with the > below sample app. > i'm not a big c coder so all i was able to do is that i got the > libharfbuzz sources > (https://packages.debian.org/unstable/libharfbuzz-dev) and checked > that i have that version and the function is there. > i would appreciate some idea what else should i try? > thanks, > csaba > > > mc36 at noti:~$ cat a.java > > import java.awt.Graphics2D; > import java.awt.image.BufferedImage; > > public class a { > > ??? public static void main(String[] args) throws Exception { > ??????? BufferedImage img = new BufferedImage(100, 100, > BufferedImage.TYPE_INT_RGB); > ??????? Graphics2D g2d = img.createGraphics(); > ??? } > > } > > > mc36 at noti:~$ javac a.java > mc36 at noti:~$ java a > Exception in thread "main" java.lang.UnsatisfiedLinkError: > /usr/lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so: > /usr/lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so: undefined > symbol: hb_font_destroy > ??????? at java.base/jdk.internal.loader.NativeLibraries.load(Native > Method) > ??????? at > java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383) > ??????? at > java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227) > ??????? at > java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169) > ??????? at > java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:310) > ??????? at > java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:280) > ??????? at > java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2392) > ??????? at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:808) > ??????? at java.base/java.lang.System.loadLibrary(System.java:1893) > ??????? at > java.desktop/sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:57) > ??????? at > java.base/java.security.AccessController.doPrivileged(AccessController.java:312) > ??????? at > java.desktop/sun.font.FontManagerNativeLibrary.(FontManagerNativeLibrary.java:32) > ??????? at > java.desktop/sun.java2d.xr.XRSurfaceData.initXRSurfaceData(XRSurfaceData.java:104) > ??????? at > java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:122) > ??????? at > java.base/java.security.AccessController.doPrivileged(AccessController.java:312) > ??????? at > java.desktop/sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:59) > ??????? at > java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:36) > ??????? at > java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:93) > ??????? at > java.desktop/java.awt.GraphicsEnvironment$LocalGE.(GraphicsEnvironment.java:84) > ??????? at > java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:106) > ??????? at > java.desktop/java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1181) > ??????? at a.main(a.java:9) > mc36 at noti:~$ From serb at openjdk.java.net Mon Mar 29 23:02:08 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 29 Mar 2021 23:02:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8012229: [lcms] Improve performance of color conversion for images with alpha channel Message-ID: The lcms 2.8 version added support for the cmsFLAGS_COPY_ALPHA flag: https://sourceforge.net/p/lcms/mailman/lcms-user/thread/001c01d1c0f3%2484a7cb30%248df76190%24%40ProDigitalSoftware.com/#msg35143398 which supports alpha channel transportation For our usage, it means we can use TYPE_4BYTE_ABGR and TYPE_INT_ARGB directly as a source and destination. Some numbers; converting new BufferedImage(3000, 3000, TYPE_INT_ARGB) from CS_sRGB to CS_CIEXYZ via op.filter(src, dst): //before the fix //Benchmark Mode Cnt Score Error Units //ColorAlphaConv.testFilter avgt 5 603,392 ? 12,932 ms/op //after the fix //Benchmark Mode Cnt Score Error Units //ColorAlphaConv.testFilter avgt 5 121,624 ? 0,906 ms/op But still slower than kcms //kcms jdk8u60 //Benchmark Mode Cnt Score Error Units //ColorAlphaConv.testFilter avgt 5 13,256 ? 0,169 ms/op ------------- Commit messages: - Initial fix Changes: https://git.openjdk.java.net/jdk/pull/3239/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3239&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8012229 Stats: 208 lines in 5 files changed: 195 ins; 2 del; 11 mod Patch: https://git.openjdk.java.net/jdk/pull/3239.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3239/head:pull/3239 PR: https://git.openjdk.java.net/jdk/pull/3239 From serb at openjdk.java.net Mon Mar 29 23:02:11 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 29 Mar 2021 23:02:11 GMT Subject: [OpenJDK 2D-Dev] RFR: 8012229: [lcms] Improve performance of color conversion for images with alpha channel In-Reply-To: References: Message-ID: <4XScAxbcJqyPi5VNPBWGGZD1a4APCqr623AEHzS8I6w=.88574969-840c-4c9d-80ce-1e0312807bc9@github.com> On Mon, 29 Mar 2021 07:36:35 GMT, Sergey Bylokhov wrote: > The lcms 2.8 version added support for the cmsFLAGS_COPY_ALPHA flag: > https://sourceforge.net/p/lcms/mailman/lcms-user/thread/001c01d1c0f3%2484a7cb30%248df76190%24%40ProDigitalSoftware.com/#msg35143398 > > which supports alpha channel transportation > > For our usage, it means we can use TYPE_4BYTE_ABGR and TYPE_INT_ARGB directly as a source and destination. > > Some numbers; converting new BufferedImage(3000, 3000, TYPE_INT_ARGB) from CS_sRGB to CS_CIEXYZ via op.filter(src, dst): > //before the fix > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 603,392 ? 12,932 ms/op > > //after the fix > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 121,624 ? 0,906 ms/op > > But still slower than kcms > //kcms jdk8u60 > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 13,256 ? 0,169 ms/op src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java line 167: > 165: return dst.getColorModel().hasAlpha() == src.getColorModel().hasAlpha(); > 166: } > 167: Thoughts about the method above: - I have left the first check as-is, so for any opaque destinations we will pass data to the lcms directly, but I am not sure that this is correct for source/destination with premultiplied alpha. - Since I am not sure about premultiplied alpha I have excluded it for the current fix if the destination has an alpha channel. src/java.desktop/share/native/liblcms/LCMS.c line 193: > 191: > 192: sTrans = cmsCreateMultiprofileTransform(iccArray, j, > 193: inFormatter, outFormatter, renderType, cmsFLAGS_COPY_ALPHA); Does not affect performance if the image does not have alpha. test/jdk/sun/java2d/cmm/ColorConvertOp/ColCvtAlphaDifferentSrcDst.java line 73: > 71: //opaqueDst(TYPE_INT_ARGB_PRE, TYPE_4BYTE_ABGR_PRE); > 72: //opaqueDst(TYPE_4BYTE_ABGR_PRE, TYPE_INT_BGR); > 73: } Actually, according to the spec, we should transform pre-alpha to alpha -> then apply ICC transform -> then transform pre-alpha-> alpha. See class description of the: https://docs.oracle.com/javase/7/docs/api/java/awt/image/ColorConvertOp.html But it looks like implementation does something different. ------------- PR: https://git.openjdk.java.net/jdk/pull/3239 From philip.race at oracle.com Tue Mar 30 05:33:36 2021 From: philip.race at oracle.com (Philip Race) Date: Mon, 29 Mar 2021 22:33:36 -0700 Subject: [OpenJDK 2D-Dev] libfontmanager.so: undefined symbol: hb_font_destroy in openjdk17~14 In-Reply-To: References: <2548be46-db99-8242-c04c-ac98a939a6f0@oracle.com> Message-ID: <0cca5a02-5dbb-4c2a-4720-945a64e06088@oracle.com> On 3/29/21 8:14 PM, mc36 wrote: > hi, > please dont! i got ~15 and the issue is gone! please don't do what ? > (but answering line by line, who knows) > thanks, > cs Ok. So it looks like you are using some debian build of openjdk and it seems likely it can't find the system libharfbuzz.so since that symbol is very basic. If you use the one from https://jdk.java.net/17/ I expect it will work since it does what the JDK 15 does that I suggested. I can't tell what the JDK 16 you have does since I'd need to see an ls -l of your /lib/jvm/java-16-openjdk-amd64/lib/libfontmanager.so -phil. > > > On 3/29/21 6:41 PM, Philip Race wrote: >> Moving this to the right list. >> >> There's lots of missing information in your email. >> >> 1) I don't know what a debian sid is. Internet suggests it is some >> upstream dev version >> Is this reproducible on any shipping distro ? > yesss, it is. https://www.debian.org/ > the only difference that you replace stable to > unstable/sid/experimental,depending how brave you're.... :) > >> >> 2) Where exactly did you get the openjdk build 17 ? Was it from >> https://jdk.java.net/17/ or somewhere else ? >> Please show the output of "java -version" to help confirm it. > > sudo apt install openjdk-17-jre -- to get the latest build of them.... > at the moment i see the following version: > > mc36 at noti:~$ java -version > openjdk version "17-ea" 2021-09-14 > OpenJDK Runtime Environment (build 17-ea+15-Debian-1) > OpenJDK 64-Bit Server VM (build 17-ea+15-Debian-1, mixed mode, sharing) > mc36 at noti:~$ > >> >> 3) What does?? "ls -l lib/libfontmanager.so" show ? > > mc36 at noti:~$ find /lib/ -name libfontmanager.so > /lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libfontmanager.so > /lib/jvm/java-15-openjdk-amd64/lib/libfontmanager.so > /lib/jvm/java-16-openjdk-amd64/lib/libfontmanager.so > /lib/jvm/java-13-openjdk-amd64/lib/libfontmanager.so > /lib/jvm/java-11-openjdk-amd64/lib/libfontmanager.so > /lib/jvm/java-14-openjdk-amd64/lib/libfontmanager.so > /lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so > mc36 at noti:~$ ls -lsa /lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so > 56 -rw-r--r-- 1 root root 55960 Mar 25 10:31 > /lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so > mc36 at noti:~$ > > >> 4) What was the JDK version you had immediately before this and where >> did you get that ? > i have all that is available in the distro, but it depends, my older > installations have something from java6 times :) > >> 5) Does either JDK 11u or JDK15u work in this respect on that system ? > > yesss, right now, every installed jvm works perfectly, i olny saw the > issue with 17~14!!!! > then, for a while i sudo update-alternatives --config java 'ed to 16, > but when they bumped > to ~15, the i reverted to auto, that is 17, and the issue is > completely gone, now all the > jvms i have works fine! > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From swpalmer at gmail.com Fri Mar 12 04:00:11 2021 From: swpalmer at gmail.com (Scott Palmer) Date: Fri, 12 Mar 2021 04:00:11 -0000 Subject: [OpenJDK 2D-Dev] RFR: 8260931: Implement JEP 382: New macOS Rendering Pipeline [v13] In-Reply-To: References: Message-ID: <5BB55AA4-04ED-4B6B-BB89-61DDD5D7EB53@gmail.com> > On Mar 11, 2021, at 9:53 PM, Sergey Bylokhov wrote: > > ?On Fri, 12 Mar 2021 02:29:04 GMT, Jayathirth D V wrote: > >>> src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java line 323: >>> >>>> 321: * more code just to support a few uncommon cases. >>>> 322: */ >>>> 323: public boolean canRenderLCDText(SunGraphics2D sg2d) { >>> >>> Just curious, can we render LCD on 10.14+ via metal? Does it work fine? >> >> Yes Sergey it works fine in 10.14+ systems via metal. Most of the JCK manual tests use LCD text on UI Components and it is recently verified in 10.14+ systems for EA10. > > Ok, for some reason I thought that the new macOS stopped providing LCD glyphs. > Are the glyphs different or just the way they are rasterized? Newer versions of macOS don?t do LCD text and have gone back to plain grey-scale anti-aliasing. Java 2D should default to NOT doing LCD anti-aliasing for text on macOS if it wants to fit in with the look of native applications. (I?m not sure if that applies to non-retina displays.) Scott From mc36 at freemail.hu Tue Mar 30 03:14:21 2021 From: mc36 at freemail.hu (mc36) Date: Tue, 30 Mar 2021 05:14:21 +0200 (CEST) Subject: [OpenJDK 2D-Dev] libfontmanager.so: undefined symbol: hb_font_destroy in openjdk17~14 In-Reply-To: <2548be46-db99-8242-c04c-ac98a939a6f0@oracle.com> References: <2548be46-db99-8242-c04c-ac98a939a6f0@oracle.com> Message-ID: hi, please dont! i got ~15 and the issue is gone! (but answering line by line, who knows) thanks, cs On 3/29/21 6:41 PM, Philip Race wrote: Moving this to the right list. There's lots of missing information in your email. 1) I don't know what a debian sid is. Internet suggests it is some upstream dev version Is this reproducible on any shipping distro ? yesss, it is. https://www.debian.org/ the only difference that you replace stable to unstable/sid/experimental,depending how brave you're.... :) ? 2) Where exactly did you get the openjdk build 17 ? Was it from https://jdk.java.net/17/ or somewhere else ? Please show the output of "java -version" to help confirm it. sudo apt install openjdk-17-jre -- to get the latest build of them.... at the moment i see the following version: mc36 at noti:~$ java -version openjdk version "17-ea" 2021-09-14 OpenJDK Runtime Environment (build 17-ea+15-Debian-1) OpenJDK 64-Bit Server VM (build 17-ea+15-Debian-1, mixed mode, sharing) mc36 at noti:~$ ? 3) What does?? "ls -l lib/libfontmanager.so" show ? ? mc36 at noti:~$ find /lib/ -name libfontmanager.so /lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libfontmanager.so /lib/jvm/java-15-openjdk-amd64/lib/libfontmanager.so /lib/jvm/java-16-openjdk-amd64/lib/libfontmanager.so /lib/jvm/java-13-openjdk-amd64/lib/libfontmanager.so /lib/jvm/java-11-openjdk-amd64/lib/libfontmanager.so /lib/jvm/java-14-openjdk-amd64/lib/libfontmanager.so /lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so mc36 at noti:~$ ls -lsa /lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so 56 -rw-r--r-- 1 root root 55960 Mar 25 10:31 /lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so mc36 at noti:~$ ? 4) What was the JDK version you had immediately before this and where did you get that ? ? i have all that is available in the distro, but it depends, my older installations have something from java6 times :) ? 5) Does either JDK 11u or JDK15u work in this respect on that system ? ? yesss, right now, every installed jvm works perfectly, i olny saw the issue with 17~14!!!! then, for a while i sudo update-alternatives --config java 'ed to 16, but when they bumped to ~15, the i reverted to auto, that is 17, and the issue is completely gone, now all the jvms i have works fine! ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From github.com+10835776+stsypanov at openjdk.java.net Tue Mar 30 06:52:43 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Tue, 30 Mar 2021 06:52:43 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8263560: Remove needless wrapping with BufferedInputStream In-Reply-To: References: Message-ID: On Sat, 13 Mar 2021 22:29:23 GMT, ?????? ??????? wrote: > In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fill()` will be called resulting in load of much bigger amount of data (8192 by default) than required. This pull request has now been integrated. Changeset: 1a681fa7 Author: Sergey Tsypanov Committer: Aleksey Shipilev URL: https://git.openjdk.java.net/jdk/commit/1a681fa7 Stats: 12 lines in 2 files changed: 2 ins; 5 del; 5 mod 8263560: Remove needless wrapping with BufferedInputStream Reviewed-by: prr, alanb, dfuchs, serb ------------- PR: https://git.openjdk.java.net/jdk/pull/2992 From shade at openjdk.java.net Tue Mar 30 13:02:33 2021 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Tue, 30 Mar 2021 13:02:33 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264428: Replace uses of StringBuffer with StringBuilder in java.desktop In-Reply-To: <2y9jvm8hnBRZQIO4qwAY-C07aSQM1QIzIT6SWAj7c70=.bda3ef0d-a445-40b0-b155-3920d072cb89@github.com> References: <2y9jvm8hnBRZQIO4qwAY-C07aSQM1QIzIT6SWAj7c70=.bda3ef0d-a445-40b0-b155-3920d072cb89@github.com> Message-ID: On Mon, 29 Mar 2021 20:50:14 GMT, Andrey Turbanov wrote: > Found by IntelliJ IDEA inspection `Java | Java language level migration aids | Java 5 | 'StringBuffer' may be 'StringBuilder'` > As suggested in https://github.com/openjdk/jdk/pull/1507#issuecomment-757369003 I've created separate PR for module `java.desktop` > Similar cleanups in the past: https://bugs.openjdk.java.net/browse/JDK-8041679 https://bugs.openjdk.java.net/browse/JDK-8264029 Submitted: https://bugs.openjdk.java.net/browse/JDK-8264428, please rename PR to "8264428: Replace uses of StringBuffer with StringBuilder in java.desktop". ------------- PR: https://git.openjdk.java.net/jdk/pull/3251 From github.com+741251+turbanoff at openjdk.java.net Tue Mar 30 13:02:32 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Tue, 30 Mar 2021 13:02:32 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264428: Replace uses of StringBuffer with StringBuilder in java.desktop Message-ID: <2y9jvm8hnBRZQIO4qwAY-C07aSQM1QIzIT6SWAj7c70=.bda3ef0d-a445-40b0-b155-3920d072cb89@github.com> Found by IntelliJ IDEA inspection `Java | Java language level migration aids | Java 5 | 'StringBuffer' may be 'StringBuilder'` As suggested in https://github.com/openjdk/jdk/pull/1507#issuecomment-757369003 I've created separate PR for module `java.desktop` Similar cleanups in the past: https://bugs.openjdk.java.net/browse/JDK-8041679 https://bugs.openjdk.java.net/browse/JDK-8264029 ------------- Commit messages: - [PATCH] Replace uses of StringBuffer with StringBuilder in java.desktop Changes: https://git.openjdk.java.net/jdk/pull/3251/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3251&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8264428 Stats: 44 lines in 11 files changed: 0 ins; 8 del; 36 mod Patch: https://git.openjdk.java.net/jdk/pull/3251.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3251/head:pull/3251 PR: https://git.openjdk.java.net/jdk/pull/3251 From github.com+741251+turbanoff at openjdk.java.net Tue Mar 30 18:34:08 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Tue, 30 Mar 2021 18:34:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264428: Replace uses of StringBuffer with StringBuilder in java.desktop In-Reply-To: <2y9jvm8hnBRZQIO4qwAY-C07aSQM1QIzIT6SWAj7c70=.bda3ef0d-a445-40b0-b155-3920d072cb89@github.com> References: <2y9jvm8hnBRZQIO4qwAY-C07aSQM1QIzIT6SWAj7c70=.bda3ef0d-a445-40b0-b155-3920d072cb89@github.com> Message-ID: On Mon, 29 Mar 2021 20:50:14 GMT, Andrey Turbanov wrote: > Found by IntelliJ IDEA inspection `Java | Java language level migration aids | Java 5 | 'StringBuffer' may be 'StringBuilder'` > As suggested in https://github.com/openjdk/jdk/pull/1507#issuecomment-757369003 I've created separate PR for module `java.desktop` > Similar cleanups in the past: https://bugs.openjdk.java.net/browse/JDK-8041679 https://bugs.openjdk.java.net/browse/JDK-8264029 src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFieldNode.java line 127: > 125: StringBuilder sb = new StringBuilder(); > 126: for (int i = 0; i < count; i++) { > 127: sb.append((data[i] & 0xff)); Remove redundant parentheses ------------- PR: https://git.openjdk.java.net/jdk/pull/3251 From github.com+741251+turbanoff at openjdk.java.net Tue Mar 30 19:05:37 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Tue, 30 Mar 2021 19:05:37 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264428: Replace uses of StringBuffer with StringBuilder in java.desktop [v2] In-Reply-To: <2y9jvm8hnBRZQIO4qwAY-C07aSQM1QIzIT6SWAj7c70=.bda3ef0d-a445-40b0-b155-3920d072cb89@github.com> References: <2y9jvm8hnBRZQIO4qwAY-C07aSQM1QIzIT6SWAj7c70=.bda3ef0d-a445-40b0-b155-3920d072cb89@github.com> Message-ID: > Found by IntelliJ IDEA inspection `Java | Java language level migration aids | Java 5 | 'StringBuffer' may be 'StringBuilder'` > As suggested in https://github.com/openjdk/jdk/pull/1507#issuecomment-757369003 I've created separate PR for module `java.desktop` > Similar cleanups in the past: https://bugs.openjdk.java.net/browse/JDK-8041679 https://bugs.openjdk.java.net/browse/JDK-8264029 Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: [PATCH] Replace uses of StringBuffer with StringBuilder in java.desktop ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/3251/files - new: https://git.openjdk.java.net/jdk/pull/3251/files/9bd4e523..80bff1db Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3251&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3251&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/3251.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3251/head:pull/3251 PR: https://git.openjdk.java.net/jdk/pull/3251 From github.com+741251+turbanoff at openjdk.java.net Tue Mar 30 19:05:38 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Tue, 30 Mar 2021 19:05:38 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264428: Replace uses of StringBuffer with StringBuilder in java.desktop [v2] In-Reply-To: References: <2y9jvm8hnBRZQIO4qwAY-C07aSQM1QIzIT6SWAj7c70=.bda3ef0d-a445-40b0-b155-3920d072cb89@github.com> Message-ID: On Tue, 30 Mar 2021 18:31:34 GMT, Andrey Turbanov wrote: >> Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: >> >> [PATCH] Replace uses of StringBuffer with StringBuilder in java.desktop > > src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFieldNode.java line 127: > >> 125: StringBuilder sb = new StringBuilder(); >> 126: for (int i = 0; i < count; i++) { >> 127: sb.append((data[i] & 0xff)); > > Remove redundant parentheses fixed. It's suspicious that IDEA wasn't able to remove them by itself. Reported https://youtrack.jetbrains.com/issue/IDEA-265548 ------------- PR: https://git.openjdk.java.net/jdk/pull/3251 From philip.race at oracle.com Tue Mar 30 23:34:15 2021 From: philip.race at oracle.com (Philip Race) Date: Tue, 30 Mar 2021 16:34:15 -0700 Subject: [OpenJDK 2D-Dev] libfontmanager.so: undefined symbol: hb_font_destroy in openjdk17~14 In-Reply-To: <0cca5a02-5dbb-4c2a-4720-945a64e06088@oracle.com> References: <2548be46-db99-8242-c04c-ac98a939a6f0@oracle.com> <0cca5a02-5dbb-4c2a-4720-945a64e06088@oracle.com> Message-ID: <8aa59b9f-428e-c3f6-66bd-3466fbe0a61a@oracle.com> PS also I'd be interested to know the output of ldd /lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so It should resolve libharfbuzz.so in some system directory I've double-checked the test build I did on Ubuntu 20.10 for JDK 17 b14 and it works fine finding libharfbuzz there. So my current best guess is it is related to how your distro built it .. -phil. On 3/29/21 10:33 PM, Philip Race wrote: > > > On 3/29/21 8:14 PM, mc36 wrote: >> hi, >> please dont! i got ~15 and the issue is gone! > > please don't do what ? > >> (but answering line by line, who knows) >> thanks, >> cs > > Ok. So it looks like you are using some debian build of openjdk and it > seems likely > it can't find the system libharfbuzz.so since that symbol is very basic. > > If you use the one from https://jdk.java.net/17/ I expect it will work > since it does > what the JDK 15 does that I suggested. > > I can't tell what the JDK 16 you have does since I'd need to see an ls > -l of your > /lib/jvm/java-16-openjdk-amd64/lib/libfontmanager.so > > -phil. > >> >> >> On 3/29/21 6:41 PM, Philip Race wrote: >>> Moving this to the right list. >>> >>> There's lots of missing information in your email. >>> >>> 1) I don't know what a debian sid is. Internet suggests it is some >>> upstream dev version >>> Is this reproducible on any shipping distro ? >> yesss, it is. https://www.debian.org/ >> the only difference that you replace stable to >> unstable/sid/experimental,depending how brave you're.... :) >> >>> >>> 2) Where exactly did you get the openjdk build 17 ? Was it from >>> https://jdk.java.net/17/ or somewhere else ? >>> Please show the output of "java -version" to help confirm it. >> >> sudo apt install openjdk-17-jre -- to get the latest build of them.... >> at the moment i see the following version: >> >> mc36 at noti:~$ java -version >> openjdk version "17-ea" 2021-09-14 >> OpenJDK Runtime Environment (build 17-ea+15-Debian-1) >> OpenJDK 64-Bit Server VM (build 17-ea+15-Debian-1, mixed mode, sharing) >> mc36 at noti:~$ >> >>> >>> 3) What does?? "ls -l lib/libfontmanager.so" show ? >> >> mc36 at noti:~$ find /lib/ -name libfontmanager.so >> /lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libfontmanager.so >> /lib/jvm/java-15-openjdk-amd64/lib/libfontmanager.so >> /lib/jvm/java-16-openjdk-amd64/lib/libfontmanager.so >> /lib/jvm/java-13-openjdk-amd64/lib/libfontmanager.so >> /lib/jvm/java-11-openjdk-amd64/lib/libfontmanager.so >> /lib/jvm/java-14-openjdk-amd64/lib/libfontmanager.so >> /lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so >> mc36 at noti:~$ ls -lsa /lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so >> 56 -rw-r--r-- 1 root root 55960 Mar 25 10:31 >> /lib/jvm/java-17-openjdk-amd64/lib/libfontmanager.so >> mc36 at noti:~$ >> >> >>> 4) What was the JDK version you had immediately before this and >>> where did you get that ? >> i have all that is available in the distro, but it depends, my older >> installations have something from java6 times :) >> >>> 5) Does either JDK 11u or JDK15u work in this respect on that system ? >> >> yesss, right now, every installed jvm works perfectly, i olny saw the >> issue with 17~14!!!! >> then, for a while i sudo update-alternatives --config java 'ed to 16, >> but when they bumped >> to ~15, the i reverted to auto, that is 17, and the issue is >> completely gone, now all the >> jvms i have works fine! >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdv at openjdk.java.net Wed Mar 31 07:34:42 2021 From: jdv at openjdk.java.net (Jayathirth D V) Date: Wed, 31 Mar 2021 07:34:42 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264475: CopyArea ignores clip state in metal rendering pipeline Message-ID: In MTLBlitLoops.copyArea() we use standalone encoder which has no clip state information because of which we ignore clip parameters set in rect clip and shape clip. We need to query and use encoders from EncoderManager to honour clip states in copyArea. ------------- Commit messages: - 8264475: CopyArea ignores clip state in metal rendering pipeline Changes: https://git.openjdk.java.net/jdk/pull/3283/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3283&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8264475 Stats: 56 lines in 2 files changed: 39 ins; 0 del; 17 mod Patch: https://git.openjdk.java.net/jdk/pull/3283.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3283/head:pull/3283 PR: https://git.openjdk.java.net/jdk/pull/3283 From jdv at openjdk.java.net Wed Mar 31 07:34:42 2021 From: jdv at openjdk.java.net (Jayathirth D V) Date: Wed, 31 Mar 2021 07:34:42 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264475: CopyArea ignores clip state in metal rendering pipeline In-Reply-To: References: Message-ID: On Wed, 31 Mar 2021 07:27:45 GMT, Jayathirth D V wrote: > In MTLBlitLoops.copyArea() we use standalone encoder which has no clip state information because of which we ignore clip parameters set in rect clip and shape clip. We need to query and use encoders from EncoderManager to honour clip states in copyArea. src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTexurePool.m line 206: > 204: mipmapped:NO]; > 205: textureDescriptor.usage = MTLTextureUsageRenderTarget | > 206: MTLTextureUsageShaderRead; In copyArea we use intermediate texture queried from TexturePool as render target. If we dont set any MTLTextureUsage, we are getting assertion errors when Metal API validation is enabled because by default we can only do texture shader read(https://developer.apple.com/documentation/metal/mtltexturedescriptor/1515783-usage?language=objc). To avoid these assertion errors in Metal API validation we need to set appropriate MTLTextureUsage parameters. ------------- PR: https://git.openjdk.java.net/jdk/pull/3283 From aghaisas at openjdk.java.net Wed Mar 31 12:43:17 2021 From: aghaisas at openjdk.java.net (Ajit Ghaisas) Date: Wed, 31 Mar 2021 12:43:17 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264475: CopyArea ignores clip state in metal rendering pipeline In-Reply-To: References: Message-ID: <1Iq_SFdZn90BWHWlLdfPP0YWcUABM-TtG_yun_E8L-8=.cd2878ec-d567-4afd-a2a9-5a30dd493e10@github.com> On Wed, 31 Mar 2021 07:27:45 GMT, Jayathirth D V wrote: > In MTLBlitLoops.copyArea() we use standalone encoder which has no clip state information because of which we ignore clip parameters set in rect clip and shape clip. We need to query and use encoders from EncoderManager to honour clip states in copyArea. I tested this fix. No regressions were observed. Using MTLBlitCommandEncoder is intuitive when metal resource copying needs to be done. I suggest to add a comment (may be as a method description or in code where we do the actual copy) to mention why we use MTLRenderCommandEncoder and not MTLBlitCommandEncoder. ------------- PR: https://git.openjdk.java.net/jdk/pull/3283 From philip.race at oracle.com Wed Mar 31 14:41:40 2021 From: philip.race at oracle.com (Philip Race) Date: Wed, 31 Mar 2021 07:41:40 -0700 Subject: [OpenJDK 2D-Dev] libfontmanager.so: undefined symbol: hb_font_destroy in openjdk17~14 In-Reply-To: References: <2548be46-db99-8242-c04c-ac98a939a6f0@oracle.com> <0cca5a02-5dbb-4c2a-4720-945a64e06088@oracle.com> <8aa59b9f-428e-c3f6-66bd-3466fbe0a61a@oracle.com> Message-ID: <2f5c1162-7add-ff31-d24c-ed49a6cad7cf@oracle.com> On 3/30/21 11:31 PM, mc36 wrote: > > please find below, but, again, it's jre17~15, where everything seems fine. Oh that's what you mean by the incomprehensible " please dont! i got ~15 and the issue is gone!" So it was some one-off problem with the build 14 from your distro. I think this points to how important it is to first complain there and not here. -phil. From jdv at openjdk.java.net Wed Mar 31 15:03:54 2021 From: jdv at openjdk.java.net (Jayathirth D V) Date: Wed, 31 Mar 2021 15:03:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264475: CopyArea ignores clip state in metal rendering pipeline [v2] In-Reply-To: References: Message-ID: > In MTLBlitLoops.copyArea() we use standalone encoder which has no clip state information because of which we ignore clip parameters set in rect clip and shape clip. We need to query and use encoders from EncoderManager to honour clip states in copyArea. Jayathirth D V has updated the pull request incrementally with one additional commit since the last revision: Add comment on usage of MTLRenderCommandEncoder ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/3283/files - new: https://git.openjdk.java.net/jdk/pull/3283/files/d72f9490..3e1ba4c9 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3283&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3283&range=00-01 Stats: 7 lines in 1 file changed: 7 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/3283.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3283/head:pull/3283 PR: https://git.openjdk.java.net/jdk/pull/3283 From jdv at openjdk.java.net Wed Mar 31 15:06:27 2021 From: jdv at openjdk.java.net (Jayathirth D V) Date: Wed, 31 Mar 2021 15:06:27 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264475: CopyArea ignores clip state in metal rendering pipeline In-Reply-To: <1Iq_SFdZn90BWHWlLdfPP0YWcUABM-TtG_yun_E8L-8=.cd2878ec-d567-4afd-a2a9-5a30dd493e10@github.com> References: <1Iq_SFdZn90BWHWlLdfPP0YWcUABM-TtG_yun_E8L-8=.cd2878ec-d567-4afd-a2a9-5a30dd493e10@github.com> Message-ID: <86-OA0614MggDHTo2H9Sap5OlbQvXgKus1E8dKRrYUU=.c400d0ef-77f3-4e4a-8f67-a683241458e7@github.com> On Wed, 31 Mar 2021 12:39:49 GMT, Ajit Ghaisas wrote: > I tested this fix. No regressions were observed. > > Using MTLBlitCommandEncoder is intuitive when metal resource copying needs to be done. > I suggest to add a comment (may be as a method description or in code where we do the actual copy) to mention why we use MTLRenderCommandEncoder and not MTLBlitCommandEncoder. Thanks Ajit for testing the fix. I have added comment mentioning why we use MTLRenderCommandEncoder and not MTLBlitCommandEncoder. ------------- PR: https://git.openjdk.java.net/jdk/pull/3283 From azvegint at openjdk.java.net Wed Mar 31 17:58:15 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Wed, 31 Mar 2021 17:58:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8012229: [lcms] Improve performance of color conversion for images with alpha channel In-Reply-To: References: Message-ID: On Mon, 29 Mar 2021 07:36:35 GMT, Sergey Bylokhov wrote: > The lcms 2.8 version added support for the cmsFLAGS_COPY_ALPHA flag: > https://sourceforge.net/p/lcms/mailman/lcms-user/thread/001c01d1c0f3%2484a7cb30%248df76190%24%40ProDigitalSoftware.com/#msg35143398 > > which supports alpha channel transportation > > For our usage, it means we can use TYPE_4BYTE_ABGR and TYPE_INT_ARGB directly as a source and destination. > > Some numbers: > converting new BufferedImage(3000, 3000, TYPE_INT_ARGB) from CS_sRGB to CS_CIEXYZ via op.filter(src, dst). > //before the fix > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 603,392 ? 12,932 ms/op > > //after the fix > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 121,624 ? 0,906 ms/op > > But still slower than kcms > //kcms jdk8u60 > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 13,256 ? 0,169 ms/op Marked as reviewed by azvegint (Reviewer). test/jdk/sun/java2d/cmm/ColorConvertOp/ColCvtAlphaDifferentSrcDst.java line 52: > 50: > 51: private static int WIDTH = 256; > 52: private static int HEIGHT = 256; Basing on naming, it looks that you wanted to make these variable final. ------------- PR: https://git.openjdk.java.net/jdk/pull/3239 From aivanov at openjdk.java.net Wed Mar 31 19:47:24 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Wed, 31 Mar 2021 19:47:24 GMT Subject: [OpenJDK 2D-Dev] Withdrawn: 8263893: getPrinterNames() leaks nameArray if Java String allocation fails In-Reply-To: References: Message-ID: On Fri, 19 Mar 2021 20:36:57 GMT, Alexey Ivanov wrote: > If `JNU_NewStringPlatform` fails to allocate new Java String object for printer name, `std::bad_alloc` is thrown. The handler for the exception does not release the local reference to the `nameArray`, thus it will be leaked. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jdk/pull/3096 From serb at openjdk.java.net Wed Mar 31 19:59:25 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 31 Mar 2021 19:59:25 GMT Subject: [OpenJDK 2D-Dev] RFR: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows [v2] In-Reply-To: References: Message-ID: On Thu, 18 Mar 2021 12:29:01 GMT, Alexander Scherbatiy wrote: >> Printing text using GlyphVector outline has bad quality on printers with low DPI on Windows. >> The GDI system used for text printing on Windows accepts only integer path coordinates. >> Rounding GlyphVector outline coordinates leads to distorted printed text. >> >> The issue had been reported as JDK-8256264 but was reverted because of the regression JDK-8259007 "This test printed a blank page". >> >> The fix JDK-8256264 scaled coordinates in wPrinterJob.moveTo()/lineTo() methods up and scaled transforms in wPrinterJob.beginPath()/endPath() down. >> >> The regression was in the WPathGraphics.deviceDrawLine() method which uses wPrinterJob.moveTo()/lineTo() methods without surrounding them with wPrinterJob.beginPath()/endPath() so the line coordinates were only scaled up. >> >> I tried to put wPrinterJob.beginPath()/endPath() methods around wPrinterJob.moveTo()/lineTo() in the method WPathGraphics.deviceDrawLine() but the line was not drawn at all even without scaling coordinates up and transform down (without JDK-8256264 fix). It looks like GDI treats this case as an empty shape. >> >> The proposed fix applies path coordinates and transform scaling only in WPathGraphics.convertToWPath() method. >> The one more PathPrecisionScaleFactorShapeTest.java manual test is added which checks that all methods that draw paths in WPathGraphics are used: line in WPathGraphics.deviceDrawLine() and SEG_LINETO/SEG_QUADTO/SEG_CUBICTO in WPathGraphics.convertToWPath() . >> >> The `java/awt/print` and `java/awt/PrintJob` automatic and manual tests were run on Windows 10 Pro with the fix. >> >> There are two failed automated tests which fail without the fix as well: >> java/awt/print/PrinterJob/GlyphPositions.java >> java/awt/print/PrinterJob/PSQuestionMark.java >> >> The following manual tests have issues on my system: >> - `java/awt/print/Dialog/PrintDlgPageable.java` java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainThread cannot access a member of class PrintDlgPageable with modifiers "public static" >> >> - `java/awt/print/PrinterJob/PrintAttributeUpdateTest.java` I select pages radio button, press the print button but the test does not finish and I do not see any other dialogs with pass/fail buttons. >> >> - `java/awt/PrintJob/PrintCheckboxTest/PrintCheckboxManualTest.java` Tests that there is no ClassCastException thrown in printing checkbox and scrollbar with XAWT. Error. Can't find HTML file: test\jdk\java\awt\PrintJob\PrintCheckboxTest\PrintCheckboxManualTest.html >> >> >> - `java/awt/print/PrinterJob/SecurityDialogTest.java` A windows with instructions is shown but it does not contain print/pass/fail buttons and it is not possible to close the window. >> >> - The tests below fail with "Error. Parse Exception: Arguments to `manual' option not supported: yesno" message: >> java/awt/print/Dialog/DialogOrient.java >> java/awt/print/Dialog/DialogType.java >> java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java >> java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java >> java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java >> java/awt/print/PrinterJob/PageDialogTest.java >> java/awt/print/PrinterJob/PageRanges.java >> java/awt/print/PrinterJob/PageRangesDlgTest.java >> java/awt/print/PrinterJob/PrintGlyphVectorTest.java >> java/awt/print/PrinterJob/PrintLatinCJKTest.java >> java/awt/print/PrinterJob/PrintTextTest.java >> java/awt/print/PrinterJob/SwingUIText.java >> java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java >> java/awt/PrintJob/PageSetupDlgBlockingTest/PageSetupDlgBlockingTest.java >> java/awt/PrintJob/SaveDialogTitleTest.java > > Alexander Scherbatiy has updated the pull request incrementally with two additional commits since the last revision: > > - Use DASSERT to check SetGraphicsMode and WorldTransform results > - Change setGraphicsMode() type to void Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2756 From serb at openjdk.java.net Wed Mar 31 20:40:08 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 31 Mar 2021 20:40:08 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt In-Reply-To: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> References: <08GQSw2xtXS6dK733iJJeozFOcykbE9odAaj84HqDo0=.9eb0c33f-9ee7-460a-b941-392797abb691@github.com> Message-ID: On Tue, 23 Mar 2021 15:18:13 GMT, Severin Gehwolf wrote: > The suggestion is to rename 'jvm' variable in `libjavajpeg` to `the_jvm` so this conflict no longer occurs when `libjavajpeg.a` and `libawt.a` are being linked into one native image. > > Testing: test/jdk/javax/imageio jtreg tests. GHA pre-integration tests running too. > > Thoughts? Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3155 From serb at openjdk.java.net Wed Mar 31 21:15:30 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 31 Mar 2021 21:15:30 GMT Subject: [OpenJDK 2D-Dev] RFR: 8264428: Replace uses of StringBuffer with StringBuilder in java.desktop In-Reply-To: References: <2y9jvm8hnBRZQIO4qwAY-C07aSQM1QIzIT6SWAj7c70=.bda3ef0d-a445-40b0-b155-3920d072cb89@github.com> Message-ID: <27yKI-MoNpdtE7_qYEHLNj-tmphsEvwwT7NunRjEY5c=.d585ed9c-b74c-4b82-8c24-fca05d944f58@github.com> On Tue, 30 Mar 2021 12:39:15 GMT, Aleksey Shipilev wrote: >> Found by IntelliJ IDEA inspection `Java | Java language level migration aids | Java 5 | 'StringBuffer' may be 'StringBuilder'` >> As suggested in https://github.com/openjdk/jdk/pull/1507#issuecomment-757369003 I've created separate PR for module `java.desktop` >> Similar cleanups in the past: https://bugs.openjdk.java.net/browse/JDK-8041679 https://bugs.openjdk.java.net/browse/JDK-8264029 > > Submitted: https://bugs.openjdk.java.net/browse/JDK-8264428, please rename PR to "8264428: Replace uses of StringBuffer with StringBuilder in java.desktop". Looks like this change goes beyond of simple replacement of StringBuffer with StringBuilder. Please update the description of the bug and PR description. ------------- PR: https://git.openjdk.java.net/jdk/pull/3251 From serb at openjdk.java.net Wed Mar 31 21:26:13 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 31 Mar 2021 21:26:13 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255800: Raster creation methods need some specification clean up In-Reply-To: References: Message-ID: On Fri, 26 Mar 2021 19:53:44 GMT, Phil Race wrote: > https://bugs.openjdk.java.net/browse/JDK-8255800 could have been a one line spec clean up but > it didn't take a lot of looking to realize there were many more inconsistencies between spec and implementation. > I've spent a lot of time on what is just small number of factory methods in Raster because there are so > many possible exceptions and in some cases they rely on other API they call to generate exceptions and > these may have not been documented or documented acc. to some long lost behavior. > I've mostly tried to ONLY change spec. But I couldn't help myself when some checks were missed that > ended up with bizarre and dubious behavior - throwing NegativeArrayIndexException which just about > always has to be an internal bug ! > > The supplied test passes on JDK 16 as well as this code, because the (relatively) small number of > cases where JDK 16 threw NegativeArrayIndexException are caught and allowed only for releases < 17 > So where you see those in the test it corresponds to the behavioral changes from NegativeArrayIndexException > to IllegalArgumentException. > JCK conformance tests still pass so they must not test those conditions. src/java.desktop/share/classes/java/awt/image/Raster.java line 263: > 261: * both > 0 > 262: * @throws IllegalArgumentException if the product of {@code w} > 263: * and {@code h} is greater than {@code Integer.MAX_VALUE} Do we really want to specify this? I hit this bug during HiDPI work and it seems this is an implementation bug that we do not support big size(w*h). src/java.desktop/share/classes/java/awt/image/Raster.java line 337: > 335: * {@code DataBuffer.TYPE_BYTE}, > 336: * {@code DataBuffer.TYPE_USHORT} > 337: * or {@code DataBuffer.TYPE_INT} What about other types like TYPE_SHORT or we assume it is unsupported? ------------- PR: https://git.openjdk.java.net/jdk/pull/3223 From serb at openjdk.java.net Wed Mar 31 21:26:13 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 31 Mar 2021 21:26:13 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255800: Raster creation methods need some specification clean up In-Reply-To: References: <-0wFDhzgacQic6ii8fKr9N3HLDcQi5AjF-sNNznUGxg=.dabe42bd-2f95-4f12-be90-2a4a35be3234@github.com> Message-ID: On Fri, 26 Mar 2021 22:45:56 GMT, Phil Race wrote: >> src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java line 127: >> >>> 125: * @throws IllegalArgumentException if {@code pixelStride} is less than 0 >>> 126: * @throws IllegalArgumentException if {@code scanlineStride} is less than 0 >>> 127: * @throws NullPointerException if {@code bandOffsets} is {@code null} >> >> I like the NPE here, but probably it makes sense to use the same exception for all errors? "IllegalArgumentException " > > Meaning even though you like the NPE you would change it to IAE like the rest ? Yes and no, I just wanted to highlight this place, since somebody may prefer IAE here. ------------- PR: https://git.openjdk.java.net/jdk/pull/3223 From serb at openjdk.java.net Wed Mar 31 21:31:43 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 31 Mar 2021 21:31:43 GMT Subject: [OpenJDK 2D-Dev] RFR: 8012229: [lcms] Improve performance of color conversion for images with alpha channel [v2] In-Reply-To: References: Message-ID: > The lcms 2.8 version added support for the cmsFLAGS_COPY_ALPHA flag: > https://sourceforge.net/p/lcms/mailman/lcms-user/thread/001c01d1c0f3%2484a7cb30%248df76190%24%40ProDigitalSoftware.com/#msg35143398 > > which supports alpha channel transportation > > For our usage, it means we can use TYPE_4BYTE_ABGR and TYPE_INT_ARGB directly as a source and destination. > > Some numbers: > converting new BufferedImage(3000, 3000, TYPE_INT_ARGB) from CS_sRGB to CS_CIEXYZ via op.filter(src, dst). > //before the fix > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 603,392 ? 12,932 ms/op > > //after the fix > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 121,624 ? 0,906 ms/op > > But still slower than kcms > //kcms jdk8u60 > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 13,256 ? 0,169 ms/op Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Merge branch 'master' into JDK-8012229 - Update ColCvtAlphaDifferentSrcDst.java - Initial fix ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/3239/files - new: https://git.openjdk.java.net/jdk/pull/3239/files/c89a4ca1..60a3dfca Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3239&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3239&range=00-01 Stats: 4586 lines in 234 files changed: 3018 ins; 664 del; 904 mod Patch: https://git.openjdk.java.net/jdk/pull/3239.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3239/head:pull/3239 PR: https://git.openjdk.java.net/jdk/pull/3239 From azvegint at openjdk.java.net Wed Mar 31 21:37:26 2021 From: azvegint at openjdk.java.net (Alexander Zvegintsev) Date: Wed, 31 Mar 2021 21:37:26 GMT Subject: [OpenJDK 2D-Dev] RFR: 8012229: [lcms] Improve performance of color conversion for images with alpha channel [v2] In-Reply-To: References: Message-ID: On Wed, 31 Mar 2021 21:31:43 GMT, Sergey Bylokhov wrote: >> The lcms 2.8 version added support for the cmsFLAGS_COPY_ALPHA flag: >> https://sourceforge.net/p/lcms/mailman/lcms-user/thread/001c01d1c0f3%2484a7cb30%248df76190%24%40ProDigitalSoftware.com/#msg35143398 >> >> which supports alpha channel transportation >> >> For our usage, it means we can use TYPE_4BYTE_ABGR and TYPE_INT_ARGB directly as a source and destination. >> >> Some numbers: >> converting new BufferedImage(3000, 3000, TYPE_INT_ARGB) from CS_sRGB to CS_CIEXYZ via op.filter(src, dst). >> //before the fix >> //Benchmark Mode Cnt Score Error Units >> //ColorAlphaConv.testFilter avgt 5 603,392 ? 12,932 ms/op >> >> //after the fix >> //Benchmark Mode Cnt Score Error Units >> //ColorAlphaConv.testFilter avgt 5 121,624 ? 0,906 ms/op >> >> But still slower than kcms >> //kcms jdk8u60 >> //Benchmark Mode Cnt Score Error Units >> //ColorAlphaConv.testFilter avgt 5 13,256 ? 0,169 ms/op > > Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Merge branch 'master' into JDK-8012229 > - Update ColCvtAlphaDifferentSrcDst.java > - Initial fix Marked as reviewed by azvegint (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/3239 From prr at openjdk.java.net Wed Mar 31 22:06:18 2021 From: prr at openjdk.java.net (Phil Race) Date: Wed, 31 Mar 2021 22:06:18 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255800: Raster creation methods need some specification clean up In-Reply-To: References: Message-ID: On Wed, 31 Mar 2021 21:21:24 GMT, Sergey Bylokhov wrote: >> https://bugs.openjdk.java.net/browse/JDK-8255800 could have been a one line spec clean up but >> it didn't take a lot of looking to realize there were many more inconsistencies between spec and implementation. >> I've spent a lot of time on what is just small number of factory methods in Raster because there are so >> many possible exceptions and in some cases they rely on other API they call to generate exceptions and >> these may have not been documented or documented acc. to some long lost behavior. >> I've mostly tried to ONLY change spec. But I couldn't help myself when some checks were missed that >> ended up with bizarre and dubious behavior - throwing NegativeArrayIndexException which just about >> always has to be an internal bug ! >> >> The supplied test passes on JDK 16 as well as this code, because the (relatively) small number of >> cases where JDK 16 threw NegativeArrayIndexException are caught and allowed only for releases < 17 >> So where you see those in the test it corresponds to the behavioral changes from NegativeArrayIndexException >> to IllegalArgumentException. >> JCK conformance tests still pass so they must not test those conditions. > > src/java.desktop/share/classes/java/awt/image/Raster.java line 263: > >> 261: * both > 0 >> 262: * @throws IllegalArgumentException if the product of {@code w} >> 263: * and {@code h} is greater than {@code Integer.MAX_VALUE} > > Do we really want to specify this? I hit this bug during HiDPI work and it seems this is an implementation bug that we do not support big size(w*h). The implementation issues that constrain this are substantial. I find it unlikely we'd find a reason to support it. I mean a bigger issue is we can'r even support an image that's Integer.MAX_VALUE wide and 1 pixel high. Removing this from the spec. at that time would be trivial compared to the work in supporting it. And likely it would be some other method that would support that anyway for the aforementioned int reason. And we also (and always have) documented an exception if adding the location.x + w would overflow an int. So in summary, yes, let's document it. > src/java.desktop/share/classes/java/awt/image/Raster.java line 337: > >> 335: * {@code DataBuffer.TYPE_BYTE}, >> 336: * {@code DataBuffer.TYPE_USHORT} >> 337: * or {@code DataBuffer.TYPE_INT} > > What about other types like TYPE_SHORT or we assume it is unsupported? The existing code throws IAE if it is not one of these exact types. See around line 460 in this updated file. And that code is in a public factory method called by this factory method. And that callee has exactly this documentation. So I am just copying it over so that it is consistently documented. ------------- PR: https://git.openjdk.java.net/jdk/pull/3223 From prr at openjdk.java.net Wed Mar 31 22:06:17 2021 From: prr at openjdk.java.net (Phil Race) Date: Wed, 31 Mar 2021 22:06:17 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255800: Raster creation methods need some specification clean up In-Reply-To: References: <-0wFDhzgacQic6ii8fKr9N3HLDcQi5AjF-sNNznUGxg=.dabe42bd-2f95-4f12-be90-2a4a35be3234@github.com> Message-ID: On Wed, 31 Mar 2021 21:17:07 GMT, Sergey Bylokhov wrote: >> Meaning even though you like the NPE you would change it to IAE like the rest ? > > Yes and no, I just wanted to highlight this place, since somebody may prefer IAE here. Well IAE was my initial thought but I decided to minimize the behavioral changes. ------------- PR: https://git.openjdk.java.net/jdk/pull/3223 From serb at openjdk.java.net Wed Mar 31 23:06:39 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 31 Mar 2021 23:06:39 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8012229: [lcms] Improve performance of color conversion for images with alpha channel In-Reply-To: References: Message-ID: <1W8FAmvukK1mGDPBnxIJ3TZy57eT1VjLn29bpmmUc98=.9561e5a8-5495-4ec0-8931-2e0da824a6ff@github.com> On Mon, 29 Mar 2021 07:36:35 GMT, Sergey Bylokhov wrote: > The lcms 2.8 version added support for the cmsFLAGS_COPY_ALPHA flag: > https://sourceforge.net/p/lcms/mailman/lcms-user/thread/001c01d1c0f3%2484a7cb30%248df76190%24%40ProDigitalSoftware.com/#msg35143398 > > which supports alpha channel transportation > > For our usage, it means we can use TYPE_4BYTE_ABGR and TYPE_INT_ARGB directly as a source and destination. > > Some numbers: > converting new BufferedImage(3000, 3000, TYPE_INT_ARGB) from CS_sRGB to CS_CIEXYZ via op.filter(src, dst). > //before the fix > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 603,392 ? 12,932 ms/op > > //after the fix > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 121,624 ? 0,906 ms/op > > But still slower than kcms > //kcms jdk8u60 > //Benchmark Mode Cnt Score Error Units > //ColorAlphaConv.testFilter avgt 5 13,256 ? 0,169 ms/op This pull request has now been integrated. Changeset: 16acfafb Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/16acfafb Stats: 208 lines in 5 files changed: 195 ins; 2 del; 11 mod 8012229: [lcms] Improve performance of color conversion for images with alpha channel Reviewed-by: azvegint ------------- PR: https://git.openjdk.java.net/jdk/pull/3239