Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v6]

2024-01-24 Thread Roland Westrelin
On Wed, 24 Jan 2024 18:56:15 GMT, Aleksey Shipilev wrote: > > Naive question: the right way to use this would be almost invariably be > > like this: > > ``` > > if (isCompileConstant(foo) && fooHasCertainStaticProperties(foo)) { > > // fast-path > > } > > // slow path > > ``` > > > > > >

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxiliary classes [v2]

2024-01-24 Thread Alexander Kriegisch
On Thu, 22 Apr 2021 21:50:45 GMT, Rafael Winterhalter wrote: >> Rafael Winterhalter has refreshed the contents of this pull request, and >> previous commits have been removed. Incremental views are not available. The >> pull request now contains one commit: >> >> 8200559: Java agents doing

Re: RFR: JDK-8324598: use mem_unit when working with sysinfo memory and swap related information

2024-01-24 Thread David Holmes
On Wed, 24 Jan 2024 10:07:17 GMT, Matthias Baesken wrote: > According to the sysinfo manpage ( > https://man7.org/linux/man-pages/man2/sysinfo.2.html ) the memory and swap > related entries in the struct sysinfo are given as multiples of mem_unit > bytes. > "In the above structure, sizes of

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v5]

2024-01-24 Thread David Holmes
On Wed, 24 Jan 2024 19:37:40 GMT, Paul Sandoz wrote: >> It is still weird to talk about expressions at this level. We really check >> if the value is constant, like the method name suggests now. Yes, this >> implicitly tests that the expression that produced that value is fully >>

Re: RFR: 8322768: Optimize non-subword vector compress and expand APIs for AVX2 target. [v9]

2024-01-24 Thread Jatin Bhateja
On Tue, 23 Jan 2024 15:20:47 GMT, Emanuel Peter wrote: >> Jatin Bhateja 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 10 additional >>

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v6]

2024-01-24 Thread Quan Anh Mai
On Wed, 24 Jan 2024 18:56:15 GMT, Aleksey Shipilev wrote: >>> Naive question: the right way to use this would be almost invariably be >>> like this: >>> >>> ``` >>> if (isCompileConstant(foo) && fooHasCertainStaticProperties(foo)) { >>> // fast-path >>> } >>> // slow path >>> ``` >>> >>>

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes

2024-01-24 Thread Joshua Cao
On Wed, 24 Jan 2024 23:53:34 GMT, jmehrens wrote: > For any Map/Collection you can fetch the Spliterator and use estimateSize or > getExactSizeIfKnown as both return size as a long. Based on the code, I think this will just return the original size. It would be the same as casting `(long)

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes [v2]

2024-01-24 Thread Joshua Cao
On Wed, 24 Jan 2024 20:40:36 GMT, Joshua Cao wrote: >> This change mirrors what we did for ConcurrentHashMap in >> https://github.com/openjdk/jdk/pull/17116. When we add all entries from one >> map to anther, we should resize that map to the size of the sum of both maps. >> >> I used the

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes [v3]

2024-01-24 Thread Joshua Cao
> This change mirrors what we did for ConcurrentHashMap in > https://github.com/openjdk/jdk/pull/17116. When we add all entries from one > map to anther, we should resize that map to the size of the sum of both maps. > > I used the command below to run the benchmarks. I set a high heap to

Re: RFR: 8324657: Intermittent OOME on exception message create

2024-01-24 Thread Sergey Bylokhov
On Mon, 22 Jan 2024 20:52:32 GMT, Roger Riggs wrote: > When an exception handler for an OutOfMemoryError uses string concatenation > to compose an exception message, the invoke dynamic string format > implementation may itself exhaust memory, preventing the exception from being > handled. >

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes

2024-01-24 Thread jmehrens
On Wed, 24 Jan 2024 21:53:51 GMT, Hannes Greule wrote: >...then suggest we should change the Map::size() api to return a long... For any Map/Collection you can fetch the Spliterator and use estimateSize or getExactSizeIfKnown as both return size as a long. - PR Comment:

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v50]

2024-01-24 Thread Aggelos Biboudis
> This is the proposed patch for Primitive types in patterns, instanceof, and > switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: Update

Integrated: JDK-6503196: API doc for DecimalFormat::getMaximumIntegerDigits is unclear

2024-01-24 Thread Justin Lu
On Tue, 23 Jan 2024 18:40:42 GMT, Justin Lu wrote: > Please review this PR which clarifies some confusion for the digit getter and > setter methods of DecimalFormat. > > When formatting non `BigInteger` and `BigDecimal` values, DecimalFormat uses > 309/340 as hard limits for integer and

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Aggelos Biboudis
On Wed, 24 Jan 2024 17:15:06 GMT, Vicente Romero wrote: >> Aggelos Biboudis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove redundant test from checkUnconditionallyExact > >

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v49]

2024-01-24 Thread Aggelos Biboudis
> This is the proposed patch for Primitive types in patterns, instanceof, and > switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v47]

2024-01-24 Thread Aggelos Biboudis
On Wed, 24 Jan 2024 21:47:19 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Introduce ExactnessConversionsSupportTest > >

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v48]

2024-01-24 Thread Aggelos Biboudis
> This is the proposed patch for Primitive types in patterns, instanceof, and > switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:

Integrated: 8324647: Invalid test group of lib-test after JDK-8323515

2024-01-24 Thread Jie Fu
On Wed, 24 Jan 2024 15:20:37 GMT, Jie Fu wrote: > This patch tries to fix the invalid test group definition of lib-test. > Please review. > Thanks. This pull request has now been integrated. Changeset: 2d5cb972 Author:Jie Fu URL:

Re: RFR: 8324657: Intermittent OOME on exception message create

2024-01-24 Thread Naoto Sato
On Mon, 22 Jan 2024 20:52:32 GMT, Roger Riggs wrote: > When an exception handler for an OutOfMemoryError uses string concatenation > to compose an exception message, the invoke dynamic string format > implementation may itself exhaust memory, preventing the exception from being > handled. >

Re: RFR: 8324647: Invalid test group of lib-test after JDK-8323515

2024-01-24 Thread Jie Fu
On Wed, 24 Jan 2024 17:22:42 GMT, Aleksey Shipilev wrote: >> This patch tries to fix the invalid test group definition of lib-test. >> Please review. >> Thanks. > > Ooof. I wonder how that happened. This would not show up before we try to run > the actual libtest tests. What is extra wild is

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes

2024-01-24 Thread Hannes Greule
On Wed, 24 Jan 2024 20:54:43 GMT, Joshua Cao wrote: > > The current benchmark and the change don't really cover the case where many > > keys exist in _both_ maps. Could you add a benchmark for that? > > I added a benchmark that assumes the worse case. Please see the top post. > Yes, this

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v47]

2024-01-24 Thread Maurizio Cimadamore
On Wed, 24 Jan 2024 19:33:52 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8324657: Intermittent OOME on exception message create

2024-01-24 Thread Iris Clark
On Mon, 22 Jan 2024 20:52:32 GMT, Roger Riggs wrote: > When an exception handler for an OutOfMemoryError uses string concatenation > to compose an exception message, the invoke dynamic string format > implementation may itself exhaust memory, preventing the exception from being > handled. >

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread David Holmes
On Wed, 24 Jan 2024 13:47:17 GMT, Doug Simon wrote: > You need to check if class is already loaded by trying findLoadedClass first. Thanks @xxDark . I knew it should work. :) - PR Comment: https://git.openjdk.org/jdk/pull/17520#issuecomment-1908961416

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v42]

2024-01-24 Thread Maurizio Cimadamore
On Wed, 24 Jan 2024 14:53:19 GMT, Aggelos Biboudis wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 4147: >> >>> 4145: } >>> 4146: if (clazztype.isPrimitive()) { >>> 4147: preview.checkSourceLevel(tree.pattern.pos(), >>>

Re: RFR: 8323717: Introduce test keyword for tests that need external dependencies

2024-01-24 Thread Leonid Mesnik
On Mon, 15 Jan 2024 10:48:23 GMT, Aleksey Shipilev wrote: > Some jtreg tests require resolvable external dependencies. This resolution is > delegated to JIB, which is not used in vanilla OpenJDK testing. It would be > convenient to add a keyword that marks tests that require these external >

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes

2024-01-24 Thread Joshua Cao
On Wed, 24 Jan 2024 19:55:27 GMT, Chen Liang wrote: > Then we might need some statistics on how often `putAll` replaces existing > mappings, ranging from none at all to completely. For example, > `Collectors.toMap` would never replace existing mappings, even though it > doesn't use `putAll`

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes

2024-01-24 Thread Joshua Cao
On Wed, 24 Jan 2024 19:06:49 GMT, Volker Simonis wrote: > The current benchmark and the change don't really cover the case where many > keys exist in _both_ maps. Could you add a benchmark for that? I added a benchmark that assumes the worse case. Please see the top post. Yes, this change is

Re: RFR: 8291027: Some of TimeZone methods marked 'synchronized' unnecessarily

2024-01-24 Thread Andrey Turbanov
On Wed, 17 Jan 2024 18:19:18 GMT, Naoto Sato wrote: >> src/java.base/share/classes/java/util/TimeZone.java line 629: >> >>> 627: */ >>> 628: public static String[] getAvailableIDs(int rawOffset) { >>> 629: return ZoneInfo.getAvailableIDs(rawOffset); >> >> BTW can we call

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes [v2]

2024-01-24 Thread Joshua Cao
> This change mirrors what we did for ConcurrentHashMap in > https://github.com/openjdk/jdk/pull/17116. When we add all entries from one > map to anther, we should resize that map to the size of the sum of both maps. > > I used the command below to run the benchmarks. I set a high heap to

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Vicente Romero
On Wed, 24 Jan 2024 18:26:08 GMT, Aggelos Biboudis wrote: >> test/langtools/tools/javac/patterns/CastConversionMatch.java line 6: >> >>> 4: * @summary Match which involves a cast conversion >>> 5: * @compile/fail/ref=CastConversionMatch.out -XDrawDiagnostics >>> CastConversionMatch.java >>>

Re: RFR: 8324657: Intermittent OOME on exception message create

2024-01-24 Thread Lance Andersen
On Mon, 22 Jan 2024 20:52:32 GMT, Roger Riggs wrote: > When an exception handler for an OutOfMemoryError uses string concatenation > to compose an exception message, the invoke dynamic string format > implementation may itself exhaust memory, preventing the exception from being > handled. >

RFR: 8324657: Intermittent OOME on exception message create

2024-01-24 Thread Roger Riggs
When an exception handler for an OutOfMemoryError uses string concatenation to compose an exception message, the invoke dynamic string format implementation may itself exhaust memory, preventing the exception from being handled. Explicit use of String.concat() call can improve exception

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes

2024-01-24 Thread Chen Liang
On Wed, 24 Jan 2024 00:26:09 GMT, Joshua Cao wrote: > This change mirrors what we did for ConcurrentHashMap in > https://github.com/openjdk/jdk/pull/17116. When we add all entries from one > map to anther, we should resize that map to the size of the sum of both maps. > > I used the command

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes

2024-01-24 Thread Hannes Greule
On Wed, 24 Jan 2024 00:26:09 GMT, Joshua Cao wrote: > This change mirrors what we did for ConcurrentHashMap in > https://github.com/openjdk/jdk/pull/17116. When we add all entries from one > map to anther, we should resize that map to the size of the sum of both maps. > > I used the command

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v5]

2024-01-24 Thread Paul Sandoz
On Wed, 24 Jan 2024 18:48:34 GMT, Aleksey Shipilev wrote: >> @dholmes-ora Indeed it's a compiler magic, albeit not really weird. While >> the method execution only receives the evaluated value of `expr`, the method >> compilation has the expression in its original form. As a result, it can >>

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Aggelos Biboudis
On Wed, 24 Jan 2024 18:21:11 GMT, Joe Darcy wrote: >> I have this regarding numeric values. Is it the kind of test you have in >> mind? >> >>

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v47]

2024-01-24 Thread Aggelos Biboudis
> This is the proposed patch for Primitive types in patterns, instanceof, and > switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes

2024-01-24 Thread Volker Simonis
On Wed, 24 Jan 2024 00:26:09 GMT, Joshua Cao wrote: > This change mirrors what we did for ConcurrentHashMap in > https://github.com/openjdk/jdk/pull/17116. When we add all entries from one > map to anther, we should resize that map to the size of the sum of both maps. > > I used the command

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v6]

2024-01-24 Thread Aleksey Shipilev
On Wed, 24 Jan 2024 18:51:27 GMT, Maurizio Cimadamore wrote: > Naive question: the right way to use this would be almost invariably be like > this: > > ``` > if (isCompileConstant(foo) && fooHasCertainStaticProperties(foo)) { > // fast-path > } > // slow path > ``` > > Right? Yes, I

Integrated: 8322149: ConcurrentHashMap smarter presizing for copy constructor and putAll

2024-01-24 Thread Joshua Cao
On Fri, 15 Dec 2023 01:16:55 GMT, Joshua Cao wrote: > ConcurrentHashMap's copy constructor calls `putAll()` -> `tryPresize()` -> > `transfer()`. When coming from the copy constructor, the Map is empty, so > there is nothing to transfer. But `transfer()` will still copy all the empty > nodes

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v6]

2024-01-24 Thread Maurizio Cimadamore
On Wed, 24 Jan 2024 18:48:03 GMT, Maurizio Cimadamore wrote: > Naive question: the right way to use this would be almost invariably be like > this: > > ``` > if (isCompileConstant(foo) && fooHasCertainStaticProperties(foo)) { > // fast-path > } > // slow path > ``` > > Right? Then the

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v6]

2024-01-24 Thread Aleksey Shipilev
On Wed, 24 Jan 2024 10:33:05 GMT, Quan Anh Mai wrote: >> Hi, >> >> This patch introduces `JitCompiler::isConstantExpression` which can be used >> to statically determine whether an expression has been constant-folded by >> the Jit compiler, leading to more constant-folding opportunities. For

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v5]

2024-01-24 Thread Aleksey Shipilev
On Wed, 24 Jan 2024 07:15:12 GMT, Quan Anh Mai wrote: >> This seems really weird to me for Java code. The method doesn't get the >> original "expression" it only gets the value of that expression after it has >> been evaluated. Is there some kind of weird "magic" happening here? > >

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v6]

2024-01-24 Thread Maurizio Cimadamore
On Wed, 24 Jan 2024 10:33:05 GMT, Quan Anh Mai wrote: >> Hi, >> >> This patch introduces `JitCompiler::isConstantExpression` which can be used >> to statically determine whether an expression has been constant-folded by >> the Jit compiler, leading to more constant-folding opportunities. For

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v46]

2024-01-24 Thread Aggelos Biboudis
> This is the proposed patch for Primitive types in patterns, instanceof, and > switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Vicente Romero
On Wed, 24 Jan 2024 15:55:51 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Aggelos Biboudis
On Wed, 24 Jan 2024 18:24:34 GMT, Vicente Romero wrote: >> Aggelos Biboudis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove redundant test from checkUnconditionallyExact > >

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Vicente Romero
On Wed, 24 Jan 2024 15:55:51 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Joe Darcy
On Wed, 24 Jan 2024 18:14:11 GMT, Aggelos Biboudis wrote: > I have this regarding numeric values. Is it the kind of test you have in mind? > >

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Joe Darcy
On Wed, 24 Jan 2024 15:55:51 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Aggelos Biboudis
On Wed, 24 Jan 2024 18:12:35 GMT, Joe Darcy wrote: >> Aggelos Biboudis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove redundant test from checkUnconditionallyExact > >

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44]

2024-01-24 Thread Vicente Romero
On Wed, 24 Jan 2024 15:34:33 GMT, Vicente Romero wrote: >> Aggelos Biboudis has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Enhance Javadoc of ExactConversionsSupport (2) >> - Enhance Javadoc of ExactConversionsSupport > >

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Vicente Romero
On Wed, 24 Jan 2024 15:55:51 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8324647: Invalid test group of lib-test after JDK-8323515

2024-01-24 Thread Aleksey Shipilev
On Wed, 24 Jan 2024 15:20:37 GMT, Jie Fu wrote: > This patch tries to fix the invalid test group definition of lib-test. > Please review. > Thanks. Ooof. I wonder how that happened. This would not show up before we try to run the actual libtest tests. What is extra wild is that GHA reports

Re: RFR: 8315487: Security Providers Filter [v5]

2024-01-24 Thread Martin Balao
> In addition to the goals, scope, motivation, specification and requirement > notes in [JDK-8315487](https://bugs.openjdk.org/browse/JDK-8315487), we would > like to describe the most relevant decisions taken during the implementation > of this enhancement. These notes are organized by

Withdrawn: 8323832: Load JVMCI with the platform class loader

2024-01-24 Thread Doug Simon
On Mon, 22 Jan 2024 17:34:16 GMT, Doug Simon wrote: > This PR changes `jdk.internal.vm.ci` such that it is loaded by the platform > class loader instead of the boot class loader. This allows Native Image to > load a version of JVMCI different than the version on top of which Native > Image is

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread Doug Simon
On Tue, 23 Jan 2024 19:16:49 GMT, Doug Simon wrote: >> This PR changes `jdk.internal.vm.ci` such that it is loaded by the platform >> class loader instead of the boot class loader. This allows Native Image to >> load a version of JVMCI different than the version on top of which Native >>

Re: RFR: 8315487: Security Providers Filter [v4]

2024-01-24 Thread Martin Balao
> In addition to the goals, scope, motivation, specification and requirement > notes in [JDK-8315487](https://bugs.openjdk.org/browse/JDK-8315487), we would > like to describe the most relevant decisions taken during the implementation > of this enhancement. These notes are organized by

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread Magnus Ihse Bursie
On Tue, 23 Jan 2024 19:16:49 GMT, Doug Simon wrote: >> This PR changes `jdk.internal.vm.ci` such that it is loaded by the platform >> class loader instead of the boot class loader. This allows Native Image to >> load a version of JVMCI different than the version on top of which Native >>

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v42]

2024-01-24 Thread Aggelos Biboudis
On Wed, 24 Jan 2024 12:20:55 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Set previewEnabled properly in SwitchBootstraps > >

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45]

2024-01-24 Thread Aggelos Biboudis
> This is the proposed patch for Primitive types in patterns, instanceof, and > switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: Remove

RFR: 8324635: (zipfs) Regression in Files.setPosixFilePermissions called on existing MSDOS entries

2024-01-24 Thread Eirik Bjørsnøs
Please review this PR to fix to a regression in ZipFileSystem, introduced by JDK-8322565 in PR #17170. When `Files.setPosixFilePermissions` is called on an existing MSDOS entry, then `Entry.posixPerms` field will be -1 (all 1s in binary). The logic introduced by JDK-8322565 did not account for

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44]

2024-01-24 Thread Vicente Romero
On Wed, 24 Jan 2024 15:26:54 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44]

2024-01-24 Thread Vicente Romero
On Wed, 24 Jan 2024 15:26:54 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread Alan Bateman
On Wed, 24 Jan 2024 13:47:17 GMT, Doug Simon wrote: > You're right. I had forgotten the intricacies of class loader delegation. The > only hard constraint on loading a class in multiple loaders is that `java.*` > classes [must (only) be loaded by the boot >

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44]

2024-01-24 Thread Aggelos Biboudis
> This is the proposed patch for Primitive types in patterns, instanceof, and > switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request incrementally with two additional commits since the last revision: -

RFR: 8324647: Invalid test group of lib-test after JDK-8323515

2024-01-24 Thread Jie Fu
This patch tries to fix the invalid test group definition of lib-test. Please review. Thanks. - Commit messages: - 8324647: Invalid test group of lib-test after JDK-8323515 Changes: https://git.openjdk.org/jdk/pull/17558/files Webrev: https://webrevs.openjdk.org/?repo=jdk=17558=00

Re: RFR: 8323515: Create test alias "all" for all test roots [v3]

2024-01-24 Thread Jie Fu
On Tue, 23 Jan 2024 17:03:13 GMT, Aleksey Shipilev wrote: >> Aleksey Shipilev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Catch-all -> All tests > > Thank you all! Hi @shipilev , plese see https://github.com/openjdk/jdk/pull/17558

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v42]

2024-01-24 Thread Aggelos Biboudis
On Wed, 24 Jan 2024 12:13:23 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Set previewEnabled properly in SwitchBootstraps > >

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v42]

2024-01-24 Thread Aggelos Biboudis
On Wed, 24 Jan 2024 12:22:20 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Set previewEnabled properly in SwitchBootstraps > >

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v41]

2024-01-24 Thread Aggelos Biboudis
On Wed, 24 Jan 2024 11:50:05 GMT, Aggelos Biboudis wrote: >> Uh, I think this is a good catch. >> >> I am not completely sure what the policy is, but here we are enhancing a >> non-preview method with some preview-based behavior. I would feel better if >> the method would refuse to work in

Re: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v43]

2024-01-24 Thread Aggelos Biboudis
> This is the proposed patch for Primitive types in patterns, instanceof, and > switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: Check

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread Doug Simon
On Wed, 24 Jan 2024 12:16:44 GMT, xxDark wrote: > You need to check if class is already loaded by trying findLoadedClass first. You're right. I had forgotten the intricacies of class loader delegation. The only hard constraint on loading a class in multiple loaders is that `java.*` classes

Re: RFR: JDK-8263261 Extend String::translateEscapes to support unicode escapes [v9]

2024-01-24 Thread Jim Laskey
> Currently String::translateEscapes does not support unicode escapes, reported > as a IllegalArgumentException("Invalid escape sequence: ..."). > String::translateEscapes should translate unicode escape sequences to provide > full coverage, Jim Laskey has updated the pull request

Re: [jdk22] RFR: 8319128: sun/security/pkcs11 tests fail on OL 7.9 aarch64

2024-01-24 Thread Lutz Schmidt
On Tue, 23 Jan 2024 10:21:42 GMT, Goetz Lindenmaier wrote: > I backport this to fix this issue in 22. We see it failing there in our CI. Looks good. - Marked as reviewed by lucy (Reviewer). PR Review: https://git.openjdk.org/jdk22/pull/95#pullrequestreview-1841351221

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v42]

2024-01-24 Thread Maurizio Cimadamore
On Wed, 24 Jan 2024 11:53:52 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v42]

2024-01-24 Thread Maurizio Cimadamore
On Wed, 24 Jan 2024 11:53:52 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v42]

2024-01-24 Thread Maurizio Cimadamore
On Wed, 24 Jan 2024 11:53:52 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread xxDark
On Wed, 24 Jan 2024 08:56:10 GMT, Doug Simon wrote: > > I'm still puzzled by the need to do this as any non-delegating classloader > > would have allowed this even if JVMCI were loaded by the bootloader. > > As far as I understand, even a non-delegating classloader cannot redefine a > class

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v42]

2024-01-24 Thread Maurizio Cimadamore
On Wed, 24 Jan 2024 11:53:52 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread David Holmes
On Wed, 24 Jan 2024 08:56:10 GMT, Doug Simon wrote: > As far as I understand, even a non-delegating classloader cannot redefine a > class loaded by the boot loader. I modified the test to show this and get: > > ``` > java.lang.LinkageError: loader LoadAlternativeJVMCI$1 @4a1f4d08 attempted >

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread David Holmes
On Tue, 23 Jan 2024 19:16:49 GMT, Doug Simon wrote: >> This PR changes `jdk.internal.vm.ci` such that it is loaded by the platform >> class loader instead of the boot class loader. This allows Native Image to >> load a version of JVMCI different than the version on top of which Native >>

Re: [jdk22] RFR: 8319128: sun/security/pkcs11 tests fail on OL 7.9 aarch64

2024-01-24 Thread Goetz Lindenmaier
On Tue, 23 Jan 2024 10:21:42 GMT, Goetz Lindenmaier wrote: > I backport this to fix this issue in 22. We see it failing there in our CI. Passed SAP nighlyt testing with jdk22 and jdk22u. - PR Comment: https://git.openjdk.org/jdk22/pull/95#issuecomment-1907981934

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v41]

2024-01-24 Thread Aggelos Biboudis
On Wed, 24 Jan 2024 10:26:18 GMT, Jan Lahoda wrote: >> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 72: >> >>> 70: private static final Object SENTINEL = new Object(); >>> 71: private static final MethodHandles.Lookup LOOKUP = >>> MethodHandles.lookup(); >>>

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v42]

2024-01-24 Thread Aggelos Biboudis
> This is the proposed patch for Primitive types in patterns, instanceof, and > switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: Set

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread David Holmes
On Wed, 24 Jan 2024 08:46:08 GMT, Doug Simon wrote: >> test/hotspot/jtreg/compiler/jvmci/LoadAlternativeJVMCI.java line 54: >> >>> 52: >>> 53: ClassLoader pcl = ClassLoader.getPlatformClassLoader(); >>> 54: URLClassLoader ucl = new URLClassLoader(cp, null); >> >> I am missing

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread Alan Bateman
On Tue, 23 Jan 2024 19:16:49 GMT, Doug Simon wrote: >> This PR changes `jdk.internal.vm.ci` such that it is loaded by the platform >> class loader instead of the boot class loader. This allows Native Image to >> load a version of JVMCI different than the version on top of which Native >>

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v5]

2024-01-24 Thread Quan Anh Mai
On Wed, 24 Jan 2024 09:03:43 GMT, Aleksey Shipilev wrote: >> That sounds like a better name for the class, although I think >> `jdk.internal.misc` is more suitable than `jdk.internal.vm`. Do you have any >> preference? Thanks. > > +1 to `ConstantSupport`. I think `jdk.internal.vm` is a proper

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v6]

2024-01-24 Thread Quan Anh Mai
> Hi, > > This patch introduces `JitCompiler::isConstantExpression` which can be used > to statically determine whether an expression has been constant-folded by the > Jit compiler, leading to more constant-folding opportunities. For example, it > can be used in

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v41]

2024-01-24 Thread Jan Lahoda
On Wed, 24 Jan 2024 03:47:06 GMT, Vicente Romero wrote: >> Aggelos Biboudis has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 60 commits: >> >> - Improve Javadoc of ExactConversionsSupport >> - Merge branch 'master' into

Re: RFR: 8321396: Retire test/jdk/java/util/zip/NoExtensionSignature.java [v2]

2024-01-24 Thread Eirik Bjørsnøs
> Please review this PR which suggests we retire the ZIP test > `NoExtensionSignature` along with its `test.jar` test vector. > > The concern of a missing data descriptor signature is covered by the recently > updated `DataDescriptorSignatureMissing` test, see #12959. That test is more >

RFR: JDK-8324598: use mem_unit when working with sysinfo memory and swap related information

2024-01-24 Thread Matthias Baesken
According to the sysinfo manpage ( https://man7.org/linux/man-pages/man2/sysinfo.2.html ) the memory and swap related entries in the struct sysinfo are given as multiples of mem_unit bytes. "In the above structure, sizes of the memory and swap fields are given as multiples of mem_unit bytes."

Re: RFR: 8323832: Load JVMCI with the platform class loader

2024-01-24 Thread Paul Woegerer
On Tue, 23 Jan 2024 17:00:20 GMT, xxDark wrote: > There is zero reason to do this. Passing `null` as parent class loader would > suffice as boot loader just uses `findBootstrapClassOrNull` in > `JavaLangAccess` either way. Right, using `null` does the same thing. In the final version will use

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v5]

2024-01-24 Thread Aleksey Shipilev
On Tue, 23 Jan 2024 22:49:49 GMT, Quan Anh Mai wrote: >> src/java.base/share/classes/jdk/internal/misc/JitCompiler.java line 32: >> >>> 30: * Just-in-time-compiler-related queries >>> 31: */ >>> 32: public class JitCompiler { >> >> An alternative name and location is

Re: RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v5]

2024-01-24 Thread Aleksey Shipilev
On Tue, 23 Jan 2024 22:41:44 GMT, Quan Anh Mai wrote: >> src/java.base/share/classes/jdk/internal/misc/JitCompiler.java line 119: >> >>> 117: * @see #isCompileConstant(boolean) >>> 118: */ >>> 119: @IntrinsicCandidate >> >> Note how the Java entry for MH intrinsic we have

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread Doug Simon
On Wed, 24 Jan 2024 06:11:30 GMT, David Holmes wrote: > I'm still puzzled by the need to do this as any non-delegating classloader > would have allowed this even if JVMCI were loaded by the bootloader. As far as I understand, even a non-delegating classloader cannot redefine a class loaded by

Re: RFR: 8323832: Load JVMCI with the platform class loader [v2]

2024-01-24 Thread Doug Simon
On Wed, 24 Jan 2024 06:07:55 GMT, David Holmes wrote: >> Doug Simon has updated the pull request incrementally with one additional >> commit since the last revision: >> >> use null to denote boot class loader as delegation parent > >

Re: RFR: 8324573: HashMap::putAll should resize to sum of both map sizes

2024-01-24 Thread Hannes Greule
On Wed, 24 Jan 2024 00:26:09 GMT, Joshua Cao wrote: > This change mirrors what we did for ConcurrentHashMap in > https://github.com/openjdk/jdk/pull/17116. When we add all entries from one > map to anther, we should resize that map to the size of the sum of both maps. > > I used the command