Re: RFR: 8319423: Improve Year.isLeap by checking divisibility by 16 [v2]

2023-11-03 Thread Quan Anh Mai
On Fri, 3 Nov 2023 23:22:27 GMT, Claes Redestad wrote: >> https://github.com/cassioneri/eaf suggest this code for leap year >> calculation: >> >> public static boolean isLeap(long year) { >> int d = year % 100 != 0 ? 4 : 16; >> return (year & (d - 1)) == 0; >> } >> >> .

Re: RFR: 8319423: Improve Year.isLeap by checking divisibility by 16 [v2]

2023-11-03 Thread Quan Anh Mai
On Fri, 3 Nov 2023 23:22:27 GMT, Claes Redestad wrote: >> https://github.com/cassioneri/eaf suggest this code for leap year >> calculation: >> >> public static boolean isLeap(long year) { >> int d = year % 100 != 0 ? 4 : 16; >> return (year & (d - 1)) == 0; >> } >> >> .

Re: RFR: 8319423: Improve Year.isLeap by checking divisibility by 16

2023-11-03 Thread Andriy Plokhotnyuk
On Fri, 3 Nov 2023 23:34:49 GMT, Claes Redestad wrote: > > @cl4es Could you please test > > [this](https://github.com/plokhotnyuk/jsoniter-scala/blob/ba6f4f80deaf0e7a1a95787321de3cc2a232d66d/jsoniter-scala-core/jvm/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonReader.scala#L3687)

Withdrawn: 8311906: Race condition in String constructor

2023-11-03 Thread Chen Liang
On Mon, 25 Sep 2023 12:28:40 GMT, Chen Liang wrote: > In the constructor of String, many locations the user-supplied byte or char > arrays are read multiple times with a plain memory access; if a user > previously wrote to one of such locations out of happens-before order, > distinct plain mem

Re: RFR: 8311906: Race condition in String constructor

2023-11-03 Thread Chen Liang
On Mon, 25 Sep 2023 12:28:40 GMT, Chen Liang wrote: > In the constructor of String, many locations the user-supplied byte or char > arrays are read multiple times with a plain memory access; if a user > previously wrote to one of such locations out of happens-before order, > distinct plain mem

Re: RFR: 8318144: Match on enum constants with body compiles but fails with MatchException

2023-11-03 Thread Chen Liang
On Fri, 3 Nov 2023 16:26:49 GMT, Jan Lahoda wrote: > For code like: > > enum E {A {}, B {} } > Object o = E.A; > switch (o) { > case E.A -> System.err.println(o); > default -> System.err.println("default"); > } > > > The result is `default`, not `A`, due to incorrect classes being co

Re: RFR: 8294980: test/jdk/java/lang/invoke 15 test classes use experimental bytecode library [v2]

2023-11-03 Thread Chen Liang
On Wed, 25 Oct 2023 12:36:40 GMT, Mourad Abbay wrote: >> test/jdk/java/lang/invoke/common/test/java/lang/invoke/lib/InstructionHelper.java >> line 71: >> >>> 69: for (int i = 0; i < >>> type.parameterCount(); i++) { >>> 70:

Re: RFR: 8319423: Improve Year.isLeap by checking divisibility by 16

2023-11-03 Thread Claes Redestad
On Fri, 3 Nov 2023 22:37:40 GMT, Andriy Plokhotnyuk wrote: > @cl4es Could you please test > [this](https://github.com/plokhotnyuk/jsoniter-scala/blob/ba6f4f80deaf0e7a1a95787321de3cc2a232d66d/jsoniter-scala-core/jvm/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonReader.scala#L3687)

Re: RFR: 8318650: Optimized subword gather for x86 targets. [v3]

2023-11-03 Thread Sandhya Viswanathan
On Tue, 31 Oct 2023 07:19:55 GMT, Jatin Bhateja wrote: >> Hi All, >> >> This patch optimizes sub-word gather operation for x86 targets with AVX2 and >> AVX512 features. >> >> Following is the summary of changes:- >> >> 1) Intrinsify sub-word gather with high performance backend implementation

Re: RFR: 8319423: Improve Year.isLeap by checking divisibility by 16 [v2]

2023-11-03 Thread Claes Redestad
> https://github.com/cassioneri/eaf suggest this code for leap year calculation: > > public static boolean isLeap(long year) { > int d = year % 100 != 0 ? 4 : 16; > return (year & (d - 1)) == 0; > } > > .. with a claim this would compile down to branchless, easily pipeline

Re: RFR: 8319423: Improve Year.isLeap by checking divisibility by 16

2023-11-03 Thread Andriy Plokhotnyuk
On Fri, 3 Nov 2023 12:03:24 GMT, Claes Redestad wrote: > https://github.com/cassioneri/eaf suggest this code for leap year calculation: > > public static boolean isLeap(long year) { > int d = year % 100 != 0 ? 4 : 16; > return (year & (d - 1)) == 0; > } > > .. with a cla

Re: RFR: 8319200: Don't use test thread factory in ProcessTools.createLimitedTestJavaProcessBuilder()

2023-11-03 Thread Mark Sheppard
On Wed, 1 Nov 2023 00:06:35 GMT, Leonid Mesnik wrote: > Test thread factory is a mode similar to VM flags and should not be used in > ProcessTools.createLimitedTestJavaProcessBuilder(). Only > createTestJavaProcessBuilder() should use it like jtreg VM options. > > Adding the test thread factor

Re: RFR: 8319378: Spec for j.util.Timer::purge and j.util.Timer::cancel could be improved

2023-11-03 Thread Naoto Sato
On Fri, 3 Nov 2023 20:40:11 GMT, Justin Lu wrote: > Please review this PR which clarifies the definition of a _cancelled_ task in > _j.util.Timer::purge_ and _j.util.Timer::cancel_. > > Timer::purge claims that its return value is the number of tasks in the queue > that were cancelled. This ca

Re: RFR: 8319423: Improve Year.isLeap by checking divisibility by 16

2023-11-03 Thread Naoto Sato
On Fri, 3 Nov 2023 12:03:24 GMT, Claes Redestad wrote: > https://github.com/cassioneri/eaf suggest this code for leap year calculation: > > public static boolean isLeap(long year) { > int d = year % 100 != 0 ? 4 : 16; > return (year & (d - 1)) == 0; > } > > .. with a cla

Re: RFR: 8318650: Optimized subword gather for x86 targets. [v3]

2023-11-03 Thread Sandhya Viswanathan
On Tue, 31 Oct 2023 07:19:55 GMT, Jatin Bhateja wrote: >> Hi All, >> >> This patch optimizes sub-word gather operation for x86 targets with AVX2 and >> AVX512 features. >> >> Following is the summary of changes:- >> >> 1) Intrinsify sub-word gather with high performance backend implementation

RFR: 8319423: Improve Year.isLeap by checking divisibility by 16

2023-11-03 Thread Claes Redestad
https://github.com/cassioneri/eaf suggest this code for leap year calculation: public static boolean isLeap(long year) { int d = year % 100 != 0 ? 4 : 16; return (year & (d - 1)) == 0; } .. with a claim this would compile down to branchless, easily pipelined code. This do

Re: RFR: 8319423: Improve Year.isLeap by checking divisibility by 16

2023-11-03 Thread Roger Riggs
On Fri, 3 Nov 2023 12:03:24 GMT, Claes Redestad wrote: > https://github.com/cassioneri/eaf suggest this code for leap year calculation: > > public static boolean isLeap(long year) { > int d = year % 100 != 0 ? 4 : 16; > return (year & (d - 1)) == 0; > } > > .. with a cla

RFR: 8319378: Spec for j.util.Timer::purge and j.util.Timer::cancel could be improved

2023-11-03 Thread Justin Lu
Please review this PR which clarifies the definition of a _cancelled_ task in _j.util.Timer::purge_ and _j.util.Timer::cancel_. Timer::purge claims that its return value is the number of tasks in the queue that were cancelled. This can be misleading, as a user can call Timer::cancel, thinking t

Re: RFR: 8317742: ISO Standard Date Format implementation consistency on DateTimeFormatter and String.format [v3]

2023-11-03 Thread Roger Riggs
On Mon, 16 Oct 2023 20:52:10 GMT, Shaojin Wen wrote: >> j.u.Formatter now prints "%tF" (iso standard date) and the result is >> incorrect when processing year < 0 or year > > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > >

Re: RFR: 8303920: Avoid calling out to python in DataDescriptorSignatureMissing test [v9]

2023-11-03 Thread Eirik Bjorsnos
On Fri, 3 Nov 2023 18:43:31 GMT, Lance Andersen wrote: > I can kick of a test run internally next week or perhaps Sunday Thanks for your reviews, Lance and Iris! FWIW, the test ran fine on Github Actions, including on `linux-x86` (which is 32-bit, right?): TEST: java/util/zip/DataDescriptorS

Re: RFR: 8303920: Avoid calling out to python in DataDescriptorSignatureMissing test [v9]

2023-11-03 Thread Iris Clark
On Mon, 30 Oct 2023 17:48:48 GMT, Eirik Bjorsnos wrote: >> Please review this PR which brings the DataDescriptorSignatureMissing test >> back to life. >> >> This test currently calls out to Python to create a test vector ZIP with a >> Data Descriptor without the recommended but optional signa

Withdrawn: 8311500: StackWalker.getCallerClass() throws UOE if invoked reflectively

2023-11-03 Thread duke
On Wed, 5 Jul 2023 11:45:59 GMT, Volker Simonis wrote: > As the included jtreg test demonstrates, `StackWalker.getCallerClass()` can > throw an `UnsupportedOperationException` if called reflectively. Currently > this only happens if we invoke `StackWalker.getCallerClass()` recursively > reflec

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v5]

2023-11-03 Thread Raffaello Giulietti
> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Changed behavior on len == 0. - Changes:

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v3]

2023-11-03 Thread Raffaello Giulietti
On Fri, 3 Nov 2023 09:01:48 GMT, Raffaello Giulietti wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 344: >> >>> 342: * @param len the number of bytes to use. >>> 343: * @throws NumberFormatException {@code val} is zero bytes long, >>> 344: * or {@co

Re: RFR: 8303920: Avoid calling out to python in DataDescriptorSignatureMissing test [v9]

2023-11-03 Thread Lance Andersen
On Mon, 30 Oct 2023 17:48:48 GMT, Eirik Bjorsnos wrote: >> Please review this PR which brings the DataDescriptorSignatureMissing test >> back to life. >> >> This test currently calls out to Python to create a test vector ZIP with a >> Data Descriptor without the recommended but optional signa

Re: RFR: 8303920: Avoid calling out to python in DataDescriptorSignatureMissing test [v8]

2023-11-03 Thread Lance Andersen
On Mon, 30 Oct 2023 17:57:23 GMT, Eirik Bjorsnos wrote: >> This way of updating the copyright was suggested by @jaikiran in the March >> 10th comment above. Would be nice to get this clarified, yes. > > There is actually very little left of Martin's code after my rewrite, besides > whitespace,

Re: RFR: JDK-8319122: Improve documentation of various Zip-file related APIs

2023-11-03 Thread Erik Joelsson
On Mon, 30 Oct 2023 17:54:13 GMT, Volker Simonis wrote: >> The various Zip/Jar-file related Java APIs have some long-standing >> differences or peculiarities with respect to the ZIP-file specification or >> compared to other implementations which should be documented in the API-doc. >> This do

RFR: JDK-8319122: Improve documentation of various Zip-file related APIs

2023-11-03 Thread Yakov Shafranovich
The various Zip/Jar-file related Java APIs have some long-standing differences or peculiarities with respect to the ZIP-file specification or compared to other implementations which should be documented in the API-doc. This documents the following: - Cache of JAR files in JarURLConnection class

Re: RFR: JDK-8319122: Improve documentation of various Zip-file related APIs

2023-11-03 Thread Volker Simonis
On Mon, 30 Oct 2023 17:26:53 GMT, Yakov Shafranovich wrote: > The various Zip/Jar-file related Java APIs have some long-standing > differences or peculiarities with respect to the ZIP-file specification or > compared to other implementations which should be documented in the API-doc. > This do

Re: RFR: 8319316: Clarify text around which layouts a linker supports [v3]

2023-11-03 Thread Maurizio Cimadamore
On Fri, 3 Nov 2023 18:16:17 GMT, Jorn Vernee wrote: >> - Add linker note about packed structs. >> - Relax language a bit to avoid implying that only listed layouts are >> supported. > > Jorn Vernee has updated the pull request incrementally with one additional > commit since the last revision:

Re: RFR: 8319316: Clarify text around which layouts a linker supports [v3]

2023-11-03 Thread Jorn Vernee
> - Add linker note about packed structs. > - Relax language a bit to avoid implying that only listed layouts are > supported. Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: Add 'strict' Co-authored-by: Maurizio Cimadamore <546

Re: RFR: 8319316: Clarify text around which layouts a linker supports [v2]

2023-11-03 Thread Maurizio Cimadamore
On Fri, 3 Nov 2023 16:35:18 GMT, Jorn Vernee wrote: >> - Add linker note about packed structs. >> - Relax language a bit to avoid implying that only listed layouts are >> supported. > > Jorn Vernee has updated the pull request incrementally with one additional > commit since the last revision:

Integrated: 8318466: Improve spec of NumberFormat's methods with unsupported operations

2023-11-03 Thread Justin Lu
On Wed, 1 Nov 2023 21:27:57 GMT, Justin Lu wrote: > Please review this simple change which refines the specification of some > NumberFormat methods (with unsupported operations) to separate the API and > implementation specification. This pull request has now been integrated. Changeset: ea6a8

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v4]

2023-11-03 Thread Jan Lahoda
> Consider code like: > > void test(Object o) { > switch (o) { > case X1 -> {} > case X2 -> {} > ...(about 100 cases) > ``` > > javac will compile the switch into a switch whose selector is an indy > invocation to `SwitchBootstraps.typeSwitch`, with static arguments being th

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v3]

2023-11-03 Thread Rémi Forax
On Fri, 3 Nov 2023 16:43:30 GMT, Jan Lahoda wrote: >> Consider code like: >> >> void test(Object o) { >> switch (o) { >> case X1 -> {} >> case X2 -> {} >> ...(about 100 cases) >> ``` >> >> javac will compile the switch into a switch whose selector is an indy >> invocation

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v2]

2023-11-03 Thread Jan Lahoda
On Fri, 3 Nov 2023 15:50:43 GMT, Rémi Forax wrote: >> Jan Lahoda has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Some more get->orElseThrow >> - Reflecting review feedback. > > src/java.base/share/classes/java/lang/runtime/SwitchBoots

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v3]

2023-11-03 Thread Jan Lahoda
> Consider code like: > > void test(Object o) { > switch (o) { > case X1 -> {} > case X2 -> {} > ...(about 100 cases) > ``` > > javac will compile the switch into a switch whose selector is an indy > invocation to `SwitchBootstraps.typeSwitch`, with static arguments being th

Withdrawn: 8318839: Update test thread factory to catch all exceptions

2023-11-03 Thread Leonid Mesnik
On Wed, 25 Oct 2023 21:08:01 GMT, Leonid Mesnik wrote: > The jtreg starts the main thread in a separate ThreadGroup and checks > unhandled exceptions for this group. However, it doesn't catch all unhandled > exceptions. There is a jtreg issue for this > https://bugs.openjdk.org/browse/CODETOOL

Re: RFR: 8318839: Update test thread factory to catch all exceptions [v2]

2023-11-03 Thread Leonid Mesnik
On Fri, 3 Nov 2023 03:44:31 GMT, Leonid Mesnik wrote: >> The jtreg starts the main thread in a separate ThreadGroup and checks >> unhandled exceptions for this group. However, it doesn't catch all unhandled >> exceptions. There is a jtreg issue for this >> https://bugs.openjdk.org/browse/CODET

Re: RFR: 8319316: Clarify text around which layouts a linker supports [v2]

2023-11-03 Thread Jorn Vernee
On Fri, 3 Nov 2023 16:17:32 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/java/lang/foreign/Linker.java line 247: >> >>> 245: * >>> 246: * >>> 247: * Linker implementations may optionally support additional layouts, >>> such as 'packed' struct layouts. >> >> Optional: should we sa

Re: RFR: 8319316: Clarify text around which layouts a linker supports [v2]

2023-11-03 Thread Jorn Vernee
> - Add linker note about packed structs. > - Relax language a bit to avoid implying that only listed layouts are > supported. Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: add examples of packed structs - Changes: -

RFR: 8318144: Match on enum constants with body compiles but fails with MatchException

2023-11-03 Thread Jan Lahoda
For code like: enum E {A {}, B {} } Object o = E.A; switch (o) { case E.A -> System.err.println(o); default -> System.err.println("default"); } The result is `default`, not `A`, due to incorrect classes being compared. Thanks for @liach for noting the solution here: https://github.com

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v2]

2023-11-03 Thread Jan Lahoda
On Fri, 3 Nov 2023 15:24:48 GMT, Jan Lahoda wrote: >> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 346: >> >>> 344: Class clazz = >>> label.constantType().resolveConstantDesc(lookup); >>> 345: >>> 346: if (value.getClass() !=

Re: RFR: 8319316: Clarify text around which layouts a linker supports

2023-11-03 Thread Jorn Vernee
On Fri, 3 Nov 2023 14:48:31 GMT, Maurizio Cimadamore wrote: >> - Add linker note about packed structs. >> - Relax language a bit to avoid implying that only listed layouts are >> supported. > > src/java.base/share/classes/java/lang/foreign/Linker.java line 247: > >> 245: * >> 246: * >> 247:

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v2]

2023-11-03 Thread Rémi Forax
On Fri, 3 Nov 2023 15:32:34 GMT, Jan Lahoda wrote: >> Consider code like: >> >> void test(Object o) { >> switch (o) { >> case X1 -> {} >> case X2 -> {} >> ...(about 100 cases) >> ``` >> >> javac will compile the switch into a switch whose selector is an indy >> invocation

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow

2023-11-03 Thread Rémi Forax
On Fri, 3 Nov 2023 15:29:05 GMT, Jan Lahoda wrote: > Thanks for all the comments so far - I think I've either reflected them, or > wrote a comment to each of them. Please let me know if there's something > else, or if I've forgotten something. You idea to use an extra array is clever. Using an

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v2]

2023-11-03 Thread Rémi Forax
On Fri, 3 Nov 2023 15:32:34 GMT, Jan Lahoda wrote: >> Consider code like: >> >> void test(Object o) { >> switch (o) { >> case X1 -> {} >> case X2 -> {} >> ...(about 100 cases) >> ``` >> >> javac will compile the switch into a switch whose selector is an indy >> invocation

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v2]

2023-11-03 Thread Rémi Forax
On Fri, 3 Nov 2023 15:32:34 GMT, Jan Lahoda wrote: >> Consider code like: >> >> void test(Object o) { >> switch (o) { >> case X1 -> {} >> case X2 -> {} >> ...(about 100 cases) >> ``` >> >> javac will compile the switch into a switch whose selector is an indy >> invocation

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v2]

2023-11-03 Thread Jan Lahoda
On Fri, 3 Nov 2023 14:19:17 GMT, Rémi Forax wrote: >> Jan Lahoda has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Some more get->orElseThrow >> - Reflecting review feedback. > > src/java.base/share/classes/java/lang/runtime/SwitchBoots

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v2]

2023-11-03 Thread Jan Lahoda
> Consider code like: > > void test(Object o) { > switch (o) { > case X1 -> {} > case X2 -> {} > ...(about 100 cases) > ``` > > javac will compile the switch into a switch whose selector is an indy > invocation to `SwitchBootstraps.typeSwitch`, with static arguments being th

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow [v2]

2023-11-03 Thread Jan Lahoda
On Fri, 3 Nov 2023 09:48:15 GMT, Chen Liang wrote: >> Jan Lahoda has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Some more get->orElseThrow >> - Reflecting review feedback. > > src/java.base/share/classes/java/lang/runtime/SwitchBoots

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow

2023-11-03 Thread Jan Lahoda
On Fri, 3 Nov 2023 08:41:12 GMT, Jan Lahoda wrote: > Consider code like: > > void test(Object o) { > switch (o) { > case X1 -> {} > case X2 -> {} > ...(about 100 cases) > ``` > > javac will compile the switch into a switch whose selector is an indy > invocation to `SwitchB

Re: RFR: JDK-8315457 Implementation of String Templates (Second Preview) [v4]

2023-11-03 Thread Jim Laskey
> Update String Templates for a second preview. With the addition of > > - Expression type and throws are determined from the `process` method of the > processor type and not the processor type. > > - Qualified `STR` and `RAW` are treated the same as unqualified `STR` and > `RAW` . > > - Raw (

Re: RFR: JDK-8315458 Implementation of Implicitly Declared Classes and Instance Main Method (Second Preview) [v12]

2023-11-03 Thread Vicente Romero
On Fri, 3 Nov 2023 15:00:41 GMT, Jim Laskey wrote: >> src/java.base/share/native/libjli/java.c line 559: >> >>> 557: >>> 558: /* Build platform specific argument array */ >>> 559: if ((mainType & MAIN_WITHOUT_ARGS) == 0) { >> >> nice, thanks, a minor addition to the condition: `&& argc

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow

2023-11-03 Thread Rémi Forax
On Fri, 3 Nov 2023 08:41:12 GMT, Jan Lahoda wrote: > Consider code like: > > void test(Object o) { > switch (o) { > case X1 -> {} > case X2 -> {} > ...(about 100 cases) > ``` > > javac will compile the switch into a switch whose selector is an indy > invocation to `SwitchB

Re: RFR: 8294980: test/jdk/java/lang/invoke 15 test classes use experimental bytecode library [v2]

2023-11-03 Thread Mourad Abbay
> early experimental version of the bytecode library is bundled under: > test/jdk/lib/testlibrary/bytecode > > following tests reference it: > test/jdk/java/lang/invoke/common/test/java/lang/invoke/lib/InstructionHelper.java > test/jdk/java/lang/invoke/condy/CondyWithGarbageTest.java > test/jdk/ja

Re: RFR: JDK-8315458 Implementation of Implicitly Declared Classes and Instance Main Method (Second Preview) [v12]

2023-11-03 Thread Jim Laskey
On Fri, 3 Nov 2023 14:26:29 GMT, Vicente Romero wrote: >> Jim Laskey 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 12 additional >> commits si

Re: RFR: JDK-8315457 Implementation of String Templates (Second Preview) [v3]

2023-11-03 Thread Jan Lahoda
On Tue, 17 Oct 2023 16:03:25 GMT, Jim Laskey wrote: >> Update String Templates for a second preview. With the addition of >> >> - Expression type and throws are determined from the `process` method of the >> processor type and not the processor type. >> >> - Qualified `STR` and `RAW` are treat

Re: RFR: 8319316: Clarify text around which layouts a linker supports

2023-11-03 Thread Maurizio Cimadamore
On Fri, 3 Nov 2023 00:10:48 GMT, Jorn Vernee wrote: > - Add linker note about packed structs. > - Relax language a bit to avoid implying that only listed layouts are > supported. src/java.base/share/classes/java/lang/foreign/Linker.java line 247: > 245: * > 246: * > 247: * Linker implement

Re: RFR: JDK-8315458 Implementation of Implicitly Declared Classes and Instance Main Method (Second Preview) [v12]

2023-11-03 Thread Vicente Romero
On Fri, 3 Nov 2023 12:40:48 GMT, Jim Laskey wrote: >> Address changes from JEP 445 to JEP 463. >> >> - Move from a SYNTHETIC unnamed class to a MANDATED implicit class. >> >> - Don't mark class on read. >> >> - Remove reflection and annotation processing related to unnamed classes. >> >> - Si

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow

2023-11-03 Thread Rémi Forax
On Fri, 3 Nov 2023 08:41:12 GMT, Jan Lahoda wrote: > Consider code like: > > void test(Object o) { > switch (o) { > case X1 -> {} > case X2 -> {} > ...(about 100 cases) > ``` > > javac will compile the switch into a switch whose selector is an indy > invocation to `SwitchB

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow

2023-11-03 Thread Rémi Forax
On Fri, 3 Nov 2023 08:41:12 GMT, Jan Lahoda wrote: > Consider code like: > > void test(Object o) { > switch (o) { > case X1 -> {} > case X2 -> {} > ...(about 100 cases) > ``` > > javac will compile the switch into a switch whose selector is an indy > invocation to `SwitchB

RFR: 8319386: Migrate Class::getEnclosingMethod/Constructor away from old generic utilities

2023-11-03 Thread Chen Liang
Please review a patch that migrates `Class::getEnclosingMethod` and `Class::getEnclosingConstructor`'s descriptor parsing from old generic utilities to more simple utilities from java.lang.invoke implementation. This will help migrate away from the old generic repositories in the future. The `g

RFR: 8319316: Clarify text around which layouts a linker supports

2023-11-03 Thread Jorn Vernee
- Add linker note about packed structs. - Relax language a bit to avoid implying that only listed layouts are supported. - Commit messages: - simplify language - - Add linker note about packed structs. Changes: https://git.openjdk.org/jdk/pull/16485/files Webrev: https://webrevs.o

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow

2023-11-03 Thread Chen Liang
On Fri, 3 Nov 2023 08:41:12 GMT, Jan Lahoda wrote: > Consider code like: > > void test(Object o) { > switch (o) { > case X1 -> {} > case X2 -> {} > ...(about 100 cases) > ``` > > javac will compile the switch into a switch whose selector is an indy > invocation to `SwitchB

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow

2023-11-03 Thread Jan Lahoda
On Fri, 3 Nov 2023 08:51:48 GMT, Adam Sotona wrote: >> Consider code like: >> >> void test(Object o) { >> switch (o) { >> case X1 -> {} >> case X2 -> {} >> ...(about 100 cases) >> ``` >> >> javac will compile the switch into a switch whose selector is an indy >> invocation

Re: RFR: JDK-8315458 Implementation of Implicitly Declared Classes and Instance Main Method (Second Preview) [v12]

2023-11-03 Thread Jim Laskey
> Address changes from JEP 445 to JEP 463. > > - Move from a SYNTHETIC unnamed class to a MANDATED implicit class. > > - Don't mark class on read. > > - Remove reflection and annotation processing related to unnamed classes. > > - Simplify main method search. Jim Laskey has updated the pull re

Re: RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow

2023-11-03 Thread Adam Sotona
On Fri, 3 Nov 2023 08:41:12 GMT, Jan Lahoda wrote: > Consider code like: > > void test(Object o) { > switch (o) { > case X1 -> {} > case X2 -> {} > ...(about 100 cases) > ``` > > javac will compile the switch into a switch whose selector is an indy > invocation to `SwitchB

RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow

2023-11-03 Thread Jan Lahoda
Consider code like: void test(Object o) { switch (o) { case X1 -> {} case X2 -> {} ...(about 100 cases) ``` javac will compile the switch into a switch whose selector is an indy invocation to `SwitchBootstraps.typeSwitch`, with static arguments being the types in the cases.

Integrated: 8319323: FFM: Harmonize the @throws tags in the javadocs

2023-11-03 Thread Per Minborg
On Thu, 2 Nov 2023 14:46:49 GMT, Per Minborg wrote: > This PR proposes to harmonize the @throws tags in the javadocs for the FFM > API. > > The @throws tags are using a bit different principles with respect to > formatting and ending with a period or not. > > Looking at some prominent Java cl

Re: RFR: JDK-8315458 Implementation of Implicitly Declared Classes and Instance Main Method (Second Preview) [v2]

2023-11-03 Thread Jim Laskey
On Thu, 2 Nov 2023 18:10:27 GMT, Rémi Forax wrote: >> Hmmm. I'll check with Gavin, but I thought in discussions Alex said that it >> should be mandated. At any rate, seems the ACC_MANDATED should be removed >> for stated reasons. > > It should be MANDATED in theory given it's not an artifact of

Re: RFR: 8294980: test/jdk/java/lang/invoke 15 test classes use experimental bytecode library

2023-11-03 Thread Chen Liang
On Thu, 19 Oct 2023 14:37:06 GMT, Mourad Abbay wrote: > early experimental version of the bytecode library is bundled under: > test/jdk/lib/testlibrary/bytecode > > following tests reference it: > test/jdk/java/lang/invoke/common/test/java/lang/invoke/lib/InstructionHelper.java > test/jdk/java/l

Re: RFR: 8294980: test/jdk/java/lang/invoke 15 test classes use experimental bytecode library

2023-11-03 Thread Mourad Abbay
On Mon, 23 Oct 2023 01:15:54 GMT, Chen Liang wrote: >> early experimental version of the bytecode library is bundled under: >> test/jdk/lib/testlibrary/bytecode >> >> following tests reference it: >> test/jdk/java/lang/invoke/common/test/java/lang/invoke/lib/InstructionHelper.java >> test/jdk/ja

RFR: 8294980: test/jdk/java/lang/invoke 15 test classes use experimental bytecode library

2023-11-03 Thread Mourad Abbay
early experimental version of the bytecode library is bundled under: test/jdk/lib/testlibrary/bytecode following tests reference it: test/jdk/java/lang/invoke/common/test/java/lang/invoke/lib/InstructionHelper.java test/jdk/java/lang/invoke/condy/CondyWithGarbageTest.java test/jdk/java/lang/invoke

Re: RFR: JDK-8315458 Implementation of Implicitly Declared Classes and Instance Main Method (Second Preview) [v11]

2023-11-03 Thread Jim Laskey
> Address changes from JEP 445 to JEP 463. > > - Move from a SYNTHETIC unnamed class to a MANDATED implicit class. > > - Don't mark class on read. > > - Remove reflection and annotation processing related to unnamed classes. > > - Simplify main method search. Jim Laskey has updated the pull re

Re: RFR: JDK-8315458 Implementation of Implicitly Declared Classes and Instance Main Method (Second Preview) [v10]

2023-11-03 Thread Jim Laskey
On Fri, 3 Nov 2023 05:01:19 GMT, Vicente Romero wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove unnamed classes from examples.not-yet.txt > > src/java.base/share/native/libjli/java.c line 544: > >> 542: >> 5

Re: RFR: JDK-8315458 Implementation of Implicitly Declared Classes and Instance Main Method (Second Preview) [v10]

2023-11-03 Thread Jim Laskey
On Fri, 3 Nov 2023 01:06:56 GMT, Mandy Chung wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove unnamed classes from examples.not-yet.txt > > src/java.base/share/native/libjli/java.c line 539: > >> 537:

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v4]

2023-11-03 Thread Raffaello Giulietti
> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Better formatting for empty loop bodies. -

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v3]

2023-11-03 Thread Raffaello Giulietti
On Thu, 2 Nov 2023 22:21:15 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Restored ordering of exceptions. > > src/java.base/share/classes/java/math/BigInteger.java line 344: > >> 342:

Re: RFR: 8308753: Class-File API transition to Preview [v24]

2023-11-03 Thread Adam Sotona
> Classfile API is an internal library under package `jdk.internal.classfile`  > in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it > into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goe

Re: RFR: 8304446: javap --system flag doesn't override system APIs [v2]

2023-11-03 Thread Adam Sotona
> Javap ignores --system option when searching for JDK classes. > This patch prepends search over JDK system modules. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Skip search over JDK modules

Re: RFR: 8318839: Update test thread factory to catch all exceptions [v2]

2023-11-03 Thread Alan Bateman
On Fri, 3 Nov 2023 05:43:38 GMT, David Holmes wrote: > I don't understand what this is trying to do. If any virtual thread has an > uncaught exception then other virtual threads will throw it wrapped in a > RuntimeException. But the first virtual thread that completes (normally or by > throwin