From serb at openjdk.java.net Sun Jan 3 03:28:09 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sun, 3 Jan 2021 03:28:09 GMT Subject: [OpenJDK 2D-Dev] RFR: 6986863: ProfileDeferralMgr throwing ConcurrentModificationException In-Reply-To: References: Message-ID: On Thu, 3 Dec 2020 23:52:25 GMT, Sergey Bylokhov wrote: > This change intended to enhance the lazy initialization of the standard color profiles concurrently by different threads. > > We defer standard profiles loading because most of UI application uses a small amount of data from the profile like numComponents and colorSpaceType, and this data is known in advance. But any other profile-related activity (like a color conversion, profile data accesses, etc.) triggers profile activation when we load all profile data to the memory. > > Before the fix for JDK-6793818, we defer only one sRGB color profile, see: https://github.com/openjdk/jdk/commit/2726f2a3621dd2562d4fb660b4c3d376c65027aa > > Notes about the link above: > - The code in the ProfileDeferralMgr, which contain the Vector of profiles for activation does not use any synchronization > - The `activateDeferredProfile` and `activate` methods are implemented to throw `ProfileDataException`, but this exception is ignored during activation process: > https://github.com/openjdk/jdk/commit/2726f2a3621dd2562d4fb660b4c3d376c65027aa#diff-0839c25a6c999452be28b431c54d5daa91364d302cfda6efa5c56421c2f2bdcbR96 > > The fix: > - Drops the usage of ProfileDeferralMgr (which contained the Vector of profiles for activation) and ProfileActivator machinery. Instead, we will have just one `ICC_Profile.activate()` method which will activate and initialize the `ICC_Profile.cmmProfile` if it is null > - The `activate` method implementation mimics the old behavior when the CMMException and IOException were wrapped by the ProfileDataException, and the ProfileDataException itself was ignored during activation - > so an exception will not be thrown in the method itself, but only when the null profile will be used. > > See some comments inline. Any volunteers for a review? ------------- PR: https://git.openjdk.java.net/jdk/pull/1613 From psadhukhan at openjdk.java.net Mon Jan 4 08:22:09 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Mon, 4 Jan 2021 08:22:09 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout Message-ID: Test fails with timeout and it seems likely due to non-availability of printer in the test system. We should just update the test to check for default (or available) printers and return if there is no printer. ------------- Commit messages: - 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout Changes: https://git.openjdk.java.net/jdk/pull/1927/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1927&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8215537 Stats: 7 lines in 1 file changed: 7 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/1927.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1927/head:pull/1927 PR: https://git.openjdk.java.net/jdk/pull/1927 From serb at openjdk.java.net Mon Jan 4 08:28:55 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 4 Jan 2021 08:28:55 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout In-Reply-To: References: Message-ID: <-up-8GvJbTW2SvsqRuaN8u3lowBfbvxnfAPMdfINDBE=.3e6c4a14-a563-4f9f-a460-693cfbc19317@github.com> On Mon, 4 Jan 2021 08:15:37 GMT, Prasanta Sadhukhan wrote: > Test fails with timeout and it seems likely due to non-availability of printer in the test system. We should just update the test to check for default (or available) printers and return if there is no printer. If the printer is not found then why the "PrinterException: No print service found" is not thrown? ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Mon Jan 4 08:47:56 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Mon, 4 Jan 2021 08:47:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout In-Reply-To: <-up-8GvJbTW2SvsqRuaN8u3lowBfbvxnfAPMdfINDBE=.3e6c4a14-a563-4f9f-a460-693cfbc19317@github.com> References: <-up-8GvJbTW2SvsqRuaN8u3lowBfbvxnfAPMdfINDBE=.3e6c4a14-a563-4f9f-a460-693cfbc19317@github.com> Message-ID: On Mon, 4 Jan 2021 08:26:04 GMT, Sergey Bylokhov wrote: >> Test fails with timeout and it seems likely due to non-availability of printer in the test system. We should just update the test to check for default (or available) printers and return if there is no printer. > > If the printer is not found then why the "PrinterException: No print service found" is not thrown? IIUC, In windows there can be non-real printers like "Send To OneNote", "Fax" which falls in Printers/Scanner list but not exactly printer so PrinterException is not thrown. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From serb at openjdk.java.net Mon Jan 4 09:26:56 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 4 Jan 2021 09:26:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout In-Reply-To: References: <-up-8GvJbTW2SvsqRuaN8u3lowBfbvxnfAPMdfINDBE=.3e6c4a14-a563-4f9f-a460-693cfbc19317@github.com> Message-ID: On Mon, 4 Jan 2021 08:45:21 GMT, Prasanta Sadhukhan wrote: > IIUC, In windows there can be non-real printers like "Send To OneNote", "Fax" which falls in Printers/Scanner list but not exactly printer so PrinterException is not thrown. I am not sure that the fax is related here, but the "printjob.print()" should throw such an exception if printjob.getPrintService() is null (so we do not have any useful printers). Do you have a chance to reproduce this bug? BTW the suggestion in the JBS was to fail the test if no printers are found. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Mon Jan 4 10:27:12 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Mon, 4 Jan 2021 10:27:12 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout [v2] In-Reply-To: References: Message-ID: <7qjMCFOBix6UV1-FNgDfcBNkKvMXApGdA-f-9LvojRo=.c8334604-98f2-4baa-8a0b-abb171b6e1cf@github.com> > Test fails with timeout and it seems likely due to non-availability of printer in the test system. We should just update the test to check for default (or available) printers and return if there is no printer. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Fail the test if no printer is found ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1927/files - new: https://git.openjdk.java.net/jdk/pull/1927/files/4c3bc143..d4d70e34 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1927&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1927&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/1927.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1927/head:pull/1927 PR: https://git.openjdk.java.net/jdk/pull/1927 From serb at openjdk.java.net Mon Jan 4 11:22:03 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 4 Jan 2021 11:22:03 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259042: Inconsistent use of general primitives loops Message-ID: The java2d uses the primitives such as Blit loop for rendering differing things. Currently, not all possible variants of primitives are implemented, but it is possible to register some general loop that may produce the primitives for some specific src/comp/dst. But we have some inconsistent here: - Some primitives register themselves as a general loop but always return null in the makePrimitive() method - Some primitives (which are not registered as general loops) return null or throw an error in the makePrimitive() method After the fix: - The primitive will be registered as a general primitive only if it has a meaningful makePrimitive method - An attempt to call the makePrimitive for non registered general loop will cause an error mach5 is green ------------- Commit messages: - Initial fix Changes: https://git.openjdk.java.net/jdk/pull/1926/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1926&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8259042 Stats: 260 lines in 22 files changed: 33 ins; 167 del; 60 mod Patch: https://git.openjdk.java.net/jdk/pull/1926.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1926/head:pull/1926 PR: https://git.openjdk.java.net/jdk/pull/1926 From erikj at openjdk.java.net Mon Jan 4 15:32:11 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 4 Jan 2021 15:32:11 GMT Subject: [OpenJDK 2D-Dev] RFR: 8257733: Move module-specific data from make to respective module [v4] In-Reply-To: References: Message-ID: On Tue, 15 Dec 2020 22:56:15 GMT, Magnus Ihse Bursie wrote: >> A lot (but not all) of the data in make/data is tied to a specific module. For instance, the publicsuffixlist is used by java.base, and fontconfig by java.desktop. (A few directories, like mainmanifest, is *actually* used by make for the whole build.) >> >> These data files should move to the module they belong to. The are, after all, "source code" for that module that is "compiler" into resulting deliverables, for that module. (But the "source code" language is not Java or C, but typically a highly domain specific language or data format, and the "compilation" is, often, a specialized transformation.) >> >> This misplacement of the data directory is most visible at code review time. When such data is changed, most of the time build-dev (or the new build label) is involved, even though this has nothing to do with the build. While this is annoying, a worse problem is if the actual team that needs to review the patch (i.e., the team owning the module) is missed in the review. >> >> ### Modules reviewed >> >> - [x] java.base >> - [ ] java.desktop >> - [x] jdk.compiler >> - [x] java.se > > Magnus Ihse Bursie 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 eight additional commits since the last revision: > > - Update comment refering to "make" dir > - Move new symbols to jdk.compiler > - Merge branch 'master' into shuffle-data > - Move macosxicons from share to macosx > - Move to share/data, and move jdwp.spec to java.se > - Update references in test > - Step 2: Update references > - First stage, move actual data files Marked as reviewed by erikj (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/1611 From prr at openjdk.java.net Mon Jan 4 20:34:57 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 4 Jan 2021 20:34:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout [v2] In-Reply-To: <7qjMCFOBix6UV1-FNgDfcBNkKvMXApGdA-f-9LvojRo=.c8334604-98f2-4baa-8a0b-abb171b6e1cf@github.com> References: <7qjMCFOBix6UV1-FNgDfcBNkKvMXApGdA-f-9LvojRo=.c8334604-98f2-4baa-8a0b-abb171b6e1cf@github.com> Message-ID: On Mon, 4 Jan 2021 10:27:12 GMT, Prasanta Sadhukhan wrote: >> Test fails with timeout and it seems likely due to non-availability of printer in the test system. We should just update the test to check for default (or available) printers and return if there is no printer. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Fail the test if no printer is found test/jdk/java/awt/print/PrinterJob/LandscapeStackOverflow.java line 50: > 48: PrintService defaultPrtSrv = PrintServiceLookup.lookupDefaultPrintService(); > 49: if (printjob.getPrintService() == null || defaultPrtSrv == null) { > 50: throw new RuntimeException("No printer found"); We need to make this more robust. The checks should be before we create the pritner job and should be to find ANY printer and none throws the excepton, but if there is only a non-default one, set that as the printer for the job after creating the job. That may not matter on Windows but on other platforms I am sure you can have printers, but not a default one. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From prr at openjdk.java.net Mon Jan 4 21:09:03 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 4 Jan 2021 21:09:03 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259042: Inconsistent use of general primitives loops In-Reply-To: References: Message-ID: <4JxEORig0xHMcgC9lsU7h62f3hWNA5bCg_7ZM8mLBNs=.53a8e713-b413-49da-88a9-0b88bad6a2c5@github.com> On Mon, 4 Jan 2021 08:09:31 GMT, Sergey Bylokhov wrote: > The java2d uses the primitives such as Blit loop for rendering differing things. Currently, not all possible variants of primitives are implemented, but it is possible to register some general loop that may produce the primitives for some specific src/comp/dst. > > But we have some inconsistent here: > - Some primitives register themselves as a general loop but always return null in the makePrimitive() method > - Some primitives (which are not registered as general loops) return null or throw an error in the makePrimitive() method > > After the fix: > - The primitive will be registered as a general primitive only if it has a meaningful makePrimitive method > - An attempt to call the makePrimitive for non registered general loop will cause an error > > mach5 is green Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/1926 From prr at openjdk.java.net Mon Jan 4 21:11:58 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 4 Jan 2021 21:11:58 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8257809: JNI warnings from Toolkit JPEG image decoding In-Reply-To: References: Message-ID: On Sun, 20 Dec 2020 01:37:47 GMT, Phil Race wrote: > The fix is to reverse the order of acquisition to get dst before src so that the call to GetArrayLength() comes first. > This also necessitates moving the RELEASE_ARRAYS() call on an error condition to the new "2nd" block. > > The new regression test passes on all platforms and all the other headless tests passed too. > So do the automated headful tests. This pull request has now been integrated. Changeset: e6f99260 Author: Phil Race URL: https://git.openjdk.java.net/jdk/commit/e6f99260 Stats: 126 lines in 4 files changed: 116 ins; 10 del; 0 mod 8257809: JNI warnings from Toolkit JPEG image decoding Reviewed-by: serb ------------- PR: https://git.openjdk.java.net/jdk/pull/1850 From prr at openjdk.java.net Mon Jan 4 21:24:14 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 4 Jan 2021 21:24:14 GMT Subject: [OpenJDK 2D-Dev] RFR: 8257733: Move module-specific data from make to respective module [v4] In-Reply-To: References: Message-ID: On Tue, 15 Dec 2020 22:56:15 GMT, Magnus Ihse Bursie wrote: >> A lot (but not all) of the data in make/data is tied to a specific module. For instance, the publicsuffixlist is used by java.base, and fontconfig by java.desktop. (A few directories, like mainmanifest, is *actually* used by make for the whole build.) >> >> These data files should move to the module they belong to. The are, after all, "source code" for that module that is "compiler" into resulting deliverables, for that module. (But the "source code" language is not Java or C, but typically a highly domain specific language or data format, and the "compilation" is, often, a specialized transformation.) >> >> This misplacement of the data directory is most visible at code review time. When such data is changed, most of the time build-dev (or the new build label) is involved, even though this has nothing to do with the build. While this is annoying, a worse problem is if the actual team that needs to review the patch (i.e., the team owning the module) is missed in the review. >> >> ### Modules reviewed >> >> - [x] java.base >> - [ ] java.desktop >> - [x] jdk.compiler >> - [x] java.se > > Magnus Ihse Bursie 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 eight additional commits since the last revision: > > - Update comment refering to "make" dir > - Move new symbols to jdk.compiler > - Merge branch 'master' into shuffle-data > - Move macosxicons from share to macosx > - Move to share/data, and move jdwp.spec to java.se > - Update references in test > - Step 2: Update references > - First stage, move actual data files Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/1611 From prr at openjdk.java.net Mon Jan 4 21:25:59 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 4 Jan 2021 21:25:59 GMT Subject: [OpenJDK 2D-Dev] RFR: 8256321: Some "inactive" color profiles use the wrong profile class In-Reply-To: References: Message-ID: On Fri, 13 Nov 2020 22:50:02 GMT, Sergey Bylokhov wrote: > The implementation of ICC_Profile tries to defer loading the data of the color profile, and it uses some predefined values for some profile properties for the standard profiles like sRGB, PYCC, etc. If the application requests profile data then the ICC_Profile class activates the profile and uses properties from that data. > > Deferring mechanism for all profiles was added in JDK-6793818, but unfortunately, the color profile class was hardcoded incorrectly "CLASS_DISPLAY" for all profiles. However, the "CIEXYZ.pf" and "PYCC.pf" profiles should use "CLASS_COLORSPACECONVERSION". > > Later the color "profiles/xxx.pf" were replaced in the JDK, and the actual type of the "CIEXYZ.pf" was changed to the "CLASS_ABSTRACT", but the deferring mechanism still uses "CLASS_DISPLAY". > > As a result of this bug, the color profile reports different values before/after activations. Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/1211 From psadhukhan at openjdk.java.net Tue Jan 5 08:33:06 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Tue, 5 Jan 2021 08:33:06 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259007: This test printed a blank page Message-ID: Backout JDK-8256264 fix. ------------- Commit messages: - 8259007: This test printed a blank page Changes: https://git.openjdk.java.net/jdk16/pull/80/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk16&pr=80&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8259007 Stats: 470 lines in 4 files changed: 0 ins; 459 del; 11 mod Patch: https://git.openjdk.java.net/jdk16/pull/80.diff Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/80/head:pull/80 PR: https://git.openjdk.java.net/jdk16/pull/80 From psadhukhan at openjdk.java.net Tue Jan 5 09:08:15 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Tue, 5 Jan 2021 09:08:15 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout [v3] In-Reply-To: References: Message-ID: > Test fails with timeout and it seems likely due to non-availability of printer in the test system. We should just update the test to check for default (or available) printers and return if there is no printer. Prasanta Sadhukhan has updated the pull request incrementally with two additional commits since the last revision: - jckech issue fix - Make printer search more robust ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1927/files - new: https://git.openjdk.java.net/jdk/pull/1927/files/d4d70e34..7098cb41 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1927&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1927&range=01-02 Stats: 15 lines in 1 file changed: 12 ins; 1 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/1927.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1927/head:pull/1927 PR: https://git.openjdk.java.net/jdk/pull/1927 From serb at openjdk.java.net Tue Jan 5 12:52:58 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 5 Jan 2021 12:52:58 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8256321: Some "inactive" color profiles use the wrong profile class In-Reply-To: References: Message-ID: On Fri, 13 Nov 2020 22:50:02 GMT, Sergey Bylokhov wrote: > The implementation of ICC_Profile tries to defer loading the data of the color profile, and it uses some predefined values for some profile properties for the standard profiles like sRGB, PYCC, etc. If the application requests profile data then the ICC_Profile class activates the profile and uses properties from that data. > > Deferring mechanism for all profiles was added in JDK-6793818, but unfortunately, the color profile class was hardcoded incorrectly "CLASS_DISPLAY" for all profiles. However, the "CIEXYZ.pf" and "PYCC.pf" profiles should use "CLASS_COLORSPACECONVERSION". > > Later the color "profiles/xxx.pf" were replaced in the JDK, and the actual type of the "CIEXYZ.pf" was changed to the "CLASS_ABSTRACT", but the deferring mechanism still uses "CLASS_DISPLAY". > > As a result of this bug, the color profile reports different values before/after activations. This pull request has now been integrated. Changeset: a6c08813 Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/a6c08813 Stats: 87 lines in 2 files changed: 85 ins; 0 del; 2 mod 8256321: Some "inactive" color profiles use the wrong profile class Reviewed-by: prr ------------- PR: https://git.openjdk.java.net/jdk/pull/1211 From prr at openjdk.java.net Tue Jan 5 16:31:57 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 5 Jan 2021 16:31:57 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259007: This test printed a blank page In-Reply-To: References: Message-ID: On Tue, 5 Jan 2021 08:28:28 GMT, Prasanta Sadhukhan wrote: > Backout JDK-8256264 fix. I assume you tested this does indeed fix the regressipn ? Approving on that understanding. ------------- Marked as reviewed by prr (Reviewer). PR: https://git.openjdk.java.net/jdk16/pull/80 From prr at openjdk.java.net Tue Jan 5 16:36:57 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 5 Jan 2021 16:36:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout [v2] In-Reply-To: References: <7qjMCFOBix6UV1-FNgDfcBNkKvMXApGdA-f-9LvojRo=.c8334604-98f2-4baa-8a0b-abb171b6e1cf@github.com> Message-ID: <4O58ozI6UL_quW_Oaf3TgkMOiMYNoBzXaDbGVQHbJW8=.a9e26885-55b7-4247-ad2d-325263d7044a@github.com> On Mon, 4 Jan 2021 20:31:56 GMT, Phil Race wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> Fail the test if no printer is found > > test/jdk/java/awt/print/PrinterJob/LandscapeStackOverflow.java line 50: > >> 48: PrintService defaultPrtSrv = PrintServiceLookup.lookupDefaultPrintService(); >> 49: if (printjob.getPrintService() == null || defaultPrtSrv == null) { >> 50: throw new RuntimeException("No printer found"); > > We need to make this more robust. > The checks should be before we create the pritner job and should be to find ANY printer and none > throws the excepton, but if there is only a non-default one, set that as the printer for the job after creating the job. > > That may not matter on Windows but on other platforms I am sure you can have printers, but not a default one. > if (printService.length == 1) { So if there are two, you do nothing ? I was thinking of code like this PrintService[] printService = PrinterJob.lookupPrintServices(); if (printService.length == 0) { throw new RuntimeException("no printer found"); } PrinterJob printjob = PrinterJob.getPrinterJob(); if (printjob.getPrintService() == null) { printjob.setPrintService(printService[0]); } ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From serb at openjdk.java.net Tue Jan 5 23:36:57 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 5 Jan 2021 23:36:57 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259007: This test printed a blank page In-Reply-To: References: Message-ID: <5IeE9I8sVWZ-UCgiS0IehFWbU3vKWkhl5TDl_1nTJGE=.feaecc78-2846-4229-a916-c420d496e546@github.com> On Tue, 5 Jan 2021 08:28:28 GMT, Prasanta Sadhukhan wrote: > Backout JDK-8256264 fix. Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk16/pull/80 From serb at openjdk.java.net Wed Jan 6 00:04:55 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 6 Jan 2021 00:04:55 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259007: This test printed a blank page In-Reply-To: <5IeE9I8sVWZ-UCgiS0IehFWbU3vKWkhl5TDl_1nTJGE=.feaecc78-2846-4229-a916-c420d496e546@github.com> References: <5IeE9I8sVWZ-UCgiS0IehFWbU3vKWkhl5TDl_1nTJGE=.feaecc78-2846-4229-a916-c420d496e546@github.com> Message-ID: On Tue, 5 Jan 2021 23:34:02 GMT, Sergey Bylokhov wrote: >> Backout JDK-8256264 fix. > > Marked as reviewed by serb (Reviewer). The fix for JDK-8256264 made an assumption that moveTo/lineTo methods are always wrapped by the beginPath/endPath. So that fix sets the scale in the beginPath/endPath and correct the passed parameters in the moveTo/lineTo. But this new code in the moveTo/lineTo does not work well if the beginPath was not called. ------------- PR: https://git.openjdk.java.net/jdk16/pull/80 From psadhukhan at openjdk.java.net Wed Jan 6 04:29:11 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 6 Jan 2021 04:29:11 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout [v2] In-Reply-To: <4O58ozI6UL_quW_Oaf3TgkMOiMYNoBzXaDbGVQHbJW8=.a9e26885-55b7-4247-ad2d-325263d7044a@github.com> References: <7qjMCFOBix6UV1-FNgDfcBNkKvMXApGdA-f-9LvojRo=.c8334604-98f2-4baa-8a0b-abb171b6e1cf@github.com> <4O58ozI6UL_quW_Oaf3TgkMOiMYNoBzXaDbGVQHbJW8=.a9e26885-55b7-4247-ad2d-325263d7044a@github.com> Message-ID: On Tue, 5 Jan 2021 16:34:11 GMT, Phil Race wrote: >> test/jdk/java/awt/print/PrinterJob/LandscapeStackOverflow.java line 50: >> >>> 48: PrintService defaultPrtSrv = PrintServiceLookup.lookupDefaultPrintService(); >>> 49: if (printjob.getPrintService() == null || defaultPrtSrv == null) { >>> 50: throw new RuntimeException("No printer found"); >> >> We need to make this more robust. >> The checks should be before we create the pritner job and should be to find ANY printer and none >> throws the excepton, but if there is only a non-default one, set that as the printer for the job after creating the job. >> >> That may not matter on Windows but on other platforms I am sure you can have printers, but not a default one. > >> if (printService.length == 1) { > > So if there are two, you do nothing ? > > I was thinking of code like this > > PrintService[] printService = PrinterJob.lookupPrintServices(); > if (printService.length == 0) { > throw new RuntimeException("no printer found"); > } > PrinterJob printjob = PrinterJob.getPrinterJob(); > if (printjob.getPrintService() == null) { > printjob.setPrintService(printService[0]); > } I was of the understanding that if there are multiple, then we have to choose one as default so defaultPrintService will not be null. But, the above code looks more apt. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Wed Jan 6 04:29:10 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 6 Jan 2021 04:29:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout [v4] In-Reply-To: References: Message-ID: > Test fails with timeout and it seems likely due to non-availability of printer in the test system. We should just update the test to check for default (or available) printers and return if there is no printer. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Fix code ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1927/files - new: https://git.openjdk.java.net/jdk/pull/1927/files/7098cb41..8ed618f2 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1927&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1927&range=02-03 Stats: 13 lines in 1 file changed: 0 ins; 9 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/1927.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1927/head:pull/1927 PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Wed Jan 6 04:37:03 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 6 Jan 2021 04:37:03 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259007: This test printed a blank page In-Reply-To: References: Message-ID: On Tue, 5 Jan 2021 16:29:23 GMT, Phil Race wrote: > > > I assume you tested this does indeed fix the regressipn ? > Approving on that understanding. Yes, it does fix in my testing and I also got confirmation from EG that this patch fix the issues. ------------- PR: https://git.openjdk.java.net/jdk16/pull/80 From serb at openjdk.java.net Wed Jan 6 04:58:01 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 6 Jan 2021 04:58:01 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout [v4] In-Reply-To: References: Message-ID: On Wed, 6 Jan 2021 04:29:10 GMT, Prasanta Sadhukhan wrote: >> Test fails with timeout and it seems likely due to non-availability of printer in the test system. We should just update the test to check for default (or available) printers and return if there is no printer. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Fix code test/jdk/java/awt/print/PrinterJob/LandscapeStackOverflow.java line 46: > 44: > 45: public static final void main( String[] parameters ) throws Exception { > 46: PrintService[] printService = PrinterJob.lookupPrintServices(); As far as I understand and comment in my previouse comment, if the lookupPrintServices() return empty array then the "PrinterJob.print()" will throw the same PrinterException("No print service found"); And if default printer is not set, and we have some other printers then "PrinterJob.print()" will select some non-default printer already, isn't it? I meant that we just duplicate an existed checks, and both of them wll not work. If the system has some non-real printers like XPS, or "print to PDF" then such printers will be count by the "PrinterJob.lookupPrintServices()" so no exception will be thrown and the test just hands suggestion the user to save the printed document somewhere. The hang occur exactly where it is reported in JBS "WPrinterJob._startDoc". I can reproduce it on the freshly installed Windows. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Wed Jan 6 06:37:56 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 6 Jan 2021 06:37:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout [v4] In-Reply-To: References: Message-ID: On Wed, 6 Jan 2021 04:55:34 GMT, Sergey Bylokhov wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix code > > test/jdk/java/awt/print/PrinterJob/LandscapeStackOverflow.java line 46: > >> 44: >> 45: public static final void main( String[] parameters ) throws Exception { >> 46: PrintService[] printService = PrinterJob.lookupPrintServices(); > > As far as I understand and comment in my previouse comment, if the lookupPrintServices() return empty array then the "PrinterJob.print()" will throw the same PrinterException("No print service found"); > > And if default printer is not set, and we have some other printers then "PrinterJob.print()" will select some non-default printer already, isn't it? > > I meant that we just duplicate an existed checks, and both of them wll not work. If the system has some non-real printers like XPS, or "print to PDF" then such printers will be count by the "PrinterJob.lookupPrintServices()" so no exception will be thrown and the test just hands suggestion the user to save the printed document somewhere. The hang occur exactly where it is reported in JBS "WPrinterJob._startDoc". > > I can reproduce it on the freshly installed Windows. I'm not sure we can avoid this if user selects "print to pdf" as default printservice or if it is the only printservice available. Maybe converting it to manual is the way to go. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Wed Jan 6 06:39:59 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 6 Jan 2021 06:39:59 GMT Subject: [OpenJDK 2D-Dev] [jdk16] Integrated: 8259007: This test printed a blank page In-Reply-To: References: Message-ID: <592pk01b29mAgL-EDR7ndCQqKF6ysK32PSjt5zydSPY=.6fa34f64-5f5d-4a8e-ba81-c7c4239b0b49@github.com> On Tue, 5 Jan 2021 08:28:28 GMT, Prasanta Sadhukhan wrote: > Backout JDK-8256264 fix. This pull request has now been integrated. Changeset: 80110dac Author: Prasanta Sadhukhan URL: https://git.openjdk.java.net/jdk16/commit/80110dac Stats: 470 lines in 4 files changed: 0 ins; 459 del; 11 mod 8259007: This test printed a blank page Reviewed-by: prr, serb ------------- PR: https://git.openjdk.java.net/jdk16/pull/80 From serb at openjdk.java.net Wed Jan 6 06:45:54 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 6 Jan 2021 06:45:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout [v4] In-Reply-To: References: Message-ID: On Wed, 6 Jan 2021 06:35:20 GMT, Prasanta Sadhukhan wrote: >> test/jdk/java/awt/print/PrinterJob/LandscapeStackOverflow.java line 46: >> >>> 44: >>> 45: public static final void main( String[] parameters ) throws Exception { >>> 46: PrintService[] printService = PrinterJob.lookupPrintServices(); >> >> As far as I understand and comment in my previouse comment, if the lookupPrintServices() return empty array then the "PrinterJob.print()" will throw the same PrinterException("No print service found"); >> >> And if default printer is not set, and we have some other printers then "PrinterJob.print()" will select some non-default printer already, isn't it? >> >> I meant that we just duplicate an existed checks, and both of them wll not work. If the system has some non-real printers like XPS, or "print to PDF" then such printers will be count by the "PrinterJob.lookupPrintServices()" so no exception will be thrown and the test just hands suggestion the user to save the printed document somewhere. The hang occur exactly where it is reported in JBS "WPrinterJob._startDoc". >> >> I can reproduce it on the freshly installed Windows. > > I'm not sure we can avoid this if user selects "print to pdf" as default printservice or if it is the only printservice available. Maybe converting it to manual is the way to go. We can update the documentation "testing.html" about the "printer" keyword and describe how to skip/run the tests marked by this keyword. or we can just close the bug as not-a-defect. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Wed Jan 6 07:02:55 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 6 Jan 2021 07:02:55 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259232: Bad JNI lookup during printing In-Reply-To: References: Message-ID: On Wed, 6 Jan 2021 01:17:02 GMT, Phil Race wrote: > Didn't hit this because all the print testing I conducted used the swing print + page dialog but the logging made it easy to find the source of the problem. > I've also done an audit of GET_METHOD_* usages for this pattern - I had previously done it for DECLARE_METHOD* which is the bulk. Marked as reviewed by psadhukhan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/1952 From serb at openjdk.java.net Wed Jan 6 10:09:56 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 6 Jan 2021 10:09:56 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8259042: Inconsistent use of general primitives loops In-Reply-To: References: Message-ID: <0Opv1nzW_s0kfaXnLwwNxbcSWY_vEgtsjoguhOjVQ8U=.c3cee7e8-fa49-41f2-be52-2a416fde3049@github.com> On Mon, 4 Jan 2021 08:09:31 GMT, Sergey Bylokhov wrote: > The java2d uses the primitives such as Blit loop for rendering differing things. Currently, not all possible variants of primitives are implemented, but it is possible to register some general loop that may produce the primitives for some specific src/comp/dst. > > But we have some inconsistent here: > - Some primitives register themselves as a general loop but always return null in the makePrimitive() method > - Some primitives (which are not registered as general loops) return null or throw an error in the makePrimitive() method > > After the fix: > - The primitive will be registered as a general primitive only if it has a meaningful makePrimitive method > - An attempt to call the makePrimitive for non registered general loop will cause an error > > mach5 is green This pull request has now been integrated. Changeset: 8a05d605 Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/8a05d605 Stats: 260 lines in 22 files changed: 33 ins; 167 del; 60 mod 8259042: Inconsistent use of general primitives loops Reviewed-by: prr ------------- PR: https://git.openjdk.java.net/jdk/pull/1926 From prr at openjdk.java.net Wed Jan 6 17:36:55 2021 From: prr at openjdk.java.net (Phil Race) Date: Wed, 6 Jan 2021 17:36:55 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8259232: Bad JNI lookup during printing In-Reply-To: References: Message-ID: On Wed, 6 Jan 2021 01:17:02 GMT, Phil Race wrote: > Didn't hit this because all the print testing I conducted used the swing print + page dialog but the logging made it easy to find the source of the problem. > I've also done an audit of GET_METHOD_* usages for this pattern - I had previously done it for DECLARE_METHOD* which is the bulk. This pull request has now been integrated. Changeset: 940b0530 Author: Phil Race URL: https://git.openjdk.java.net/jdk/commit/940b0530 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod 8259232: Bad JNI lookup during printing Reviewed-by: psadhukhan ------------- PR: https://git.openjdk.java.net/jdk/pull/1952 From serb at openjdk.java.net Wed Jan 6 19:39:02 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 6 Jan 2021 19:39:02 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259232: Bad JNI lookup during printing In-Reply-To: References: Message-ID: On Wed, 6 Jan 2021 01:17:02 GMT, Phil Race wrote: > Didn't hit this because all the print testing I conducted used the swing print + page dialog but the logging made it easy to find the source of the problem. > I've also done an audit of GET_METHOD_* usages for this pattern - I had previously done it for DECLARE_METHOD* which is the bulk. src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m line 59: > 57: GET_METHOD_RETURN(sjm_getNSPrintInfo, sjc_CPrinterJob, "getNSPrintInfo", "()J", ret); > 58: > 59: #define GET_CPRINTERDIALOG_METHOD_RETURN(ret) \ I guess the name of the macro should be renamed as well? ------------- PR: https://git.openjdk.java.net/jdk/pull/1952 From serb at openjdk.java.net Thu Jan 7 02:09:10 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Thu, 7 Jan 2021 02:09:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 6986863: ProfileDeferralMgr throwing ConcurrentModificationException [v2] In-Reply-To: References: Message-ID: <-e0tgOvR6d52wrXo-w_8I-T3phJxifYXIYmicD2BBaQ=.d0550cdd-adcc-4ae6-9bb5-4f27067f4205@github.com> > This change intended to enhance the lazy initialization of the standard color profiles concurrently by different threads. > > We defer standard profiles loading because most of UI application uses a small amount of data from the profile like numComponents and colorSpaceType, and this data is known in advance. But any other profile-related activity (like a color conversion, profile data accesses, etc.) triggers profile activation when we load all profile data to the memory. > > Before the fix for JDK-6793818, we defer only one sRGB color profile, see: https://github.com/openjdk/jdk/commit/2726f2a3621dd2562d4fb660b4c3d376c65027aa > > Notes about the link above: > - The code in the ProfileDeferralMgr, which contain the Vector of profiles for activation does not use any synchronization > - The `activateDeferredProfile` and `activate` methods are implemented to throw `ProfileDataException`, but this exception is ignored during activation process: > https://github.com/openjdk/jdk/commit/2726f2a3621dd2562d4fb660b4c3d376c65027aa#diff-0839c25a6c999452be28b431c54d5daa91364d302cfda6efa5c56421c2f2bdcbR96 > > The fix: > - Drops the usage of ProfileDeferralMgr (which contained the Vector of profiles for activation) and ProfileActivator machinery. Instead, we will have just one `ICC_Profile.activate()` method which will activate and initialize the `ICC_Profile.cmmProfile` if it is null > - The `activate` method implementation mimics the old behavior when the CMMException and IOException were wrapped by the ProfileDataException, and the ProfileDataException itself was ignored during activation - > so an exception will not be thrown in the method itself, but only when the null profile will be used. > > See some comments inline. Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: - Merge branch 'master' into JDK-6986863 - Merge branch 'master' into JDK-6986863 - Merge branch 'master' into JDK-6986863 - Merge branch 'master' into JDK-6986863 - Delete the DeferralMgr machinery - Update ICC_Profile.java - Wrong spec in ProfileDeferralInfo - Update ICC_Profile.java - Race on access ICC_Profile#deferralInfo - Implementation of thread-safe per profile activation - ... and 1 more: https://git.openjdk.java.net/jdk/compare/67c22114...a5b2af2f ------------- Changes: https://git.openjdk.java.net/jdk/pull/1613/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1613&range=01 Stats: 520 lines in 9 files changed: 183 ins; 265 del; 72 mod Patch: https://git.openjdk.java.net/jdk/pull/1613.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1613/head:pull/1613 PR: https://git.openjdk.java.net/jdk/pull/1613 From serb at openjdk.java.net Thu Jan 7 02:25:18 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Thu, 7 Jan 2021 02:25:18 GMT Subject: [OpenJDK 2D-Dev] RFR: 6986863: ProfileDeferralMgr throwing ConcurrentModificationException [v3] In-Reply-To: References: Message-ID: > This change intended to enhance the lazy initialization of the standard color profiles concurrently by different threads. > > We defer standard profiles loading because most of UI application uses a small amount of data from the profile like numComponents and colorSpaceType, and this data is known in advance. But any other profile-related activity (like a color conversion, profile data accesses, etc.) triggers profile activation when we load all profile data to the memory. > > Before the fix for JDK-6793818, we defer only one sRGB color profile, see: https://github.com/openjdk/jdk/commit/2726f2a3621dd2562d4fb660b4c3d376c65027aa > > Notes about the link above: > - The code in the ProfileDeferralMgr, which contain the Vector of profiles for activation does not use any synchronization > - The `activateDeferredProfile` and `activate` methods are implemented to throw `ProfileDataException`, but this exception is ignored during activation process: > https://github.com/openjdk/jdk/commit/2726f2a3621dd2562d4fb660b4c3d376c65027aa#diff-0839c25a6c999452be28b431c54d5daa91364d302cfda6efa5c56421c2f2bdcbR96 > > The fix: > - Drops the usage of ProfileDeferralMgr (which contained the Vector of profiles for activation) and ProfileActivator machinery. Instead, we will have just one `ICC_Profile.activate()` method which will activate and initialize the `ICC_Profile.cmmProfile` if it is null > - The `activate` method implementation mimics the old behavior when the CMMException and IOException were wrapped by the ProfileDataException, and the ProfileDataException itself was ignored during activation - > so an exception will not be thrown in the method itself, but only when the null profile will be used. > > See some comments inline. Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: Update ProfileActivationDuringPropertyAccess.java ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1613/files - new: https://git.openjdk.java.net/jdk/pull/1613/files/a5b2af2f..fb32b3f4 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1613&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1613&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/1613.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1613/head:pull/1613 PR: https://git.openjdk.java.net/jdk/pull/1613 From mbaesken at openjdk.java.net Thu Jan 7 08:57:04 2021 From: mbaesken at openjdk.java.net (Matthias Baesken) Date: Thu, 7 Jan 2021 08:57:04 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 Message-ID: <2c1_uxFtoGC0thMIRFzfazpmpMDN90qO7oA2w5vYUsk=.485c854f-1f0c-4718-ba12-35a0cd77c041@github.com> Hello, for a while the AIX build fails with the following error in the harfbuzz build 1500-004: (U) INTERNAL COMPILER ERROR while compiling OT::MarkBasePosFormat1::collect_variation_indices(hb_collect_variation_indices_context_t *) const. Compilation ended. Contact your Service Representative and provide the following information: GRARNN: gr29643 is used before it is defined. This xlc 16 version is used for compiling bash-4.4$ xlc -qversion IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12) Version: 16.01.0000.0006 Solution by IBM compiler support is to use "-qdebug=necan", this effectively turns off an optimisation called "Early Re-canonizing" on the harfbuzz lib. ------------- Commit messages: - JDK-8258484 Changes: https://git.openjdk.java.net/jdk/pull/1972/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1972&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8258484 Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/1972.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1972/head:pull/1972 PR: https://git.openjdk.java.net/jdk/pull/1972 From mbaesken at openjdk.java.net Thu Jan 7 09:34:09 2021 From: mbaesken at openjdk.java.net (Matthias Baesken) Date: Thu, 7 Jan 2021 09:34:09 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 [v2] In-Reply-To: <2c1_uxFtoGC0thMIRFzfazpmpMDN90qO7oA2w5vYUsk=.485c854f-1f0c-4718-ba12-35a0cd77c041@github.com> References: <2c1_uxFtoGC0thMIRFzfazpmpMDN90qO7oA2w5vYUsk=.485c854f-1f0c-4718-ba12-35a0cd77c041@github.com> Message-ID: > Hello, for a while the AIX build fails with the following error in the harfbuzz build > 1500-004: (U) INTERNAL COMPILER ERROR while compiling OT::MarkBasePosFormat1::collect_variation_indices(hb_collect_variation_indices_context_t *) const. > Compilation ended. Contact your Service Representative and provide the following information: GRARNN: gr29643 is used before it is defined. > > This xlc 16 version is used for compiling > bash-4.4$ xlc -qversion > IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12) > Version: 16.01.0000.0006 > > Solution by IBM compiler support is to use "-qdebug=necan", this effectively turns off an optimisation called "Early Re-canonizing" on the harfbuzz lib. Matthias Baesken has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains two new commits since the last revision: - Adjust comment - JDK-8258484 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1972/files - new: https://git.openjdk.java.net/jdk/pull/1972/files/ecd93d06..27205b26 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1972&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1972&range=00-01 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/1972.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1972/head:pull/1972 PR: https://git.openjdk.java.net/jdk/pull/1972 From clanger at openjdk.java.net Thu Jan 7 09:34:10 2021 From: clanger at openjdk.java.net (Christoph Langer) Date: Thu, 7 Jan 2021 09:34:10 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 [v2] In-Reply-To: References: <2c1_uxFtoGC0thMIRFzfazpmpMDN90qO7oA2w5vYUsk=.485c854f-1f0c-4718-ba12-35a0cd77c041@github.com> Message-ID: On Thu, 7 Jan 2021 09:19:27 GMT, Matthias Baesken wrote: >> Hello, for a while the AIX build fails with the following error in the harfbuzz build >> 1500-004: (U) INTERNAL COMPILER ERROR while compiling OT::MarkBasePosFormat1::collect_variation_indices(hb_collect_variation_indices_context_t *) const. >> Compilation ended. Contact your Service Representative and provide the following information: GRARNN: gr29643 is used before it is defined. >> >> This xlc 16 version is used for compiling >> bash-4.4$ xlc -qversion >> IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12) >> Version: 16.01.0000.0006 >> >> Solution by IBM compiler support is to use "-qdebug=necan", this effectively turns off an optimisation called "Early Re-canonizing" on the harfbuzz lib. > > Matthias Baesken has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains two new commits since the last revision: > > - Adjust comment > - JDK-8258484 Hi Matthias, looks good to me in principal. I would spell out the abbreviation ICE, though, otherwise somebody reading this later could have difficulties to grok it ;-) Thanks Christoph Maybe better: Early re-canonizing has to be disabled to workaround an internal XlC compiler error when building libharfbuzz ? LGTM now :) ------------- Changes requested by clanger (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/1972Marked as reviewed by clanger (Reviewer). From mdoerr at openjdk.java.net Thu Jan 7 10:14:59 2021 From: mdoerr at openjdk.java.net (Martin Doerr) Date: Thu, 7 Jan 2021 10:14:59 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 [v2] In-Reply-To: References: <2c1_uxFtoGC0thMIRFzfazpmpMDN90qO7oA2w5vYUsk=.485c854f-1f0c-4718-ba12-35a0cd77c041@github.com> Message-ID: On Thu, 7 Jan 2021 09:34:09 GMT, Matthias Baesken wrote: >> Hello, for a while the AIX build fails with the following error in the harfbuzz build >> 1500-004: (U) INTERNAL COMPILER ERROR while compiling OT::MarkBasePosFormat1::collect_variation_indices(hb_collect_variation_indices_context_t *) const. >> Compilation ended. Contact your Service Representative and provide the following information: GRARNN: gr29643 is used before it is defined. >> >> This xlc 16 version is used for compiling >> bash-4.4$ xlc -qversion >> IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12) >> Version: 16.01.0000.0006 >> >> Solution by IBM compiler support is to use "-qdebug=necan", this effectively turns off an optimisation called "Early Re-canonizing" on the harfbuzz lib. > > Matthias Baesken has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. Marked as reviewed by mdoerr (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/1972 From mbaesken at openjdk.java.net Thu Jan 7 12:43:00 2021 From: mbaesken at openjdk.java.net (Matthias Baesken) Date: Thu, 7 Jan 2021 12:43:00 GMT Subject: [OpenJDK 2D-Dev] Integrated: JDK-8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 In-Reply-To: <2c1_uxFtoGC0thMIRFzfazpmpMDN90qO7oA2w5vYUsk=.485c854f-1f0c-4718-ba12-35a0cd77c041@github.com> References: <2c1_uxFtoGC0thMIRFzfazpmpMDN90qO7oA2w5vYUsk=.485c854f-1f0c-4718-ba12-35a0cd77c041@github.com> Message-ID: On Thu, 7 Jan 2021 08:51:25 GMT, Matthias Baesken wrote: > Hello, for a while the AIX build fails with the following error in the harfbuzz build > 1500-004: (U) INTERNAL COMPILER ERROR while compiling OT::MarkBasePosFormat1::collect_variation_indices(hb_collect_variation_indices_context_t *) const. > Compilation ended. Contact your Service Representative and provide the following information: GRARNN: gr29643 is used before it is defined. > > This xlc 16 version is used for compiling > bash-4.4$ xlc -qversion > IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12) > Version: 16.01.0000.0006 > > Solution by IBM compiler support is to use "-qdebug=necan", this effectively turns off an optimisation called "Early Re-canonizing" on the harfbuzz lib. This pull request has now been integrated. Changeset: 3f9f86f0 Author: Matthias Baesken URL: https://git.openjdk.java.net/jdk/commit/3f9f86f0 Stats: 6 lines in 1 file changed: 5 ins; 0 del; 1 mod 8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 Reviewed-by: clanger, mdoerr ------------- PR: https://git.openjdk.java.net/jdk/pull/1972 From sgehwolf at redhat.com Thu Jan 7 17:31:57 2021 From: sgehwolf at redhat.com (Severin Gehwolf) Date: Thu, 07 Jan 2021 18:31:57 +0100 Subject: [OpenJDK 2D-Dev] [11u] Backport of 8247872: Upgrade HarfBuzz to the latest 2.7.2 In-Reply-To: References: Message-ID: <32e197f5ec5fce10f1aaf06260c54b0328c7549b.camel@redhat.com> On Thu, 2021-01-07 at 17:16 +0000, Doerr, Martin wrote: > Hi, > > I've created a jdk11u backport of JDK-8247872: Upgrade HarfBuzz to > the latest 2.7.2 > http://cr.openjdk.java.net/~mdoerr/8247872_harfbuzz_11u/webrev.00/ > > I had to resolve it a bit manually [1]. > However, the main problem is that it heavily uses C++11, so easiest > solution is to add HARFBUZZ_CFLAGS := -std=c++11. > This works for all supported compilers [2] except xlC on AIX and sun > studio on Solaris. We are building vanilla JDK 11 builds with gcc 4.4.7 which doesn't support the -std=c++11 option. We've had issues in that area before. See JDK-8256557. Thanks, Severin > I could envision different solutions: > > ? 1.? Change code to work with older C++ standard. I don't want to do > this because this seems to be significant effort and is probably > error prone (I'm not really familiar with the code and TMP code is > hard to adapt). And we may have to repeat it for future HB upgrades. > ? 2.? Upgrade compilers: This is possible on AIX. We'd need to > backport some build changes and use xlclang++. But I guess there's no > solaris studio available which can compile it. Note that the original > bug was blocked by JEP 362: Deprecate the Solaris and SPARC Ports. > ? 3.? Use configure flag --with-harfbuzz=system on the problematic > platforms. Disadvantage: All machines require new enough version of > libharfbuzz installed. > ? 4.? Skip JDK-8247872 backport. Oracle must have had a reason for > backporting it to 11.0.11-oracle, so some jdk11u users will probably > want to have it at least on the main platforms. > > Any comments or ideas will be appreciated. > > Best regards, > Martin > > > [1] Resolution steps: > - Manually delete hb-dsalgs.hh. > - Awt2dLibraries.gmk is at a different location in 11u. > - Integrate a few hunks manually due to minor adaptations for Solaris > build: see > http://cr.openjdk.java.net/~mdoerr/8247872_harfbuzz_11u/8247872_harfbuzz_failing_hunks.txt > - Add HARFBUZZ_CFLAGS := -std=c++11 to Awt2dLibraries.gmk. > > [2] Supported compilers: > https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms > From jwilhelm at openjdk.java.net Thu Jan 7 20:45:15 2021 From: jwilhelm at openjdk.java.net (Jesper Wilhelmsson) Date: Thu, 7 Jan 2021 20:45:15 GMT Subject: [OpenJDK 2D-Dev] RFR: Merge jdk16 Message-ID: <02vnbZrSN2O7CorWeOmmETnD8eNM9ebzDlkuVSO5HPs=.bf19f127-43d1-4e1f-85eb-3ffa97908b21@github.com> Forwardport JDK 16 -> JDK 17 ------------- Commit messages: - Merge - 8249633: doclint reports missing javadoc for JavaFX property methods that have a property description - 8251200: False positive messages about missing comments for serialization - 8259312: VerifyCACerts.java fails as soneraclass2ca cert will expire in 90 days - 8259075: Update the copyright notice in the files generated by CLDR Converter tool - 8259224: (ann) getAnnotatedReceiverType should not parameterize owner(s) of statically nested classes - 8258558: Revert changes for JDK-8252505 and related issues - 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition - 8259007: This test printed a blank page - 8258989: JVM is failed to inline in jdk.internal.vm.vector.VectorSupport::convert - ... and 8 more: https://git.openjdk.java.net/jdk/compare/0e6de4eb...bbd6426f The webrevs contain the adjustments done while merging with regards to each parent branch: - master: https://webrevs.openjdk.java.net/?repo=jdk&pr=1989&range=00.0 - jdk16: https://webrevs.openjdk.java.net/?repo=jdk&pr=1989&range=00.1 Changes: https://git.openjdk.java.net/jdk/pull/1989/files Stats: 2957 lines in 68 files changed: 751 ins; 2142 del; 64 mod Patch: https://git.openjdk.java.net/jdk/pull/1989.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1989/head:pull/1989 PR: https://git.openjdk.java.net/jdk/pull/1989 From jwilhelm at openjdk.java.net Thu Jan 7 21:21:57 2021 From: jwilhelm at openjdk.java.net (Jesper Wilhelmsson) Date: Thu, 7 Jan 2021 21:21:57 GMT Subject: [OpenJDK 2D-Dev] Integrated: Merge jdk16 In-Reply-To: <02vnbZrSN2O7CorWeOmmETnD8eNM9ebzDlkuVSO5HPs=.bf19f127-43d1-4e1f-85eb-3ffa97908b21@github.com> References: <02vnbZrSN2O7CorWeOmmETnD8eNM9ebzDlkuVSO5HPs=.bf19f127-43d1-4e1f-85eb-3ffa97908b21@github.com> Message-ID: On Thu, 7 Jan 2021 20:40:49 GMT, Jesper Wilhelmsson wrote: > Forwardport JDK 16 -> JDK 17 This pull request has now been integrated. Changeset: 555641ed Author: Jesper Wilhelmsson URL: https://git.openjdk.java.net/jdk/commit/555641ed Stats: 2957 lines in 68 files changed: 751 ins; 2142 del; 64 mod Merge ------------- PR: https://git.openjdk.java.net/jdk/pull/1989 From christoph.langer at sap.com Thu Jan 7 22:41:38 2021 From: christoph.langer at sap.com (Langer, Christoph) Date: Thu, 7 Jan 2021 22:41:38 +0000 Subject: [OpenJDK 2D-Dev] [11u] Backport of 8247872: Upgrade HarfBuzz to the latest 2.7.2 In-Reply-To: <32e197f5ec5fce10f1aaf06260c54b0328c7549b.camel@redhat.com> References: <32e197f5ec5fce10f1aaf06260c54b0328c7549b.camel@redhat.com> Message-ID: Hi, is there any other reason why harfbuzz 2.7.2 needs to be backported to OpenJDK 11 beyond the fact that Oracle did it? I think both, having to uplift compiler requirements and/or requiring additional system dependencies, would be a price too high to pay for this. And modifying the code to work without c++11 features doesn't seem feasible. Just my .02? at this point... Best regards Christoph > -----Original Message----- > From: 2d-dev <2d-dev-retn at openjdk.java.net> On Behalf Of Severin > Gehwolf > Sent: Donnerstag, 7. Januar 2021 18:32 > To: Doerr, Martin ; jdk-updates- > dev at openjdk.java.net; 2d-dev at openjdk.java.net > Subject: Re: [OpenJDK 2D-Dev] [11u] Backport of 8247872: Upgrade HarfBuzz > to the latest 2.7.2 > > On Thu, 2021-01-07 at 17:16 +0000, Doerr, Martin wrote: > > Hi, > > > > I've created a jdk11u backport of JDK-8247872: Upgrade HarfBuzz to > > the latest 2.7.2 > > http://cr.openjdk.java.net/~mdoerr/8247872_harfbuzz_11u/webrev.00/ > > > > I had to resolve it a bit manually [1]. > > However, the main problem is that it heavily uses C++11, so easiest > > solution is to add HARFBUZZ_CFLAGS := -std=c++11. > > This works for all supported compilers [2] except xlC on AIX and sun > > studio on Solaris. > > We are building vanilla JDK 11 builds with gcc 4.4.7 which doesn't > support the -std=c++11 option. We've had issues in that area before. > See JDK-8256557. > > Thanks, > Severin > > > I could envision different solutions: > > > > ? 1.? Change code to work with older C++ standard. I don't want to do > > this because this seems to be significant effort and is probably > > error prone (I'm not really familiar with the code and TMP code is > > hard to adapt). And we may have to repeat it for future HB upgrades. > > ? 2.? Upgrade compilers: This is possible on AIX. We'd need to > > backport some build changes and use xlclang++. But I guess there's no > > solaris studio available which can compile it. Note that the original > > bug was blocked by JEP 362: Deprecate the Solaris and SPARC Ports. > > ? 3.? Use configure flag --with-harfbuzz=system on the problematic > > platforms. Disadvantage: All machines require new enough version of > > libharfbuzz installed. > > ? 4.? Skip JDK-8247872 backport. Oracle must have had a reason for > > backporting it to 11.0.11-oracle, so some jdk11u users will probably > > want to have it at least on the main platforms. > > > > Any comments or ideas will be appreciated. > > > > Best regards, > > Martin > > > > > > [1] Resolution steps: > > - Manually delete hb-dsalgs.hh. > > - Awt2dLibraries.gmk is at a different location in 11u. > > - Integrate a few hunks manually due to minor adaptations for Solaris > > build: see > > > http://cr.openjdk.java.net/~mdoerr/8247872_harfbuzz_11u/8247872_harfb > uzz_failing_hunks.txt > > - Add HARFBUZZ_CFLAGS := -std=c++11 to Awt2dLibraries.gmk. > > > > [2] Supported compilers: > > https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms > > > From clanger at openjdk.java.net Thu Jan 7 22:55:08 2021 From: clanger at openjdk.java.net (Christoph Langer) Date: Thu, 7 Jan 2021 22:55:08 GMT Subject: [OpenJDK 2D-Dev] [jdk16] Integrated: 8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 Message-ID: 8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 ------------- Commit messages: - Backport 3f9f86f0d3f918b9955ba6ba73c9c58ae8fcf7cb Changes: https://git.openjdk.java.net/jdk16/pull/95/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk16&pr=95&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8258484 Stats: 6 lines in 1 file changed: 5 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk16/pull/95.diff Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/95/head:pull/95 PR: https://git.openjdk.java.net/jdk16/pull/95 From clanger at openjdk.java.net Thu Jan 7 22:55:08 2021 From: clanger at openjdk.java.net (Christoph Langer) Date: Thu, 7 Jan 2021 22:55:08 GMT Subject: [OpenJDK 2D-Dev] [jdk16] Integrated: 8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 In-Reply-To: References: Message-ID: On Thu, 7 Jan 2021 22:47:35 GMT, Christoph Langer wrote: > 8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 This pull request has now been integrated. Changeset: 677802d2 Author: Christoph Langer URL: https://git.openjdk.java.net/jdk16/commit/677802d2 Stats: 6 lines in 1 file changed: 5 ins; 0 del; 1 mod 8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006 Backport-of: 3f9f86f0d3f918b9955ba6ba73c9c58ae8fcf7cb ------------- PR: https://git.openjdk.java.net/jdk16/pull/95 From aph at redhat.com Fri Jan 8 09:44:23 2021 From: aph at redhat.com (Andrew Haley) Date: Fri, 8 Jan 2021 09:44:23 +0000 Subject: [OpenJDK 2D-Dev] [11u] Backport of 8247872: Upgrade HarfBuzz to the latest 2.7.2 In-Reply-To: References: <32e197f5ec5fce10f1aaf06260c54b0328c7549b.camel@redhat.com> Message-ID: <46127723-fc47-1526-99da-6fb48af2a3ee@redhat.com> On 1/7/21 10:41 PM, Langer, Christoph wrote: > Hi, > > is there any other reason why harfbuzz 2.7.2 needs to be backported to OpenJDK 11 beyond the fact that Oracle did it? > > I think both, having to uplift compiler requirements and/or requiring additional system dependencies, would be a price too high to pay for this. And modifying the code to work without c++11 features doesn't seem feasible. It does seem like a lot of work. maybe the issue is that HarfBuzz is no longer supported, and wouldn't get critical updates. -- Andrew Haley (he/him) Java Platform Lead Engineer Red Hat UK Ltd. https://keybase.io/andrewhaley EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671 From prr at openjdk.java.net Sat Jan 9 01:33:02 2021 From: prr at openjdk.java.net (Phil Race) Date: Sat, 9 Jan 2021 01:33:02 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. Message-ID: Proposed updates to JNI error handling. ------------- Commit messages: - 8259343: [macOS] Update JNI error handling in Cocoa code. - 8259343: [macOS] Update JNI error handling in Cocoa code. Changes: https://git.openjdk.java.net/jdk/pull/1967/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1967&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8259343 Stats: 73 lines in 8 files changed: 58 ins; 1 del; 14 mod Patch: https://git.openjdk.java.net/jdk/pull/1967.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1967/head:pull/1967 PR: https://git.openjdk.java.net/jdk/pull/1967 From serb at openjdk.java.net Sat Jan 9 01:33:03 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 9 Jan 2021 01:33:03 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. In-Reply-To: References: Message-ID: On Wed, 6 Jan 2021 21:14:06 GMT, Phil Race wrote: > Proposed updates to JNI error handling. src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 180: > 178: * nature of the problem that has been detected and how survivable it is. > 179: */ > 180: #define CHECK_EXCEPTION() \ Since this macro does not try to return from the outer code we can change it to the method? src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 182: > 180: #define CHECK_EXCEPTION() \ > 181: if ((*env)->ExceptionOccurred(env) != NULL) { \ > 182: if ([NSThread isMainThread] == YES) { \ Isn't it is a similar code to the https://github.com/openjdk/jdk/blob/67c221148159d94142a3a6d9ddadce2dff8c858b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m#L334 Where we just catch an exception log it, and continue to run our infinite loop? Why do we need to do something specific here? I mean we cannot drop any try/catch blocks anyway since an nsexception may be generated by some external system code. src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 41: > 39: NSLog(@"%@",[NSThread callStackSymbols]); \ > 40: if ([NSThread isMainThread] == NO) { \ > 41: JNU_ThrowInternalError(env, "Bad JNI Lookup"); \ It will be possible that(most of the time) the JNU_ThrowInternalError will be called while we already have a raised java exception. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Sat Jan 9 01:33:05 2021 From: prr at openjdk.java.net (Phil Race) Date: Sat, 9 Jan 2021 01:33:05 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. In-Reply-To: References: Message-ID: On Thu, 7 Jan 2021 00:35:27 GMT, Sergey Bylokhov wrote: >> Proposed updates to JNI error handling. > > src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 180: > >> 178: * nature of the problem that has been detected and how survivable it is. >> 179: */ >> 180: #define CHECK_EXCEPTION() \ > > Since this macro does not try to return from the outer code we can change it to the method? But then "env" would need to be passed explicitly. I don't think the churn is worth it. And a method would then need a .m or .c file ... > src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 41: > >> 39: NSLog(@"%@",[NSThread callStackSymbols]); \ >> 40: if ([NSThread isMainThread] == NO) { \ >> 41: JNU_ThrowInternalError(env, "Bad JNI Lookup"); \ > > It will be possible that(most of the time) the JNU_ThrowInternalError will be called while we already have a raised java exception. I don't think "most" of the time is very likely. JNI lookup failures don't cause exceptions to be thrown. Is that what you are tihinking ? And separately, with either the current code of clearing exceptions or the change here to the practice of throwing NSException on seeing a Java Exception I think it very unlikely. > src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 182: > >> 180: #define CHECK_EXCEPTION() \ >> 181: if ((*env)->ExceptionOccurred(env) != NULL) { \ >> 182: if ([NSThread isMainThread] == YES) { \ > > Isn't it is a similar code to the > https://github.com/openjdk/jdk/blob/67c221148159d94142a3a6d9ddadce2dff8c858b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m#L334 > Where we just catch an exception log it, and continue to run our infinite loop? Why do we need to do something specific here? I mean we cannot drop any try/catch blocks anyway since an nsexception may be generated by some external system code. In my testing that code does not get called. The new code does. So the old code could probably be deleted as useless but it is also harmless and just maybe it'll catch something else, even if it isn't doing anything that I can see. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From serb at openjdk.java.net Sat Jan 9 01:33:06 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 9 Jan 2021 01:33:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. In-Reply-To: References: Message-ID: On Fri, 8 Jan 2021 02:40:58 GMT, Phil Race wrote: >> src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 41: >> >>> 39: NSLog(@"%@",[NSThread callStackSymbols]); \ >>> 40: if ([NSThread isMainThread] == NO) { \ >>> 41: JNU_ThrowInternalError(env, "Bad JNI Lookup"); \ >> >> It will be possible that(most of the time) the JNU_ThrowInternalError will be called while we already have a raised java exception. > > I don't think "most" of the time is very likely. JNI lookup failures don't cause exceptions to be thrown. > Is that what you are tihinking ? > > And separately, with either the current code of clearing exceptions or the change here to the practice of throwing NSException on seeing a Java Exception I think it very unlikely. Then how we get NoSuchMethodError here? https://bugs.openjdk.java.net/browse/JDK-8259232? https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#GetMethodID Calling Instance Methods: GetMethodID RETURNS: Returns a method ID, or NULL if the specified method cannot be found. THROWS: NoSuchMethodError: if the specified method cannot be found. ExceptionInInitializerError: if the class initializer fails due to an exception. OutOfMemoryError: if the system runs out of memory. Same for fields: https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#GetFieldID >> src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 180: >> >>> 178: * nature of the problem that has been detected and how survivable it is. >>> 179: */ >>> 180: #define CHECK_EXCEPTION() \ >> >> Since this macro does not try to return from the outer code we can change it to the method? > > But then "env" would need to be passed explicitly. I don't think the churn is worth it. > And a method would then need a .m or .c file ... But that could be merged to the CallXXXMethod and placed somewhere in the libosxapp >> src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 182: >> >>> 180: #define CHECK_EXCEPTION() \ >>> 181: if ((*env)->ExceptionOccurred(env) != NULL) { \ >>> 182: if ([NSThread isMainThread] == YES) { \ >> >> Isn't it is a similar code to the >> https://github.com/openjdk/jdk/blob/67c221148159d94142a3a6d9ddadce2dff8c858b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m#L334 >> Where we just catch an exception log it, and continue to run our infinite loop? Why do we need to do something specific here? I mean we cannot drop any try/catch blocks anyway since an nsexception may be generated by some external system code. > > In my testing that code does not get called. The new code does. So the old code could probably be deleted as useless but it is also harmless and just maybe it'll catch something else, even if it isn't doing anything that I can see. That code for sure should be called, it is even improved recently by JDK-8255681 I'll check how it was intended to work. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Sat Jan 9 01:33:06 2021 From: prr at openjdk.java.net (Phil Race) Date: Sat, 9 Jan 2021 01:33:06 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. In-Reply-To: References: Message-ID: <2MhWS44-i0zX8lt6BUh_dpOxsEQdYnifCB8dcqO_25E=.319e2c92-6bf1-40fa-86a6-5d9df8c6c27e@github.com> On Fri, 8 Jan 2021 04:40:36 GMT, Sergey Bylokhov wrote: >> But then "env" would need to be passed explicitly. I don't think the churn is worth it. >> And a method would then need a .m or .c file ... > > But that could be merged to the CallXXXMethod and placed somewhere in the libosxapp You mean those methods or macros that we already discussed and I explained why I do not want to do that ? This is a small update for error checking not revisiting everything done before. >> I don't think "most" of the time is very likely. JNI lookup failures don't cause exceptions to be thrown. >> Is that what you are tihinking ? >> >> And separately, with either the current code of clearing exceptions or the change here to the practice of throwing NSException on seeing a Java Exception I think it very unlikely. > > Then how we get NoSuchMethodError here? https://bugs.openjdk.java.net/browse/JDK-8259232? > https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#GetMethodID > Calling Instance Methods: GetMethodID > RETURNS: > Returns a method ID, or NULL if the specified method cannot be found. > THROWS: > NoSuchMethodError: if the specified method cannot be found. > ExceptionInInitializerError: if the class initializer fails due to an exception. > OutOfMemoryError: if the system runs out of memory. > > Same for fields: > https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#GetFieldID Ok. I will only create my own if none is pending. >> In my testing that code does not get called. The new code does. So the old code could probably be deleted as useless but it is also harmless and just maybe it'll catch something else, even if it isn't doing anything that I can see. > > That code for sure should be called, it is even improved recently by JDK-8255681 > I'll check how it was intended to work. I hadn't noticed that line - and definintely not realised it was recent. I suppose he must have had a way to trigger it. But I don't think it hurts to have both. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Sat Jan 9 01:33:07 2021 From: prr at openjdk.java.net (Phil Race) Date: Sat, 9 Jan 2021 01:33:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. In-Reply-To: References: Message-ID: On Wed, 6 Jan 2021 21:14:06 GMT, Phil Race wrote: > Proposed updates to JNI error handling. src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 46: > 44: if ((*env)->ExceptionOccurred(env) != NULL) { \ > 45: (*env)->ExceptionDescribe(env); \ > 46: } \ So the update here is that if we are not on the appkit thread, make sure a java exception is thrown. If we are on the appkit thread, clear any java exception since it isn't going anywhere but do it using describe which prints it. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From lbourges at openjdk.java.net Sat Jan 9 09:13:03 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sat, 9 Jan 2021 09:13:03 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang Message-ID: This is my first fix proposal on this bug: - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class - fix all RenderingEngine implementations in java.desktop module - MarlinRenderingEngine now use the clip region to roughly & quickly clip the given shape in strokeTo(clip) - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. I will write a new test class in follow-up commits to validate the bug fix. ------------- Commit messages: - fixed whitespaces - jdk-7018932.0 Changes: https://git.openjdk.java.net/jdk/pull/2013/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-7018932 Stats: 225 lines in 5 files changed: 219 ins; 1 del; 5 mod Patch: https://git.openjdk.java.net/jdk/pull/2013.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2013/head:pull/2013 PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Sat Jan 9 09:50:19 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sat, 9 Jan 2021 09:50:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v2] In-Reply-To: References: Message-ID: <186HTlXruOKA44_Y4m-Ruo36mGXKdambtsvbIt5m0fo=.4991139b-5e2f-4d07-b45a-8479dea183aa@github.com> > This is my first fix proposal on this bug: > - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class > - fix all RenderingEngine implementations in java.desktop module > - MarlinRenderingEngine now use the clip region to roughly & quickly clip the given shape in strokeTo(clip) > - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. > > I will write a new test class in follow-up commits to validate the bug fix. Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: fixed RenderingEngine.Tracer impl + added DrawingTest7018932 test ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2013/files - new: https://git.openjdk.java.net/jdk/pull/2013/files/4d04b85d..5785f866 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=00-01 Stats: 134 lines in 2 files changed: 134 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/2013.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2013/head:pull/2013 PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Sat Jan 9 10:05:11 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sat, 9 Jan 2021 10:05:11 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v3] In-Reply-To: References: Message-ID: > This is my first fix proposal on this bug: > - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class > - fix all RenderingEngine implementations in java.desktop module > - MarlinRenderingEngine now use the clip region to roughly & quickly clip the given shape in strokeTo(clip) > - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. > > I will write a new test class in follow-up commits to validate the bug fix. Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: fixed white spaces ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2013/files - new: https://git.openjdk.java.net/jdk/pull/2013/files/5785f866..4df9ab38 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2013.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2013/head:pull/2013 PR: https://git.openjdk.java.net/jdk/pull/2013 From serb at openjdk.java.net Sat Jan 9 10:20:21 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 9 Jan 2021 10:20:21 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255710: Opensource unit/regression tests for CMM Message-ID: A few tests for the CMM moved to the open repo. ------------- Commit messages: - Initial fix Changes: https://git.openjdk.java.net/jdk/pull/2012/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2012&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8255710 Stats: 457 lines in 8 files changed: 457 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/2012.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2012/head:pull/2012 PR: https://git.openjdk.java.net/jdk/pull/2012 From pbansal at openjdk.java.net Sat Jan 9 12:53:11 2021 From: pbansal at openjdk.java.net (Pankaj Bansal) Date: Sat, 9 Jan 2021 12:53:11 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259237: Demo selection changes with left/right arrow key. No need to press space for selection. Message-ID: Please review a fix for jdk16 Issue: In SwingSet2, if the user navigates through the demos, the demo gets selected/starts on pressing left/right key only. There is no need to press the "space" key. Earlier, on pressing the left/right key, only demo icon used to get focused and user needed to press the "space" to actually select a demo. Cause: The SwingSet2 has JToggleButtons added to a ButtonGroup. Each JToggleButton has an AbstractAction set on it, which loads the demo. Earlier, when the user pressed Left/Right button, only the selected button used to change. The Action set on JToggleButton used to perform only on pressing the "Space" button. Now, the Action is performed on navigating the JToggleButtons using Left/Right keys without the need to press the "space" key. This issue is a side effect of fix done for https://bugs.openjdk.java.net/browse/JDK-8249548. The issues fixed in JDK-8249548 were not present in JRadioButton as there was code available to handle it in AquaButtonRadioUI and BasicRadioButtonUI. The fix done for JDK-8249548 moved duplicate code from AquaButtonRadioUI and BasicRadioButtonUI and moved it to BasicButtonUI, so this code is available for JToggleButton and JRadioButton for all L&Fs. This was wrong as there is a difference in behaviour for JRadioButtons added to ButtonGroup for AquaL&F and other L&Fs. In AquaL&F, the AbstractAction set on JRadioButton is not performed on button selection and user has to press "space". In other L&Fs, the AbstractAction is performed on selection of Button itself without the need to press "space". Fix: The current change fixes the issue in present bug and keeps the fixes done in JDK-8249548. Following is the behaviour of JToggleButton and JRadioButton for different L&Fs before JDK-8249548 fix, after JDK-8249548 fix and after current fix. Before fix for JDK-8249548 JToggleButton: For all L&Fs, user can not navigate/select the buttons added to ButtonGroup properly as mentioned in the JDK-8249548. JRadioButton: For Synth L&F (Nimbus L&F), user can not navigate/select the buttons added to ButtonGroup. For AquaL&F, user can select the buttons added to ButtonGroup by pressing left/right key and needs to press the "space" to perform the set Action. For Other L&Fs, user can select/navigate the buttons and the set Action is also performed without pressing "space" After fix for JDK-8249548 JToggleButton: For all L&Fs, user can navigate/select the buttons added to ButtonGroups and the AbstractAction set is performed without the need to press "space". JRadioButton: For all L&Fs, user can navigate/select the buttons added to ButtonGroups and the AbstractAction set is performed without the need to press "space". After current fix: JToggleButton: For all L&Fs, user can navigate/select the buttons added to ButtonGroups. User needs to press "space" to perform the set AbstractAction. JRadioButton: For AquaL&F, the behaviour before JDK-8249548 is restored, so user needs to press the "space" to perform the set Action. For all other L&Fs (including Synth L&F), the behaviour is same. User can navigate/select the buttons added to ButtonGroups and set Action is performed without pressing "space" I have run mach5 jobs with full jtreg/jck and all looks good. Links in JBS. The test TestButtonGroupFocusTraversal.java is modified such that it fails without current fix and passes after the fix. The fix also should be verified by running SwingSet2. ------------- Commit messages: - 8259237: Demo selection changes with left/right arrow key. No need to press space for selection. Changes: https://git.openjdk.java.net/jdk16/pull/99/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk16&pr=99&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8259237 Stats: 375 lines in 4 files changed: 350 ins; 20 del; 5 mod Patch: https://git.openjdk.java.net/jdk16/pull/99.diff Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/99/head:pull/99 PR: https://git.openjdk.java.net/jdk16/pull/99 From serb at openjdk.java.net Sun Jan 10 02:49:57 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sun, 10 Jan 2021 02:49:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v3] In-Reply-To: References: Message-ID: On Sat, 9 Jan 2021 10:05:11 GMT, Laurent Bourg?s wrote: >> This is my fix proposal to this bug: >> - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class >> - fixed all RenderingEngine implementations in java.desktop module >> - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) >> - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. >> >> I wrote a new test class to validate the bug fix. > > Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: > > fixed white spaces src/java.desktop/share/classes/sun/java2d/pipe/RenderingEngine.java line 257: > 255: * @since 17 > 256: */ > 257: public abstract void strokeTo(Shape src, I think we need to clarify the backward compatibility of this change. - If we would like to support the old marlin version via "-Dsun.java2d.renderer" option in jdk17 then adding the new abstract method to this interface breaks this possibility. To support that this method should be made default and call the old strokeTo method. - If support for the old marlin library is not necessary then we could drop the old method from this interface(but preserve it in the MarlinRenderingEngine to have the same marlin codebase), it won't be used anyway. src/java.desktop/share/classes/sun/java2d/pipe/LoopPipe.java line 273: > 271: (sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE); > 272: > 273: // No clipping (pre-jdk17) This code is not a part of the marlin, so exists only in the jdk17. Do we need these commented lines here? test/jdk/sun/java2d/marlin/DrawingTest7018932.java line 42: > 40: * @run main DrawingTest7018932 > 41: */ > 42: public class DrawingTest7018932 extends JPanel { This will work only in the headful environment, I suggest something like this: /* * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ import java.awt.BasicStroke; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Stroke; import java.awt.geom.Line2D; import java.awt.image.BufferedImage; import static java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE; /* * @test * @bug 7018932 * @summary fix LoopPipe.getStrokedSpans() performance (clipping enabled by Marlin renderer) */ public final class StrokedLinePerf { public static void main(String[] args) { BufferedImage bi = new BufferedImage(400, 400, TYPE_INT_ARGB_PRE); test(bi, true); test(bi, false); } private static void test(BufferedImage bi, boolean useAA) { Graphics2D g2d = bi.createGraphics(); long start = System.nanoTime(); if (useAA) { g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); } else { g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); } Stroke stroke = new BasicStroke(2.0f, 1, 0, 1.0f, new float[]{0.0f, 4.0f}, 0.0f); g2d.setStroke(stroke); //Large values to trigger crash / infinite loop. g2d.draw(new Line2D.Double(4.0, 1.794369841E9, 567.0, -2.147483648E9)); System.out.println("Test duration= " + (1e-6 * (System.nanoTime() - start)) + " ms."); g2d.dispose(); } } ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Sun Jan 10 11:19:56 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sun, 10 Jan 2021 11:19:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v3] In-Reply-To: References: Message-ID: On Sun, 10 Jan 2021 02:20:04 GMT, Sergey Bylokhov wrote: >> Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: >> >> fixed white spaces > > src/java.desktop/share/classes/sun/java2d/pipe/RenderingEngine.java line 257: > >> 255: * @since 17 >> 256: */ >> 257: public abstract void strokeTo(Shape src, > > I think we need to clarify the backward compatibility of this change. > - If we would like to support the old marlin version via "-Dsun.java2d.renderer" option in jdk17 then adding the new abstract method to this interface breaks this possibility. To support that this method should be made default and call the old strokeTo method. > - If support for the old marlin library is not necessary then we could drop the old method from this interface(but preserve it in the MarlinRenderingEngine to have the same marlin codebase), it won't be used anyway. I like the first proposal: use default class method as RE is an abstract class. > src/java.desktop/share/classes/sun/java2d/pipe/LoopPipe.java line 273: > >> 271: (sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE); >> 272: >> 273: // No clipping (pre-jdk17) > > This code is not a part of the marlin, so exists only in the jdk17. Do we need these commented lines here? Will remove the comment > test/jdk/sun/java2d/marlin/DrawingTest7018932.java line 42: > >> 40: * @run main DrawingTest7018932 >> 41: */ >> 42: public class DrawingTest7018932 extends JPanel { > > This will work only in the headful environment, I suggest something like this: > /* > * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > * under the terms of the GNU General Public License version 2 only, as > * published by the Free Software Foundation. > * > * This code is distributed in the hope that it will be useful, but WITHOUT > * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > * version 2 for more details (a copy is included in the LICENSE file that > * accompanied this code). > * > * You should have received a copy of the GNU General Public License version > * 2 along with this work; if not, write to the Free Software Foundation, > * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > * > * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA > * or visit www.oracle.com if you need additional information or have any > * questions. > */ > > import java.awt.BasicStroke; > import java.awt.Graphics2D; > import java.awt.RenderingHints; > import java.awt.Stroke; > import java.awt.geom.Line2D; > import java.awt.image.BufferedImage; > > import static java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE; > > /* > * @test > * @bug 7018932 > * @summary fix LoopPipe.getStrokedSpans() performance (clipping enabled by Marlin renderer) > */ > public final class StrokedLinePerf { > > public static void main(String[] args) { > BufferedImage bi = new BufferedImage(400, 400, TYPE_INT_ARGB_PRE); > test(bi, true); > test(bi, false); > } > > private static void test(BufferedImage bi, boolean useAA) { > Graphics2D g2d = bi.createGraphics(); > long start = System.nanoTime(); > > if (useAA) { > g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, > RenderingHints.VALUE_ANTIALIAS_ON); > } else { > g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, > RenderingHints.VALUE_ANTIALIAS_OFF); > } > > Stroke stroke = new BasicStroke(2.0f, 1, 0, 1.0f, new float[]{0.0f, 4.0f}, 0.0f); > g2d.setStroke(stroke); > > //Large values to trigger crash / infinite loop. > g2d.draw(new Line2D.Double(4.0, 1.794369841E9, 567.0, -2.147483648E9)); > > System.out.println("Test duration= " + (1e-6 * (System.nanoTime() - start)) + " ms."); > g2d.dispose(); > } > } Interesting, but BufferedImage rendering may use another java2d pipeline... so I will check if LoopPipe.getStrokedSpans() is used by your test code. ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Sun Jan 10 11:19:58 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sun, 10 Jan 2021 11:19:58 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v3] In-Reply-To: References: Message-ID: On Sun, 10 Jan 2021 11:16:51 GMT, Laurent Bourg?s wrote: >> test/jdk/sun/java2d/marlin/DrawingTest7018932.java line 42: >> >>> 40: * @run main DrawingTest7018932 >>> 41: */ >>> 42: public class DrawingTest7018932 extends JPanel { >> >> This will work only in the headful environment, I suggest something like this: >> /* >> * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. >> * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. >> * >> * This code is free software; you can redistribute it and/or modify it >> * under the terms of the GNU General Public License version 2 only, as >> * published by the Free Software Foundation. >> * >> * This code is distributed in the hope that it will be useful, but WITHOUT >> * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or >> * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License >> * version 2 for more details (a copy is included in the LICENSE file that >> * accompanied this code). >> * >> * You should have received a copy of the GNU General Public License version >> * 2 along with this work; if not, write to the Free Software Foundation, >> * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. >> * >> * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA >> * or visit www.oracle.com if you need additional information or have any >> * questions. >> */ >> >> import java.awt.BasicStroke; >> import java.awt.Graphics2D; >> import java.awt.RenderingHints; >> import java.awt.Stroke; >> import java.awt.geom.Line2D; >> import java.awt.image.BufferedImage; >> >> import static java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE; >> >> /* >> * @test >> * @bug 7018932 >> * @summary fix LoopPipe.getStrokedSpans() performance (clipping enabled by Marlin renderer) >> */ >> public final class StrokedLinePerf { >> >> public static void main(String[] args) { >> BufferedImage bi = new BufferedImage(400, 400, TYPE_INT_ARGB_PRE); >> test(bi, true); >> test(bi, false); >> } >> >> private static void test(BufferedImage bi, boolean useAA) { >> Graphics2D g2d = bi.createGraphics(); >> long start = System.nanoTime(); >> >> if (useAA) { >> g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, >> RenderingHints.VALUE_ANTIALIAS_ON); >> } else { >> g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, >> RenderingHints.VALUE_ANTIALIAS_OFF); >> } >> >> Stroke stroke = new BasicStroke(2.0f, 1, 0, 1.0f, new float[]{0.0f, 4.0f}, 0.0f); >> g2d.setStroke(stroke); >> >> //Large values to trigger crash / infinite loop. >> g2d.draw(new Line2D.Double(4.0, 1.794369841E9, 567.0, -2.147483648E9)); >> >> System.out.println("Test duration= " + (1e-6 * (System.nanoTime() - start)) + " ms."); >> g2d.dispose(); >> } >> } > > Interesting, but BufferedImage rendering may use another java2d pipeline... so I will check if LoopPipe.getStrokedSpans() is used by your test code. Moreover the bug was detected on both gdi & xrender native pipelines... ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From pbansal at openjdk.java.net Sun Jan 10 12:59:58 2021 From: pbansal at openjdk.java.net (Pankaj Bansal) Date: Sun, 10 Jan 2021 12:59:58 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255710: Opensource unit/regression tests for CMM In-Reply-To: References: Message-ID: On Sat, 9 Jan 2021 07:28:20 GMT, Sergey Bylokhov wrote: > A few tests for the CMM moved to the open repo. Marked as reviewed by pbansal (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2012 From lbourges at openjdk.java.net Sun Jan 10 21:00:17 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sun, 10 Jan 2021 21:00:17 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v4] In-Reply-To: References: Message-ID: > This is my fix proposal to this bug: > - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class > - fixed all RenderingEngine implementations in java.desktop module > - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) > - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. > > I wrote a new test class to validate the bug fix. Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: Fixed RenderingEngine.strokeTo(clip) to call by default former method. Fixed CurveClipSplitter (float) to use double-precision for higher accuracy. Improved StrokedLineTest to use only bufferedimage rendering. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2013/files - new: https://git.openjdk.java.net/jdk/pull/2013/files/4df9ab38..3ae23d94 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=02-03 Stats: 216 lines in 4 files changed: 74 ins; 112 del; 30 mod Patch: https://git.openjdk.java.net/jdk/pull/2013.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2013/head:pull/2013 PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Sun Jan 10 21:00:18 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sun, 10 Jan 2021 21:00:18 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v3] In-Reply-To: References: Message-ID: On Sun, 10 Jan 2021 11:17:49 GMT, Laurent Bourg?s wrote: >> Interesting, but BufferedImage rendering may use another java2d pipeline... so I will check if LoopPipe.getStrokedSpans() is used by your test code. > > Moreover the bug was detected on both gdi & xrender native pipelines... Confirmed: * useAA=true: sun.java2d.marlin.MarlinRenderingEngine.getAATileGenerator(java.awt.geom.Line2D$Double, AffineTransform[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]], Region[[0, 0 => 400, 400]], java.awt.BasicStroke at 110e1781, wide, normalized) * useAA=false: sun.java2d.marlin.MarlinRenderingEngine.strokeTo(java.awt.geom.Line2D$Double, AffineTransform[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]], Region[[0, 0 => 400, 400]], java.awt.BasicStroke at 110e1781, wide, normalized, non-AA, sun.java2d.pipe.ShapeSpanIterator) ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Sun Jan 10 21:04:12 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sun, 10 Jan 2021 21:04:12 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v5] In-Reply-To: References: Message-ID: > This is my fix proposal to this bug: > - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class > - fixed all RenderingEngine implementations in java.desktop module > - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) > - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. > > I wrote a new test class to validate the bug fix. Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: Removed comments in LoopPipe.java ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2013/files - new: https://git.openjdk.java.net/jdk/pull/2013/files/3ae23d94..02cc2cb1 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=03-04 Stats: 7 lines in 1 file changed: 0 ins; 7 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/2013.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2013/head:pull/2013 PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Sun Jan 10 21:10:13 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sun, 10 Jan 2021 21:10:13 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v6] In-Reply-To: References: Message-ID: > This is my fix proposal to this bug: > - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class > - fixed all RenderingEngine implementations in java.desktop module > - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) > - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. > > I wrote a new test class to validate the bug fix. Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: fixed typo BasicSroke to BasicStroke ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2013/files - new: https://git.openjdk.java.net/jdk/pull/2013/files/02cc2cb1..0592f191 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=05 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=04-05 Stats: 6 lines in 3 files changed: 0 ins; 0 del; 6 mod Patch: https://git.openjdk.java.net/jdk/pull/2013.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2013/head:pull/2013 PR: https://git.openjdk.java.net/jdk/pull/2013 From herrick at openjdk.java.net Mon Jan 11 01:56:56 2021 From: herrick at openjdk.java.net (Andy Herrick) Date: Mon, 11 Jan 2021 01:56:56 GMT Subject: [OpenJDK 2D-Dev] Withdrawn: JDK-8189198: Add "forRemoval = true" to Applet APIs In-Reply-To: References: Message-ID: On Mon, 9 Nov 2020 13:56:33 GMT, Andy Herrick wrote: > JDK-8189198: Add "forRemoval = true" to Applet APIs This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From prr at openjdk.java.net Mon Jan 11 02:59:07 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 11 Jan 2021 02:59:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8255710: Opensource unit/regression tests for CMM In-Reply-To: References: Message-ID: On Sat, 9 Jan 2021 07:28:20 GMT, Sergey Bylokhov wrote: > A few tests for the CMM moved to the open repo. Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2012 From serb at openjdk.java.net Mon Jan 11 06:07:57 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 11 Jan 2021 06:07:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. In-Reply-To: References: Message-ID: On Wed, 6 Jan 2021 21:14:06 GMT, Phil Race wrote: > Proposed updates to JNI error handling. src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 41: > 39: NSLog(@"%@",[NSThread callStackSymbols]); \ > 40: if ([NSThread isMainThread] == NO) { \ > 41: if ((*env)->ExceptionOccurred(env) == NULL) { \ Not sure that the check for ExceptionOccurred is needed, in all other places where we check the ref to methods/field we only check the return value, and if it is null then return immediately assuming that an exception is rased already, for example : https://github.com/openjdk/jdk/blob/b72de3c5fc99f365e9fb25114ddd28eceddfa6e8/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp#L357 Note that the exception in the static initializer is fatal for the application. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From serb at openjdk.java.net Mon Jan 11 06:07:59 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 11 Jan 2021 06:07:59 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. In-Reply-To: References: Message-ID: <7RahvO2lHhxOAhcIdk2_pqtsbqdelLHRSXeAin2ZnQY=.0aaa2356-c382-46e7-83be-99ec143ee8ff@github.com> On Fri, 8 Jan 2021 19:05:09 GMT, Phil Race wrote: >> Proposed updates to JNI error handling. > > src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 46: > >> 44: if ((*env)->ExceptionOccurred(env) != NULL) { \ >> 45: (*env)->ExceptionDescribe(env); \ >> 46: } \ > > So the update here is that if we are not on the appkit thread, make sure a java exception is thrown. > If we are on the appkit thread, clear any java exception since it isn't going anywhere but do it using > describe which prints it. I read the logic of the method differently, probably the wrong indents? - If we are not on the toolkit thread then - Check ExceptionOccurred -> throw JNU_ThrowInternalError if needed or check exception again ->call ExceptionDescribe - NSException raise at the end. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From serb at openjdk.java.net Mon Jan 11 06:08:00 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 11 Jan 2021 06:08:00 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. In-Reply-To: <2MhWS44-i0zX8lt6BUh_dpOxsEQdYnifCB8dcqO_25E=.319e2c92-6bf1-40fa-86a6-5d9df8c6c27e@github.com> References: <2MhWS44-i0zX8lt6BUh_dpOxsEQdYnifCB8dcqO_25E=.319e2c92-6bf1-40fa-86a6-5d9df8c6c27e@github.com> Message-ID: On Fri, 8 Jan 2021 19:17:17 GMT, Phil Race wrote: >> That code for sure should be called, it is even improved recently by JDK-8255681 >> I'll check how it was intended to work. > > I hadn't noticed that line - and definintely not realised it was recent. > I suppose he must have had a way to trigger it. > But I don't think it hurts to have both. I just tried to understand why we need to complicate this, to me, it is unclear why handling the same errors in the NSApplicationAWT.m does not work. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From serb at openjdk.java.net Mon Jan 11 06:13:58 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 11 Jan 2021 06:13:58 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v4] In-Reply-To: References: Message-ID: On Sun, 10 Jan 2021 21:00:17 GMT, Laurent Bourg?s wrote: >> This is my fix proposal to this bug: >> - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class >> - fixed all RenderingEngine implementations in java.desktop module >> - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) >> - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. >> >> I wrote a new test class to validate the bug fix. > > Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: > > Fixed RenderingEngine.strokeTo(clip) to call by default former method. > Fixed CurveClipSplitter (float) to use double-precision for higher > accuracy. > Improved StrokedLineTest to use only bufferedimage rendering. src/java.desktop/share/classes/sun/java2d/marlin/TransformingPathConsumer2D.java line 902: > 900: > 901: // clip rectangle (ymin, ymax, xmin, xmax) including padding: > 902: final double[] clipRectPad = new double[4]; It does not seem related to this fix? Or an updated test uncovered this? test/jdk/sun/java2d/marlin/StrokedLinePerf.java line 37: > 35: * @bug 7018932 > 36: * @summary fix LoopPipe.getStrokedSpans() performance (clipping enabled by Marlin renderer) > 37: * @run main DrawingTest7018932 typo DrawingTest7018932 -> StrokedLinePerf ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From serb at openjdk.java.net Mon Jan 11 08:19:19 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 11 Jan 2021 08:19:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259522: Apply java.io.Serial annotations in java.desktop Message-ID: Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. This annotation can be applied to these methods in the module: private void writeObject(java.io.ObjectOutputStream stream) throws IOException private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException private void readObjectNoData() throws ObjectStreamException ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException private static final ObjectStreamField[] serialPersistentFields private static final long serialVersionUID Notes: - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. A similar fix was implemented for java.base module as well: http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html ------------- Commit messages: - Update TextAttribute.java - Update readResolve - Update writeReplace - Update readObject - Update writeObject - Update serialPersistentFields - Update serialVersionUID Changes: https://git.openjdk.java.net/jdk/pull/2020/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2020&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8259522 Stats: 3426 lines in 343 files changed: 2268 ins; 287 del; 871 mod Patch: https://git.openjdk.java.net/jdk/pull/2020.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2020/head:pull/2020 PR: https://git.openjdk.java.net/jdk/pull/2020 From psadhukhan at openjdk.java.net Mon Jan 11 08:22:59 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Mon, 11 Jan 2021 08:22:59 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259237: Demo selection changes with left/right arrow key. No need to press space for selection. In-Reply-To: References: Message-ID: On Sat, 9 Jan 2021 12:47:48 GMT, Pankaj Bansal wrote: > Please review a fix for jdk16 > > Issue: In SwingSet2, if the user navigates through the demos, the demo gets selected/starts on pressing left/right key only. There is no need to press the "space" key. Earlier, on pressing the left/right key, only demo icon used to get focused and user needed to press the "space" to actually select a demo. > > Cause: The SwingSet2 has JToggleButtons added to a ButtonGroup. Each JToggleButton has an AbstractAction set on it, which loads the demo. Earlier, when the user pressed Left/Right button, only the selected button used to change. The Action set on JToggleButton used to perform only on pressing the "Space" button. Now, the Action is performed on navigating the JToggleButtons using Left/Right keys without the need to press the "space" key. > > This issue is a side effect of fix done for https://bugs.openjdk.java.net/browse/JDK-8249548. The issues fixed in JDK-8249548 were not present in JRadioButton as there was code available to handle it in AquaButtonRadioUI and BasicRadioButtonUI. The fix done for JDK-8249548 moved duplicate code from AquaButtonRadioUI and BasicRadioButtonUI and moved it to BasicButtonUI, so this code is available for JToggleButton and JRadioButton for all L&Fs. This was wrong as there is a difference in behaviour for JRadioButtons added to ButtonGroup for AquaL&F and other L&Fs. In AquaL&F, the AbstractAction set on JRadioButton is not performed on button selection and user has to press "space". In other L&Fs, the AbstractAction is performed on selection of Button itself without the need to press "space". > > Fix: The current change fixes the issue in present bug and keeps the fixes done in JDK-8249548. Following is the behaviour of JToggleButton and JRadioButton for different L&Fs before JDK-8249548 fix, after JDK-8249548 fix and after current fix. > > Before fix for JDK-8249548 > JToggleButton: > For all L&Fs, user can not navigate/select the buttons added to ButtonGroup properly as mentioned in the JDK-8249548. > JRadioButton: > For Synth L&F (Nimbus L&F), user can not navigate/select the buttons added to ButtonGroup. > For AquaL&F, user can select the buttons added to ButtonGroup by pressing left/right key and needs to press the "space" to perform the set Action. > For Other L&Fs, user can select/navigate the buttons and the set Action is also performed without pressing "space" > > After fix for JDK-8249548 > JToggleButton: > For all L&Fs, user can navigate/select the buttons added to ButtonGroups and the AbstractAction set is performed without the need to press "space". > JRadioButton: > For all L&Fs, user can navigate/select the buttons added to ButtonGroups and the AbstractAction set is performed without the need to press "space". > > After current fix: > JToggleButton: > For all L&Fs, user can navigate/select the buttons added to ButtonGroups. User needs to press "space" to perform the set AbstractAction. > JRadioButton: > For AquaL&F, the behaviour before JDK-8249548 is restored, so user needs to press the "space" to perform the set Action. > For all other L&Fs (including Synth L&F), the behaviour is same. User can navigate/select the buttons added to ButtonGroups and set Action is performed without pressing "space" > > I have run mach5 jobs with full jtreg/jck and all looks good. Links in JBS. The test TestButtonGroupFocusTraversal.java is modified such that it fails without current fix and passes after the fix. The fix also should be verified by running SwingSet2. I guess you did not run jtreg job with latest problemlist as it did not run javax/swing/JRadioButton/ButtonGroupFocus/ButtonGroupFocusTest.java javax/swing/JRadioButton/8075609/bug8075609.java javax/swing/JRadioButton/8033699/bug8033699.java Please see this test pass with your change as some of them used to fail after JDK-8226892 which was reworked by fix of JDK-8249548 src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java line 228: > 226: if (listener != null) { > 227: b.removeMouseListener(listener); > 228: b.removeMouseListener(listener); Why are we removing same listener twice? ------------- PR: https://git.openjdk.java.net/jdk16/pull/99 From pbansal at openjdk.java.net Mon Jan 11 08:37:57 2021 From: pbansal at openjdk.java.net (Pankaj Bansal) Date: Mon, 11 Jan 2021 08:37:57 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259237: Demo selection changes with left/right arrow key. No need to press space for selection. In-Reply-To: References: Message-ID: On Mon, 11 Jan 2021 08:05:21 GMT, Prasanta Sadhukhan wrote: >> Please review a fix for jdk16 >> >> Issue: In SwingSet2, if the user navigates through the demos, the demo gets selected/starts on pressing left/right key only. There is no need to press the "space" key. Earlier, on pressing the left/right key, only demo icon used to get focused and user needed to press the "space" to actually select a demo. >> >> Cause: The SwingSet2 has JToggleButtons added to a ButtonGroup. Each JToggleButton has an AbstractAction set on it, which loads the demo. Earlier, when the user pressed Left/Right button, only the selected button used to change. The Action set on JToggleButton used to perform only on pressing the "Space" button. Now, the Action is performed on navigating the JToggleButtons using Left/Right keys without the need to press the "space" key. >> >> This issue is a side effect of fix done for https://bugs.openjdk.java.net/browse/JDK-8249548. The issues fixed in JDK-8249548 were not present in JRadioButton as there was code available to handle it in AquaButtonRadioUI and BasicRadioButtonUI. The fix done for JDK-8249548 moved duplicate code from AquaButtonRadioUI and BasicRadioButtonUI and moved it to BasicButtonUI, so this code is available for JToggleButton and JRadioButton for all L&Fs. This was wrong as there is a difference in behaviour for JRadioButtons added to ButtonGroup for AquaL&F and other L&Fs. In AquaL&F, the AbstractAction set on JRadioButton is not performed on button selection and user has to press "space". In other L&Fs, the AbstractAction is performed on selection of Button itself without the need to press "space". >> >> Fix: The current change fixes the issue in present bug and keeps the fixes done in JDK-8249548. Following is the behaviour of JToggleButton and JRadioButton for different L&Fs before JDK-8249548 fix, after JDK-8249548 fix and after current fix. >> >> Before fix for JDK-8249548 >> JToggleButton: >> For all L&Fs, user can not navigate/select the buttons added to ButtonGroup properly as mentioned in the JDK-8249548. >> JRadioButton: >> For Synth L&F (Nimbus L&F), user can not navigate/select the buttons added to ButtonGroup. >> For AquaL&F, user can select the buttons added to ButtonGroup by pressing left/right key and needs to press the "space" to perform the set Action. >> For Other L&Fs, user can select/navigate the buttons and the set Action is also performed without pressing "space" >> >> After fix for JDK-8249548 >> JToggleButton: >> For all L&Fs, user can navigate/select the buttons added to ButtonGroups and the AbstractAction set is performed without the need to press "space". >> JRadioButton: >> For all L&Fs, user can navigate/select the buttons added to ButtonGroups and the AbstractAction set is performed without the need to press "space". >> >> After current fix: >> JToggleButton: >> For all L&Fs, user can navigate/select the buttons added to ButtonGroups. User needs to press "space" to perform the set AbstractAction. >> JRadioButton: >> For AquaL&F, the behaviour before JDK-8249548 is restored, so user needs to press the "space" to perform the set Action. >> For all other L&Fs (including Synth L&F), the behaviour is same. User can navigate/select the buttons added to ButtonGroups and set Action is performed without pressing "space" >> >> I have run mach5 jobs with full jtreg/jck and all looks good. Links in JBS. The test TestButtonGroupFocusTraversal.java is modified such that it fails without current fix and passes after the fix. The fix also should be verified by running SwingSet2. > > src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java line 228: > >> 226: if (listener != null) { >> 227: b.removeMouseListener(listener); >> 228: b.removeMouseListener(listener); > > Why are we removing same listener twice? I just rolled back the changes I did in this file in JDK-8249548. Looks like this was has been there for some time. See the file in commit made in this file before JDK-8249548 https://github.com/openjdk/jdk/blob/c18080fef714949221c8ddabc4e23d409575c3d3/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java. But yes, it should not be done and I will remove it and update the PR. ------------- PR: https://git.openjdk.java.net/jdk16/pull/99 From lbourges at openjdk.java.net Mon Jan 11 09:00:27 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Mon, 11 Jan 2021 09:00:27 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v7] In-Reply-To: References: Message-ID: <4aknOPMpu8K2B0lEwOamMg97QWh7SFF97UyeI1nhxAY=.d1d841a5-2687-41a7-9c7f-d14f37d7128e@github.com> > This is my fix proposal to this bug: > - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class > - fixed all RenderingEngine implementations in java.desktop module > - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) > - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. > > I wrote a new test class to validate the bug fix. Laurent Bourg?s has updated the pull request incrementally with two additional commits since the last revision: - fixed copyright year - removed invalid jtreg test ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2013/files - new: https://git.openjdk.java.net/jdk/pull/2013/files/0592f191..f5dea906 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=06 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2013&range=05-06 Stats: 7 lines in 7 files changed: 0 ins; 1 del; 6 mod Patch: https://git.openjdk.java.net/jdk/pull/2013.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2013/head:pull/2013 PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Mon Jan 11 09:00:28 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Mon, 11 Jan 2021 09:00:28 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v4] In-Reply-To: References: Message-ID: On Mon, 11 Jan 2021 06:09:46 GMT, Sergey Bylokhov wrote: >> Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: >> >> Fixed RenderingEngine.strokeTo(clip) to call by default former method. >> Fixed CurveClipSplitter (float) to use double-precision for higher >> accuracy. >> Improved StrokedLineTest to use only bufferedimage rendering. > > test/jdk/sun/java2d/marlin/StrokedLinePerf.java line 37: > >> 35: * @bug 7018932 >> 36: * @summary fix LoopPipe.getStrokedSpans() performance (clipping enabled by Marlin renderer) >> 37: * @run main DrawingTest7018932 > > typo DrawingTest7018932 -> StrokedLinePerf Removed invalid test ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Mon Jan 11 09:04:00 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Mon, 11 Jan 2021 09:04:00 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v4] In-Reply-To: References: Message-ID: On Mon, 11 Jan 2021 06:08:15 GMT, Sergey Bylokhov wrote: >> Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: >> >> Fixed RenderingEngine.strokeTo(clip) to call by default former method. >> Fixed CurveClipSplitter (float) to use double-precision for higher >> accuracy. >> Improved StrokedLineTest to use only bufferedimage rendering. > > src/java.desktop/share/classes/sun/java2d/marlin/TransformingPathConsumer2D.java line 902: > >> 900: >> 901: // clip rectangle (ymin, ymax, xmin, xmax) including padding: >> 902: final double[] clipRectPad = new double[4]; > > It does not seem related to this fix? Or an updated test uncovered this? This fix in Marlin (float) renderer is needed as this numerical precision issue was triggered by the StrokedLinePerf using the MarlinRenderingEngine. It is very similar to DTransformingPathConsumer2D (but reuse was not trivial). I propose to remove the MarlinRenderingEngine (single-precision) in a follow-up issue ... to simplify the maintenance. ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From ihse at openjdk.java.net Mon Jan 11 09:23:11 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Mon, 11 Jan 2021 09:23:11 GMT Subject: [OpenJDK 2D-Dev] RFR: 8257733: Move module-specific data from make to respective module [v4] In-Reply-To: References: Message-ID: <95Qw1lVtqPHbGHoNJo46xIPO3OEof9nqCGJ3xA-oNZ8=.fa51b0e5-b33b-4f96-9756-a46741841201@github.com> On Mon, 4 Jan 2021 21:20:53 GMT, Phil Race wrote: >> Magnus Ihse Bursie 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 eight additional commits since the last revision: >> >> - Update comment refering to "make" dir >> - Move new symbols to jdk.compiler >> - Merge branch 'master' into shuffle-data >> - Move macosxicons from share to macosx >> - Move to share/data, and move jdwp.spec to java.se >> - Update references in test >> - Step 2: Update references >> - First stage, move actual data files > > Marked as reviewed by prr (Reviewer). This PR is not stale; it's just still waiting for input from @AlanBateman. ------------- PR: https://git.openjdk.java.net/jdk/pull/1611 From pbansal at openjdk.java.net Mon Jan 11 09:52:18 2021 From: pbansal at openjdk.java.net (Pankaj Bansal) Date: Mon, 11 Jan 2021 09:52:18 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259237: Demo selection changes with left/right arrow key. No need to press space for selection. [v2] In-Reply-To: References: Message-ID: > Please review a fix for jdk16 > > Issue: In SwingSet2, if the user navigates through the demos, the demo gets selected/starts on pressing left/right key only. There is no need to press the "space" key. Earlier, on pressing the left/right key, only demo icon used to get focused and user needed to press the "space" to actually select a demo. > > Cause: The SwingSet2 has JToggleButtons added to a ButtonGroup. Each JToggleButton has an AbstractAction set on it, which loads the demo. Earlier, when the user pressed Left/Right button, only the selected button used to change. The Action set on JToggleButton used to perform only on pressing the "Space" button. Now, the Action is performed on navigating the JToggleButtons using Left/Right keys without the need to press the "space" key. > > This issue is a side effect of fix done for https://bugs.openjdk.java.net/browse/JDK-8249548. The issues fixed in JDK-8249548 were not present in JRadioButton as there was code available to handle it in AquaButtonRadioUI and BasicRadioButtonUI. The fix done for JDK-8249548 moved duplicate code from AquaButtonRadioUI and BasicRadioButtonUI and moved it to BasicButtonUI, so this code is available for JToggleButton and JRadioButton for all L&Fs. This was wrong as there is a difference in behaviour for JRadioButtons added to ButtonGroup for AquaL&F and other L&Fs. In AquaL&F, the AbstractAction set on JRadioButton is not performed on button selection and user has to press "space". In other L&Fs, the AbstractAction is performed on selection of Button itself without the need to press "space". > > Fix: The current change fixes the issue in present bug and keeps the fixes done in JDK-8249548. Following is the behaviour of JToggleButton and JRadioButton for different L&Fs before JDK-8249548 fix, after JDK-8249548 fix and after current fix. > > Before fix for JDK-8249548 > JToggleButton: > For all L&Fs, user can not navigate/select the buttons added to ButtonGroup properly as mentioned in the JDK-8249548. > JRadioButton: > For Synth L&F (Nimbus L&F), user can not navigate/select the buttons added to ButtonGroup. > For AquaL&F, user can select the buttons added to ButtonGroup by pressing left/right key and needs to press the "space" to perform the set Action. > For Other L&Fs, user can select/navigate the buttons and the set Action is also performed without pressing "space" > > After fix for JDK-8249548 > JToggleButton: > For all L&Fs, user can navigate/select the buttons added to ButtonGroups and the AbstractAction set is performed without the need to press "space". > JRadioButton: > For all L&Fs, user can navigate/select the buttons added to ButtonGroups and the AbstractAction set is performed without the need to press "space". > > After current fix: > JToggleButton: > For all L&Fs, user can navigate/select the buttons added to ButtonGroups. User needs to press "space" to perform the set AbstractAction. > JRadioButton: > For AquaL&F, the behaviour before JDK-8249548 is restored, so user needs to press the "space" to perform the set Action. > For all other L&Fs (including Synth L&F), the behaviour is same. User can navigate/select the buttons added to ButtonGroups and set Action is performed without pressing "space" > > I have run mach5 jobs with full jtreg/jck and all looks good. Links in JBS. The test TestButtonGroupFocusTraversal.java is modified such that it fails without current fix and passes after the fix. The fix also should be verified by running SwingSet2. Pankaj Bansal has updated the pull request incrementally with one additional commit since the last revision: Remove duplicate call to remove listener ------------- Changes: - all: https://git.openjdk.java.net/jdk16/pull/99/files - new: https://git.openjdk.java.net/jdk16/pull/99/files/903ffcbd..724f5999 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk16&pr=99&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk16&pr=99&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod Patch: https://git.openjdk.java.net/jdk16/pull/99.diff Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/99/head:pull/99 PR: https://git.openjdk.java.net/jdk16/pull/99 From kizune at openjdk.java.net Mon Jan 11 11:19:04 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Mon, 11 Jan 2021 11:19:04 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259237: Demo selection changes with left/right arrow key. No need to press space for selection. [v2] In-Reply-To: References: Message-ID: On Mon, 11 Jan 2021 08:20:39 GMT, Prasanta Sadhukhan wrote: >> Pankaj Bansal has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove duplicate call to remove listener > > I guess you did not run jtreg job with latest problemlist as it did not run > javax/swing/JRadioButton/ButtonGroupFocus/ButtonGroupFocusTest.java > javax/swing/JRadioButton/8075609/bug8075609.java > javax/swing/JRadioButton/8033699/bug8033699.java > Please see this test pass with your change as some of them used to fail after JDK-8226892 which was reworked by fix of JDK-8249548 Quick question: why we special casing JRadioButton case? Is there any reason we should call the action on them? ------------- PR: https://git.openjdk.java.net/jdk16/pull/99 From pbansal at openjdk.java.net Mon Jan 11 12:01:04 2021 From: pbansal at openjdk.java.net (Pankaj Bansal) Date: Mon, 11 Jan 2021 12:01:04 GMT Subject: [OpenJDK 2D-Dev] [jdk16] RFR: 8259237: Demo selection changes with left/right arrow key. No need to press space for selection. [v2] In-Reply-To: References: Message-ID: On Mon, 11 Jan 2021 11:16:02 GMT, Alexander Zuev wrote: > Quick question: why we special casing JRadioButton case? Is there any reason we should call the action on them? This was the behaviour which was there before JDK-8249548 for JRadioButton and I am just reverting to it. As explained in the PR description, the behaviour before JDK-8249548 was as below Before fix for JDK-8249548 JToggleButton: For all L&Fs, user can not navigate/select the buttons added to ButtonGroup properly as mentioned in the JDK-8249548. JRadioButton: For Synth L&F (Nimbus L&F), user can not navigate/select the buttons added to ButtonGroup. For AquaL&F, user can select the buttons added to ButtonGroup by pressing left/right key and needs to press the "space" to perform the set Action. For Other L&Fs, user can select/navigate the buttons and the set Action is also performed without pressing "space" ------------- PR: https://git.openjdk.java.net/jdk16/pull/99 From prr at openjdk.java.net Mon Jan 11 17:52:19 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 11 Jan 2021 17:52:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v2] In-Reply-To: References: Message-ID: <5fPXj8SlcJcjfD9bwylmTZ7bR7Gia8CIDUFADlpcPAU=.6c25ea7c-89b8-4e70-8269-1cdb1bedb8d3@github.com> > Proposed updates to JNI error handling. Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8259343: [macOS] Update JNI error handling in Cocoa code. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1967/files - new: https://git.openjdk.java.net/jdk/pull/1967/files/0e745aa6..08a41150 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1967&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1967&range=00-01 Stats: 3 lines in 1 file changed: 1 ins; 1 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/1967.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1967/head:pull/1967 PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Mon Jan 11 17:52:19 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 11 Jan 2021 17:52:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v2] In-Reply-To: References: Message-ID: <1-5L0YWqNPmuzpu1O1Q1chv5l1dGr55oEdQj4r9wyRg=.1addab94-3655-417d-8e03-1a621164502a@github.com> On Mon, 11 Jan 2021 05:52:02 GMT, Sergey Bylokhov wrote: > Not sure that the check for ExceptionOccurred is needed, It may not be needed in practice but if the code path is never taken no harm ... in all other places where we check the ref to methods/field we only check the return value, and if it is null then return immediately assuming that an exception is rased already, for example : > > https://github.com/openjdk/jdk/blob/b72de3c5fc99f365e9fb25114ddd28eceddfa6e8/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp#L357 > > Note that the exception in the static initializer is fatal for the application. Nothing new here. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Mon Jan 11 17:52:20 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 11 Jan 2021 17:52:20 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v2] In-Reply-To: <7RahvO2lHhxOAhcIdk2_pqtsbqdelLHRSXeAin2ZnQY=.0aaa2356-c382-46e7-83be-99ec143ee8ff@github.com> References: <7RahvO2lHhxOAhcIdk2_pqtsbqdelLHRSXeAin2ZnQY=.0aaa2356-c382-46e7-83be-99ec143ee8ff@github.com> Message-ID: On Mon, 11 Jan 2021 05:58:28 GMT, Sergey Bylokhov wrote: >> src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 46: >> >>> 44: if ((*env)->ExceptionOccurred(env) != NULL) { \ >>> 45: (*env)->ExceptionDescribe(env); \ >>> 46: } \ >> >> So the update here is that if we are not on the appkit thread, make sure a java exception is thrown. >> If we are on the appkit thread, clear any java exception since it isn't going anywhere but do it using >> describe which prints it. > > I read the logic of the method differently, probably the wrong indents? > - If we are not on the toolkit thread then > - Check ExceptionOccurred -> throw JNU_ThrowInternalError if needed or check exception again ->call ExceptionDescribe > - NSException raise at the end. I have a paren in the wrong place ! I've pushed an update. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Mon Jan 11 17:52:20 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 11 Jan 2021 17:52:20 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v2] In-Reply-To: References: <2MhWS44-i0zX8lt6BUh_dpOxsEQdYnifCB8dcqO_25E=.319e2c92-6bf1-40fa-86a6-5d9df8c6c27e@github.com> Message-ID: <3jqvTyJ_wKIDMURTmYQSbTCwUMcVRRvzvVekjS9Eem0=.866999d7-3542-4f3f-9e93-d6955b05a657@github.com> On Mon, 11 Jan 2021 06:01:36 GMT, Sergey Bylokhov wrote: >> I hadn't noticed that line - and definintely not realised it was recent. >> I suppose he must have had a way to trigger it. >> But I don't think it hurts to have both. > > I just tried to understand why we need to complicate this, to me, it is unclear why handling the same errors in the NSApplicationAWT.m does not work. Because of the reason I've said before. That logging in NSApplication AWT is not being seen. Something is swallowing it. So I'd say if anything remove that logging and keep the new one but as I also said it isn't harmful to have provision in case it also logs some case we aren't catching. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From erikj at openjdk.java.net Mon Jan 11 18:59:03 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 11 Jan 2021 18:59:03 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v2] In-Reply-To: <5fPXj8SlcJcjfD9bwylmTZ7bR7Gia8CIDUFADlpcPAU=.6c25ea7c-89b8-4e70-8269-1cdb1bedb8d3@github.com> References: <5fPXj8SlcJcjfD9bwylmTZ7bR7Gia8CIDUFADlpcPAU=.6c25ea7c-89b8-4e70-8269-1cdb1bedb8d3@github.com> Message-ID: On Mon, 11 Jan 2021 17:52:19 GMT, Phil Race wrote: >> Proposed updates to JNI error handling. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8259343: [macOS] Update JNI error handling in Cocoa code. make/modules/java.desktop/Lib.gmk line 96: > 94: $(call SET_SHARED_LIBRARY_ORIGIN), \ > 95: LIBS := \ > 96: -ljava \ There should be a dependency declaration added too. Something like this right after the SetupJdkLibrary macro call: $(BUILD_LIBOSXAPP): $(call FindLib, java.base, java) ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Mon Jan 11 19:27:12 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 11 Jan 2021 19:27:12 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3] In-Reply-To: References: Message-ID: > Proposed updates to JNI error handling. Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8259343: [macOS] Update JNI error handling in Cocoa code. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1967/files - new: https://git.openjdk.java.net/jdk/pull/1967/files/08a41150..913b37c2 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1967&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1967&range=01-02 Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/1967.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1967/head:pull/1967 PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Mon Jan 11 19:27:12 2021 From: prr at openjdk.java.net (Phil Race) Date: Mon, 11 Jan 2021 19:27:12 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v2] In-Reply-To: References: <5fPXj8SlcJcjfD9bwylmTZ7bR7Gia8CIDUFADlpcPAU=.6c25ea7c-89b8-4e70-8269-1cdb1bedb8d3@github.com> Message-ID: On Mon, 11 Jan 2021 18:56:38 GMT, Erik Joelsson wrote: > There should be a dependency declaration added too. Something like this right after the SetupJdkLibrary macro call: > > $(BUILD_LIBOSXAPP): $(call FindLib, java.base, java) Fixed. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From erikj at openjdk.java.net Mon Jan 11 20:22:58 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 11 Jan 2021 20:22:58 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3] In-Reply-To: References: Message-ID: <9q6B-ZySWhc8qPfcn728cCehk_SSer-qtIhCJdI3sXg=.dce6e806-9858-481b-96a7-f27ed7d2bdb3@github.com> On Mon, 11 Jan 2021 19:27:12 GMT, Phil Race wrote: >> Proposed updates to JNI error handling. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8259343: [macOS] Update JNI error handling in Cocoa code. Build changes look good. ------------- Marked as reviewed by erikj (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/1967 From serb at openjdk.java.net Tue Jan 12 02:34:58 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 02:34:58 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3] In-Reply-To: References: Message-ID: On Mon, 11 Jan 2021 19:27:12 GMT, Phil Race wrote: >> Proposed updates to JNI error handling. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8259343: [macOS] Update JNI error handling in Cocoa code. src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 197: > 195: } \ > 196: if (getenv("JNU_NO_COCOA_EXCEPTION") == NULL) { \ > 197: [NSException raise:NSGenericException format:@"Java Exception"]; \ How did you check that the logging in the NSApplication was swallowing? Both macro will throw the NSException on the toolkit thread now, does it mean that in both cases the logging in the NSApplication will be ignored/no output? ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From serb at openjdk.java.net Tue Jan 12 02:41:00 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 02:41:00 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3] In-Reply-To: <1-5L0YWqNPmuzpu1O1Q1chv5l1dGr55oEdQj4r9wyRg=.1addab94-3655-417d-8e03-1a621164502a@github.com> References: <1-5L0YWqNPmuzpu1O1Q1chv5l1dGr55oEdQj4r9wyRg=.1addab94-3655-417d-8e03-1a621164502a@github.com> Message-ID: On Mon, 11 Jan 2021 17:09:14 GMT, Phil Race wrote: >> src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 41: >> >>> 39: NSLog(@"%@",[NSThread callStackSymbols]); \ >>> 40: if ([NSThread isMainThread] == NO) { \ >>> 41: if ((*env)->ExceptionOccurred(env) == NULL) { \ >> >> Not sure that the check for ExceptionOccurred is needed, in all other places where we check the ref to methods/field we only check the return value, and if it is null then return immediately assuming that an exception is rased already, for example : >> https://github.com/openjdk/jdk/blob/b72de3c5fc99f365e9fb25114ddd28eceddfa6e8/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp#L357 >> >> Note that the exception in the static initializer is fatal for the application. > >> Not sure that the check for ExceptionOccurred is needed, > It may not be needed in practice but if the code path is never taken no harm ... > > in all other places where we check the ref to methods/field we only check the return value, and if it is null then return immediately assuming that an exception is rased already, for example : >> >> https://github.com/openjdk/jdk/blob/b72de3c5fc99f365e9fb25114ddd28eceddfa6e8/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp#L357 >> >> Note that the exception in the static initializer is fatal for the application. > > Nothing new here. The new thing here is that you check the result of the ExceptionOccurred if NULL is returned from the GetMethodID/etc, we usually never do it. If such checks are necessary then I'll create a separate bug to update other similar use cases. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From serb at openjdk.java.net Tue Jan 12 07:00:05 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 07:00:05 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8255710: Opensource unit/regression tests for CMM In-Reply-To: References: Message-ID: On Sat, 9 Jan 2021 07:28:20 GMT, Sergey Bylokhov wrote: > A few tests for the CMM moved to the open repo. This pull request has now been integrated. Changeset: 98ccfbf4 Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/98ccfbf4 Stats: 457 lines in 8 files changed: 457 ins; 0 del; 0 mod 8255710: Opensource unit/regression tests for CMM Reviewed-by: pbansal, prr ------------- PR: https://git.openjdk.java.net/jdk/pull/2012 From psadhukhan at openjdk.java.net Tue Jan 12 10:15:12 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Tue, 12 Jan 2021 10:15:12 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout [v5] In-Reply-To: References: Message-ID: > Test fails with timeout and it seems likely due to non-availability of printer in the test system. We should just update the test to check for default (or available) printers and return if there is no printer. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Convert into manual test to overcome automatic printer selection issue ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1927/files - new: https://git.openjdk.java.net/jdk/pull/1927/files/8ed618f2..3ce4f066 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1927&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1927&range=03-04 Stats: 64 lines in 1 file changed: 56 ins; 1 del; 7 mod Patch: https://git.openjdk.java.net/jdk/pull/1927.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1927/head:pull/1927 PR: https://git.openjdk.java.net/jdk/pull/1927 From serb at openjdk.java.net Tue Jan 12 10:46:58 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 10:46:58 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout In-Reply-To: References: <-up-8GvJbTW2SvsqRuaN8u3lowBfbvxnfAPMdfINDBE=.3e6c4a14-a563-4f9f-a460-693cfbc19317@github.com> Message-ID: On Mon, 4 Jan 2021 09:23:50 GMT, Sergey Bylokhov wrote: >> IIUC, In windows there can be non-real printers like "Send To OneNote", "Fax" which falls in Printers/Scanner list but not exactly printer so PrinterException is not thrown. > >> IIUC, In windows there can be non-real printers like "Send To OneNote", "Fax" which falls in Printers/Scanner list but not exactly printer so PrinterException is not thrown. > > I am not sure that the fax is related here, but the "printjob.print()" should throw such an exception if printjob.getPrintService() is null (so we do not have any useful printers). Do you have a chance to reproduce this bug? > > BTW the suggestion in the JBS was to fail the test if no printers are found. Not sure that one more manual test is needed, the run of the test marked by the printer keyword already required to have a configured printer. Otherwise, why do we need that keyword at all? ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Tue Jan 12 11:52:03 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Tue, 12 Jan 2021 11:52:03 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout In-Reply-To: References: <-up-8GvJbTW2SvsqRuaN8u3lowBfbvxnfAPMdfINDBE=.3e6c4a14-a563-4f9f-a460-693cfbc19317@github.com> Message-ID: <0G7k8bzAbfBeBX2PHWXDuSXBM0kk7tX6fT-nrMNiP0U=.a7cc5830-60a7-488f-9589-aac07c543473@github.com> On Tue, 12 Jan 2021 10:44:12 GMT, Sergey Bylokhov wrote: >>> IIUC, In windows there can be non-real printers like "Send To OneNote", "Fax" which falls in Printers/Scanner list but not exactly printer so PrinterException is not thrown. >> >> I am not sure that the fax is related here, but the "printjob.print()" should throw such an exception if printjob.getPrintService() is null (so we do not have any useful printers). Do you have a chance to reproduce this bug? >> >> BTW the suggestion in the JBS was to fail the test if no printers are found. > > Not sure that one more manual test is needed, the run of the test marked by the printer keyword already required to have a configured printer. Otherwise, why do we need that keyword at all? That printer keyword seems to be just a hint/suggestion as it does not force user to do anything, so we can still get this kind of problem. Making it manual at least will let user choose which printer he actually wants to work with. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From lbourges at openjdk.java.net Tue Jan 12 12:04:55 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Tue, 12 Jan 2021 12:04:55 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang In-Reply-To: References: Message-ID: On Sat, 9 Jan 2021 09:05:27 GMT, Laurent Bourg?s wrote: > This is my fix proposal to this bug: > - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class > - fixed all RenderingEngine implementations in java.desktop module > - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) > - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. > > I wrote a new test class to validate the bug fix. Sergey, is it good now ? I ran jtreg: OK. ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From prr at openjdk.java.net Tue Jan 12 17:28:58 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 12 Jan 2021 17:28:58 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3] In-Reply-To: References: <1-5L0YWqNPmuzpu1O1Q1chv5l1dGr55oEdQj4r9wyRg=.1addab94-3655-417d-8e03-1a621164502a@github.com> Message-ID: On Tue, 12 Jan 2021 02:38:11 GMT, Sergey Bylokhov wrote: >>> Not sure that the check for ExceptionOccurred is needed, >> It may not be needed in practice but if the code path is never taken no harm ... >> >> in all other places where we check the ref to methods/field we only check the return value, and if it is null then return immediately assuming that an exception is rased already, for example : >>> >>> https://github.com/openjdk/jdk/blob/b72de3c5fc99f365e9fb25114ddd28eceddfa6e8/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp#L357 >>> >>> Note that the exception in the static initializer is fatal for the application. >> >> Nothing new here. > > The new thing here is that you check the result of the ExceptionOccurred if NULL is returned from the GetMethodID/etc, we usually never do it. If such checks are necessary then I'll create a separate bug to update other similar use cases. Here I don't have immediate control over why this is being called. So we could have null but no pending exception depending on what the caller did. It won't be executed except in the rare case there's a problem so it certainly isn't causing overhead so what is the problem ? I don't see a need to change other code unless there's a really good reason. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Tue Jan 12 17:24:57 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 12 Jan 2021 17:24:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3] In-Reply-To: References: Message-ID: On Tue, 12 Jan 2021 02:31:56 GMT, Sergey Bylokhov wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8259343: [macOS] Update JNI error handling in Cocoa code. > > src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 197: > >> 195: } \ >> 196: if (getenv("JNU_NO_COCOA_EXCEPTION") == NULL) { \ >> 197: [NSException raise:NSGenericException format:@"Java Exception"]; \ > > How did you check that the logging in the NSApplication was swallowing? Both macro will throw the NSException on the toolkit thread now, does it mean that in both cases the logging in the NSApplication will be ignored/no output? See the bug assigned to you that I filed last month : https://bugs.openjdk.java.net/browse/JDK-8258797 This error should have been logged by that NSApplicationAWT code but was not (and I mean in JDK 16 as well before I started on this) and in JDK 17 it was seen only when adding the new logging. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Tue Jan 12 18:47:57 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 12 Jan 2021 18:47:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v7] In-Reply-To: <4aknOPMpu8K2B0lEwOamMg97QWh7SFF97UyeI1nhxAY=.d1d841a5-2687-41a7-9c7f-d14f37d7128e@github.com> References: <4aknOPMpu8K2B0lEwOamMg97QWh7SFF97UyeI1nhxAY=.d1d841a5-2687-41a7-9c7f-d14f37d7128e@github.com> Message-ID: On Mon, 11 Jan 2021 09:00:27 GMT, Laurent Bourg?s wrote: >> This is my fix proposal to this bug: >> - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class >> - fixed all RenderingEngine implementations in java.desktop module >> - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) >> - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. >> >> I wrote a new test class to validate the bug fix. > > Laurent Bourg?s has updated the pull request incrementally with two additional commits since the last revision: > > - fixed copyright year > - removed invalid jtreg test src/java.desktop/share/classes/sun/java2d/pipe/SpanShapeRenderer.java line 45: > 43: */ > 44: public abstract class SpanShapeRenderer implements ShapeDrawPipe { > 45: I suppose this is just clean up when you happened to notice it wasn't used/ test/jdk/sun/java2d/marlin/StrokedLinePerf.java line 37: > 35: * @bug 7018932 > 36: * @summary fix LoopPipe.getStrokedSpans() performance (clipping enabled by Marlin renderer) > 37: * @run main/othervm/timeout=10 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine StrokedLinePerf I hope 10 seconds is enough for a stable test .. not connecting to the windowing system so maybe. src/java.desktop/share/classes/sun/java2d/marlin/TransformingPathConsumer2D.java line 902: > 900: > 901: // clip rectangle (ymin, ymax, xmin, xmax) including padding: > 902: final double[] clipRectPad = new double[4]; are all the changes to double needed for this ? Or just preparation for removing the float pipeline ? ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Tue Jan 12 18:48:00 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Tue, 12 Jan 2021 18:48:00 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v7] In-Reply-To: References: <4aknOPMpu8K2B0lEwOamMg97QWh7SFF97UyeI1nhxAY=.d1d841a5-2687-41a7-9c7f-d14f37d7128e@github.com> Message-ID: On Tue, 12 Jan 2021 18:40:39 GMT, Phil Race wrote: >> Laurent Bourg?s has updated the pull request incrementally with two additional commits since the last revision: >> >> - fixed copyright year >> - removed invalid jtreg test > > src/java.desktop/share/classes/sun/java2d/pipe/SpanShapeRenderer.java line 45: > >> 43: */ >> 44: public abstract class SpanShapeRenderer implements ShapeDrawPipe { >> 45: > > I suppose this is just clean up when you happened to notice it wasn't used/ Exactly. > test/jdk/sun/java2d/marlin/StrokedLinePerf.java line 37: > >> 35: * @bug 7018932 >> 36: * @summary fix LoopPipe.getStrokedSpans() performance (clipping enabled by Marlin renderer) >> 37: * @run main/othervm/timeout=10 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine StrokedLinePerf > > I hope 10 seconds is enough for a stable test .. not connecting to the windowing system so maybe. Each render ops take up to 100ms max on my machine, so the test runs in 0.5s on my machine. Would you prefer 30s ? Timeout is mandatory to detect test failure = hanging ... ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From lbourges at openjdk.java.net Tue Jan 12 18:50:58 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Tue, 12 Jan 2021 18:50:58 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v7] In-Reply-To: References: <4aknOPMpu8K2B0lEwOamMg97QWh7SFF97UyeI1nhxAY=.d1d841a5-2687-41a7-9c7f-d14f37d7128e@github.com> Message-ID: On Tue, 12 Jan 2021 18:43:36 GMT, Phil Race wrote: >> Laurent Bourg?s has updated the pull request incrementally with two additional commits since the last revision: >> >> - fixed copyright year >> - removed invalid jtreg test > > src/java.desktop/share/classes/sun/java2d/marlin/TransformingPathConsumer2D.java line 902: > >> 900: >> 901: // clip rectangle (ymin, ymax, xmin, xmax) including padding: >> 902: final double[] clipRectPad = new double[4]; > > are all the changes to double needed for this ? Or just preparation for removing the float pipeline ? These change are just enough to make MarlinRenderingEngine (float) pass the new test. Later we will propose to remove the float pipeline. ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From serb at openjdk.java.net Tue Jan 12 18:59:56 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 18:59:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v7] In-Reply-To: <4aknOPMpu8K2B0lEwOamMg97QWh7SFF97UyeI1nhxAY=.d1d841a5-2687-41a7-9c7f-d14f37d7128e@github.com> References: <4aknOPMpu8K2B0lEwOamMg97QWh7SFF97UyeI1nhxAY=.d1d841a5-2687-41a7-9c7f-d14f37d7128e@github.com> Message-ID: On Mon, 11 Jan 2021 09:00:27 GMT, Laurent Bourg?s wrote: >> This is my fix proposal to this bug: >> - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class >> - fixed all RenderingEngine implementations in java.desktop module >> - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) >> - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. >> >> I wrote a new test class to validate the bug fix. > > Laurent Bourg?s has updated the pull request incrementally with two additional commits since the last revision: > > - fixed copyright year > - removed invalid jtreg test Internal testing is fine, The fix looks good. Thank you for your contribution! ------------- Marked as reviewed by serb (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2013 From prr at openjdk.java.net Tue Jan 12 19:39:03 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 12 Jan 2021 19:39:03 GMT Subject: [OpenJDK 2D-Dev] RFR: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang [v7] In-Reply-To: <4aknOPMpu8K2B0lEwOamMg97QWh7SFF97UyeI1nhxAY=.d1d841a5-2687-41a7-9c7f-d14f37d7128e@github.com> References: <4aknOPMpu8K2B0lEwOamMg97QWh7SFF97UyeI1nhxAY=.d1d841a5-2687-41a7-9c7f-d14f37d7128e@github.com> Message-ID: <4CH0U2V4-EW6lrB_nPI5Mnu4frNzT_QsQvX4EIylJsY=.84a2da80-45ac-438d-95cd-27545ee89f2f@github.com> On Mon, 11 Jan 2021 09:00:27 GMT, Laurent Bourg?s wrote: >> This is my fix proposal to this bug: >> - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class >> - fixed all RenderingEngine implementations in java.desktop module >> - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) >> - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. >> >> I wrote a new test class to validate the bug fix. > > Laurent Bourg?s has updated the pull request incrementally with two additional commits since the last revision: > > - fixed copyright year > - removed invalid jtreg test Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From serb at openjdk.java.net Tue Jan 12 20:06:57 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 20:06:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3] In-Reply-To: References: Message-ID: <9L-Z-lva8-afVWdri9YjO0wIM0nQ6H7IUOcruvNUToY=.33f942e9-23cb-43e7-a07d-b1fe64df4974@github.com> On Mon, 11 Jan 2021 19:27:12 GMT, Phil Race wrote: >> Proposed updates to JNI error handling. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8259343: [macOS] Update JNI error handling in Cocoa code. Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From serb at openjdk.java.net Tue Jan 12 20:06:59 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 20:06:59 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3] In-Reply-To: References: Message-ID: On Tue, 12 Jan 2021 17:21:53 GMT, Phil Race wrote: >> src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 197: >> >>> 195: } \ >>> 196: if (getenv("JNU_NO_COCOA_EXCEPTION") == NULL) { \ >>> 197: [NSException raise:NSGenericException format:@"Java Exception"]; \ >> >> How did you check that the logging in the NSApplication was swallowing? Both macro will throw the NSException on the toolkit thread now, does it mean that in both cases the logging in the NSApplication will be ignored/no output? > > See the bug assigned to you that I filed last month : https://bugs.openjdk.java.net/browse/JDK-8258797 > This error should have been logged by that NSApplicationAWT code but was not (and I mean in JDK 16 as well before I started on this) and in JDK 17 it was seen only when adding the new logging. I have found it down to the absence of NSApplication#reportException() method and logging in it. Ok will update that code later in the separate update. ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From prr at openjdk.java.net Tue Jan 12 20:22:57 2021 From: prr at openjdk.java.net (Phil Race) Date: Tue, 12 Jan 2021 20:22:57 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8259343: [macOS] Update JNI error handling in Cocoa code. In-Reply-To: References: Message-ID: On Wed, 6 Jan 2021 21:14:06 GMT, Phil Race wrote: > Proposed updates to JNI error handling. This pull request has now been integrated. Changeset: d6a2105b Author: Phil Race URL: https://git.openjdk.java.net/jdk/commit/d6a2105b Stats: 75 lines in 8 files changed: 60 ins; 1 del; 14 mod 8259343: [macOS] Update JNI error handling in Cocoa code. Reviewed-by: erikj, serb ------------- PR: https://git.openjdk.java.net/jdk/pull/1967 From aivanov at openjdk.java.net Tue Jan 12 20:25:56 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Tue, 12 Jan 2021 20:25:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259522: Apply java.io.Serial annotations in java.desktop In-Reply-To: References: Message-ID: On Mon, 11 Jan 2021 06:21:52 GMT, Sergey Bylokhov wrote: > Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. > > This annotation can be applied to these methods in the module: > > private void writeObject(java.io.ObjectOutputStream stream) throws IOException > private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException > private void readObjectNoData() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException > private static final ObjectStreamField[] serialPersistentFields > private static final long serialVersionUID > > Notes: > - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added > - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. > > A similar fix was implemented for java.base module as well: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html Marked as reviewed by aivanov (Reviewer). src/java.desktop/share/classes/com/sun/media/sound/InvalidDataException.java line 42: > 40: */ > 41: @Serial > 42: private static final long serialVersionUID = 1L; This is the standard wording, yet should it mention the serialization is between the same versions only because the value of serialVersionUID is not unique? src/java.desktop/share/classes/java/awt/image/RasterFormatException.java line 28: > 26: package java.awt.image; > 27: > 28: Suggestion: In the majority of classes, there's only one empty line between package declaration and the first import statement. src/java.desktop/share/classes/java/awt/image/ImagingOpException.java line 28: > 26: package java.awt.image; > 27: > 28: Suggestion: ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From serb at openjdk.java.net Tue Jan 12 20:42:18 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 20:42:18 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: References: Message-ID: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> > Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. > > This annotation can be applied to these methods in the module: > > private void writeObject(java.io.ObjectOutputStream stream) throws IOException > private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException > private void readObjectNoData() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException > private static final ObjectStreamField[] serialPersistentFields > private static final long serialVersionUID > > Notes: > - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added > - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. > > A similar fix was implemented for java.base module as well: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html Sergey Bylokhov has updated the pull request incrementally with two additional commits since the last revision: - Update src/java.desktop/share/classes/java/awt/image/ImagingOpException.java Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> - Update src/java.desktop/share/classes/java/awt/image/RasterFormatException.java Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2020/files - new: https://git.openjdk.java.net/jdk/pull/2020/files/2e50a258..502c1a40 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2020&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2020&range=00-01 Stats: 4 lines in 2 files changed: 0 ins; 4 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/2020.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2020/head:pull/2020 PR: https://git.openjdk.java.net/jdk/pull/2020 From serb at openjdk.java.net Tue Jan 12 20:42:19 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 20:42:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: References: Message-ID: On Tue, 12 Jan 2021 11:29:24 GMT, Alexey Ivanov wrote: >> Sergey Bylokhov has updated the pull request incrementally with two additional commits since the last revision: >> >> - Update src/java.desktop/share/classes/java/awt/image/ImagingOpException.java >> >> Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> >> - Update src/java.desktop/share/classes/java/awt/image/RasterFormatException.java >> >> Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> > > src/java.desktop/share/classes/com/sun/media/sound/InvalidDataException.java line 42: > >> 40: */ >> 41: @Serial >> 42: private static final long serialVersionUID = 1L; > > This is the standard wording, yet should it mention the serialization is between the same versions only because the value of serialVersionUID is not unique? I think it is "quite" unique, the "1L" is used from the beginning. It is just different from the value which could be generated by the "serialver" but still should work fine. ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From lbourges at openjdk.java.net Tue Jan 12 20:54:57 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Tue, 12 Jan 2021 20:54:57 GMT Subject: [OpenJDK 2D-Dev] Integrated: 7018932 : Drawing very large coordinates with a dashed Stroke can cause Java to hang In-Reply-To: References: Message-ID: On Sat, 9 Jan 2021 09:05:27 GMT, Laurent Bourg?s wrote: > This is my fix proposal to this bug: > - added new method strokeTo(... Region clip ...) in the abstract RenderingEngine class > - fixed all RenderingEngine implementations in java.desktop module > - MarlinRenderingEngine now uses the clip region to roughly & quickly clip the given shape in strokeTo(clip) > - LoopPipe.getStrokeSpans() uses the new strokeTo(clip) method to get good performance with huge dashed shapes. > > I wrote a new test class to validate the bug fix. This pull request has now been integrated. Changeset: e4df2098 Author: Laurent Bourg?s URL: https://git.openjdk.java.net/jdk/commit/e4df2098 Stats: 345 lines in 7 files changed: 307 ins; 1 del; 37 mod 7018932: Drawing very large coordinates with a dashed Stroke can cause Java to hang Reviewed-by: serb, prr ------------- PR: https://git.openjdk.java.net/jdk/pull/2013 From aivanov at openjdk.java.net Tue Jan 12 21:58:14 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Tue, 12 Jan 2021 21:58:14 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: References: Message-ID: On Tue, 12 Jan 2021 20:36:21 GMT, Sergey Bylokhov wrote: >> src/java.desktop/share/classes/com/sun/media/sound/InvalidDataException.java line 42: >> >>> 40: */ >>> 41: @Serial >>> 42: private static final long serialVersionUID = 1L; >> >> This is the standard wording, yet should it mention the serialization is between the same versions only because the value of serialVersionUID is not unique? > > I think it is "quite" unique, the "1L" is used from the beginning. It is just different from the value which could be generated by the "serialver" but still should work fine. Okay. There are several classes which extend this one, all of them use the same 1L value which makes it not "quite" unique. Changing the values at this time presents more risks than benefits. ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From serb at openjdk.java.net Wed Jan 13 02:58:56 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 13 Jan 2021 02:58:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout In-Reply-To: <0G7k8bzAbfBeBX2PHWXDuSXBM0kk7tX6fT-nrMNiP0U=.a7cc5830-60a7-488f-9589-aac07c543473@github.com> References: <-up-8GvJbTW2SvsqRuaN8u3lowBfbvxnfAPMdfINDBE=.3e6c4a14-a563-4f9f-a460-693cfbc19317@github.com> <0G7k8bzAbfBeBX2PHWXDuSXBM0kk7tX6fT-nrMNiP0U=.a7cc5830-60a7-488f-9589-aac07c543473@github.com> Message-ID: On Tue, 12 Jan 2021 11:49:09 GMT, Prasanta Sadhukhan wrote: >> Not sure that one more manual test is needed, the run of the test marked by the printer keyword already required to have a configured printer. Otherwise, why do we need that keyword at all? > > That printer keyword seems to be just a hint/suggestion as it does not force user to do anything, so we can still get this kind of problem. Making it manual at least will let user choose which printer he actually wants to work with. That's not a hint, it is similar to the headful keyword: - "headful" requires the proper configured system and accessible Desktop - "printer" requires the properly configured printer https://github.com/openjdk/jdk/blob/0957d9eb1452b953c1a700ce7ea41155c22bc00e/test/jdk/TEST.ROOT#L14 ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Wed Jan 13 04:20:01 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 13 Jan 2021 04:20:01 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout In-Reply-To: References: <-up-8GvJbTW2SvsqRuaN8u3lowBfbvxnfAPMdfINDBE=.3e6c4a14-a563-4f9f-a460-693cfbc19317@github.com> <0G7k8bzAbfBeBX2PHWXDuSXBM0kk7tX6fT-nrMNiP0U=.a7cc5830-60a7-488f-9589-aac07c543473@github.com> Message-ID: <3CgjxbTmr6kB2b1QV0iRbgYVjp7hlX0Gou2_BYRTths=.2c94ea40-87de-434a-b3af-b3f7dd102ad3@github.com> On Wed, 13 Jan 2021 02:55:46 GMT, Sergey Bylokhov wrote: >> That printer keyword seems to be just a hint/suggestion as it does not force user to do anything, so we can still get this kind of problem. Making it manual at least will let user choose which printer he actually wants to work with. > > That's not a hint, it is similar to the headful keyword: > - "headful" requires the proper configured system and accessible Desktop > - "printer" requires the properly configured printer > https://github.com/openjdk/jdk/blob/0957d9eb1452b953c1a700ce7ea41155c22bc00e/test/jdk/TEST.ROOT#L14 OK. But it's a keyword for jtreg, not useful for standalone execution as you have seen that one can get the problem running on freshly installed windows system. Making it manual will overcome standalone execution problem too. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Wed Jan 13 06:13:57 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 13 Jan 2021 06:13:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> References: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> Message-ID: <0BeCSRlVfit-78buTvO8-tci6rZDhwsML4JXKzujLM8=.ff5ba622-5c99-4925-b690-5b348d0d0e18@github.com> On Tue, 12 Jan 2021 20:42:18 GMT, Sergey Bylokhov wrote: >> Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. >> >> This annotation can be applied to these methods in the module: >> >> private void writeObject(java.io.ObjectOutputStream stream) throws IOException >> private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException >> private void readObjectNoData() throws ObjectStreamException >> ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException >> ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException >> private static final ObjectStreamField[] serialPersistentFields >> private static final long serialVersionUID >> >> Notes: >> - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added >> - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. >> >> A similar fix was implemented for java.base module as well: >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html > > Sergey Bylokhov has updated the pull request incrementally with two additional commits since the last revision: > > - Update src/java.desktop/share/classes/java/awt/image/ImagingOpException.java > > Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> > - Update src/java.desktop/share/classes/java/awt/image/RasterFormatException.java > > Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> Why do we add serialVersionUID in some classes like DefaultMutableTreeNode.java but not in other swing classes? Also, if this change is for stricter compile-time checking, shouldn't we remove @SuppressWarnings("serial") check? ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From serb at openjdk.java.net Wed Jan 13 06:30:57 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 13 Jan 2021 06:30:57 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout In-Reply-To: <3CgjxbTmr6kB2b1QV0iRbgYVjp7hlX0Gou2_BYRTths=.2c94ea40-87de-434a-b3af-b3f7dd102ad3@github.com> References: <-up-8GvJbTW2SvsqRuaN8u3lowBfbvxnfAPMdfINDBE=.3e6c4a14-a563-4f9f-a460-693cfbc19317@github.com> <0G7k8bzAbfBeBX2PHWXDuSXBM0kk7tX6fT-nrMNiP0U=.a7cc5830-60a7-488f-9589-aac07c543473@github.com> <3CgjxbTmr6kB2b1QV0iRbgYVjp7hlX0Gou2_BYRTths=.2c94ea40-87de-434a-b3af-b3f7dd102ad3@github.com> Message-ID: On Wed, 13 Jan 2021 04:16:49 GMT, Prasanta Sadhukhan wrote: >> That's not a hint, it is similar to the headful keyword: >> - "headful" requires the proper configured system and accessible Desktop >> - "printer" requires the properly configured printer >> https://github.com/openjdk/jdk/blob/0957d9eb1452b953c1a700ce7ea41155c22bc00e/test/jdk/TEST.ROOT#L14 > > OK. But it's a keyword for jtreg, not useful for standalone execution as you have seen that one can get the problem running on freshly installed windows system. Making it manual will overcome standalone execution problem too. It is similar to run the headful tests on windows/macOS w/o system preparation or run the tests on Linux w/o Xserver. Or similar to running the tests when the system shortcuts are enabled, will you change all tests which press combinations of keys to the manual tests? I assume no since these are the requirements for the tests run. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Wed Jan 13 06:53:55 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 13 Jan 2021 06:53:55 GMT Subject: [OpenJDK 2D-Dev] RFR: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout In-Reply-To: References: <-up-8GvJbTW2SvsqRuaN8u3lowBfbvxnfAPMdfINDBE=.3e6c4a14-a563-4f9f-a460-693cfbc19317@github.com> <0G7k8bzAbfBeBX2PHWXDuSXBM0kk7tX6fT-nrMNiP0U=.a7cc5830-60a7-488f-9589-aac07c543473@github.com> <3CgjxbTmr6kB2b1QV0iRbgYVjp7hlX0Gou2_BYRTths=.2c94ea40-87de-434a-b3af-b3f7dd102ad3@github.com> Message-ID: On Wed, 13 Jan 2021 06:28:34 GMT, Sergey Bylokhov wrote: >> OK. But it's a keyword for jtreg, not useful for standalone execution as you have seen that one can get the problem running on freshly installed windows system. Making it manual will overcome standalone execution problem too. > > It is similar to run the headful tests on windows/macOS w/o system preparation or run the tests on Linux w/o Xserver. Or similar to running the tests when the system shortcuts are enabled, will you change all tests which press combinations of keys to the manual tests? I assume no since these are the requirements for the tests run. Ok. I will close this as not-an-issue then. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From psadhukhan at openjdk.java.net Wed Jan 13 06:58:59 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 13 Jan 2021 06:58:59 GMT Subject: [OpenJDK 2D-Dev] Withdrawn: 8215537: [TEST_BUG] java/awt/print/PrinterJob/LandscapeStackOverflow.java fails by timeout In-Reply-To: References: Message-ID: On Mon, 4 Jan 2021 08:15:37 GMT, Prasanta Sadhukhan wrote: > Test fails with timeout and it seems likely due to non-availability of printer in the test system. We should just update the test to check for default (or available) printers and return if there is no printer. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jdk/pull/1927 From serb at openjdk.java.net Wed Jan 13 07:07:54 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 13 Jan 2021 07:07:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: <0BeCSRlVfit-78buTvO8-tci6rZDhwsML4JXKzujLM8=.ff5ba622-5c99-4925-b690-5b348d0d0e18@github.com> References: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> <0BeCSRlVfit-78buTvO8-tci6rZDhwsML4JXKzujLM8=.ff5ba622-5c99-4925-b690-5b348d0d0e18@github.com> Message-ID: On Wed, 13 Jan 2021 06:10:53 GMT, Prasanta Sadhukhan wrote: > Why do we add serialVersionUID in some classes like DefaultMutableTreeNode.java but not in other swing classes? Most Swing classes are marked by the specific "Warning" that "Same-version serialization only" is supported. (I think such a warning is missed in a few classes). So generally the serialVersionUID field is not needed in such classes, but if present this provides a small benefit -> this UID is not generated at runtime. For example, the DefaultMutableTreeNode was updated by the JDK-5017904 fix, which was unrelated to serialization but was targeted for the performance issue. > Also, if this change is for stricter compile-time checking, shouldn't we remove @SuppressWarnings("serial") check? At some point, we probably can remove it but will need to fix all serialization warnings which were disabled. ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From psadhukhan at openjdk.java.net Wed Jan 13 07:34:56 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 13 Jan 2021 07:34:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> References: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> Message-ID: On Tue, 12 Jan 2021 20:42:18 GMT, Sergey Bylokhov wrote: >> Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. >> >> This annotation can be applied to these methods in the module: >> >> private void writeObject(java.io.ObjectOutputStream stream) throws IOException >> private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException >> private void readObjectNoData() throws ObjectStreamException >> ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException >> ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException >> private static final ObjectStreamField[] serialPersistentFields >> private static final long serialVersionUID >> >> Notes: >> - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added >> - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. >> >> A similar fix was implemented for java.base module as well: >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html > > Sergey Bylokhov has updated the pull request incrementally with two additional commits since the last revision: > > - Update src/java.desktop/share/classes/java/awt/image/ImagingOpException.java > > Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> > - Update src/java.desktop/share/classes/java/awt/image/RasterFormatException.java > > Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> Marked as reviewed by psadhukhan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From lbourges at openjdk.java.net Thu Jan 14 09:32:13 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Thu, 14 Jan 2021 09:32:13 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) Message-ID: - Removed MarlinRenderingEngine and related classes - Fixed jtreg tests to remove explicit test runs on MarlinRenderingEngine - Marlin Version set to 0.9.1.4 Jtreg tests [test/jdk/sun/java2d/marlin/] : OK ------------- Commit messages: - restored MarlinTileGenerator - JDK-8259681: removed MarlinRenderingEngine and related classes Changes: https://git.openjdk.java.net/jdk/pull/2076/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2076&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8259681 Stats: 8573 lines in 15 files changed: 0 ins; 8566 del; 7 mod Patch: https://git.openjdk.java.net/jdk/pull/2076.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2076/head:pull/2076 PR: https://git.openjdk.java.net/jdk/pull/2076 From lbourges at openjdk.java.net Thu Jan 14 11:17:19 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Thu, 14 Jan 2021 11:17:19 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v2] In-Reply-To: References: Message-ID: > - Removed MarlinRenderingEngine and related classes > - Fixed jtreg tests to remove explicit test runs on MarlinRenderingEngine > - Marlin Version set to 0.9.1.4 > > Jtreg tests [test/jdk/sun/java2d/marlin/] : OK Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: fixed invalid Stroker.CAP_BUTT reference ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2076/files - new: https://git.openjdk.java.net/jdk/pull/2076/files/806a9053..14660d92 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2076&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2076&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2076.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2076/head:pull/2076 PR: https://git.openjdk.java.net/jdk/pull/2076 From lbourges at openjdk.java.net Thu Jan 14 12:30:02 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Thu, 14 Jan 2021 12:30:02 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) In-Reply-To: References: Message-ID: On Thu, 14 Jan 2021 09:27:41 GMT, Laurent Bourg?s wrote: > - Removed MarlinRenderingEngine and related classes > - Fixed jtreg tests to remove explicit test runs on MarlinRenderingEngine > - Marlin Version set to 0.9.1.4 > > Jtreg tests [test/jdk/sun/java2d/marlin/] : OK Apparently windows x64 build failed: no C compiler found ! ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From prr at openjdk.java.net Thu Jan 14 15:54:03 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 14 Jan 2021 15:54:03 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) In-Reply-To: References: Message-ID: <4UabF7e4tSIk5Rze97Ah189ExAbpAKQeyj54J3llzbE=.7cbd4a77-ba1f-4bcb-946d-04a630624a25@github.com> On Thu, 14 Jan 2021 12:26:48 GMT, Laurent Bourg?s wrote: > Apparently windows x64 build failed: no C compiler found ! Other PRs have the same issue. I suppose problem with github actions. Maybe the github default compiler change. ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From brett.okken.os at gmail.com Thu Jan 14 17:09:16 2021 From: brett.okken.os at gmail.com (Brett Okken) Date: Thu, 14 Jan 2021 11:09:16 -0600 Subject: [OpenJDK 2D-Dev] Using VarHandle to read/write primitives Message-ID: In ImageInputStreamImpl and ImageOutputStreamImpl there are methods to read and write other primitive and primitive array types. Has there been thought of using byte array view VarHandles[1] to implement these actions rather than bit twiddling? [1] - https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/MethodHandles.html#byteArrayViewVarHandle(java.lang.Class,java.nio.ByteOrder) From serb at openjdk.java.net Fri Jan 15 00:31:01 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 15 Jan 2021 00:31:01 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8259522: Apply java.io.Serial annotations in java.desktop In-Reply-To: References: Message-ID: On Mon, 11 Jan 2021 06:21:52 GMT, Sergey Bylokhov wrote: > Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. > > This annotation can be applied to these methods in the module: > > private void writeObject(java.io.ObjectOutputStream stream) throws IOException > private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException > private void readObjectNoData() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException > private static final ObjectStreamField[] serialPersistentFields > private static final long serialVersionUID > > Notes: > - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added > - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. > > A similar fix was implemented for java.base module as well: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html This pull request has now been integrated. Changeset: 978bed6c Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/978bed6c Stats: 3424 lines in 343 files changed: 2264 ins; 287 del; 873 mod 8259522: Apply java.io.Serial annotations in java.desktop Reviewed-by: aivanov, psadhukhan ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From serb at openjdk.java.net Fri Jan 15 01:25:05 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 15 Jan 2021 01:25:05 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) In-Reply-To: <4UabF7e4tSIk5Rze97Ah189ExAbpAKQeyj54J3llzbE=.7cbd4a77-ba1f-4bcb-946d-04a630624a25@github.com> References: <4UabF7e4tSIk5Rze97Ah189ExAbpAKQeyj54J3llzbE=.7cbd4a77-ba1f-4bcb-946d-04a630624a25@github.com> Message-ID: On Thu, 14 Jan 2021 15:51:39 GMT, Phil Race wrote: >> Apparently windows x64 build failed: no C compiler found ! > >> Apparently windows x64 build failed: no C compiler found ! > > Other PRs have the same issue. I suppose problem with github actions. Maybe the github default compiler change. I'll start internal testing. ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From serb at openjdk.java.net Fri Jan 15 02:10:05 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 15 Jan 2021 02:10:05 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) In-Reply-To: References: <4UabF7e4tSIk5Rze97Ah189ExAbpAKQeyj54J3llzbE=.7cbd4a77-ba1f-4bcb-946d-04a630624a25@github.com> Message-ID: On Fri, 15 Jan 2021 01:22:42 GMT, Sergey Bylokhov wrote: >>> Apparently windows x64 build failed: no C compiler found ! >> >> Other PRs have the same issue. I suppose problem with github actions. Maybe the github default compiler change. > > I'll start internal testing. please update the copyright dates ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From serb at openjdk.java.net Fri Jan 15 07:42:09 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 15 Jan 2021 07:42:09 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v2] In-Reply-To: References: Message-ID: <9jqbpcFf4ut9CIng69PDqoEe6MJRIyj3voITYtFlo-g=.74044c6b-5f50-4a12-9301-9de8c55a5e8c@github.com> On Thu, 14 Jan 2021 11:17:19 GMT, Laurent Bourg?s wrote: >> - Removed MarlinRenderingEngine and related classes >> - Fixed jtreg tests to remove explicit test runs on MarlinRenderingEngine >> - Marlin Version set to 0.9.1.4 >> >> Jtreg tests [test/jdk/sun/java2d/marlin/] : OK > > Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: > > fixed invalid Stroker.CAP_BUTT reference Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From linuxhippy at gmail.com Fri Jan 15 08:32:58 2021 From: linuxhippy at gmail.com (Clemens Eisserer) Date: Fri, 15 Jan 2021 09:32:58 +0100 Subject: [OpenJDK 2D-Dev] Making the OpenGL-Queue-Flusher work concurrently with AWT threads possible? (... the future of the opengl pipeline) Message-ID: Hi, With solid OpenGL support on Linux being ubiquitous these days and the XRender pipeline being a bit of a dead-end (works quite well except MaskBlit/MaskFill/BufferedImageOps), I was looking a bit into the state/performance of the OpenGL pipeline. Specifically why it performs sometimes worse compared to XRender, despite almost all XRender implementations are running on top of OpenGL these days anyway (except proprietary nvidia). 1. One area where XRender is having an advantage is implicit parallelism. While Java is producing X11 protocol, the XServer can concurrently perform the drawing operations running on a different core. Therefore when running some Swing benchmarks with xrender enabled I see java consuming 100% of one core, while the XServer consumes ~50% of another one. With the OpenGL pipeline on the other hand, just one core is fully loaded - despite a similar design (one flusher thread calling into OpenGL, and one or more independent threads queuing drawing operations into a buffer). The reason seems to be the OGLRenderQueue has just one buffer, so either the flusher thread is active or a queuing thread but not both. I wonder, have there been attempts made to introduce double-buffering here and have producers (awt threads) and consumer (queue flusher thread) running concurrently here? 2. Especially MaskFill did perform quite poor in my tests, because drivers are typically not optimized for tiny texture uploads (32x32 coverage masks). Just stubbing out the subTex2D call improved framerate of one benchmark from 100fps to 300fps. I have done some prototyping uploading coverage masks via Shader_Storage_Buffer_Object, but that requires ARB_shader_storage_buffer_object (GL 4.3) as well glBufferStorage (4.4), so effectivly OpenGL-4.4. On the pro side of this approach composition peaked at about 10GB/s with 64x64 mask tiles. Which leads me to the next question: The pipeline currently is written in rather ancient OpenGL-2.x style. Once the need to support old OSX versions is gone, the OpenGL pipeline would not be enabled be default on any platform. Once this is the case, would it be feasable to clean up the code by making use of modern GL and by leaving legacy platforms behind? Modern GL has many improvements in areas where the current pipeline is suffering a bit (overhead of state changes for small drawing operations, etc). Thanks and best regards, Clemens -------------- next part -------------- An HTML attachment was scrubbed... URL: From bourges.laurent at gmail.com Fri Jan 15 11:06:25 2021 From: bourges.laurent at gmail.com (=?UTF-8?Q?Laurent_Bourg=C3=A8s?=) Date: Fri, 15 Jan 2021 12:06:25 +0100 Subject: [OpenJDK 2D-Dev] Making the OpenGL-Queue-Flusher work concurrently with AWT threads possible? (... the future of the opengl pipeline) In-Reply-To: References: Message-ID: Hi Clemens, It reminds me our discussion few years ago, when I experimented opengl on linux and tuned the OGLRenderQueue for the Marlin renderer, see: - https://github.com/bourgesl/marlin-renderer/blob/jdk/src/main/java/sun/java2d/pipe/RenderQueue.java - https://github.com/bourgesl/marlin-renderer/blob/jdk/src/main/java/sun/java2d/opengl/OGLRenderQueue.java 1. These changes mainly consists in increasing internal queue buffer from 32K to 1 Mb (based on my own performance tests). Ideally an heuristic (data volume per second) could help estimating the appropriate queue capacity needed to automatically optimize the producer writing / consumer reading speed. I like your idea to have multiple queue producer but a single consumer means a single Surface destination at 1 time ? How to do parallel rendering on different surfaces (ogl context switch) ? 2. As the Marlin renderer supports large tiles (up to 256x256), it is very easy to adjust Marlin tiles at runtime for performance: -Dsun.java2d.renderer.log=true -Dsun.java2d.renderer.tileSize_log2=5 -Dsun.java2d.renderer.tileWidth_log2=5 By default, 5 means 2^5 = 32. Just set larger values: -Dsun.java2d.renderer.tileSize_log2=6 -Dsun.java2d.renderer.tileWidth_log2=6 Finally your proposal is amazing and I could join you in your efforts, if we publicly work on the same repository (github.com ?) Cheers, Happy New Year, Laurent Le ven. 15 janv. 2021 ? 09:35, Clemens Eisserer a ?crit : > Hi, > > With solid OpenGL support on Linux being ubiquitous these days and the > XRender pipeline being a bit of a dead-end (works quite well except > MaskBlit/MaskFill/BufferedImageOps), I was looking a bit into the > state/performance of the OpenGL pipeline. > Specifically why it performs sometimes worse compared to XRender, despite > almost all XRender implementations are running on top of OpenGL these days > anyway (except proprietary nvidia). > > 1. One area where XRender is having an advantage is implicit parallelism. > While Java is producing X11 protocol, the XServer can concurrently perform > the drawing operations running on a different core. > Therefore when running some Swing benchmarks with xrender enabled I see > java consuming 100% of one core, while the XServer consumes ~50% of another > one. > With the OpenGL pipeline on the other hand, just one core is fully loaded > - despite a similar design (one flusher thread calling into OpenGL, and one > or more independent threads queuing drawing operations into a buffer). > > The reason seems to be the OGLRenderQueue has just one buffer, so either > the flusher thread is active or a queuing thread but not both. > I wonder, have there been attempts made to introduce double-buffering here > and have producers (awt threads) and consumer (queue flusher thread) > running concurrently here? > > 2. Especially MaskFill did perform quite poor in my tests, because drivers > are typically not optimized for tiny texture uploads (32x32 coverage masks). > Just stubbing out the subTex2D call improved framerate of one benchmark > from 100fps to 300fps. > I have done some prototyping uploading coverage masks via > Shader_Storage_Buffer_Object, but that requires > ARB_shader_storage_buffer_object (GL 4.3) as well glBufferStorage (4.4), so > effectivly OpenGL-4.4. > On the pro side of this approach composition peaked at about 10GB/s with > 64x64 mask tiles. > > Which leads me to the next question: > The pipeline currently is written in rather ancient OpenGL-2.x style. > Once the need to support old OSX versions is gone, the OpenGL pipeline > would not be enabled be default on any platform. > Once this is the case, would it be feasable to clean up the code by making > use of modern GL and by leaving legacy platforms behind? > Modern GL has many improvements in areas where the current pipeline is > suffering a bit (overhead of state changes for small drawing operations, > etc). > > Thanks and best regards, Clemens > -- -- Laurent Bourg?s -------------- next part -------------- An HTML attachment was scrubbed... URL: From lbourges at openjdk.java.net Fri Jan 15 11:19:19 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Fri, 15 Jan 2021 11:19:19 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v3] In-Reply-To: References: Message-ID: > - Removed MarlinRenderingEngine and related classes > - Fixed jtreg tests to remove explicit test runs on MarlinRenderingEngine > - Marlin Version set to 0.9.1.4 > > Jtreg tests [test/jdk/sun/java2d/marlin/] : OK Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: fixed copyright year + removed useless interfaces (IRendererContext, MarlinRenderer) ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2076/files - new: https://git.openjdk.java.net/jdk/pull/2076/files/14660d92..ebcd0cd3 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2076&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2076&range=01-02 Stats: 88 lines in 7 files changed: 0 ins; 75 del; 13 mod Patch: https://git.openjdk.java.net/jdk/pull/2076.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2076/head:pull/2076 PR: https://git.openjdk.java.net/jdk/pull/2076 From lbourges at openjdk.java.net Fri Jan 15 11:31:05 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Fri, 15 Jan 2021 11:31:05 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v2] In-Reply-To: <9jqbpcFf4ut9CIng69PDqoEe6MJRIyj3voITYtFlo-g=.74044c6b-5f50-4a12-9301-9de8c55a5e8c@github.com> References: <9jqbpcFf4ut9CIng69PDqoEe6MJRIyj3voITYtFlo-g=.74044c6b-5f50-4a12-9301-9de8c55a5e8c@github.com> Message-ID: On Fri, 15 Jan 2021 07:38:58 GMT, Sergey Bylokhov wrote: >> Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: >> >> fixed invalid Stroker.CAP_BUTT reference > > Marked as reviewed by serb (Reviewer). Sergey, I slightly modified the reviewed change: see incremental changes: https://openjdk.github.io/cr/?repo=jdk&pr=2076&range=01-02 ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From lbourges at openjdk.java.net Fri Jan 15 11:37:01 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Fri, 15 Jan 2021 11:37:01 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v2] In-Reply-To: References: <9jqbpcFf4ut9CIng69PDqoEe6MJRIyj3voITYtFlo-g=.74044c6b-5f50-4a12-9301-9de8c55a5e8c@github.com> Message-ID: On Fri, 15 Jan 2021 11:28:35 GMT, Laurent Bourg?s wrote: >> Marked as reviewed by serb (Reviewer). > > Sergey, I slightly modified the reviewed change: > see incremental changes: https://openjdk.github.io/cr/?repo=jdk&pr=2076&range=01-02 One more idea: should I rename all Dxxx classes to xxx to make code more obvious, readable ? However, renaming DMarlinRenderingEngine to MarlinRenderingEngine may lead confusion with previous versions and may be a compatibility issue ? so I would prefer keeping DMarlinRenderingEngine now. What do you think ? ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From alanb at openjdk.java.net Fri Jan 15 15:01:09 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Fri, 15 Jan 2021 15:01:09 GMT Subject: [OpenJDK 2D-Dev] RFR: 8257733: Move module-specific data from make to respective module [v4] In-Reply-To: <95Qw1lVtqPHbGHoNJo46xIPO3OEof9nqCGJ3xA-oNZ8=.fa51b0e5-b33b-4f96-9756-a46741841201@github.com> References: <95Qw1lVtqPHbGHoNJo46xIPO3OEof9nqCGJ3xA-oNZ8=.fa51b0e5-b33b-4f96-9756-a46741841201@github.com> Message-ID: On Mon, 11 Jan 2021 09:20:07 GMT, Magnus Ihse Bursie wrote: >> Marked as reviewed by prr (Reviewer). > > This PR is not stale; it's just still waiting for input from @AlanBateman. @magicus Can the CharacterDataXXX.template files move to src/java.base/share/classes/java/lang? ------------- PR: https://git.openjdk.java.net/jdk/pull/1611 From mark.reinhold at oracle.com Fri Jan 15 18:27:09 2021 From: mark.reinhold at oracle.com (mark.reinhold at oracle.com) Date: Fri, 15 Jan 2021 10:27:09 -0800 Subject: [OpenJDK 2D-Dev] RFR: 8257733: Move module-specific data from make to respective module In-Reply-To: References: <6Xos38Butvxz7sBGvR26EfT7mJrTXt_AvEj3tQcUnXA=.581f1b5c-a4f5-457c-bbee-5c2badd48ec5@github.com> Message-ID: <20210115102709.538599954@eggemoggin.niobe.net> 2020/12/4 6:08:13 -0800, erikj at openjdk.java.net: > On Fri, 4 Dec 2020 12:30:02 GMT, Alan Bateman wrote: >>> And I can certainly move jdwp.spec to java.base instead. That's the >>> reason I need input on this: All I know is that is definitely not >>> the responsibility of the Build Group to maintain that document, and >>> I made my best guess at where to place it. >> >>> And I can certainly move jdwp.spec to java.base instead. >> >> If jdwp.spec has to move to the src tree then src/java.se is probably >> the most suitable home because Java SE specifies JDWP as an optional >> interface. So nothing to do with java.base and the build will need to >> continue to generate the sources for the front-end (jdk.jdi) and >> back-end (jdk.jdwp.agent) as they implement the protocol. > > My understanding of JEPs is that they should be viewed as living > documents. In this case, I think it's perfectly valid to update JEP > 201 with additional source code layout. Both for this and for the > other missing dirs. Feature JEPs are living documents until such time as they are delivered. In this case it would not be appropriate to update JEP 201, which is as much about the transition from the old source-code layout as it is about the new layout as of 2014. At this point, and given that we?d already gone beyond JEP 201 prior to this change (with `man` and `lib` subdirectories), what?d make the most sense is a new informational JEP that documents the source-code layout. Informational JEPs can, within reason, be updated over time. - Mark From ihse at openjdk.java.net Fri Jan 15 18:30:07 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Fri, 15 Jan 2021 18:30:07 GMT Subject: [OpenJDK 2D-Dev] RFR: 8257733: Move module-specific data from make to respective module [v4] In-Reply-To: References: <95Qw1lVtqPHbGHoNJo46xIPO3OEof9nqCGJ3xA-oNZ8=.fa51b0e5-b33b-4f96-9756-a46741841201@github.com> Message-ID: On Fri, 15 Jan 2021 14:58:14 GMT, Alan Bateman wrote: >> This PR is not stale; it's just still waiting for input from @AlanBateman. > > @magicus Can the CharacterDataXXX.template files move to src/java.base/share/classes/java/lang? @AlanBateman That sounds like an excellent idea. I'll update the PR first thing next week. :) ------------- PR: https://git.openjdk.java.net/jdk/pull/1611 From serb at openjdk.java.net Fri Jan 15 23:09:08 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 15 Jan 2021 23:09:08 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v2] In-Reply-To: References: <9jqbpcFf4ut9CIng69PDqoEe6MJRIyj3voITYtFlo-g=.74044c6b-5f50-4a12-9301-9de8c55a5e8c@github.com> Message-ID: On Fri, 15 Jan 2021 11:34:35 GMT, Laurent Bourg?s wrote: > However, renaming DMarlinRenderingEngine to MarlinRenderingEngine may lead confusion with previous versions and may be a compatibility issue ? so I would prefer keeping DMarlinRenderingEngine now. I agree with you. ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From Sergey.Bylokhov at oracle.com Fri Jan 15 23:38:01 2021 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 15 Jan 2021 15:38:01 -0800 Subject: [OpenJDK 2D-Dev] Making the OpenGL-Queue-Flusher work concurrently with AWT threads possible? (... the future of the opengl pipeline) In-Reply-To: References: Message-ID: On 15.01.2021 00:32, Clemens Eisserer wrote: > With solid OpenGL support on Linux being ubiquitous these days and the XRender pipeline being a bit of a dead-end (works quite well except MaskBlit/MaskFill/BufferedImageOps), I was looking a bit into the state/performance of the OpenGL pipeline. > Specifically why it performs sometimes worse compared to XRender, despite almost all XRender implementations are running on top of OpenGL these days anyway (except proprietary nvidia). > > 1. One area where XRender is having an advantage is implicit parallelism. > While Java is producing X11 protocol, the XServer can concurrently perform the drawing operations running on a different core. > Therefore when running some Swing benchmarks with xrender enabled I see java consuming 100% of one core, while the XServer consumes ~50% of another one. > With the OpenGL pipeline on the other hand, just one core is fully loaded - despite a similar design (one flusher thread calling into OpenGL, and one or more independent threads queuing drawing operations into a buffer). The design is a little bit different, the XRender pipeline: - Many threads which call draw operations and sends them to the XServer - The XSerever decode the the draw operation and push the commands to the "opengl buffer" - Some video driver code which decode the ogl buffer and actually draw something The OGL pipeline - Many threads call draw operations, and save them in the internal RenderQueue buffer - One RenderQueue thread decode the the draw operation and push the commands to the "opengl buffer" - Some video driver code which decode the ogl buffer and actually draw something Depends on the method on how to measure the performance results will be different. - For the screen rendering you will need to check the screen, is something is really rendering(glflush and XFlush could help a little bit but not always) - For the volatile image you will need to test roundtrip when you write and read data The only obviously bad results could occur if some pipeline will use the software rendering(even for some small intermittent operations) > The reason seems to be the OGLRenderQueue has just one buffer, so either the flusher thread is active or a queuing thread but not both. > I wonder, have there been attempts made to introduce double-buffering here and have producers (awt threads) and consumer (queue flusher thread) running concurrently here? I am not sure that it work that way, the only way to block the queuing thread is to call "flushNow()", for other cases it should not be blocked. The OGLRenderQueue thread however could became blocked every 100ms. > > 2. Especially MaskFill did perform quite poor in my tests, because drivers are typically not optimized for tiny texture uploads (32x32 coverage masks). > Just stubbing out the subTex2D call improved framerate of one benchmark from 100fps to 300fps. > I have done some prototyping uploading coverage masks via Shader_Storage_Buffer_Object, but that requires? ARB_shader_storage_buffer_object (GL 4.3) as well glBufferStorage (4.4), so effectivly OpenGL-4.4. > On the pro side of this approach composition peaked at about 10GB/s with 64x64 mask tiles. There are many ways to improve the OGL pipeline using new OGL feature, but be aware that currently the OGL pipeline is the only one crossplatform pipeline which works virtually on most of devices(new and old). A similar architecture issue exists in the d3d pipeline as well, so maybe the Vulkan will better, it could replace XRender and D3D someday? I thought Vulkan superseded the OGL, no? > > Which leads me to the next question: > The pipeline currently is written in rather ancient OpenGL-2.x style. > Once the need to support old OSX versions is gone, the OpenGL pipeline would not be enabled be default on any platform. > Once this is the case, would it be feasable to clean up the code by making use of modern GL and by leaving legacy platforms behind? > Modern GL has many improvements in areas where the current pipeline is suffering a bit (overhead of state changes for small drawing operations, etc). -- Best regards, Sergey. From Sergey.Bylokhov at oracle.com Fri Jan 15 23:50:16 2021 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 15 Jan 2021 15:50:16 -0800 Subject: [OpenJDK 2D-Dev] Making the OpenGL-Queue-Flusher work concurrently with AWT threads possible? (... the future of the opengl pipeline) In-Reply-To: References: Message-ID: <2ca5c098-bc55-4e25-b517-38cc3108161f@oracle.com> On 15.01.2021 03:06, Laurent Bourg?s wrote: > Hi Clemens, > > It reminds me our discussion few years ago, when I experimented opengl on linux and tuned the OGLRenderQueue for the Marlin renderer, see: > - https://github.com/bourgesl/marlin-renderer/blob/jdk/src/main/java/sun/java2d/pipe/RenderQueue.java > - https://github.com/bourgesl/marlin-renderer/blob/jdk/src/main/java/sun/java2d/opengl/OGLRenderQueue.java > > 1. These changes mainly consists in increasing internal queue buffer from 32K to 1 Mb (based on my own performance tests). > Ideally an heuristic (data volume per second) could help estimating the appropriate queue capacity needed to automatically optimize the producer writing / consumer reading speed. The problem with increasing the buffer is that it can cause unexpected spikes during drawing -> Most of the draw operations will work faster because all of them just put the "draw operation" to the buffer and the flush will occur less often, but the flush operation itself will be slower. Imagine a situation when the user draws something on the screen while the 1 Mb buffer is full. Also note that executing OGL commands in native on the OGLRenderQueue does not mean that the picture is rendered on the screen, it could be possible that the picture will appeared at the end of the buffer when will call glFlush/glFinish, so the lag could occurred when we flush 1Mb vs 32k. -- Best regards, Sergey. From serb at openjdk.java.net Sat Jan 16 07:33:24 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 16 Jan 2021 07:33:24 GMT Subject: [OpenJDK 2D-Dev] RFR: 6986863: ProfileDeferralMgr throwing ConcurrentModificationException [v4] In-Reply-To: References: Message-ID: > This change intended to enhance the lazy initialization of the standard color profiles concurrently by different threads. > > We defer standard profiles loading because most of UI application uses a small amount of data from the profile like numComponents and colorSpaceType, and this data is known in advance. But any other profile-related activity (like a color conversion, profile data accesses, etc.) triggers profile activation when we load all profile data to the memory. > > Before the fix for JDK-6793818, we defer only one sRGB color profile, see: https://github.com/openjdk/jdk/commit/2726f2a3621dd2562d4fb660b4c3d376c65027aa > > Notes about the link above: > - The code in the ProfileDeferralMgr, which contain the Vector of profiles for activation does not use any synchronization > - The `activateDeferredProfile` and `activate` methods are implemented to throw `ProfileDataException`, but this exception is ignored during activation process: > https://github.com/openjdk/jdk/commit/2726f2a3621dd2562d4fb660b4c3d376c65027aa#diff-0839c25a6c999452be28b431c54d5daa91364d302cfda6efa5c56421c2f2bdcbR96 > > The fix: > - Drops the usage of ProfileDeferralMgr (which contained the Vector of profiles for activation) and ProfileActivator machinery. Instead, we will have just one `ICC_Profile.activate()` method which will activate and initialize the `ICC_Profile.cmmProfile` if it is null > - The `activate` method implementation mimics the old behavior when the CMMException and IOException were wrapped by the ProfileDataException, and the ProfileDataException itself was ignored during activation - > so an exception will not be thrown in the method itself, but only when the null profile will be used. > > See some comments inline. Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: - Merge branch 'master' into JDK-6986863 - Update ProfileActivationDuringPropertyAccess.java - Merge branch 'master' into JDK-6986863 - Merge branch 'master' into JDK-6986863 - Merge branch 'master' into JDK-6986863 - Merge branch 'master' into JDK-6986863 - Delete the DeferralMgr machinery - Update ICC_Profile.java - Wrong spec in ProfileDeferralInfo - Update ICC_Profile.java - ... and 3 more: https://git.openjdk.java.net/jdk/compare/d63388c0...884f9e90 ------------- Changes: https://git.openjdk.java.net/jdk/pull/1613/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1613&range=03 Stats: 520 lines in 9 files changed: 183 ins; 265 del; 72 mod Patch: https://git.openjdk.java.net/jdk/pull/1613.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1613/head:pull/1613 PR: https://git.openjdk.java.net/jdk/pull/1613 From kcr at openjdk.java.net Sat Jan 16 16:59:39 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Sat, 16 Jan 2021 16:59:39 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v2] In-Reply-To: References: <9jqbpcFf4ut9CIng69PDqoEe6MJRIyj3voITYtFlo-g=.74044c6b-5f50-4a12-9301-9de8c55a5e8c@github.com> Message-ID: On Fri, 15 Jan 2021 23:06:21 GMT, Sergey Bylokhov wrote: >> One more idea: >> should I rename all Dxxx classes to xxx to make code more obvious, readable ? >> >> However, renaming DMarlinRenderingEngine to MarlinRenderingEngine may lead confusion with previous versions and may be a compatibility issue ? so I would prefer keeping DMarlinRenderingEngine now. >> >> What do you think ? > >> However, renaming DMarlinRenderingEngine to MarlinRenderingEngine may lead confusion with previous versions and may be a compatibility issue ? so I would prefer keeping DMarlinRenderingEngine now. > > I agree with you. I also agree with this. Similarly, when you go to remove the single-precision `MarlinRasterizer` from JavaFX, via [JDK-8259718](https://bugs.openjdk.java.net/browse/JDK-8259718), I would expect to see `DMarlinRasterizer` and similar names to remain. ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From serb at openjdk.java.net Sat Jan 16 21:41:29 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Sat, 16 Jan 2021 21:41:29 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v3] In-Reply-To: References: Message-ID: On Fri, 15 Jan 2021 11:19:19 GMT, Laurent Bourg?s wrote: >> - Removed MarlinRenderingEngine and related classes >> - Fixed jtreg tests to remove explicit test runs on MarlinRenderingEngine >> - Marlin Version set to 0.9.1.4 >> >> Jtreg tests [test/jdk/sun/java2d/marlin/] : OK > > Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: > > fixed copyright year + removed useless interfaces (IRendererContext, MarlinRenderer) Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From lbourges at openjdk.java.net Sun Jan 17 09:07:37 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sun, 17 Jan 2021 09:07:37 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v4] In-Reply-To: References: Message-ID: > - Removed MarlinRenderingEngine and related classes > - Fixed jtreg tests to remove explicit test runs on MarlinRenderingEngine > - Marlin Version set to 0.9.1.4 > > Jtreg tests [test/jdk/sun/java2d/marlin/] : OK Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: renamed Dxx classes to their original names ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2076/files - new: https://git.openjdk.java.net/jdk/pull/2076/files/ebcd0cd3..80428a96 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2076&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2076&range=02-03 Stats: 165 lines in 12 files changed: 0 ins; 0 del; 165 mod Patch: https://git.openjdk.java.net/jdk/pull/2076.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2076/head:pull/2076 PR: https://git.openjdk.java.net/jdk/pull/2076 From lbourges at openjdk.java.net Sun Jan 17 09:29:28 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sun, 17 Jan 2021 09:29:28 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v3] In-Reply-To: References: Message-ID: <26Z5Os95OOq_isTF3OJECTtc5IAb4zCbe_XvSxDP1CE=.ee883ab5-cfc1-4584-94c9-97eca310bd9a@github.com> On Sat, 16 Jan 2021 21:38:32 GMT, Sergey Bylokhov wrote: >> Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: >> >> fixed copyright year + removed useless interfaces (IRendererContext, MarlinRenderer) > > Marked as reviewed by serb (Reviewer). Sergey, I made the class refactoring, more clear in incremental webrev: https://openjdk.github.io/cr/?repo=jdk&pr=2076&range=02-03 Still Approved ? ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From lbourges at openjdk.java.net Sun Jan 17 10:31:45 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sun, 17 Jan 2021 10:31:45 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v3] In-Reply-To: <26Z5Os95OOq_isTF3OJECTtc5IAb4zCbe_XvSxDP1CE=.ee883ab5-cfc1-4584-94c9-97eca310bd9a@github.com> References: <26Z5Os95OOq_isTF3OJECTtc5IAb4zCbe_XvSxDP1CE=.ee883ab5-cfc1-4584-94c9-97eca310bd9a@github.com> Message-ID: On Sun, 17 Jan 2021 09:27:03 GMT, Laurent Bourg?s wrote: >> Marked as reviewed by serb (Reviewer). > > Sergey, I made the class refactoring, more clear in incremental webrev: > https://openjdk.github.io/cr/?repo=jdk&pr=2076&range=02-03 > Still Approved ? Forgot to fix copyright year on renamed classes, sorry ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From linuxhippy at gmail.com Sun Jan 17 12:08:36 2021 From: linuxhippy at gmail.com (Clemens Eisserer) Date: Sun, 17 Jan 2021 13:08:36 +0100 Subject: [OpenJDK 2D-Dev] Making the OpenGL-Queue-Flusher work concurrently with AWT threads possible? (... the future of the opengl pipeline) In-Reply-To: References: Message-ID: Hi Sergey, > The design is a little bit different, the XRender pipeline: > - Many threads which call draw operations and sends them to the XServer > - The XSerever decode the the draw operation and push the commands to the "opengl buffer" > - Some video driver code which decode the ogl buffer and actually draw something > The OGL pipeline > - Many threads call draw operations, and save them in the internal RenderQueue buffer > - One RenderQueue thread decode the the draw operation and push the commands to the "opengl buffer" > - Some video driver code which decode the ogl buffer and actually draw something So in both cases producers (application threads) and the consumer are decoupled via some kind of queue (unix domain socket for x11, in-memory queue for the renderqueue) and in theory could operate concurrently. > I am not sure that it work that way, the only way to block the queuing thread is to call "flushNow()", for other cases it should not be blocked. > The OGLRenderQueue thread however could became blocked every 100ms. Since there is only one RenderQueue+Buffer, the entire queue has to be locked while the commands are processed by the RenderQueue-Thread (via the AWT lock held by the thread which is implicitly calling flushNow triggered by a full buffer). This serverly limits parallelism - you can either process commands (RenderQueue thread) or queue new commands (AWT threads) but not both at the same time. This lead me to the original question - whether this was a necessity caused by structural requirements/limitations or whether it simply hasn't been thought through / implemented. I did some prototyping of a double-buffered renderqueue (no other changes) over the weekend and results are really promising (1x1 fillRect to measure pipeline-overhead, 20x20 aa oval to get an impression data-heavy buffer interaction): Test(graphics.render.tests.fillRect) averaged 1.4837645794468326E7 pixels/sec with !antialias, to VolatileImg(), ident, SrcOver, single, width1, 1x1, !clip, bounce, Default, !xormode, !alphacolor, !extraalpha Test(graphics.render.tests.fillOval) averaged 3.896264839428713E7 pixels/sec with !alphacolor, SrcOver, 20x20, Default, antialias, bounce, !xormode, to VolatileImg(), !clip, width1, !extraalpha, single, ident whereas the original JDK with OGL yielded: Test(graphics.render.tests.fillRect) averaged 5061909.644344761 pixels/sec with single, 1x1, SrcOver, !extraalpha, bounce, Default, !xormode, to VolatileImg(), ident, !alphacolor, width1, !antialias, !clip Test(graphics.render.tests.fillOval) averaged 1.0837940280832347E7 pixels/sec with single, 20x20, SrcOver, !extraalpha, bounce, Default, !xormode, to VolatileImg(), ident, !alphacolor, width1, antialias, !clip and with XRender: Test(graphics.render.tests.fillRect) averaged 2.5252814688096754E7 pixels/sec with ident, to VolatileImg(), 1x1, !clip, !extraalpha, width1, !alphacolor, Default, single, bounce, !antialias, !xormode, SrcOver All test results: Test(graphics.render.tests.fillOval) averaged 2.53725229244114E7 pixels/sec with ident, to VolatileImg(), 20x20, !clip, !extraalpha, width1, !alphacolor, Default, single, bounce, antialias, !xormode, SrcOver To be honest I don't have an explanation why results are *that* good, but on the other hand - XRender is still clearly faster for 1x1 fillRect and not *that* much slower for the maskfills. > There are many ways to improve the OGL pipeline using new OGL feature, but be aware that currently the OGL > pipeline is the only one crossplatform pipeline which works virtually on most of devices(new and old). > A similar architecture issue exists in the d3d pipeline as well, so maybe the Vulkan will better, > it could replace XRender and D3D someday? > > I thought Vulkan superseded the OGL, no? It did and for sure it would be a good/better path forward. On the other hand it would require a new pipeline implementation and not just incremental changes, something hard to do in spare-time ;) Thanks and best regards, Clemens -------------- next part -------------- An HTML attachment was scrubbed... URL: From bourges.laurent at gmail.com Sun Jan 17 13:19:36 2021 From: bourges.laurent at gmail.com (=?UTF-8?Q?Laurent_Bourg=C3=A8s?=) Date: Sun, 17 Jan 2021 14:19:36 +0100 Subject: [OpenJDK 2D-Dev] Making the OpenGL-Queue-Flusher work concurrently with AWT threads possible? (... the future of the opengl pipeline) In-Reply-To: References: Message-ID: Hi Clemens, I read again the source code and wanted to add metrics like wait_ratio and make some new heuristics to auto tune the buffer capacity. I was also tempted to rewrite the buffer overflow strategy: swap buffer or use a larger one... Apparently you made another approach (double buffer) to reduce the wait latency in awt threads... and allow gl thread to run concurently: excellent ! Le dim. 17 janv. 2021 ? 13:11, Clemens Eisserer a ?crit : > Hi Sergey, > > > The design is a little bit different, the XRender pipeline: > > - Many threads which call draw operations and sends them to the XServer > > - The XSerever decode the the draw operation and push the commands to > the "opengl buffer" > > - Some video driver code which decode the ogl buffer and actually draw > something > > The OGL pipeline > > - Many threads call draw operations, and save them in the internal > RenderQueue buffer > > - One RenderQueue thread decode the the draw operation and push the > commands to the "opengl buffer" > > - Some video driver code which decode the ogl buffer and actually draw > something > > So in both cases producers (application threads) and the consumer are > decoupled via some kind of queue (unix domain socket for x11, in-memory > queue for the renderqueue) and in theory could operate concurrently. > > > I am not sure that it work that way, the only way to block the queuing > thread is to call "flushNow()", for other cases it should not be blocked. > > The OGLRenderQueue thread however could became blocked every 100ms. > > Since there is only one RenderQueue+Buffer, the entire queue has to be > locked while the commands are processed by the RenderQueue-Thread (via the > AWT lock held by the thread which is implicitly calling flushNow triggered > by a full buffer). > This serverly limits parallelism - you can either process commands > (RenderQueue thread) or queue new commands (AWT threads) but not both at > the same time. > This lead me to the original question - whether this was a necessity > caused by structural requirements/limitations or whether it simply hasn't > been thought through / implemented. > > I did some prototyping of a double-buffered renderqueue (no other changes) > over the weekend and results are really promising (1x1 fillRect to measure > pipeline-overhead, 20x20 aa oval to get an impression data-heavy buffer > interaction): > > Test(graphics.render.tests.fillRect) averaged 1.4837645794468326E7 > pixels/sec > with !antialias, to VolatileImg(), ident, SrcOver, single, width1, 1x1, > !clip, bounce, Default, !xormode, !alphacolor, !extraalpha > Test(graphics.render.tests.fillOval) averaged 3.896264839428713E7 > pixels/sec > with !alphacolor, SrcOver, 20x20, Default, antialias, bounce, !xormode, > to VolatileImg(), !clip, width1, !extraalpha, single, ident > > whereas the original JDK with OGL yielded: > > Test(graphics.render.tests.fillRect) averaged 5061909.644344761 pixels/sec > with single, 1x1, SrcOver, !extraalpha, bounce, Default, !xormode, to > VolatileImg(), ident, !alphacolor, width1, !antialias, !clip > Test(graphics.render.tests.fillOval) averaged 1.0837940280832347E7 > pixels/sec > with single, 20x20, SrcOver, !extraalpha, bounce, Default, !xormode, to > VolatileImg(), ident, !alphacolor, width1, antialias, !clip > > and with XRender: > Test(graphics.render.tests.fillRect) averaged 2.5252814688096754E7 > pixels/sec > with ident, to VolatileImg(), 1x1, !clip, !extraalpha, width1, > !alphacolor, Default, single, bounce, !antialias, !xormode, SrcOver > All test results: > Test(graphics.render.tests.fillOval) averaged 2.53725229244114E7 pixels/sec > with ident, to VolatileImg(), 20x20, !clip, !extraalpha, width1, > !alphacolor, Default, single, bounce, antialias, !xormode, SrcOver > Could you share your patch to let me study it and try improving it ? Cheers, Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: From lbourges at openjdk.java.net Sun Jan 17 13:32:34 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Sun, 17 Jan 2021 13:32:34 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v5] In-Reply-To: References: Message-ID: > - Removed MarlinRenderingEngine and related classes > - Fixed jtreg tests to remove explicit test runs on MarlinRenderingEngine > - Marlin Version set to 0.9.1.4 > > Jtreg tests [test/jdk/sun/java2d/marlin/] : OK Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: fixed copyright year again ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2076/files - new: https://git.openjdk.java.net/jdk/pull/2076/files/80428a96..8818d050 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2076&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2076&range=03-04 Stats: 10 lines in 10 files changed: 0 ins; 0 del; 10 mod Patch: https://git.openjdk.java.net/jdk/pull/2076.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2076/head:pull/2076 PR: https://git.openjdk.java.net/jdk/pull/2076 From linuxhippy at gmail.com Sun Jan 17 18:58:15 2021 From: linuxhippy at gmail.com (Clemens Eisserer) Date: Sun, 17 Jan 2021 19:58:15 +0100 Subject: [OpenJDK 2D-Dev] Making the OpenGL-Queue-Flusher work concurrently with AWT threads possible? (... the future of the opengl pipeline) In-Reply-To: References: Message-ID: Hi Laurent, Thanks for your interest in tuning the pipelines and all the work you did in this regard with Marlin. > I read again the source code and wanted to add metrics like wait_ratio and make some new heuristics to auto tune the buffer capacity. > I was also tempted to rewrite the buffer overflow strategy: swap buffer or use a larger one... > Apparently you made another approach (double buffer) to reduce the wait latency in awt threads... and allow gl thread to run concurently: excellent ! > Could you share your patch to let me study it and try improving it ? Sure, I've forked openjdk at: https://github.com/ceisserer/jdk However please keep in mind this is still very much a proof-of-concept hack done in one day only: - There are some places in native code which do not expect the pointer to the buffer to change after a flush, which are still not modified. - I guess it would be better to return the new RenderBuffer from ensureCapacity and flushnow, instead of relying on callers to re-fetch it after calling those methods - I am not 100% convinced the rewritten locking in the OglRenderQueue flusher thread is correct under all circumstances. This code would need a rewrite/clean-up and error-handling, now that it has to take into account two different operating modes (sync / async flush). As this has to fit into AWT's existing locking scheme, it took me some time to get it working. - there are still rough edges and issues/bugs: when flushNow in OGLBlitLoops.IsoBlit is changed to flush async, I get crashes etc - so some places somewhere are either not aware of the buffer change, or expect certain behaviour I don't know about. (with async flush I get GLX errors and other strange issues). just to be curious, are you running the proprietary nvidia opengl driver? Best regards, Clemens -------------- next part -------------- An HTML attachment was scrubbed... URL: From serb at openjdk.java.net Mon Jan 18 11:15:50 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 18 Jan 2021 11:15:50 GMT Subject: [OpenJDK 2D-Dev] RFR: JDK-8259681 : Remove the Marlin rendering engine (single-precision) [v5] In-Reply-To: References: Message-ID: On Sun, 17 Jan 2021 13:32:34 GMT, Laurent Bourg?s wrote: >> - Removed MarlinRenderingEngine and related classes >> - Fixed jtreg tests to remove explicit test runs on MarlinRenderingEngine >> - Marlin Version set to 0.9.1.4 >> >> Jtreg tests [test/jdk/sun/java2d/marlin/] : OK > > Laurent Bourg?s has updated the pull request incrementally with one additional commit since the last revision: > > fixed copyright year again Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From lbourges at openjdk.java.net Mon Jan 18 11:37:42 2021 From: lbourges at openjdk.java.net (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Mon, 18 Jan 2021 11:37:42 GMT Subject: [OpenJDK 2D-Dev] Integrated: JDK-8259681 : Remove the Marlin rendering engine (single-precision) In-Reply-To: References: Message-ID: On Thu, 14 Jan 2021 09:27:41 GMT, Laurent Bourg?s wrote: > - Removed MarlinRenderingEngine and related classes > - Fixed jtreg tests to remove explicit test runs on MarlinRenderingEngine > - Marlin Version set to 0.9.1.4 > > Jtreg tests [test/jdk/sun/java2d/marlin/] : OK This pull request has now been integrated. Changeset: 61292be7 Author: Laurent Bourg?s URL: https://git.openjdk.java.net/jdk/commit/61292be7 Stats: 9839 lines in 28 files changed: 53 ins; 8694 del; 1092 mod 8259681: Remove the Marlin rendering engine (single-precision) Reviewed-by: serb ------------- PR: https://git.openjdk.java.net/jdk/pull/2076 From Sergey.Bylokhov at oracle.com Mon Jan 18 12:18:52 2021 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Mon, 18 Jan 2021 04:18:52 -0800 Subject: [OpenJDK 2D-Dev] Making the OpenGL-Queue-Flusher work concurrently with AWT threads possible? (... the future of the opengl pipeline) In-Reply-To: References: Message-ID: On 17.01.2021 04:08, Clemens Eisserer wrote: > To be honest I don't have an explanation why results are *that* good, but on the other hand - XRender is still clearly faster for 1x1 fillRect and not *that* much slower for the maskfills. It is quite interesting! But it would be good to check what code was affected by this parallelization. I meant we cannot draw much-much faster than OGL draw its primitives, so even w/o parallelization if we will call flush after each fillRect/etc(mimics the in-place rendering on the current thread), we can speed up something but at the end, we will call OGL on one thread. So executing some code in parallel to the actual OGL rendering we speed up the whole benchmark so much! looks like something(code executed in parallel) works ineffective. -- Best regards, Sergey. From linuxhippy at gmail.com Mon Jan 18 12:41:12 2021 From: linuxhippy at gmail.com (Clemens Eisserer) Date: Mon, 18 Jan 2021 13:41:12 +0100 Subject: [OpenJDK 2D-Dev] Making the OpenGL-Queue-Flusher work concurrently with AWT threads possible? (... the future of the opengl pipeline) In-Reply-To: References: Message-ID: Hi Sergey, It is quite interesting! But it would be good to check what code was > affected by this parallelization. I meant we cannot draw much-much faster > than OGL draw its primitives, so even w/o parallelization if we will call > flush after each fillRect/etc(mimics the in-place rendering on the current > thread), we can speed up something but at the end, we will call OGL on one > thread. > So executing some code in parallel to the actual OGL rendering we speed up > the whole benchmark so much! looks like something(code executed in > parallel) works ineffective. > Basically, all the pipeline-code on the java-side can now be executed in parallel with the actual GL calls: - rasterization of antialiased geometry - span/scanline generation of non-antialiased geometry - queue protocol generation - pipe validation - actual RenderQueue protocol generation - all the locking for each & every primitive So sure, for GPU limited cases this won't help a lot - however, typical java2d is usually CPU limited with tons of very small primitives and many state changes in between. Laurent has done a few benchmarks with mapbench where a ~30% improvement was achieved. Not mindblowing, but also not that bad: https://github.com/bourgesl/jdk/wiki/OpenGL-fix-benchmarks Best regards, Clemens -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus.ihse.bursie at oracle.com Mon Jan 18 13:21:07 2021 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Mon, 18 Jan 2021 14:21:07 +0100 Subject: [OpenJDK 2D-Dev] RFR: 8257733: Move module-specific data from make to respective module In-Reply-To: <20210115102709.538599954@eggemoggin.niobe.net> References: <6Xos38Butvxz7sBGvR26EfT7mJrTXt_AvEj3tQcUnXA=.581f1b5c-a4f5-457c-bbee-5c2badd48ec5@github.com> <20210115102709.538599954@eggemoggin.niobe.net> Message-ID: <0219364d-3926-2b7b-4cb5-90f698eeb706@oracle.com> On 2021-01-15 19:27, mark.reinhold at oracle.com wrote: > Feature JEPs are living documents until such time as they are delivered. > In this case it would not be appropriate to update JEP 201, which is as > much about the transition from the old source-code layout as it is about > the new layout as of 2014. > > At this point, and given that we?d already gone beyond JEP 201 prior to > this change (with `man` and `lib` subdirectories), what?d make the most > sense is a new informational JEP that documents the source-code layout. > Informational JEPs can, within reason, be updated over time. So I take it I need to create a new informational JEP. :-) Fine, I can do that. I assume I mostly need to extract the parts of JEP 201 that describes the (then "new") layout, update wording to show that this is a description of the current layout, and add the new additions. It'll be a very short JEP, but in this case, that's probably a virtue. /Magnus From ihse at openjdk.java.net Mon Jan 18 13:47:20 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Mon, 18 Jan 2021 13:47:20 GMT Subject: [OpenJDK 2D-Dev] RFR: 8257733: Move module-specific data from make to respective module [v5] In-Reply-To: References: Message-ID: > A lot (but not all) of the data in make/data is tied to a specific module. For instance, the publicsuffixlist is used by java.base, and fontconfig by java.desktop. (A few directories, like mainmanifest, is *actually* used by make for the whole build.) > > These data files should move to the module they belong to. The are, after all, "source code" for that module that is "compiler" into resulting deliverables, for that module. (But the "source code" language is not Java or C, but typically a highly domain specific language or data format, and the "compilation" is, often, a specialized transformation.) > > This misplacement of the data directory is most visible at code review time. When such data is changed, most of the time build-dev (or the new build label) is involved, even though this has nothing to do with the build. While this is annoying, a worse problem is if the actual team that needs to review the patch (i.e., the team owning the module) is missed in the review. > > ### Modules reviewed > > - [x] java.base > - [x] java.desktop > - [x] jdk.compiler > - [x] java.se Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: Move characterdata templates to share/classes/java/lang. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1611/files - new: https://git.openjdk.java.net/jdk/pull/1611/files/68b252b5..c4894348 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1611&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1611&range=03-04 Stats: 4 lines in 9 files changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/1611.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1611/head:pull/1611 PR: https://git.openjdk.java.net/jdk/pull/1611 From ihse at openjdk.java.net Mon Jan 18 13:49:49 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Mon, 18 Jan 2021 13:49:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 8257733: Move module-specific data from make to respective module [v4] In-Reply-To: References: <95Qw1lVtqPHbGHoNJo46xIPO3OEof9nqCGJ3xA-oNZ8=.fa51b0e5-b33b-4f96-9756-a46741841201@github.com> Message-ID: On Fri, 15 Jan 2021 14:58:14 GMT, Alan Bateman wrote: >> This PR is not stale; it's just still waiting for input from @AlanBateman. > > @magicus Can the CharacterDataXXX.template files move to src/java.base/share/classes/java/lang? @AlanBateman When I moved the charset templates, I found this gold nugget: # Copy two Java files that need no preprocessing. $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/%.java: $(CHARACTERDATA_TEMPLATES)/%.java.template $(call LogInfo, Generating $(@F)) $(call install-file) GENSRC_CHARACTERDATA += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataUndefined.java \ $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataPrivateUse.java What this means is that we have two "template" files that are just compiled as java files, but only after being copied to gensrc. :-) That definitely needs cleaning up, but this PR is large enough as it is, so I will not do it now. ------------- PR: https://git.openjdk.java.net/jdk/pull/1611 From Sergey.Bylokhov at oracle.com Mon Jan 18 22:52:28 2021 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Mon, 18 Jan 2021 14:52:28 -0800 Subject: [OpenJDK 2D-Dev] Making the OpenGL-Queue-Flusher work concurrently with AWT threads possible? (... the future of the opengl pipeline) In-Reply-To: References: Message-ID: On 18.01.2021 04:41, Clemens Eisserer wrote: > So sure, for GPU limited cases this won't help a lot - however, typical java2d is usually CPU limited with tons of very small primitives and many state changes in between. It does not affect so much the xrender which do the same CPU related steps, but this speeds up so !much! OGL if executed in parallel. I think the benchmark is cheating here, it does not call XSync nor glflush for each operation, so it just checks the speed of pushing the data to the buffer, and not measured the actual rendering for both pipelines, unlike the software-based rendering. -- Best regards, Sergey. From serb at openjdk.java.net Tue Jan 19 09:54:00 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 19 Jan 2021 09:54:00 GMT Subject: [OpenJDK 2D-Dev] RFR: 8239894: Xserver crashes when the wrong high refresh rate is used Message-ID: We use two different approaches to listing the display modes on the system: - For single-screen configuration use version 1.1 protocol XRRGetScreenInfo/XRRConfigRates/XRRConfigSizes - For multi-screen configuration use version 1.2 protocol: XRRGetScreenResources/XRRGetOutputInfo/XRRModeInfo Unfortunately, the current code does not work for some specific double scan modes, it doubles the real refresh rate. If this refresh rate will be passed to the Xserver later it could hang/crash. The same bug existed in xrandr utility before version 1.4: https://bugs.freedesktop.org/show_bug.cgi?id=37043 https://gitlab.freedesktop.org/xorg/app/xrandr/commit/7fd4f18b649f22fad4dbf9fc64b69b3e7f172207 As suggested in the bug report I have tried to unify the code for single and multiscreen systems and use updated code currently used on the multiscreen. But unfortunately, I have found that the multi-screen code is even more broken. The problematic code is this: int scr = 0, out = 0; if (usingXinerama && XScreenCount(awt_display) > 0) { out = screen; } else { scr = screen; } The idea of the code is: if the passed screen is Xinerama index used by the java2d, then the "scr" will be zero, and "out" will be the "virtual" index for that screen. If the screen is X11 screen then "src" will be the correct screen and "out" will be zero. The problem is that the code assumes that xrandr expect the "virtual" index as the "out" parameter, but this is not. This parameter is the index of the "output" such as DP1, DP2, other ports/etc. So sometimes the code works when the first screen is connected to the first port on the video card and the second screen to the second port, otherwise, we just report data for the wrong screen or report nothing. I did not found a reliable way to map Xinerama srceens to the xrandr. It is better to rework the java2d to use the xrandr instead of xinerama. As a fix, I suggest dropping the code which uses the incorrect mapping screen->output. This includes the code related to the display modes added in the JDK-8167486 + JDK-8022810, and also the code related to the calculation of scale factor from the "ubuntu property" which does not work on the recent ubuntu version after migration to gnome3 added in the JDK-8149115 I will file a separate two bugs to reimplement this functionality, most probably the "display modes" will be implementing when we fully migrate to the xrandr, and calculation of the scale factor will be implemented via the gtk library. ------------- Commit messages: - Report the current mode in the list of supported modes in xinerama - Rollback JDK-8149115, JDK-8167486, JDK-8022810 Changes: https://git.openjdk.java.net/jdk/pull/2136/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2136&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8239894 Stats: 310 lines in 5 files changed: 3 ins; 292 del; 15 mod Patch: https://git.openjdk.java.net/jdk/pull/2136.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2136/head:pull/2136 PR: https://git.openjdk.java.net/jdk/pull/2136 From serb at openjdk.java.net Thu Jan 21 02:38:14 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Thu, 21 Jan 2021 02:38:14 GMT Subject: [OpenJDK 2D-Dev] RFR: 6606673: Path2D.Double, Path2D.Float and GeneralPath ctors throw exception when initialCapacity is negative Message-ID: The specification for Path2D.Double, Path2D.Float and GeneralPath constructors is updated. NegativeArraySizeException, IllegalArgumentException and NullPointerException are added. ------------- Commit messages: - Initial fix Changes: https://git.openjdk.java.net/jdk/pull/2174/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2174&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-6606673 Stats: 218 lines in 4 files changed: 218 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/2174.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2174/head:pull/2174 PR: https://git.openjdk.java.net/jdk/pull/2174 From psadhukhan at openjdk.java.net Thu Jan 21 05:03:49 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Thu, 21 Jan 2021 05:03:49 GMT Subject: [OpenJDK 2D-Dev] RFR: 6606673: Path2D.Double, Path2D.Float and GeneralPath ctors throw exception when initialCapacity is negative In-Reply-To: References: Message-ID: On Thu, 21 Jan 2021 00:50:28 GMT, Sergey Bylokhov wrote: > The specification for Path2D.Double, Path2D.Float and GeneralPath constructors is updated. NegativeArraySizeException, IllegalArgumentException and NullPointerException are added. Marked as reviewed by psadhukhan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2174 From kizune at openjdk.java.net Thu Jan 21 05:12:54 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Thu, 21 Jan 2021 05:12:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 6606673: Path2D.Double, Path2D.Float and GeneralPath ctors throw exception when initialCapacity is negative In-Reply-To: References: Message-ID: On Thu, 21 Jan 2021 00:50:28 GMT, Sergey Bylokhov wrote: > The specification for Path2D.Double, Path2D.Float and GeneralPath constructors is updated. NegativeArraySizeException, IllegalArgumentException and NullPointerException are added. Marked as reviewed by kizune (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2174 From kizune at openjdk.java.net Thu Jan 21 05:18:54 2021 From: kizune at openjdk.java.net (Alexander Zuev) Date: Thu, 21 Jan 2021 05:18:54 GMT Subject: [OpenJDK 2D-Dev] RFR: 8239894: Xserver crashes when the wrong high refresh rate is used In-Reply-To: References: Message-ID: On Tue, 19 Jan 2021 00:57:31 GMT, Sergey Bylokhov wrote: > We use two different approaches to listing the display modes on the system: > - For single-screen configuration use version 1.1 protocol XRRGetScreenInfo/XRRConfigRates/XRRConfigSizes > - For multi-screen configuration use version 1.2 protocol: XRRGetScreenResources/XRRGetOutputInfo/XRRModeInfo > > Unfortunately, the current code does not work for some specific double scan modes, it doubles the real refresh rate. If this refresh rate will be passed to the Xserver later it could hang/crash. > > The same bug existed in xrandr utility before version 1.4: > https://bugs.freedesktop.org/show_bug.cgi?id=37043 > https://gitlab.freedesktop.org/xorg/app/xrandr/commit/7fd4f18b649f22fad4dbf9fc64b69b3e7f172207 > > As suggested in the bug report I have tried to unify the code for single and multiscreen systems and use updated code currently used on the multiscreen. > > But unfortunately, I have found that the multi-screen code is even more broken. The problematic code is this: > > int scr = 0, out = 0; > if (usingXinerama && XScreenCount(awt_display) > 0) { > out = screen; > } else { > scr = screen; > } > The idea of the code is: if the passed screen is Xinerama index used by the java2d, then the "scr" will be zero, and "out" will be the "virtual" index for that screen. If the screen is X11 screen then "src" will be the correct screen and "out" will be zero. > > The problem is that the code assumes that xrandr expect the "virtual" index as the "out" parameter, but this is not. This parameter is the index of the "output" such as DP1, DP2, other ports/etc. > > So sometimes the code works when the first screen is connected to the first port on the video card and the second screen to the second port, otherwise, we just report data for the wrong screen or report nothing. > > I did not found a reliable way to map Xinerama srceens to the xrandr. It is better to rework the java2d to use the xrandr instead of xinerama. > > As a fix, I suggest dropping the code which uses the incorrect mapping screen->output. This includes the code related to the display modes added in the JDK-8167486 + JDK-8022810, and also the code related to the calculation of scale factor from the "ubuntu property" which does not work on the recent ubuntu version after migration to gnome3 added in the JDK-8149115 > > I will file a separate two bugs to reimplement this functionality, most probably the "display modes" will be implementing when we fully migrate to the xrandr, and calculation of the scale factor will be implemented via the gtk library. I guess not having this functionality at all is better than having a code that hangs. Can we have these new bugs about re-implementing this functionality linked in the initial bug so they can be tracked easier? ------------- Marked as reviewed by kizune (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2136 From prr at openjdk.java.net Thu Jan 21 15:58:35 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 21 Jan 2021 15:58:35 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259869: [macOS] Remove desktop module dependencies on JNF Reference APIs In-Reply-To: References: Message-ID: <2LpmfCGqLhdLNlvFIrgycqOOgQi2cJx0OZk6E15zgBE=.26f9fe00-bf88-42b1-b61e-5efc693d9bc7@github.com> On Wed, 20 Jan 2021 06:02:55 GMT, Sergey Bylokhov wrote: >> This removes desktop module usage of the JNF JNI reference convenience APIs >> These are simply a direct conversion >> JNFNewGlobalRef >> JNFDeleteGlobalRef >> JNFNewWeakGlobalRef >> JNFDeleteWeakGlobalRef >> >> These two >> JNFJObjectWrapper >> JNFWeakJObjectWrapper >> exist to allow clean up of the refs when a Cocoa wrapper object is released. >> However in all cases there are more direct ways to clean it up and in at least one usage >> the existing code directly releases it with the comment that this is more efficient. >> >> All our automated regression and JCK tests pass with this change. > > src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m line 1547: > >> 1545: AWTWindow *awtWindow = [AWTWindow getTopmostWindowUnderMouse]; >> 1546: if (awtWindow != nil) { >> 1547: topmostWindowUnderMouse = awtWindow.javaPlatformWindow; > > I wonder what type of "reference" we should return here, I do not remember how the "NewWeakGlobalRef" behave when returned to java. It is no different than other cases. Java will get a new strong ref to the object and expect it to be of the return type of this native method. > src/java.desktop/macosx/native/libawt_lwawt/awt/CDragSourceContextPeer.m line 58: > >> 56: jobject gTriggerEvent = (*env)->NewGlobalRef(env, jtrigger); >> 57: jlongArray gFormats = (*env)->NewGlobalRef(env, jformats); >> 58: jobject gFormatMap = (*env)->NewGlobalRef(env, jformatmap); > > All above should be checked for NULL since OOM may occur, but it looks like it does not throw OOM? > https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html#NewGlobalRef It is the case that per even the latest spec. none of these throw any exception. https://docs.oracle.com/en/java/javase/15/docs/specs/jni/functions.html#newglobalref So I think the existing code doesn't do anything in the event of a NULL return. And if you want to check for NULL here and return NULL from the native method there's semantic implications that require the caller never pass NULL for any of these. It is not illegal to pass NULL to NewGlobalRef. Investigating and confirming that is beyond the scope of this change. Or we make the code a bit more complex here and check that we get back non-null for a non-null arg. But once again nothing new here. > src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.h line 55: > >> 53: @property (nonatomic, retain) NSWindow *nsWindow; >> 54: >> 55: @property (nonatomic) jobject javaPlatformWindow; > > I think it will be useful to have a comment here that this value is a weak reference and should be copied to the local ref before usage. I suppose I can add a comment ... but it is already done in the couple of dozen usages so any one adding a new usage who misses that will likely miss the comment too. ------------- PR: https://git.openjdk.java.net/jdk/pull/2133 From prr at openjdk.java.net Thu Jan 21 16:28:19 2021 From: prr at openjdk.java.net (Phil Race) Date: Thu, 21 Jan 2021 16:28:19 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259869: [macOS] Remove desktop module dependencies on JNF Reference APIs [v2] In-Reply-To: References: Message-ID: > This removes desktop module usage of the JNF JNI reference convenience APIs > These are simply a direct conversion > JNFNewGlobalRef > JNFDeleteGlobalRef > JNFNewWeakGlobalRef > JNFDeleteWeakGlobalRef > > These two > JNFJObjectWrapper > JNFWeakJObjectWrapper > exist to allow clean up of the refs when a Cocoa wrapper object is released. > However in all cases there are more direct ways to clean it up and in at least one usage > the existing code directly releases it with the comment that this is more efficient. > > All our automated regression and JCK tests pass with this change. Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8259869: [macOS] Remove desktop module dependencies on JNF Reference APIs ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2133/files - new: https://git.openjdk.java.net/jdk/pull/2133/files/61d6476b..6a9e7a0d Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2133&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2133&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2133.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2133/head:pull/2133 PR: https://git.openjdk.java.net/jdk/pull/2133 From serb at openjdk.java.net Fri Jan 22 00:25:56 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 22 Jan 2021 00:25:56 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8239894: Xserver crashes when the wrong high refresh rate is used In-Reply-To: References: Message-ID: On Tue, 19 Jan 2021 00:57:31 GMT, Sergey Bylokhov wrote: > We use two different approaches to listing the display modes on the system: > - For single-screen configuration use version 1.1 protocol XRRGetScreenInfo/XRRConfigRates/XRRConfigSizes > - For multi-screen configuration use version 1.2 protocol: XRRGetScreenResources/XRRGetOutputInfo/XRRModeInfo > > Unfortunately, the current code does not work for some specific double scan modes, it doubles the real refresh rate. If this refresh rate will be passed to the Xserver later it could hang/crash. > > The same bug existed in xrandr utility before version 1.4: > https://bugs.freedesktop.org/show_bug.cgi?id=37043 > https://gitlab.freedesktop.org/xorg/app/xrandr/commit/7fd4f18b649f22fad4dbf9fc64b69b3e7f172207 > > As suggested in the bug report I have tried to unify the code for single and multiscreen systems and use updated code currently used on the multiscreen. > > But unfortunately, I have found that the multi-screen code is even more broken. The problematic code is this: > > int scr = 0, out = 0; > if (usingXinerama && XScreenCount(awt_display) > 0) { > out = screen; > } else { > scr = screen; > } > The idea of the code is: if the passed screen is Xinerama index used by the java2d, then the "scr" will be zero, and "out" will be the "virtual" index for that screen. If the screen is X11 screen then "src" will be the correct screen and "out" will be zero. > > The problem is that the code assumes that xrandr expect the "virtual" index as the "out" parameter, but this is not. This parameter is the index of the "output" such as DP1, DP2, other ports/etc. > > So sometimes the code works when the first screen is connected to the first port on the video card and the second screen to the second port, otherwise, we just report data for the wrong screen or report nothing. > > I did not found a reliable way to map Xinerama srceens to the xrandr. It is better to rework the java2d to use the xrandr instead of xinerama. > > As a fix, I suggest dropping the code which uses the incorrect mapping screen->output. This includes the code related to the display modes added in the JDK-8167486 + JDK-8022810, and also the code related to the calculation of scale factor from the "ubuntu property" which does not work on the recent ubuntu version after migration to gnome3 added in the JDK-8149115 > > I will file a separate two bugs to reimplement this functionality, most probably the "display modes" will be implementing when we fully migrate to the xrandr, and calculation of the scale factor will be implemented via the gtk library. This pull request has now been integrated. Changeset: a7c2ebc7 Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/a7c2ebc7 Stats: 310 lines in 5 files changed: 3 ins; 292 del; 15 mod 8239894: Xserver crashes when the wrong high refresh rate is used Reviewed-by: kizune ------------- PR: https://git.openjdk.java.net/jdk/pull/2136 From serb at openjdk.java.net Fri Jan 22 01:22:10 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 22 Jan 2021 01:22:10 GMT Subject: [OpenJDK 2D-Dev] RFR: 8259869: [macOS] Remove desktop module dependencies on JNF Reference APIs [v2] In-Reply-To: References: Message-ID: On Thu, 21 Jan 2021 16:28:19 GMT, Phil Race wrote: >> This removes desktop module usage of the JNF JNI reference convenience APIs >> These are simply a direct conversion >> JNFNewGlobalRef >> JNFDeleteGlobalRef >> JNFNewWeakGlobalRef >> JNFDeleteWeakGlobalRef >> >> These two >> JNFJObjectWrapper >> JNFWeakJObjectWrapper >> exist to allow clean up of the refs when a Cocoa wrapper object is released. >> However in all cases there are more direct ways to clean it up and in at least one usage >> the existing code directly releases it with the comment that this is more efficient. >> >> All our automated regression and JCK tests pass with this change. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8259869: [macOS] Remove desktop module dependencies on JNF Reference APIs Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2133 From prr at openjdk.java.net Fri Jan 22 01:55:58 2021 From: prr at openjdk.java.net (Phil Race) Date: Fri, 22 Jan 2021 01:55:58 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8259869: [macOS] Remove desktop module dependencies on JNF Reference APIs In-Reply-To: References: Message-ID: On Mon, 18 Jan 2021 16:08:37 GMT, Phil Race wrote: > This removes desktop module usage of the JNF JNI reference convenience APIs > These are simply a direct conversion > JNFNewGlobalRef > JNFDeleteGlobalRef > JNFNewWeakGlobalRef > JNFDeleteWeakGlobalRef > > These two > JNFJObjectWrapper > JNFWeakJObjectWrapper > exist to allow clean up of the refs when a Cocoa wrapper object is released. > However in all cases there are more direct ways to clean it up and in at least one usage > the existing code directly releases it with the comment that this is more efficient. > > All our automated regression and JCK tests pass with this change. This pull request has now been integrated. Changeset: 92c2f084 Author: Phil Race URL: https://git.openjdk.java.net/jdk/commit/92c2f084 Stats: 153 lines in 21 files changed: 19 ins; 7 del; 127 mod 8259869: [macOS] Remove desktop module dependencies on JNF Reference APIs Reviewed-by: serb ------------- PR: https://git.openjdk.java.net/jdk/pull/2133 From serb at openjdk.java.net Fri Jan 22 10:35:13 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 22 Jan 2021 10:35:13 GMT Subject: [OpenJDK 2D-Dev] RFR: 6986863: ProfileDeferralMgr throwing ConcurrentModificationException [v5] In-Reply-To: References: Message-ID: > This change intended to enhance the lazy initialization of the standard color profiles concurrently by different threads. > > We defer standard profiles loading because most of UI application uses a small amount of data from the profile like numComponents and colorSpaceType, and this data is known in advance. But any other profile-related activity (like a color conversion, profile data accesses, etc.) triggers profile activation when we load all profile data to the memory. > > Before the fix for JDK-6793818, we defer only one sRGB color profile, see: https://github.com/openjdk/jdk/commit/2726f2a3621dd2562d4fb660b4c3d376c65027aa > > Notes about the link above: > - The code in the ProfileDeferralMgr, which contain the Vector of profiles for activation does not use any synchronization > - The `activateDeferredProfile` and `activate` methods are implemented to throw `ProfileDataException`, but this exception is ignored during activation process: > https://github.com/openjdk/jdk/commit/2726f2a3621dd2562d4fb660b4c3d376c65027aa#diff-0839c25a6c999452be28b431c54d5daa91364d302cfda6efa5c56421c2f2bdcbR96 > > The fix: > - Drops the usage of ProfileDeferralMgr (which contained the Vector of profiles for activation) and ProfileActivator machinery. Instead, we will have just one `ICC_Profile.activate()` method which will activate and initialize the `ICC_Profile.cmmProfile` if it is null > - The `activate` method implementation mimics the old behavior when the CMMException and IOException were wrapped by the ProfileDataException, and the ProfileDataException itself was ignored during activation - > so an exception will not be thrown in the method itself, but only when the null profile will be used. > > See some comments inline. Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 14 commits: - Merge branch 'master' into JDK-6986863 - Merge branch 'master' into JDK-6986863 - Update ProfileActivationDuringPropertyAccess.java - Merge branch 'master' into JDK-6986863 - Merge branch 'master' into JDK-6986863 - Merge branch 'master' into JDK-6986863 - Merge branch 'master' into JDK-6986863 - Delete the DeferralMgr machinery - Update ICC_Profile.java - Wrong spec in ProfileDeferralInfo - ... and 4 more: https://git.openjdk.java.net/jdk/compare/14522800...ecfc1ed8 ------------- Changes: https://git.openjdk.java.net/jdk/pull/1613/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1613&range=04 Stats: 520 lines in 9 files changed: 183 ins; 265 del; 72 mod Patch: https://git.openjdk.java.net/jdk/pull/1613.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1613/head:pull/1613 PR: https://git.openjdk.java.net/jdk/pull/1613 From akozlov at openjdk.java.net Fri Jan 22 20:02:56 2021 From: akozlov at openjdk.java.net (Anton Kozlov) Date: Fri, 22 Jan 2021 20:02:56 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port 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) ------------- Commit messages: - Fix build - JDK-8253816: Update after recent changes - Rework gtests to always have wx_write - Revert gtest changes - Fix gtests in debug - Merge remote-tracking branch 'upstream/master' into jdk-macos - Fix windows_aarch64 - Use r18_tls instead of r18_reserved - JDK-8253742: bsd_aarch64 part - JDK-8257882: bsd_aarch64 part - ... and 40 more: https://git.openjdk.java.net/jdk/compare/82adfb32...3d4f4c23 Changes: https://git.openjdk.java.net/jdk/pull/2200/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2200&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8253795 Stats: 3335 lines in 117 files changed: 3230 ins; 41 del; 64 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 Jan 22 20:04:02 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Fri, 22 Jan 2021 20:04:02 GMT Subject: [OpenJDK 2D-Dev] RFR: 8240247: No longer need to wrap files with contentContainer Message-ID: [JDK-8231144](https://bugs.openjdk.java.net/browse/JDK-8231144) wrapped the contents of plain HTML documents into `
` to apply the styles and add the margins around the content for a consistent look. This is no longer necessary after [JDK-8239817](https://bugs.openjdk.java.net/browse/JDK-8239817) was fixed. These documents looks fine without being wrapped. So this fix basically undoes changes under JDK-8231144 and removes the redundant `
` wrapper element. ------------- Commit messages: - Remove contentContainer wrapper Changes: https://git.openjdk.java.net/jdk/pull/2203/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2203&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8240247 Stats: 45 lines in 15 files changed: 0 ins; 30 del; 15 mod Patch: https://git.openjdk.java.net/jdk/pull/2203.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2203/head:pull/2203 PR: https://git.openjdk.java.net/jdk/pull/2203 From serb at openjdk.java.net Fri Jan 22 20:14:41 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 22 Jan 2021 20:14:41 GMT Subject: [OpenJDK 2D-Dev] RFR: 8240247: No longer need to wrap files with contentContainer In-Reply-To: References: Message-ID: On Fri, 22 Jan 2021 19:50:17 GMT, Alexey Ivanov wrote: > [JDK-8231144](https://bugs.openjdk.java.net/browse/JDK-8231144) wrapped the contents of plain HTML documents into `
` to apply the styles and add the margins around the content for a consistent look. > > This is no longer necessary after [JDK-8239817](https://bugs.openjdk.java.net/browse/JDK-8239817) was fixed. > > These documents looks fine without being wrapped. So this fix basically undoes changes under JDK-8231144 and removes the redundant `
` wrapper element. Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2203 From erikj at openjdk.java.net Fri Jan 22 20:27:42 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Fri, 22 Jan 2021 20:27:42 GMT Subject: [OpenJDK 2D-Dev] RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port In-Reply-To: References: Message-ID: <_l6v7_5ODWCmW5x90hA_Vv0TegGm00YW98ELrJvi65o=.1b2d4f0f-0791-4d4f-bf00-d829738611b5@github.com> 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) Build changes in general look good. make/autoconf/flags-cflags.m4 line 169: > 167: WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL" > 168: > 169: DISABLED_WARNINGS="unknown-warning-option unused-parameter unused format-nonliteral" Globally disabling a warning needs some motivation. Why is this needed? Does it really need to be applied everywhere or is there a specific binary or source file where this is triggered? ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From alanb at openjdk.java.net Sat Jan 23 07:57:43 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Sat, 23 Jan 2021 07:57:43 GMT Subject: [OpenJDK 2D-Dev] RFR: 8257733: Move module-specific data from make to respective module [v4] In-Reply-To: References: <95Qw1lVtqPHbGHoNJo46xIPO3OEof9nqCGJ3xA-oNZ8=.fa51b0e5-b33b-4f96-9756-a46741841201@github.com> Message-ID: On Fri, 15 Jan 2021 14:58:14 GMT, Alan Bateman wrote: >> This PR is not stale; it's just still waiting for input from @AlanBateman. > > @magicus Can the CharacterDataXXX.template files move to src/java.base/share/classes/java/lang? > @AlanBateman When I moved the charset templates, I found this gold nugget: > > ``` > # Copy two Java files that need no preprocessing. > $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/%.java: $(CHARACTERDATA_TEMPLATES)/%.java.template > $(call LogInfo, Generating $(@F)) > $(call install-file) > > GENSRC_CHARACTERDATA += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataUndefined.java \ > $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataPrivateUse.java > ``` > > What this means is that we have two "template" files that are just compiled as java files, but only after being copied to gensrc. :-) That definitely needs cleaning up, but this PR is large enough as it is, so I will not do it now. Good find, surprised this wasn't spotted before now. We should create a separate issue to rename them and get rid of the copying in the make file. ------------- PR: https://git.openjdk.java.net/jdk/pull/1611 From aivanov at openjdk.java.net Sat Jan 23 11:40:39 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Sat, 23 Jan 2021 11:40:39 GMT Subject: [OpenJDK 2D-Dev] Integrated: 8240247: No longer need to wrap files with contentContainer In-Reply-To: References: Message-ID: On Fri, 22 Jan 2021 19:50:17 GMT, Alexey Ivanov wrote: > [JDK-8231144](https://bugs.openjdk.java.net/browse/JDK-8231144) wrapped the contents of plain HTML documents into `
` to apply the styles and add the margins around the content for a consistent look. > > This is no longer necessary after [JDK-8239817](https://bugs.openjdk.java.net/browse/JDK-8239817) was fixed. > > These documents looks fine without being wrapped. So this fix basically undoes changes under JDK-8231144 and removes the redundant `
` wrapper element. This pull request has now been integrated. Changeset: f624dba6 Author: Alexey Ivanov URL: https://git.openjdk.java.net/jdk/commit/f624dba6 Stats: 45 lines in 15 files changed: 0 ins; 30 del; 15 mod 8240247: No longer need to wrap files with contentContainer Reviewed-by: serb ------------- PR: https://git.openjdk.java.net/jdk/pull/2203 From aph at openjdk.java.net Sat Jan 23 11:46:45 2021 From: aph at openjdk.java.net (Andrew Haley) Date: Sat, 23 Jan 2021 11:46:45 GMT Subject: [OpenJDK 2D-Dev] RFR: 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) src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp line 86: > 84: > 85: switch (_num_int_args) { > 86: case 0: I don't think you need such a large switch statement. I think this can be expressed as if (num_int_args <= 6) { ldr(as_Register(num_int_args + 1), src); ... etc. src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp line 43: > 41: //describe amount of space in bytes occupied by type on native stack > 42: #ifdef __APPLE__ > 43: const int nativeByteSpace = sizeof(jbyte); I'm not sure these names should be in the global name space, and they're not very descriptive. Something like NativeStack::byteSpace would be better. Then you can use them with a `using namespace NativeStack` declaration. src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp line 433: > 431: store_and_inc(_to, from_obj, nativeShortSpace); > 432: > 433: _num_int_args++; Please lift this increment out of the conditional. src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp line 394: > 392: > 393: class SlowSignatureHandler > 394: : public NativeSignatureIterator { SlowSignatureHandler is turning into a maintenance nightmare. This isn't the fault of this commit so much as some nasty cut-and=paste programming in the code you're editing. It might well be better to rewrite this whole thing to use a table-driven approach, with a table that contains the increment and the size of each native type: then we'd have only a single routine which could pass data of any type, and each OS needs only supply a table of constants. src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 5272: > 5270: void MacroAssembler::get_thread(Register dst) { > 5271: RegSet saved_regs = RegSet::range(r0, r1) + BSD_ONLY(RegSet::range(r2, r17)) + lr - dst; > 5272: push(saved_regs, sp); This isn't very nice. ------------- PR: https://git.openjdk.java.net/jdk/pull/2200 From aivanov at openjdk.java.net Sat Jan 23 19:10:46 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Sat, 23 Jan 2021 19:10:46 GMT Subject: [OpenJDK 2D-Dev] RFR: 8260314: Replace border="1" on tables with CSS Message-ID: <6Eozf9W0lwh5FChjqvq21kTq4ewQPRn24Ad0gLTbyyM=.c6f845d9-d3a3-4266-b907-029aa8eee61a@github.com> Replace presentational attribute `border="1"` on `` element with CSS styles: table {border: outset 1px} th, td {border: inset 1px} These declarations produce the same rendering as the default one in Firefox and Edge. Another option is to use `solid` in both cases. ------------- Commit messages: - Move table styles to common