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

2022-06-13 Thread liach
On Tue, 14 Jun 2022 01:25:02 GMT, Joe Darcy wrote: >> This is an early review of changes to better model JVM access flags, that is >> "modifiers" like public, protected, etc. but explicitly at a VM level. >> >> Language level modifiers and JVM level access flags are closely related, but >>

Re: RFR: 8287186: JDK modules participating in preview [v2]

2022-06-08 Thread liach
On Wed, 8 Jun 2022 18:24:35 GMT, Paul Sandoz wrote: >> Allow JDK modules that use preview features (preview language features or >> preview API features from dependent modules) to participate without the need >> to compile with `--enable-preview`. >> >> It's difficult to enable participation

Re: RFR: JDK-8287838: Update Float and Double to use snippets

2022-06-06 Thread liach
On Sun, 5 Jun 2022 21:19:37 GMT, Joe Darcy wrote: > Various code blocks in Float and Double would be better as snippets. src/java.base/share/classes/java/lang/Double.java line 643: > 641: * expression below can be used to screen the input string: > 642: * > 643: * {@snippet

Re: RFR: 8287860: Revise usage of volatile in j.u.Locale

2022-06-06 Thread liach
On Mon, 6 Jun 2022 13:28:44 GMT, Сергей Цыпанов wrote: >> src/java.base/share/classes/java/util/Locale.java line 2260: >> >>> 2258: * Calculated hashcode >>> 2259: */ >>> 2260: private transient volatile int hashCodeValue; >> >> We can additionally annotate such cache fields with

Re: RFR: 8287860: Revise usage of volatile in j.u.Locale

2022-06-06 Thread liach
On Mon, 6 Jun 2022 13:32:21 GMT, liach wrote: >> Shouldn't the fields annotated with `@Stable` be `final` as well? > > These fields can only be written once besides the default values, but they > don't have to be written in the static initializer or constructor. So when a >

Re: RFR: 8287860: Revise usage of volatile in j.u.Locale

2022-06-06 Thread liach
On Mon, 6 Jun 2022 12:58:39 GMT, Сергей Цыпанов wrote: > - cached hash code of `Locale` and `Locale$LanguageRange` shouldn't be > volatile, even in case of race in the worst case it is recalculated at most > once per thread > - `defaultLocale` field is read multiple times in `initDefault()` >

Re: RFR: 8287785: Reduce runtime of java.lang.invoke microbenchmarks

2022-06-03 Thread liach
On Fri, 3 Jun 2022 11:16:29 GMT, Claes Redestad wrote: > - Add explicit run configurations to java.lang.invoke micros, aiming to > reduce runtime while maintaining a decently high confidence that there's > enough warmup to produce good enough data. > > - Remove several trivial baseline

Re: RFR: 8287442: Reduce list to array conversions in java.lang.invoke.MethodHandles [v2]

2022-06-02 Thread liach
On Thu, 2 Jun 2022 15:19:44 GMT, Сергей Цыпанов wrote: >> The clone is needed - as the `List>` may be a custom implementation >> of List - so you cannot make any assumption on the concrete implementation >> of `toArray`. > > But we can make an assumption on the behavior of particular method

Re: RFR: 8284780: Need methods to create pre-sized HashSet and LinkedHashSet [v17]

2022-06-01 Thread liach
On Fri, 27 May 2022 18:40:32 GMT, XenoAmess wrote: >> as title. > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > do it as naotoj said 'the new' fix should be applied to newHashMap etc. too. - PR:

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V)

2022-05-31 Thread liach
On Thu, 21 Apr 2022 00:48:00 GMT, Stuart Marks wrote: >> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare >> values by identity. Updated API documentation of these two methods >> ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityH

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v6]

2022-05-31 Thread liach
On Tue, 31 May 2022 19:33:49 GMT, Mandy Chung wrote: >> liach has updated the pull request incrementally with one additional commit >> since the last revision: >> >> Fixes suggested by mandy > > Looks good. Thanks. @mlchung Would you mind sponsoring this pa

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v3]

2022-05-31 Thread liach
On Fri, 20 May 2022 00:10:01 GMT, Mandy Chung wrote: >> liach 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 four additi

Integrated: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization

2022-05-31 Thread liach
On Fri, 20 May 2022 03:50:58 GMT, liach wrote: > Simplify calls `Class.forName(String, boolean, ClassLoader)` instead of > `Class.forName(String)`. `make test > TEST="jtreg:test/jdk/java/lang/reflect/Proxy"` passes, with the new > `LazyInitializationTest` failing th

Integrated: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo

2022-05-31 Thread liach
On Fri, 20 May 2022 04:55:37 GMT, liach wrote: > Simplify opcode handling, use `final` in `PrimitiveTypeInfo`, and replace the > hash map with a simple lookup, similar to what's done in > [JDK-8284880](https://bugs.openjdk.java.net/browse/JDK-8284880) (#8242) This pull request has

Withdrawn: JDK-8242888: Convert dynamic proxy to hidden classes

2022-05-27 Thread liach
On Sun, 17 Apr 2022 16:17:30 GMT, liach wrote: > Convert dynamic proxies to hidden classes. Modifies the serialization of > proxies (requires change in "Java Object Serialization Specification"). Makes > the proxies hidden in stack traces. Removes duplicate logi

Re: RFR: 8287353: Use snippet tag instead of pre tag in Javadoc of InterruptedException

2022-05-27 Thread liach
On Tue, 26 Apr 2022 15:04:15 GMT, Thiago Henrique Hüpner wrote: > 8287353: Use snippet tag instead of pre tag in Javadoc of InterruptedException src/java.base/share/classes/java/lang/InterruptedException.java line 35: > 33: * this exception. The following code can be used to achieve > 34:

Re: RFR: 8287442: Reduce list to array conversions in java.lang.invoke.MethodHandles

2022-05-27 Thread liach
On Fri, 27 May 2022 14:38:27 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 5266: >> >>> 5264: */ >>> 5265: public static MethodHandle dropArguments(MethodHandle target, int >>> pos, List> valueTypes) { >>> 5266: return

Re: RFR: 8287442: Reduce list to array conversions in java.lang.invoke.MethodHandles

2022-05-27 Thread liach
On Fri, 27 May 2022 14:18:19 GMT, Claes Redestad wrote: > In preparation of #8855 this PR refactors the conversions from `List` to > array and array to `List`, reducing the number of conversions when calling > `MethodHandles.dropArguments` in particular. This remove about ~5% of > allocations

Re: RFR: 8284780: Need methods to create pre-sized HashSet and LinkedHashSet [v14]

2022-05-26 Thread liach
On Thu, 26 May 2022 18:08:13 GMT, XenoAmess wrote: >> as title. > > XenoAmess has updated the pull request with a new target base due to a merge > or a rebase. The pull request now contains 16 commits: > > - Merge branch 'master' of https://git.openjdk.java.net/jdk into fix_8284780 > - Merge

Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v4]

2022-05-26 Thread liach
On Fri, 27 May 2022 01:55:25 GMT, Mandy Chung wrote: >> liach has updated the pull request with a new target base due to a merge or >> a rebase. The incremental webrev excludes the unrelated changes brought in >> by the merge/rebase. The pull request contains eight additional

Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v5]

2022-05-26 Thread liach
to implement. > > Mandy, would you mind review this? liach has updated the pull request incrementally with one additional commit since the last revision: Improve test messages - Changes: - all: https://git.openjdk.java.net/jdk/pull/8800/files - new: https://git

Re: RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v5]

2022-05-26 Thread liach
> Simplify opcode handling, use `final` in `PrimitiveTypeInfo`, and replace the > hash map with a simple lookup, similar to what's done in > [JDK-8284880](https://bugs.openjdk.java.net/browse/JDK-8284880) (#8242) liach has updated the pull request incrementally with one additional comm

Re: RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v3]

2022-05-26 Thread liach
On Thu, 26 May 2022 22:55:02 GMT, Mandy Chung wrote: >> liach has updated the pull request with a new target base due to a merge or >> a rebase. The incremental webrev excludes the unrelated changes brought in >> by the merge/rebase. The pull request contains three additional

Re: RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v3]

2022-05-26 Thread liach
On Thu, 26 May 2022 22:51:39 GMT, Mandy Chung wrote: >> liach has updated the pull request with a new target base due to a merge or >> a rebase. The incremental webrev excludes the unrelated changes brought in >> by the merge/rebase. The pull request contains three additional

Re: RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v4]

2022-05-26 Thread liach
> Simplify opcode handling, use `final` in `PrimitiveTypeInfo`, and replace the > hash map with a simple lookup, similar to what's done in > [JDK-8284880](https://bugs.openjdk.java.net/browse/JDK-8284880) (#8242) liach has updated the pull request incrementally with one additional comm

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v5]

2022-05-26 Thread liach
On Thu, 26 May 2022 22:33:29 GMT, Mandy Chung wrote: >> The original check and `Modules.addOpen` calls were added in >> [8159476](https://bugs.openjdk.java.net/browse/JDK-8159746), when the >> `invokeDefault` support was added. >> >> See: >>

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v6]

2022-05-26 Thread liach
g the module. > > Split from #8278. Helpful for moving proxies to hidden classes, but is a good > cleanup on its own. liach has updated the pull request incrementally with one additional commit since the last revision: Fixes suggested by mandy - Changes: - all: https://git

Re: RFR: JDK-8282798 java.lang.runtime.Carrier [v19]

2022-05-26 Thread liach
On Thu, 31 Mar 2022 18:48: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

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v5]

2022-05-26 Thread liach
On Thu, 26 May 2022 21:32:53 GMT, Mandy Chung wrote: >> liach 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 seven additional

Re: RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v3]

2022-05-26 Thread liach
> Simplify opcode handling, use `final` in `PrimitiveTypeInfo`, and replace the > hash map with a simple lookup, similar to what's done in > [JDK-8284880](https://bugs.openjdk.java.net/browse/JDK-8284880) (#8242) liach has updated the pull request with a new target base due t

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v5]

2022-05-26 Thread liach
g the module. > > Split from #8278. Helpful for moving proxies to hidden classes, but is a good > cleanup on its own. liach 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/reb

Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v4]

2022-05-26 Thread liach
to implement. > > Mandy, would you mind review this? liach has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits sinc

Re: RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v2]

2022-05-24 Thread liach
On Fri, 20 May 2022 22:18:42 GMT, liach wrote: >> Simplify opcode handling, use `final` in `PrimitiveTypeInfo`, and replace >> the hash map with a simple lookup, similar to what's done in >> [JDK-8284880](https://bugs.openjdk.java.net/browse/JDK-8284880) (#8242) > > li

Re: RFR: 8284780: Need methods to create pre-sized HashSet and LinkedHashSet [v10]

2022-05-24 Thread liach
On Tue, 24 May 2022 21:37:52 GMT, XenoAmess wrote: >> as title. > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > add test for newHashSet and newLinkedHashSet test/jdk/java/util/HashMap/WhiteBoxResizeTest.java line 354: >

Re: RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v2]

2022-05-24 Thread liach
On Tue, 24 May 2022 17:26:52 GMT, Roger Riggs wrote: > Did you consider switch (class) {...} in PrimitiveTypeInfo.get? I don't think we can switch on class instances yet. Even with preview enabled, best I can get is (for type incompatibility of `Class` and `Class`, etc.)

Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v3]

2022-05-24 Thread liach
On Tue, 24 May 2022 05:36:30 GMT, Jaikiran Pai wrote: >> liach has updated the pull request incrementally with one additional commit >> since the last revision: >> >> Move the try catch block as it doesn't throw checked exceptions > > src/java.base/s

Re: RFR: 8286849: Use @Stable for generic repositories

2022-05-23 Thread liach
On Tue, 17 May 2022 04:40:50 GMT, liach wrote: > Generic repositories, the implementation detail for generic information in > core reflection, can be updated to use the `@Stable` annotation to replace > their `volatile` access. Their existing accessor code is already safe, > readi

Re: RFR: 8284640: CollectorImpl class could be a record class

2022-05-20 Thread liach
On Mon, 11 Apr 2022 13:08:43 GMT, altrisi wrote: > Changes the definition of `CollectorImpl` to be a record. @stuart-marks Mind review this simple cleanup? - PR: https://git.openjdk.java.net/jdk/pull/8179

Re: RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v2]

2022-05-20 Thread liach
On Fri, 20 May 2022 20:02:28 GMT, Roger Riggs wrote: >> liach has updated the pull request incrementally with one additional commit >> since the last revision: >> >> Convert PrimitiveTypeInfo to an enum > > src/java.base/share/classes/java/lang/reflect/ProxyGene

Re: RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v2]

2022-05-20 Thread liach
> Simplify opcode handling, use `final` in `PrimitiveTypeInfo`, and replace the > hash map with a simple lookup, similar to what's done in > [JDK-8284880](https://bugs.openjdk.java.net/browse/JDK-8284880) (#8242) liach has updated the pull request incrementally with one additional comm

Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v2]

2022-05-20 Thread liach
On Fri, 20 May 2022 11:51:09 GMT, ExE Boss wrote: >> liach has updated the pull request incrementally with one additional commit >> since the last revision: >> >> remove unused field > > src/java.base/share/classes/java/lang/reflect/ProxyGene

Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v3]

2022-05-20 Thread liach
to implement. > > Mandy, would you mind review this? liach has updated the pull request incrementally with one additional commit since the last revision: Move the try catch block as it doesn't throw checked exceptions - Changes: - all: https://git.openj

RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo

2022-05-19 Thread liach
Simplify opcode handling, use `final` in `PrimitiveTypeInfo`, and replace the hash map with a simple lookup, similar to what's done in [JDK-8284880](https://bugs.openjdk.java.net/browse/JDK-8284880) (#8242) - Commit messages: - 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo

Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v2]

2022-05-19 Thread liach
to implement. > > Mandy, would you mind review this? liach has updated the pull request incrementally with one additional commit since the last revision: remove unused field - Changes: - all: https://git.openjdk.java.net/jdk/pull/8800/files - new: https://git.openjdk.j

RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization

2022-05-19 Thread liach
Simplify calls `Class.forName(String, boolean, ClassLoader)` instead of `Class.forName(String)`. `make test TEST="jtreg:test/jdk/java/lang/reflect/Proxy"` passes, with the new `LazyInitializationTest` failing the eager initialization check on the baseline and passing with this patch. On a

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v4]

2022-05-19 Thread liach
g the module. > > Split from #8278. Helpful for moving proxies to hidden classes, but is a good > cleanup on its own. liach has updated the pull request incrementally with one additional commit since the last revision: Update - Changes: - all: https://git.openjdk.java.ne

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v3]

2022-05-19 Thread liach
On Fri, 20 May 2022 00:08:36 GMT, Mandy Chung wrote: > a named module can't have unnamed package Since this is mandated by the Java Language Specification 7.4.2, I am tempted to change the thrown exception to `InternalError`, but I cannot find any restriction in the JVM Specification that

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v3]

2022-05-19 Thread liach
g the module. > > Split from #8278. Helpful for moving proxies to hidden classes, but is a good > cleanup on its own. liach 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/reb

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v2]

2022-05-19 Thread liach
On Thu, 21 Apr 2022 03:44:18 GMT, liach wrote: >> Currently, in ProxyBuilder::mapToModule and ProxyBuilder::defineProxyClass, >> the interfaces are iterated twice. The two passes can be merged into one, >> yielding the whole proxy definition context (module, package, w

RFR: 8286849: Use @Stable for generic repositories

2022-05-16 Thread liach
Generic repositories, the implementation detail for generic information in core reflection, can be updated to use the `@Stable` annotation to replace their `volatile` access. Their existing accessor code is already safe, reading the cache fields only once. In addition, fixed potentially

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline

2022-05-12 Thread liach
On Thu, 12 May 2022 17:17:37 GMT, Jorn Vernee wrote: > Hi, > > This PR brings over commits from the panama-foreign repo. These commits > mostly pertain to the switch to ASM and away from MethodHandle combinators > for the binding recipe specialization. But, there is one more commit which >

Re: RFR: JDK-8286347: incorrect use of `{@link}`

2022-05-12 Thread liach
On Fri, 6 May 2022 23:30:44 GMT, Jonathan Gibbons wrote: > Please review a small doc fix to update incorrect use of `{@link}` on arrays > of primitive types. This is fixed in 8282191 (JEP 424), which is already integrated. - PR: https://git.openjdk.java.net/jdk/pull/8584

Re: RFR: JDK-8286604: Update InputStream and OutputStream to use @implSpec

2022-05-11 Thread liach
On Wed, 11 May 2022 20:40:30 GMT, Joe Darcy wrote: > While doing a CSR review of another issue, I noticed some cases in > InputStream and OutputStream what would benefit from being upgraded to > implSpec and related javadoc tags. > > The "A subclass must provide an implementation of this

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V)

2022-05-06 Thread liach
On Thu, 21 Apr 2022 00:48:00 GMT, Stuart Marks wrote: >> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare >> values by identity. Updated API documentation of these two methods >> ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityH

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V) [v4]

2022-05-06 Thread liach
> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare > values by identity. Updated API documentation of these two methods > ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityHashMap.html#remove(java.lang.Object,java.lang.Object))) > to mention s

Re: RFR: 8285295: Need better testing for IdentityHashMap [v2]

2022-05-04 Thread liach
On Wed, 4 May 2022 14:57:19 GMT, Jaikiran Pai wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Assertions over return values. Some refinement of equals() testing. >> - Add comment about Map.Entry identity not

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V) [v3]

2022-04-29 Thread liach
> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare > values by identity. Updated API documentation of these two methods > ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityHashMap.html#remove(java.lang.Object,java.lang.Object))) > to mention s

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-29 Thread liach
On Sun, 17 Apr 2022 16:17:30 GMT, liach wrote: > Convert dynamic proxies to hidden classes. Modifies the serialization of > proxies (requires change in "Java Object Serialization Specification"). Makes > the proxies hidden in stack traces. Removes duplicate logi

Re: RFR: 8284640: CollectorImpl class could be a record class

2022-04-27 Thread liach
On Mon, 11 Apr 2022 13:08:43 GMT, altrisi wrote: > Changes the definition of `CollectorImpl` to be a record. src/java.base/share/classes/java/util/stream/Collectors.java line 197: > 195: * @param the type of the result > 196: */ > 197: static record CollectorImpl(Supplier

Re: RFR: 8285295: Need better testing for IdentityHashMap

2022-04-26 Thread liach
On Fri, 22 Apr 2022 03:37:27 GMT, Stuart Marks wrote: > Basic but fairly comprehensive set of tests for `IdentityHashMap`. The patch > in the bug report that breaks `IdentityHashMap` now causes several cases in > this new test to fail. There's more that could be done, but the new tests >

Re: RFR: 8285658: Fix two typos in the spec of j.u.random.RandomGenerator [v2]

2022-04-26 Thread liach
On Tue, 26 Apr 2022 16:55:44 GMT, Raffaello Giulietti wrote: >> The spec of the interface `java.util.random.RandomGenerator` is slightly >> incorrect when it discusses `float` and `double` random values. > > Raffaello Giulietti has updated the pull request incrementally with one > additional

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V)

2022-04-21 Thread liach
On Thu, 21 Apr 2022 00:48:00 GMT, Stuart Marks wrote: >> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare >> values by identity. Updated API documentation of these two methods >> ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityH

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V) [v2]

2022-04-20 Thread liach
> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare > values by identity. Updated API documentation of these two methods > ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityHashMap.html#remove(java.lang.Object,java.lang.Object))) > to mention s

Re: RFR: 8284942: Proxy building can just iterate superinterfaces once [v2]

2022-04-20 Thread liach
g the module. > > Split from #8278. Helpful for moving proxies to hidden classes, but is a good > cleanup on its own. liach has updated the pull request incrementally with one additional commit since the last revision: Don't need to complexify module cache - Ch

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V)

2022-04-20 Thread liach
On Thu, 21 Apr 2022 01:01:25 GMT, Stuart Marks wrote: >> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare >> values by identity. Updated API documentation of these two methods >> ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityH

Re: RFR: 8284638: store skip buffers in InputStream Object [v9]

2022-04-20 Thread liach
On Wed, 20 Apr 2022 16:30:19 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > remove uselsee

Re: RFR: 8284638: store skip buffers in InputStream Object [v8]

2022-04-20 Thread liach
On Wed, 20 Apr 2022 16:07:17 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > remove useless

Re: RFR: 8284638: store skip buffers in InputStream Object [v7]

2022-04-19 Thread liach
On Fri, 15 Apr 2022 18:56:37 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: &

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V)

2022-04-19 Thread liach
On Fri, 15 Apr 2022 05:58:32 GMT, liach wrote: > Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare > values by identity. Updated API documentation of these two methods > ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityHashMap.html#remove(java.la

Re: RFR: 8284780: Need methods to create pre-sized HashSet and LinkedHashSet [v4]

2022-04-19 Thread liach
On Tue, 19 Apr 2022 20:15:08 GMT, XenoAmess wrote: >> as title. > > XenoAmess has refreshed the contents of this pull request, and previous > commits have been removed. The incremental views will show differences > compared to the previous content of the PR. The pull request contains two new

Re: RFR: 8284638: store skip buffers in InputStream Object [v7]

2022-04-19 Thread liach
On Tue, 19 Apr 2022 18:04:03 GMT, XenoAmess wrote: > Reader uses a lock object and it appears that InputStream locks on this (per > make/reset) I would assume now that you have some object member fields you > need to hold some lock while accessing those. Even though single thread > access

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-19 Thread liach
On Sun, 17 Apr 2022 16:17:30 GMT, liach wrote: > Convert dynamic proxies to hidden classes. Modifies the serialization of > proxies (requires change in "Java Object Serialization Specification"). Makes > the proxies hidden in stack traces. Removes duplicate logi

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-18 Thread liach
On Mon, 18 Apr 2022 20:42:48 GMT, Remi Forax wrote: > The third parameter of defineProxy() is a lambda which is called for each > method that can be overriden, either toString/equals/hashCode but also any > default methods, if the lambda return true, the method is overriden, otherwise the

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-18 Thread liach
On Sun, 17 Apr 2022 16:17:30 GMT, liach wrote: > Convert dynamic proxies to hidden classes. Modifies the serialization of > proxies (requires change in "Java Object Serialization Specification"). Makes > the proxies hidden in stack traces. Removes duplicate logi

RFR: 8284942: Proxy building can just iterate superinterfaces once

2022-04-18 Thread liach
Currently, in ProxyBuilder::mapToModule and ProxyBuilder::defineProxyClass, the interfaces are iterated twice. The two passes can be merged into one, yielding the whole proxy definition context (module, package, whether there's package-private interface) when determining the module. Split from

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-17 Thread liach
On Sun, 17 Apr 2022 16:17:30 GMT, liach wrote: > Convert dynamic proxies to hidden classes. Modifies the serialization of > proxies (requires change in "Java Object Serialization Specification"). Makes > the proxies hidden in stack traces. Removes duplicate logi

RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-17 Thread liach
Convert dynamic proxies to hidden classes. Modifies the serialization of proxies (requires change in "Java Object Serialization Specification"). Makes the proxies hidden in stack traces. Removes duplicate logic in proxy building. The main compatibility changes and their rationales are: 1.

Re: RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V)

2022-04-15 Thread liach
On Fri, 15 Apr 2022 13:53:59 GMT, ExE Boss wrote: >> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare >> values by identity. Updated API documentation of these two methods >> ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityH

RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V)

2022-04-15 Thread liach
Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare values by identity. Updated API documentation of these two methods to mention such behavior. - Commit messages: - Fix indent - 8178355: IdentityHashMap uses identity-based comparison for values

Re: RFR: 8284638: store skip buffers in InputStream Object [v6]

2022-04-14 Thread liach
On Thu, 14 Apr 2022 18:52:25 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > refine jmh Now this

Re: RFR: 8284638: store skip buffers in InputStream Object [v4]

2022-04-13 Thread liach
On Wed, 13 Apr 2022 21:58:06 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > add jmh

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

2022-04-13 Thread liach
On Wed, 13 Apr 2022 21:12:40 GMT, ExE Boss wrote: >> Joe Darcy 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 26 additional commits >> since

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

2022-04-13 Thread liach
On Sat, 5 Mar 2022 19:54:44 GMT, Joe Darcy wrote: >> This is an early review of changes to better model JVM access flags, that is >> "modifiers" like public, protected, etc. but explicitly at a VM level. >> >> Language level modifiers and JVM level access flags are closely related, but >>

Re: RFR: 8284638: store skip buffers in InputStream Object [v3]

2022-04-13 Thread liach
On Wed, 13 Apr 2022 14:56:12 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > moving nr

Re: RFR: 8284638: store skip buffers in InputStream Object [v3]

2022-04-13 Thread liach
On Wed, 13 Apr 2022 14:56:12 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > moving nr

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread liach
On Wed, 13 Apr 2022 14:45:31 GMT, Roger Riggs wrote: >> src/java.base/share/classes/java/io/InputStream.java line 557: >> >>> 555: >>> 556: while (remaining > 0) { >>> 557: nr = read(skipBuffer, 0, (int)Math.min(size, remaining)); >> >> I recommend moving `nr` declaration

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-12 Thread liach
On Tue, 12 Apr 2022 22:15:22 GMT, XenoAmess wrote: > What subclasses of InputStream in the JDK do not override skip(n)? >From a peek, the majority of subclasses do not override `skip(long)`. Most >overrides are delegations or optimizations for random access structures; but >there are some

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-12 Thread liach
On Tue, 12 Apr 2022 22:19:18 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > add

Re: RFR: 8284702: Add @since for java.time.LocalDate.EPOCH

2022-04-11 Thread liach
On Tue, 12 Apr 2022 03:21:00 GMT, Glavo wrote: > `java.time.LocalDate.EPOCH` was introduced in Java 9, but there is no > corresponding `@since` in the javadoc. The absence of `@since` makes it > impossible for IDEs to check for misuse of it, it may be misused by users > targeting Java 8 and

Re: RFR: 8284638: store skip buffers in InputStream Object

2022-04-11 Thread liach
On Mon, 11 Apr 2022 22:31:01 GMT, Brian Burkhalter wrote: > Even so, it does appear that prior buffer allocations could be "lost" due to > concurrent use of skip resulting in a "minor" memory leak in the heap. The minor leak, though maybe somewhat wasteful, is the necessary cost for thread

Re: RFR: 8284638: store skip buffers in InputStream Object

2022-04-11 Thread liach
On Sat, 9 Oct 2021 17:08:50 GMT, XenoAmess wrote: > in extream situation, when doing this.skipBuffer = skipBuffer in Thread B, it > might make this.skipBuffer to a byte[6] in thread A, and thus cause a > IndexOutofBoundException in Thread A. No, it won't. The later `skipBuffer` references are

Re: RFR: 8284638: store skip buffers in InputStream Object

2022-04-11 Thread liach
On Fri, 8 Oct 2021 21:19:36 GMT, XenoAmess wrote: > @jmehrens what about this then? > I think it safe now(actually this mechanism is learned from Reader) You should really post your changes to jdk-dev at openjdk.java.net before submitting these so you can know if a change is potentially good

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-09 Thread liach
On Sat, 9 Apr 2022 15:25:47 GMT, XenoAmess wrote: > > Quick question: If the maps are intended to be fixed-size, can't the users > > just call `new HashMap<>(size, 1)`, increasing the growth factor to prevent > > growth? > > @liach this questions equals quest

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-08 Thread liach
On Wed, 6 Apr 2022 16:02:31 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > use (double) DEFAULT_LOAD_FACTOR instead of 0.75 Quick question: If the

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-05 Thread liach
On Wed, 6 Apr 2022 01:13:11 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/LinkedHashMap.java line 804: >> >>> 802: * @since 19 >>> 803: */ >>> 804: public static LinkedHashMap newLinkedHashMap(int >>> numMappings) { >> >> `LinkedHashMap` may be often

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-05 Thread liach
On Sat, 2 Apr 2022 22:46:19 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in jdk.compile

Re: RFR: JDK-8282798 java.lang.runtime.Carrier [v17]

2022-03-29 Thread liach
On Tue, 29 Mar 2022 13:58:56 GMT, ExE Boss wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add condy static methods > > src/java.base/share/classes/java/lang/runtime/Carrier.java line 335: > >> 333:

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

2022-03-26 Thread liach
On Thu, 10 Mar 2022 08:52:17 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

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-26 Thread liach
On Sat, 26 Mar 2022 12:14:25 GMT, XenoAmess wrote: >> src/java.base/share/classes/java/util/HashMap.java line 2584: >> >>> 2582: >>> 2583: /** >>> 2584: * Creates a new, empty HashMap with an initial table size >> >> You probably wanna allow for a non-NEW instance for the corner case

Re: RFR: 8282178: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-03-24 Thread liach
On Wed, 23 Feb 2022 22:33:42 GMT, liach wrote: > Replaces simple `for (Map.Entry entry : map.entrySet())` with > `map.forEach((k, v) ->)` calls. This change is better for thread-safety and > reduces allocation for some map implementations. > > A more in-depth descr

  1   2   3   >