Re: RFR: 8253495: CDS generates non-deterministic output [v2]

2022-03-08 Thread Ioi Lam
On Wed, 9 Mar 2022 07:04:56 GMT, David Holmes wrote: > I have reservations about contorting things this way just to get > "deterministic output". > > The VM needs to fully initialize and then become quiescent before the dump > occurs, and as I say below if you don't start other threads then

Re: RFR: 8253495: CDS generates non-deterministic output [v2]

2022-03-08 Thread Ioi Lam
On Wed, 9 Mar 2022 06:49:02 GMT, David Holmes wrote: >> Ioi Lam has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fixed zero build > > src/hotspot/share/prims/jvm.cpp line 2873: > >> 2871: // execute in parallel, symbols and classes

Re: RFR: 8253495: CDS generates non-deterministic output [v2]

2022-03-08 Thread David Holmes
On Wed, 9 Mar 2022 05:10:44 GMT, Ioi Lam wrote: >> This patch makes the result of "java -Xshare:dump" deterministic: >> - Disabled new Java threads from launching. This is harmless. See comments >> in jvm.cpp >> - Fixed a problem in hashtable ordering in heapShared.cpp >> - BasicHashtableEntry

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Thomas Stuefe
On Tue, 8 Mar 2022 15:54:45 GMT, Zhengyu Gu wrote: >> Please review this small patch that fixes a potential memory leak that >> exception return fails to release allocated `cacheDirs` >> >> Test: >> >> - [x] jdk_desktop on Linux x86_64 > > Zhengyu Gu has updated the pull request incrementally

Re: RFR: 8253495: CDS generates non-deterministic output [v2]

2022-03-08 Thread Ioi Lam
> This patch makes the result of "java -Xshare:dump" deterministic: > - Disabled new Java threads from launching. This is harmless. See comments in > jvm.cpp > - Fixed a problem in hashtable ordering in heapShared.cpp > - BasicHashtableEntry has a gap on 64-bit platforms that may contain random

Integrated: JDK-8280902 ResourceBundle::getBundle may throw NPE when invoked by JNI code with no caller frame

2022-03-08 Thread Tim Prinzing
On Wed, 2 Mar 2022 18:56:40 GMT, Tim Prinzing wrote: > The caller class returned by Reflection::getCallerClass was used to gain > access to it's module in most cases and class loader in one case. I added a > method to translate the caller class to caller module so that the decision of > what

Re: RFR: JDK-8280902 ResourceBundle::getBundle may throw NPE when invoked by JNI code with no caller frame [v5]

2022-03-08 Thread Tim Prinzing
> The caller class returned by Reflection::getCallerClass was used to gain > access to it's module in most cases and class loader in one case. I added a > method to translate the caller class to caller module so that the decision of > what module represents the caller with no stack frame is

Re: RFR: 8267319: Use larger default key sizes and algorithms based on CNSA [v2]

2022-03-08 Thread Valerie Peng
> It's been several years since we increased the default key sizes. Before > shifting to PQC, NSA replaced its Suite B cryptography recommendations with > the Commercial National Security Algorithm Suite which suggests: > > - SHA-384 for secure hashing > - AES-256 for symmetric encryption > -

Re: RFR: 8264160: Regex \b is not consistent with \w without UNICODE_CHARACTER_CLASS [v3]

2022-03-08 Thread Ian Graves
On Tue, 8 Mar 2022 18:54:13 GMT, Lance Andersen wrote: >> Ian Graves has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains six commits: >> >> - Merge branch 'master' of https://github.com/openjdk/jdk into bug-8264160 >> - Bug id's to

Re: RFR: 8264160: Regex \b is not consistent with \w without UNICODE_CHARACTER_CLASS [v4]

2022-03-08 Thread Ian Graves
> Proposed change in behavior to correct inconsistencies between `\w` and `\b` > metacharacters Ian Graves has updated the pull request incrementally with one additional commit since the last revision: Updating with additional descriptors. Removing DataProvider import -

Integrated: 8282432: Optimize masked "test" Vector API with predicate feature

2022-03-08 Thread Xiaohong Gong
On Wed, 2 Mar 2022 02:50:27 GMT, Xiaohong Gong wrote: > The vector `"test"` api is implemented with vector `"compare"`. And the > masked `"test" `is implemented with `"test(op).and(m)"` which means > `"compare().and(m)"` finally. Since the masked vector `"compare"` has been > optimized with

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Alexey Ivanov
On Tue, 8 Mar 2022 21:12:33 GMT, Zhengyu Gu wrote: >>> I think `NewStringUTF()` can throw OOM and also return `NULL`, just which >>> one you pick. >> >> Yes. >> >> But we're discussing whether a check for exception is necessary after >> `(*env)->SetObjectArrayElement`. > >

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Zhengyu Gu
On Tue, 8 Mar 2022 21:05:13 GMT, Alexey Ivanov wrote: >> I think `NewStringUTF()` can throw OOM and also return `NULL`, just which >> one you pick. > >> I think `NewStringUTF()` can throw OOM and also return `NULL`, just which >> one you pick. > > Yes. > > But we're discussing whether a

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Alexey Ivanov
On Tue, 8 Mar 2022 21:02:04 GMT, Zhengyu Gu wrote: > I think `NewStringUTF()` can throw OOM and also return `NULL`, just which one > you pick. Yes. But we're discussing whether a check for exception is necessary after `(*env)->SetObjectArrayElement`. - PR:

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Zhengyu Gu
On Tue, 8 Mar 2022 20:57:27 GMT, Alexey Ivanov wrote: >>> ??? You want to check and cleanup if NewStringUTF fails. You only want to >>> call SetObjectElementArray if NewStringUTF succeeds. >> >> If the SetObjectArrayElement will throw an exception we will call the >> NewStringUTF while the

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Alexey Ivanov
On Tue, 8 Mar 2022 20:12:29 GMT, Sergey Bylokhov wrote: >> Can `SetObjectElementArray` raise an exception? >> The index is within the array length and we store a string. I assume >> `cacheDirArray` is a string array. > >> ??? You want to check and cleanup if NewStringUTF fails. You only want

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Alexey Ivanov
On Tue, 8 Mar 2022 15:54:45 GMT, Zhengyu Gu wrote: >> Please review this small patch that fixes a potential memory leak that >> exception return fails to release allocated `cacheDirs` >> >> Test: >> >> - [x] jdk_desktop on Linux x86_64 > > Zhengyu Gu has updated the pull request incrementally

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread John Rose
On 8 Mar 2022, at 11:53, Jim Laskey wrote: >> I'm not sure I see anything here that would prevent the user from building a >> carrier and casting to Object[] ? > Clarified the comment. You are right. When I reworked the original code I > dropped the intermediate object. For my purposes, it was

Re: RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v2]

2022-03-08 Thread Richard Startin
On Mon, 7 Mar 2022 21:41:05 GMT, Richard Startin wrote: >> Ludovic Henry has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add UTF-16 benchmarks > > Great to see this taken up. As it’s implemented here, it’s still scalar, but > the

Re: RFR: 8282429: StringBuilder/StringBuffer.toString() skip compressing for UTF16 strings [v2]

2022-03-08 Thread Xin Liu
On Tue, 8 Mar 2022 17:33:58 GMT, Daniel Jeliński wrote: > As for a better name for `growOnly`, something like `mayBeLatin` would better > convey the variable's purpose. What do you think? There are tricky. I need to add test to cover them. The problem comes from that this patch fails to

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Brian Goetz
MethodType is a useful shape for describing a pattern, in reverse; the “parameter” types are really the pattern bindings, and the “return” type is really the (minimal) type of the target. With such a description, the MethodType for a pattern is the right input to get the carrier for the

Re: RFR: 8281146: Replace StringCoding.hasNegatives with countPositives [v11]

2022-03-08 Thread Lutz Schmidt
On Mon, 7 Mar 2022 23:13:36 GMT, Claes Redestad wrote: >> I'm requesting comments and, hopefully, some help with this patch to replace >> `StringCoding.hasNegatives` with `countPositives`. The new method does a >> very similar pass, but alters the intrinsic to return the number of leading >>

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Sergey Bylokhov
On Tue, 8 Mar 2022 13:37:44 GMT, Alexey Ivanov wrote: >> ??? You want to check and cleanup if NewStringUTF fails. You only want to >> call SetObjectElementArray if NewStringUTF succeeds. > > Can `SetObjectElementArray` raise an exception? > The index is within the array length and we store a

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Jim Laskey
On Tue, 8 Mar 2022 16:00:48 GMT, Maurizio Cimadamore wrote: >> We propose to provide a runtime anonymous carrier class object generator; >> java.lang.runtime.Carrier. This generator class is designed to share >> anonymous classes when shapes are similar. For example, if several clients >>

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Jim Laskey
On Tue, 8 Mar 2022 16:51:22 GMT, John R Rose wrote: >> src/java.base/share/classes/java/lang/runtime/Carrier.java line 48: >> >>> 46: >>> 47: /** >>> 48: * This class is used to create objects that have number and types of >> >> The class javadoc seems a bit on the thin side. I would say

Re: RFR: 8253495: CDS generates non-deterministic output

2022-03-08 Thread Erik Joelsson
On Tue, 8 Mar 2022 19:11:02 GMT, Ioi Lam wrote: > This patch makes the result of "java -Xshare:dump" deterministic: > - Disabled new Java threads from launching. This is harmless. See comments in > jvm.cpp > - Fixed a problem in hashtable ordering in heapShared.cpp > - BasicHashtableEntry has a

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Jim Laskey
On Tue, 8 Mar 2022 15:48:56 GMT, Maurizio Cimadamore wrote: >> We propose to provide a runtime anonymous carrier class object generator; >> java.lang.runtime.Carrier. This generator class is designed to share >> anonymous classes when shapes are similar. For example, if several clients >>

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Jim Laskey
On Tue, 8 Mar 2022 15:50:22 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/java/lang/runtime/Carrier.java line 432: >> >>> 430: * Construct a new object carrier class based on shape. >>> 431: * >>> 432: * @param carrierShape shape of carrier >> >>

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Jim Laskey
On Tue, 8 Mar 2022 15:40:10 GMT, Maurizio Cimadamore wrote: >> We propose to provide a runtime anonymous carrier class object generator; >> java.lang.runtime.Carrier. This generator class is designed to share >> anonymous classes when shapes are similar. For example, if several clients >>

Re: RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v2]

2022-03-08 Thread Patrick Doyle
On Mon, 7 Mar 2022 21:41:05 GMT, Richard Startin wrote: >> Ludovic Henry has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add UTF-16 benchmarks > > Great to see this taken up. As it’s implemented here, it’s still scalar, but > the

RFR: 8253495: CDS generates non-deterministic output

2022-03-08 Thread Ioi Lam
This patch makes the result of "java -Xshare:dump" deterministic: - Disabled new Java threads from launching. This is harmless. See comments in jvm.cpp - Fixed a problem in hashtable ordering in heapShared.cpp - BasicHashtableEntry has a gap on 64-bit platforms that may contain random bits.

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Brian Goetz
It is a base assumption that the specific representation — bits in an int[], a class per shape, a cache of common shapes, etc — is a pure implementation detail that can be changed at will, based on various tradeoffs like footprint-vs-startup that can be made at any time. The only assumption is

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Kasper Nielsen
> > > Agreed. Also, this class is unusual in that it is not instantiated; like > `Arrays` or `Collections` it is a (small) bundle of static factories (or > are they algorithms?). I think as such it should be called `Carriers`. > I don't know if it is still the plan. But there was talk about

Re: RFR: 8264160: Regex \b is not consistent with \w without UNICODE_CHARACTER_CLASS [v3]

2022-03-08 Thread Lance Andersen
On Tue, 8 Mar 2022 17:19:14 GMT, Ian Graves wrote: >> Proposed change in behavior to correct inconsistencies between `\w` and `\b` >> metacharacters > > Ian Graves has updated the pull request with a new target base due to a merge > or a rebase. The pull request now contains six commits: > >

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Jens Li
On Tue, 8 Mar 2022 14:02:39 GMT, Jim Laskey wrote: > We propose to provide a runtime anonymous carrier class object generator; > java.lang.runtime.Carrier. This generator class is designed to share > anonymous classes when shapes are similar. For example, if several clients > require objects

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Zhengyu Gu
On Tue, 8 Mar 2022 15:58:57 GMT, Alexey Ivanov wrote: > > I did a quick grep, there are a few suspicious spots, e.g. > > [https://github.com/openjdk/jdk/blob/master/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp#L2711](url), > > I have yet take a close look. > > It doesn't leak

Re: RFR: 8282429: StringBuilder/StringBuffer.toString() skip compressing for UTF16 strings [v2]

2022-03-08 Thread Daniel Jeliński
On Mon, 7 Mar 2022 23:36:41 GMT, Xin Liu wrote: >> If AbstractStringBuilder only grow, the inflated value which has been >> encoded in UTF16 can't be compressed. >> toString() can skip compression in this case. This can save an >> ArrayAllocation in StringUTF16::compress(). >> >>

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread forax
- Original Message - > From: "Brian Goetz" > To: "Remi Forax" > Cc: "Jim Laskey" , "core-libs-dev" > > Sent: Tuesday, March 8, 2022 4:37:41 PM > Subject: Re: RFR: JDK-8282798 java.lang.runtime.Carrier > You keep saying “what we need”. But really, what I think you mean is “what > the

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Remi Forax
- Original Message - > From: "John R Rose" > To: "core-libs-dev" > Sent: Tuesday, March 8, 2022 5:55:00 PM > Subject: Re: RFR: JDK-8282798 java.lang.runtime.Carrier > On Tue, 8 Mar 2022 15:59:59 GMT, Maurizio Cimadamore > wrote: > >>> We propose to provide a runtime anonymous carrier

Re: RFR: JDK-8282625 Formatter caches Locale/DecimalFormatSymbols poorly [v9]

2022-03-08 Thread Roger Riggs
On Tue, 8 Mar 2022 13:19:39 GMT, Jim Laskey wrote: >> Several attempts have been made to improve Formatter's numeric performance >> by caching the current Locale zero. Such fixes, however, ignore the real >> issue, which is the slowness of fetching DecimalFormatSymbols. By directly >> caching

Re: RFR: 8264160: Regex \b is not consistent with \w without UNICODE_CHARACTER_CLASS [v3]

2022-03-08 Thread Ian Graves
> Proposed change in behavior to correct inconsistencies between `\w` and `\b` > metacharacters Ian Graves has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits: - Merge branch 'master' of https://github.com/openjdk/jdk into

Re: RFR: JDK-8282625 Formatter caches Locale/DecimalFormatSymbols poorly [v9]

2022-03-08 Thread Naoto Sato
On Tue, 8 Mar 2022 13:19:39 GMT, Jim Laskey wrote: >> Several attempts have been made to improve Formatter's numeric performance >> by caching the current Locale zero. Such fixes, however, ignore the real >> issue, which is the slowness of fetching DecimalFormatSymbols. By directly >> caching

Re: RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v2]

2022-03-08 Thread Claes Redestad
On Tue, 8 Mar 2022 17:01:09 GMT, Claes Redestad wrote: >> Can we change the optimizer so that the strength reduction happens only >> after all transformations have settled? Carelessly changing a multiplication >> to a shift as today may hurt a lot of potential optimisations. >> Thanks. > >>

Re: RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v2]

2022-03-08 Thread Claes Redestad
On Tue, 8 Mar 2022 15:36:22 GMT, Quan Anh Mai wrote: > Can we change the optimizer so that the strength reduction happens only after > all transformations have settled? Carelessly changing a multiplication to a > shift as today may hurt a lot of potential optimisations. Thanks. Yes, it's

Re: RFR: 8264160: Regex \b is not consistent with \w without UNICODE_CHARACTER_CLASS [v2]

2022-03-08 Thread Ian Graves
> Proposed change in behavior to correct inconsistencies between `\w` and `\b` > metacharacters Ian Graves has updated the pull request incrementally with one additional commit since the last revision: Bug id's to header and some other cleanup - Changes: - all:

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread John R Rose
On Tue, 8 Mar 2022 15:59:59 GMT, Maurizio Cimadamore wrote: >> We propose to provide a runtime anonymous carrier class object generator; >> java.lang.runtime.Carrier. This generator class is designed to share >> anonymous classes when shapes are similar. For example, if several clients >>

Re: RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v2]

2022-03-08 Thread Paul Sandoz
On Tue, 8 Mar 2022 15:13:46 GMT, Claes Redestad wrote: >> Ludovic Henry has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add UTF-16 benchmarks > > An awkward effect of this implementation is that it perturbs results on small > Strings a

Integrated: 8281560: Matcher.hitEnd returns unexpected results in presence of CANON_EQ flag.

2022-03-08 Thread Ian Graves
On Mon, 14 Feb 2022 19:54:00 GMT, Ian Graves wrote: > Fixing a bug in `NFCCharProperty` where code falling through an if-statement > can prematurely set the matcher's `hitEnd` field to true. This pull request has now been integrated. Changeset: 3fc009be Author:Ian Graves URL:

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Maurizio Cimadamore
On Tue, 8 Mar 2022 14:02:39 GMT, Jim Laskey wrote: > We propose to provide a runtime anonymous carrier class object generator; > java.lang.runtime.Carrier. This generator class is designed to share > anonymous classes when shapes are similar. For example, if several clients > require objects

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Maurizio Cimadamore
On Tue, 8 Mar 2022 15:49:46 GMT, Maurizio Cimadamore wrote: >> We propose to provide a runtime anonymous carrier class object generator; >> java.lang.runtime.Carrier. This generator class is designed to share >> anonymous classes when shapes are similar. For example, if several clients >>

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Alexey Ivanov
On Tue, 8 Mar 2022 15:54:45 GMT, Zhengyu Gu wrote: >> Please review this small patch that fixes a potential memory leak that >> exception return fails to release allocated `cacheDirs` >> >> Test: >> >> - [x] jdk_desktop on Linux x86_64 > > Zhengyu Gu has updated the pull request incrementally

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Zhengyu Gu
> Please review this small patch that fixes a potential memory leak that > exception return fails to release allocated `cacheDirs` > > Test: > > - [x] jdk_desktop on Linux x86_64 Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig()

2022-03-08 Thread Zhengyu Gu
On Fri, 4 Mar 2022 13:25:12 GMT, Zhengyu Gu wrote: > Please review this small patch that fixes a potential memory leak that > exception return fails to release allocated `cacheDirs` > > Test: > > - [x] jdk_desktop on Linux x86_64 > > > The macros are used to hide the different syntax of

Re: RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v2]

2022-03-08 Thread Quan Anh Mai
On Fri, 4 Mar 2022 17:44:44 GMT, Ludovic Henry wrote: >> Despite the hash value being cached for Strings, computing the hash still >> represents a significant CPU usage for applications handling lots of text. >> >> Even though it would be generally better to do it through an enhancement to >>

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Brian Goetz
You keep saying “what we need”. But really, what I think you mean is “what the scheme I have in mind needs.” Can we try and separate these out? I don’t think any of these are *needed*, but maybe you want to make the argument that you have a better scheme in mind, and we should choose that

Re: RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v2]

2022-03-08 Thread Claes Redestad
On Fri, 4 Mar 2022 17:44:44 GMT, Ludovic Henry wrote: >> Despite the hash value being cached for Strings, computing the hash still >> represents a significant CPU usage for applications handling lots of text. >> >> Even though it would be generally better to do it through an enhancement to >>

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Remi Forax
Hi Jim, I believe that there is a mismatch about what is needed for the pattern matching and the API you propose. The Carrier API allows to map one tuple of types to one storage representation based on ints, longs and references. But what we need is to have several shapes for the same storage,

Re: RFR: 8282662: Use List/Set.of() factory methods to reduce memory consumption

2022-03-08 Thread liach
On Mon, 7 Mar 2022 15:11:50 GMT, Сергей Цыпанов wrote: > `List.of()` along with `Set.of()` create unmodifiable `List/Set` but with > smaller footprint comparing to `Arrays.asList()` / `new HashSet()` when > called with vararg of size 0, 1, 2. > > In general replacement of `Arrays.asList()`

Re: RFR: JDK-8280902 ResourceBundle::getBundle may throw NPE when invoked by JNI code with no caller frame [v4]

2022-03-08 Thread Magnus Ihse Bursie
On Thu, 3 Mar 2022 16:55:46 GMT, Tim Prinzing wrote: >> The caller class returned by Reflection::getCallerClass was used to gain >> access to it's module in most cases and class loader in one case. I added a >> method to translate the caller class to caller module so that the decision >> of

RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Jim Laskey
We propose to provide a runtime anonymous carrier class object generator; java.lang.runtime.Carrier. This generator class is designed to share anonymous classes when shapes are similar. For example, if several clients require objects containing two integer fields, then Carrier will ensure that

Re: RFR: 8281146: Replace StringCoding.hasNegatives with countPositives [v11]

2022-03-08 Thread Claes Redestad
On Mon, 7 Mar 2022 23:13:36 GMT, Claes Redestad wrote: >> I'm requesting comments and, hopefully, some help with this patch to replace >> `StringCoding.hasNegatives` with `countPositives`. The new method does a >> very similar pass, but alters the intrinsic to return the number of leading >>

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig()

2022-03-08 Thread Alexey Ivanov
On Tue, 8 Mar 2022 12:20:38 GMT, David Holmes wrote: >> src/java.desktop/unix/native/common/awt/fontpath.c line 940: >> >>> 938: JNU_CHECK_EXCEPTION_AND_CLEANUP(env, >>> (*FcStrListDone)(cacheDirs)); >>> 939: >>> 940: (*env)->SetObjectArrayElement(env,

Integrated: JDK-8282144 RandomSupport.convertSeedBytesToLongs sign extension overwrites previous bytes

2022-03-08 Thread Jim Laskey
On Thu, 24 Feb 2022 14:47:50 GMT, Jim Laskey wrote: > Class: ./java.base/share/classes/jdk/internal/util/random/RandomSupport.java > Method: public static long[] convertSeedBytesToLongs(byte[] seed, int n, int > z) > > The method attempts to create an array of longs by consuming the input

Re: RFR: JDK-8282625 Formatter caches Locale/DecimalFormatSymbols poorly [v7]

2022-03-08 Thread Jim Laskey
On Tue, 8 Mar 2022 05:01:56 GMT, Jaikiran Pai wrote: >> Jim Laskey has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Add comment about DecimalFormatSymbols being mutable objects. >> - Revert "Cache DecimalFormatSymbols in

Re: RFR: JDK-8282625 Formatter caches Locale/DecimalFormatSymbols poorly [v9]

2022-03-08 Thread Jim Laskey
> Several attempts have been made to improve Formatter's numeric performance by > caching the current Locale zero. Such fixes, however, ignore the real issue, > which is the slowness of fetching DecimalFormatSymbols. By directly caching > DecimalFormatSymbols in the Formatter, this enhancement

Re: RFR: JDK-8282625 Formatter caches Locale/DecimalFormatSymbols poorly [v7]

2022-03-08 Thread Jim Laskey
On Mon, 7 Mar 2022 21:24:32 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Add comment about DecimalFormatSymbols being mutable objects. >> - Revert "Cache DecimalFormatSymbols in

Re: RFR: JDK-8282625 Formatter caches Locale/DecimalFormatSymbols poorly [v8]

2022-03-08 Thread Jim Laskey
> Several attempts have been made to improve Formatter's numeric performance by > caching the current Locale zero. Such fixes, however, ignore the real issue, > which is the slowness of fetching DecimalFormatSymbols. By directly caching > DecimalFormatSymbols in the Formatter, this enhancement

Re: RFR: 8282572: EnumSet should be a sealed class

2022-03-08 Thread Jaikiran Pai
On Tue, 8 Mar 2022 10:50:35 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which proposes to implement the > enhancement requested in https://bugs.openjdk.java.net/browse/JDK-8282572? > > The (public) `EnumSet` class has 2 package private (JDK) internal sub-classes > -

Re: RFR: 8282662: Use List/Set.of() factory methods to reduce memory consumption

2022-03-08 Thread Сергей Цыпанов
On Mon, 7 Mar 2022 16:06:44 GMT, Claes Redestad wrote: > Notice list.of will have the downside of copying the input array when the > size is not small while arrays aslist does not. Is the tradeoff worth it? Good point, I see risky changes in this PR: - `ProxyGenerator` - `Proxy` - `MethodType`

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig()

2022-03-08 Thread David Holmes
On Tue, 8 Mar 2022 09:18:01 GMT, Sergey Bylokhov wrote: >> Please review this small patch that fixes a potential memory leak that >> exception return fails to release allocated `cacheDirs` >> >> Test: >> >> - [x] jdk_desktop on Linux x86_64 > >

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig()

2022-03-08 Thread David Holmes
On Tue, 8 Mar 2022 09:20:19 GMT, Sergey Bylokhov wrote: >> Please review this small patch that fixes a potential memory leak that >> exception return fails to release allocated `cacheDirs` >> >> Test: >> >> - [x] jdk_desktop on Linux x86_64 > >

Re: RFR: 8282572: EnumSet should be a sealed class

2022-03-08 Thread Lance Andersen
On Tue, 8 Mar 2022 11:45:13 GMT, Athijegannathan Sundararajan wrote: > Do we need a CSR as a public class is changed from non-sealed to sealed? > > (Although the constructor has been package-private and hence it will not > affect any non-dk code as noted by Jaikiran via private conversation.

Re: RFR: 8264160: Regex \b is not consistent with \w without UNICODE_CHARACTER_CLASS

2022-03-08 Thread Lance Andersen
On Fri, 18 Feb 2022 19:47:09 GMT, Ian Graves wrote: > Proposed change in behavior to correct inconsistencies between `\w` and `\b` > metacharacters Have not gone through the javadoc changes in detail yet but plan to, only scanned it just now On a quick skim of the test, it could use some TLC

Re: RFR: 8282572: EnumSet should be a sealed class

2022-03-08 Thread Athijegannathan Sundararajan
On Tue, 8 Mar 2022 10:50:35 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which proposes to implement the > enhancement requested in https://bugs.openjdk.java.net/browse/JDK-8282572? > > The (public) `EnumSet` class has 2 package private (JDK) internal sub-classes > -

Re: RFR: 8281560: Matcher.hitEnd returns unexpected results in presence of CANON_EQ flag. [v4]

2022-03-08 Thread Lance Andersen
On Tue, 8 Mar 2022 04:23:43 GMT, Ian Graves wrote: >> Fixing a bug in `NFCCharProperty` where code falling through an if-statement >> can prematurely set the matcher's `hitEnd` field to true. > > Ian Graves has updated the pull request incrementally with one additional > commit since the last

RFR: 8282572: EnumSet should be a sealed class

2022-03-08 Thread Jaikiran Pai
Can I please get a review of this change which proposes to implement the enhancement requested in https://bugs.openjdk.java.net/browse/JDK-8282572? The (public) `EnumSet` class has 2 package private (JDK) internal sub-classes - the `JumboEnumSet` and `RegularEnumSet`. These 2 classes don't have

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig()

2022-03-08 Thread Sergey Bylokhov
On Fri, 4 Mar 2022 13:25:12 GMT, Zhengyu Gu wrote: > Please review this small patch that fixes a potential memory leak that > exception return fails to release allocated `cacheDirs` > > Test: > > - [x] jdk_desktop on Linux x86_64 src/java.desktop/unix/native/common/awt/fontpath.c line 938:

Re: RFR: JDK-8266670: Better modeling of access flags in core reflection [v12]

2022-03-08 Thread ExE Boss
On Mon, 7 Mar 2022 11:22:29 GMT, Peter Levart wrote: >>> It does because of the AccessFlags.MODULE constant. >> >> But that’s exactly what the unqualified `MODULE` identifier refers to, and  >> there’s no other bare `MODULE` identifier in scope that would shadow the  >> `AccessFlag.MODULE`