Re: RFR: 8268192: LambdaMetafactory with invokespecial causes VerificationError

2021-06-07 Thread liach
On Mon, 7 Jun 2021 23:58:44 GMT, Dan Smith wrote: > Small bug fix. src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java line 191: > 189: useImplMethodHandle = > (Modifier.isProtected(implInfo.getModifiers()) && > 190:

Re: RFR: 8265130: Make ConstantDesc class hierarchy sealed [v3]

2021-05-20 Thread liach
On Thu, 20 May 2021 22:13:51 GMT, Gavin Bierman wrote: >> Hi all, >> >> Please review this patch to make the ConstantDesc hierarchy `sealed`, as was >> promised in its Javadoc, now that sealed classes are finalising in JDK 17. >> >> Thanks, >> Gavin > > Gavin Bierman has updated the pull

Re: RFR: 8268113: Re-use Long.hashCode() where possible

2021-06-02 Thread liach
On Wed, 2 Jun 2021 14:10:38 GMT, Сергей Цыпанов wrote: > There is a few JDK classes duplicating the contents of Long.hashCode() for > hash code calculation. They should explicitly delegate to Long.hashCode(). src/java.base/share/classes/java/lang/Double.java line 881: > 879: public

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-05-24 Thread liach
On Mon, 24 May 2021 07:13:29 GMT, Сергей Цыпанов wrote: >> Just for completeness, they're using the add-exports: >> https://github.com/AdoptOpenJDK/IcedTea-Web/blob/master/launchers/itw-modularjdk.args#L19 > > Should we then revert the changes to `JarIndex`? But don't people access these

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-05-24 Thread liach
On Mon, 24 May 2021 10:13:55 GMT, Сергей Цыпанов wrote: >> But don't people access these internal code at their own risk, as jdk may >> change these code at any time without notice? > > True, I just wonder whether it's OK to change internals when we know for sure > that this breaks 3rd party

Re: RFR: 8174222: LambdaMetafactory: validate inputs and improve documentation [v2]

2021-06-03 Thread liach
On Thu, 3 Jun 2021 20:40:23 GMT, Dan Smith wrote: >> Standardizes and better specifies the errors thrown by LambdaMetafactory, >> including for inputs that would not be generated by javac. >> >> Does some renaming of core parameters/fields to better reflect their purpose. >> >> In the

Re: RFR: 8264032: Improve thread safety of Runtime.version()

2021-03-23 Thread liach
On Tue, 23 Feb 2021 16:46:06 GMT, Andrey Turbanov wrote: > There are 2 separate reads of fields. First can return non-null value, while > second still can get null Can this really happen? If this `version` field has been updated, its value is definitely no longer `null`. And before the

Re: RFR: 8264032: Improve thread safety of Runtime.version()

2021-03-23 Thread liach
On Tue, 23 Feb 2021 13:23:44 GMT, Andrey Turbanov wrote: > Avoid double-read non volatile static field This shouldn't be a problem. Version is a pojo and value based, and the computed result may be different instances but would return `true` for `equals` and should have no problems

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-03-14 Thread liach
On Fri, 26 Feb 2021 10:48:33 GMT, Сергей Цыпанов wrote: > The usage of `LinkedList` is senseless and can be replaced with either > `ArrayList` or `ArrayDeque` which are both more compact and effective. > > jdk:tier1 and jdk:tier2 are both ok Are linked lists worse for addition even in cases

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-03-14 Thread liach
On Sun, 14 Mar 2021 14:58:11 GMT, Yi Yang wrote: >> The usage of `LinkedList` is senseless and can be replaced with either >> `ArrayList` or `ArrayDeque` which are both more compact and effective. >> >> jdk:tier1 and jdk:tier2 are both ok > >

Re: RFR: 8263102: Expand documention of Method.isBridge

2021-03-06 Thread liach
On Fri, 5 Mar 2021 21:25:20 GMT, Joe Darcy wrote: > The existing documentation of Method.isBridge isn't terribly helpful to the > reader. This RFE proposes to given a common example of how bridge methods are > used. The JLS does *not* have a section discussing bridge methods in detail; >

Re: RFR: 8263102: Expand documention of Method.isBridge [v2]

2021-03-08 Thread liach
On Tue, 9 Mar 2021 01:58:38 GMT, Stuart Marks wrote: >> Joe Darcy has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Improve linkage for isSynethetic. > > src/java.base/share/classes/java/lang/reflect/Method.java line 597: > >> 595:

Re: RFR: 8247918: Clarify Reader.skip behavior for end of stream [v2]

2021-02-12 Thread liach
On Fri, 12 Feb 2021 16:11:58 GMT, Roger Riggs wrote: >> Brian Burkhalter has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8247918: Change'ns' to 'n' in the skip doc > > The use of @ inheritdoc causes some unexpected changes in the

Re: RFR: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized*

2021-02-16 Thread liach
On Tue, 16 Feb 2021 23:18:55 GMT, Claes Redestad wrote: >> Modify the `unmodifiable*` methods in `java.util.Collections` to be >> idempotent. That is, when given an immutable collection from >> `java.util.ImmutableCollections` or `java.util.Collections`, these methods >> will return the

Re: RFR: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized*

2021-02-17 Thread liach
On Wed, 17 Feb 2021 14:21:37 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/util/Collections.java line 1473: >> >>> 1471: public static Map unmodifiableMap(Map>> extends V> m) { >>> 1472: if(m.getClass() == UnmodifiableMap.class || >>> 1473:m.getClass()

Re: RFR: 8261880: Change nested classes in java.base to static nested classes where possible [v2]

2021-02-17 Thread liach
On Wed, 17 Feb 2021 16:32:39 GMT, Сергей Цыпанов wrote: >> src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java >> line 192: >> >>> 190: >>> 191: /* Placeholder class for DelegatingMethodHandles generated ahead >>> of time */ >>> 192: static final class Holder {}

Re: RFR: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized* [v3]

2021-02-20 Thread liach
On Wed, 17 Feb 2021 19:56:01 GMT, Ian Graves wrote: >> Modify the `unmodifiable*` methods in `java.util.Collections` to be >> idempotent. That is, when given an immutable collection from >> `java.util.ImmutableCollections` or `java.util.Collections`, these methods >> will return the reference

Re: RFR: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized* [v3]

2021-02-18 Thread liach
On Thu, 18 Feb 2021 16:18:42 GMT, jmehrens wrote: >> Yes -- I think in response to this it makes more sense to pull the >> `ImmutableCollections` classes out for now and only focus on the wrapping of >> the classes within `Collections` so we aren't blocked by studying and >> rectifying these

Re: RFR: 8271820: Implementation of JEP 416: Reimplement Core Reflection with Method Handle [v3]

2021-08-21 Thread liach
On Sat, 21 Aug 2021 22:37:05 GMT, Mandy Chung wrote: >> This reimplements core reflection with method handles. >> >> For `Constructor::newInstance` and `Method::invoke`, the new implementation >> uses `MethodHandle`. For `Field` accessor, the new implementation uses >> `VarHandle`.For

Re: RFR: 8272137: Make Collection and Optional classes streamable

2021-08-17 Thread liach
On Mon, 9 Aug 2021 12:28:23 GMT, CC007 wrote: > create Streamable and ParallelStreamable interface and use them in Collection > and Optional With modern java, you can always create a `Streamable` on your own (and have specifications/documentations that a simple `Supplier` lacks) and

Re: RFR: 8272137: Make Iterable classes streamable

2021-08-13 Thread liach
On Mon, 9 Aug 2021 12:28:23 GMT, CC007 wrote: > create Streamable and ParallelStreamable interface and use them in Collection > and Optional Aren't all iterable implementations effectively streamable if they properly implement `spliterator`? And the spliterator implementation can always be

Re: RFR: 8272137: Make Collection and Optional classes streamable

2021-08-16 Thread liach
On Mon, 9 Aug 2021 12:28:23 GMT, CC007 wrote: > create Streamable and ParallelStreamable interface and use them in Collection > and Optional You can view the mailing lists at https://mail.openjdk.java.net/mailman/listinfo and subscribe there. If you want to send a mail, just send one to say

Re: RFR: JDK-8272192 Shortcut String equality checks by checking equality of the value array

2021-09-04 Thread liach
On Sat, 4 Sep 2021 11:59:58 GMT, q2q-2q2 wrote: > Shortcut String equality checks by checking equality of the value array src/java.base/share/classes/java/lang/String.java line 1964: > 1962: public boolean equalsIgnoreCase(String anotherString) { > 1963: if (anotherString != null)

Re: RFR: 8274715: Implement forEach in Collections.CopiesList

2021-10-04 Thread liach
On Thu, 11 Feb 2021 13:28:49 GMT, Сергей Цыпанов wrote: > Originally was proposed by Zheka Kozlov here: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057192.html > > Just a tiny optimization: we can use for-i loop instead of > `Iterable.forEach()` which is relying on

Re: RFR: 4890732: GZIPOutputStream doesn't support optional GZIP fields [v12]

2021-09-27 Thread liach
On Mon, 6 Sep 2021 07:20:11 GMT, Lin Zang wrote: >> 4890732: GZIPOutputStream doesn't support optional GZIP fields > > Lin Zang has updated the pull request with a new target base due to a merge > or a rebase. The pull request now contains 17 commits: > > - Merge branch 'master' into

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap

2021-12-04 Thread liach
On Wed, 24 Nov 2021 05:16:40 GMT, liach wrote: > Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` > `merge` would throw CME if the functions modified the map itself, and there > are corresponding specification changes. Since I don't have an account on t

RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe

2021-12-18 Thread liach
Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), by design, duplicate initialization of ReflectionFactory should be safe as it performs side-effect-free property read actions, and the suggesting of making the `initted` field volatile cannot prevent concurrent

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v2]

2021-12-18 Thread liach
problems with this > patch, as I am relatively inexperienced in this field of fences and there are > relatively less available documents. (Thanks to > https://shipilev.net/blog/2014/on-the-fence-with-dependencies/) liach has updated the pull request incrementally with one additi

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v2]

2021-12-18 Thread liach
On Sun, 19 Dec 2021 05:56:55 GMT, David Holmes wrote: >> liach has updated the pull request incrementally with one additional commit >> since the last revision: >> >> Just use volatile directly to ensure read order > > src/java.base/share/classes/jdk/internal/

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v2]

2021-12-19 Thread liach
On Sun, 19 Dec 2021 08:45:02 GMT, Alan Bateman wrote: >> liach has updated the pull request incrementally with one additional commit >> since the last revision: >> >> Just use volatile directly to ensure read order > > src/java.base/share/classes/jdk/internal/

Re: RFR: 8261404: Class.getReflectionFactory() is not thread-safe [v2]

2021-12-17 Thread liach
On Thu, 16 Dec 2021 21:38:30 GMT, liach wrote: >> Simply changes this to only read the static field once to prevent `null` on >> second read. > > liach has updated the pull request incrementally with two additional commits > since the last revision: > > - sorry, r

Integrated: 8261404: Class.getReflectionFactory() is not thread-safe

2021-12-17 Thread liach
On Thu, 16 Dec 2021 21:04:58 GMT, liach wrote: > Simply changes this to only read the static field once to prevent `null` on > second read. This pull request has now been integrated. Changeset: 905b7639 Author: liach Committer: Mandy Chung URL: https://git.openjdk.java.n

RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap

2021-11-23 Thread liach
Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` `merge` would throw CME if the functions modified the map itself, and there are corresponding specification changes. - Commit messages: - Also test cme for identity hash map - Fix putIfAbsent - JDK-8277520:

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-16 Thread liach
On Tue, 16 Nov 2021 05:24:38 GMT, Vicente Romero wrote: > Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much

Re: RFR: JDK-8277095 : Empty streams create too many objects

2021-11-15 Thread liach
On Fri, 5 Nov 2021 12:53:46 GMT, kabutz wrote: > This is a draft proposal for how we could improve stream performance for the > case where the streams are empty. Empty collections are common-place. If we > iterate over them with an Iterator, we would have to create one small > Iterator object

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap [v2]

2021-12-16 Thread liach
> Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` > `merge` would throw CME if the functions modified the map itself, and there > are corresponding specification changes. liach has updated the pull request with a new target base due to a merge or

RFR: 8261404: Class.getReflectionFactory() is not thread-safe

2021-12-16 Thread liach
Simply changes this to only read the static field once to prevent `null` on second read. - Commit messages: - 8261404: Class.getReflectionFactory() is not thread-safe Changes: https://git.openjdk.java.net/jdk/pull/6870/files Webrev:

Re: RFR: 8261404: Class.getReflectionFactory() is not thread-safe [v2]

2021-12-16 Thread liach
> Simply changes this to only read the static field once to prevent `null` on > second read. liach has updated the pull request incrementally with two additional commits since the last revision: - sorry, reintroduced the bug in last patch - choose a concise name for the loc

Re: RFR: 8213905: reflection not working for type annotations applied to exception types in the inner class constructor

2021-12-16 Thread liach
On Thu, 16 Dec 2021 17:44:04 GMT, Vicente Romero wrote: > Hi, > > Please review this change that is fixing a bug in reflection in particular in > `sun.reflect.annotation.TypeAnnotationParser::buildAnnotatedTypes` the > current code is assuming that for inner class constructors it is always >

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap

2021-12-14 Thread liach
On Wed, 24 Nov 2021 05:16:40 GMT, liach wrote: > Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` > `merge` would throw CME if the functions modified the map itself, and there > are corresponding specification changes. Just curious, what else is re

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap [v2]

2022-01-13 Thread liach
On Thu, 16 Dec 2021 20:48:39 GMT, liach wrote: >> Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` >> `merge` would throw CME if the functions modified the map itself, and there >> are corresponding specification changes. > > liach has updated the

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v2]

2022-01-17 Thread liach
On Sun, 19 Dec 2021 06:51:45 GMT, liach wrote: >> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), >> by design, duplicate initialization of ReflectionFactory should be safe as >> it performs side-effect-free property read actions, and the sugges

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v5]

2022-02-10 Thread liach
On Thu, 10 Feb 2022 02:24:43 GMT, liach wrote: >> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), >> by design, duplicate initialization of ReflectionFactory should be safe as >> it performs side-effect-free property read actions, and the sugges

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v7]

2022-02-11 Thread liach
On Fri, 11 Feb 2022 13:51:38 GMT, liach wrote: >> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), >> by design, duplicate initialization of ReflectionFactory should be safe as >> it performs side-effect-free property read actions, and the sugges

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap [v2]

2022-02-11 Thread liach
On Thu, 16 Dec 2021 20:48:39 GMT, liach wrote: >> Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` >> `merge` would throw CME if the functions modified the map itself, and there >> are corresponding specification changes. > > liach has updated the

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v25]

2022-03-04 Thread liach
On Fri, 4 Mar 2022 17:30:48 GMT, XenoAmess wrote: >> 8281631: HashMap copy constructor and putAll can over-allocate table > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > refine test nitpick for the test code: for better

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

2022-03-07 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: 8281631: HashMap copy constructor and putAll can over-allocate table [v27]

2022-03-05 Thread liach
On Sat, 5 Mar 2022 19:06:03 GMT, XenoAmess wrote: >> 8281631: HashMap copy constructor and putAll can over-allocate table > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > refactor tests

RFR: 8283237: CallSite should be a sealed class

2022-03-16 Thread liach
Change `CallSite` to a sealed class, as `CallSite` is an abstract class which does not allow direct subclassing by users per its documentation. Since I don't have a JBS account, I posted the content for the CSR in a GitHub Gist at https://gist.github.com/150d5aa7f8b13a4deddf95969ad39d73 and

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap [v4]

2022-03-16 Thread liach
On Mon, 21 Feb 2022 23:36:19 GMT, liach wrote: >> Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` >> `merge` would throw CME if the functions modified the map itself, and there >> are corresponding specification changes. > > liach has

Re: RFR: 8283237: CallSite should be a sealed class [v2]

2022-03-17 Thread liach
95969ad39d73 and wish someone > can submit a CSR for me. liach has updated the pull request incrementally with one additional commit since the last revision: Swap mutable and volatile in the permits list - Changes: - all: https://git.openjdk.java.net/jdk/pull/7840/files

Re: RFR: 8283237: CallSite should be a sealed class

2022-03-17 Thread liach
On Thu, 17 Mar 2022 06:47:13 GMT, Rémi Forax wrote: >> Change `CallSite` to a sealed class, as `CallSite` is an abstract class >> which does not allow direct subclassing by users per its documentation. >> Since I don't have a JBS account, I posted the content for the CSR in a >> GitHub Gist

Re: RFR: 8279598: Provide adapter from RandomGenerator to Random [v19]

2022-03-17 Thread liach
On Wed, 16 Mar 2022 14:54:41 GMT, Yasser Bazzi wrote: >> Hi, could i get a review on this implementation proposed by Stuart Marks, i >> decided to use the >> https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html >> interface to create the default

Re: RFR: 8283075: Bad IllegalArgumentException message for out of range rank from ClassDesc.arrayType(int) [v2]

2022-03-15 Thread liach
On Tue, 15 Mar 2022 17:09:03 GMT, Joe Darcy wrote: >> src/java.base/share/classes/java/lang/constant/ClassDesc.java line 185: >> >>> 183: netRank = Math.addExact(currentDepth, rank); >>> 184: if (netRank > >>> ConstantUtils.MAX_ARRAY_TYPE_DESC_DIMENSIONS) { >>> 185:

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: 8279598: Provide adapter from RandomGenerator to Random [v19]

2022-03-17 Thread liach
On Wed, 16 Mar 2022 14:54:41 GMT, Yasser Bazzi wrote: >> Hi, could i get a review on this implementation proposed by Stuart Marks, i >> decided to use the >> https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html >> interface to create the default

Re: RFR: 8279598: Provide adapter from RandomGenerator to Random [v19]

2022-03-18 Thread liach
On Fri, 18 Mar 2022 13:06:12 GMT, jmehrens wrote: > > The toString method of both classes do not implement anything so i dont > > think we should override it, > > The inherited implementation is descriptive enough because the the class > names are the implementation: >

Re: RFR: 8279598: Provide adapter from RandomGenerator to Random [v19]

2022-03-18 Thread liach
On Fri, 18 Mar 2022 19:11:45 GMT, jmehrens wrote: > > you are not expected to inspect a random object by its string. > > ToString representations tend to show up in exception messages and logging. > > Seems like this adapter just won't adapt that call. Not a deal breaker. > > > Also the

Re: RFR: 8283237: CallSite should be a sealed class [v2]

2022-03-18 Thread liach
On Fri, 18 Mar 2022 21:05:01 GMT, altrisi wrote: > Note that there's a class in tests (or something similar) that extends > CallSite directly: >

Re: RFR: 8283237: CallSite should be a sealed class [v3]

2022-03-18 Thread liach
95969ad39d73 and wish someone > can submit a CSR for me. liach has updated the pull request incrementally with one additional commit since the last revision: Remove homemade callsite from test - Changes: - all: https://git.openjdk.java.net/jdk/pull/7840/files

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

2022-03-09 Thread liach
On Wed, 9 Mar 2022 08:35:45 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: 8282662: Use List/Set.of() factory methods to reduce memory consumption [v2]

2022-03-09 Thread liach
On Wed, 9 Mar 2022 09:37:30 GMT, Сергей Цыпанов wrote: >> src/java.base/share/classes/java/nio/file/FileTreeIterator.java line 70: >> >>> 68: throws IOException >>> 69: { >>> 70: this.walker = new FileTreeWalker(List.of(options), maxDepth); >> >> Relates to

Re: RFR: 8283067: Incorrect comment in java.base/share/classes/java/util/ArrayList.java

2022-03-12 Thread liach
On Sat, 12 Mar 2022 09:48:14 GMT, xpbob wrote: > * Constructs an empty list with an initial capacity of ten > > => > > * Constructs an empty list with default sized empty instances. > > > private static final Object[] DEFAULTCAPACITY_EMPTY_ELEMENTDATA = {}; > >

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap [v3]

2022-02-21 Thread liach
> Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` > `merge` would throw CME if the functions modified the map itself, and there > are corresponding specification changes. liach has updated the pull request with a new target base due to a merge or

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap [v3]

2022-02-21 Thread liach
On Mon, 21 Feb 2022 22:27:34 GMT, liach wrote: >> Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` >> `merge` would throw CME if the functions modified the map itself, and there >> are corresponding specification changes. > > liach has updated the

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap [v4]

2022-02-21 Thread liach
> Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` > `merge` would throw CME if the functions modified the map itself, and there > are corresponding specification changes. liach has updated the pull request incrementally with two additional commits since the last

Re: RFR: 8279598: Provide adapter from RandomGenerator to Random [v6]

2022-02-22 Thread liach
On Sun, 20 Feb 2022 06:39:26 GMT, liach wrote: >> Yasser Bazzi has updated the pull request incrementally with one additional >> commit since the last revision: >> >> remove missed whitespace > > src/java.base/share/classes/java/util/Random.java line 95: >

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v9]

2022-02-19 Thread liach
problems with this > patch, as I am relatively inexperienced in this field of fences and there are > relatively less available documents. (Thanks to > https://shipilev.net/blog/2014/on-the-fence-with-dependencies/) liach has updated the pull request with a new target base due to a

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v8]

2022-02-19 Thread liach
problems with this > patch, as I am relatively inexperienced in this field of fences and there are > relatively less available documents. (Thanks to > https://shipilev.net/blog/2014/on-the-fence-with-dependencies/) liach has updated the pull request incrementally with one additi

Re: RFR: 8279598: Provide adapter from RandomGenerator to Random [v6]

2022-02-19 Thread liach
On Sun, 20 Feb 2022 03:15:22 GMT, Yasser Bazzi wrote: >> Hi, could i get a review on this implementation proposed by Stuart Marks, i >> decided to use the >> https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html >> interface to create the default

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v21]

2022-02-20 Thread liach
On Sun, 20 Feb 2022 18:08:37 GMT, XenoAmess wrote: >> 8281631: HashMap copy constructor and putAll can over-allocate table > > XenoAmess has updated the pull request incrementally with three additional > commits since the last revision: > > - refine test > - 1. optimize IdentityHashMap that

Re: RFR: 8279598: Provide adapter from RandomGenerator to Random [v9]

2022-02-25 Thread liach
On Fri, 25 Feb 2022 01:13:41 GMT, Yasser Bazzi wrote: >> Hi, could i get a review on this implementation proposed by Stuart Marks, i >> decided to use the >> https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html >> interface to create the default

Re: RFR: 8279598: Provide adapter from RandomGenerator to Random [v6]

2022-02-25 Thread liach
On Tue, 22 Feb 2022 23:19:14 GMT, Marcono1234 wrote: >> Yasser Bazzi has updated the pull request incrementally with one additional >> commit since the last revision: >> >> remove missed whitespace > > src/java.base/share/classes/java/util/Random.java line 298: > >> 296: */ >> 297:

Re: RFR: 8279598: Provide adapter from RandomGenerator to Random [v10]

2022-02-25 Thread liach
On Fri, 25 Feb 2022 23:27:28 GMT, Yasser Bazzi wrote: > I prefered to keep the interface explicit to the reader but this object's goal is to serve as a random than a randomgenerator - PR: https://git.openjdk.java.net/jdk/pull/7001

Re: RFR: 8279598: Provide adapter from RandomGenerator to Random [v11]

2022-02-28 Thread liach
On Mon, 28 Feb 2022 18:49:59 GMT, ExE Boss wrote: >> Yasser Bazzi has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update javadoc > > src/java.base/share/classes/java/util/Random.java line 93: > >> 91: >> 92:

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v9]

2022-02-21 Thread liach
On Sat, 19 Feb 2022 16:06:35 GMT, liach wrote: >> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), >> by design, duplicate initialization of ReflectionFactory should be safe as >> it performs side-effect-free property read actions, and the sugges

Re: RFR: 8261407: ReflectionFactory.checkInitted() is not thread-safe [v9]

2022-02-22 Thread liach
On Sat, 19 Feb 2022 16:06:35 GMT, liach wrote: >> Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), >> by design, duplicate initialization of ReflectionFactory should be safe as >> it performs side-effect-free property read actions, and the sugges

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

2022-02-23 Thread liach
;> A more in-depth description of benefits is available at >> https://mail.openjdk.java.net/pipermail/core-libs-dev/2022-February/086201.html >> and at the JBS issue itself. >> >> A [jmh >> comparison](https://jmh.morethan.io/?sources=https://gist.g

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

2022-02-23 Thread liach
ibs-dev/2022-February/086201.html and at the JBS issue itself. A [jmh comparison](https://jmh.morethan.io/?sources=https://gist.githubusercontent.com/liach/0c0f79f0c0b9b78f474d65cda2c5f7b5/raw/4f2a160c51164aefdfac6ab5a19bdbc8c65f5fcf/base-results.json,https://gist.githubusercontent.com/li

Integrated: 8261407: ReflectionFactory.checkInitted() is not thread-safe

2022-02-22 Thread liach
On Sun, 19 Dec 2021 03:21:55 GMT, liach wrote: > Upon review of [8261407](https://bugs.openjdk.java.net/browse/JDK-8261407), > by design, duplicate initialization of ReflectionFactory should be safe as it > performs side-effect-free property read actions, and the suggesting

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v21]

2022-02-20 Thread liach
On Sun, 20 Feb 2022 18:08:24 GMT, XenoAmess wrote: > I don't thik it reasonable. or is there eveidence it be? If this map is too dense, there may be a lot of hash collisions, and the lookup performance would decrease because this hashmap is linear probe than red-black tree buckets like the

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v21]

2022-02-20 Thread liach
yHashMap(Map map, int >>> expectedSize) { >> >> Why are you writing a new constructor when you can just change the old call >> to `this(m.size());`? > >> @liach implementations `size()` seems O1, and returns a single int number >> field, but it actually defer

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v21]

2022-02-20 Thread liach
On Sun, 20 Feb 2022 19:08:39 GMT, liach wrote: >>> @liach implementations `size()` seems O1, and returns a single int number >>> field, but it actually defers in some Map implementations. >> >> @liach for example, in ConcurrentSkipListMap and ConcurrentHashMap

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v21]

2022-02-20 Thread liach
ct allocation-wise (no >> allocation of immutable entry objects), but that belongs to another issue. > > @liach Hi. please have a look at the latest commit. > do you think it be better now? Oops, didn't notice there was this helpful `init` method. Does look much more straightforwa

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v22]

2022-02-20 Thread liach
arks to see how bad the lookup performance degrades >> > after you saves memory used by the hash table. >> >> OK, would find some time for it. > > @liach which jmh test should I run by the way? > > Or is there some commandline tools for this? > > I found n

Re: RFR: 8283237: CallSite should be a sealed class [v3]

2022-03-22 Thread liach
On Fri, 18 Mar 2022 22:12:10 GMT, liach wrote: >> Change `CallSite` to a sealed class, as `CallSite` is an abstract class >> which does not allow direct subclassing by users per its documentation. >> Since I don't have a JBS account, I posted the content for the CSR in

Re: RFR: 8283237: CallSite should be a sealed class [v4]

2022-03-22 Thread liach
95969ad39d73 and wish someone > can submit a CSR for me. liach has updated the pull request incrementally with one additional commit since the last revision: Revert "Remove homemade callsite from test" This reverts commit 1bcd779f677420326bf365c3580ceab5a6b5e3fa. --

Re: RFR: 8283237: CallSite should be a sealed class [v3]

2022-03-22 Thread liach
On Fri, 18 Mar 2022 22:12:10 GMT, liach wrote: >> Change `CallSite` to a sealed class, as `CallSite` is an abstract class >> which does not allow direct subclassing by users per its documentation. >> Since I don't have a JBS account, I posted the content for the CSR in

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap [v4]

2022-03-19 Thread liach
On Mon, 21 Feb 2022 23:36:19 GMT, liach wrote: >> Might need a CSR as now `computeIfAbsent` `computeIfPresent` `compute` >> `merge` would throw CME if the functions modified the map itself, and there >> are corresponding specification changes. > > liach has

Re: RFR: JDK-8277520: Implement JDK-8 default methods for IdentityHashMap [v4]

2022-03-19 Thread liach
ta set for all test runs to avoid >> contributing to errors? > > @liach I don't have much time to spend on this. Several comments. > > JMH benchmarking is more than a bit of an art. There's a lot of information > in the JMH samples, so I'd recommend going through them

Re: RFR: 8283237: CallSite should be a sealed class [v3]

2022-03-19 Thread liach
On Fri, 18 Mar 2022 22:12:10 GMT, liach wrote: >> Change `CallSite` to a sealed class, as `CallSite` is an abstract class >> which does not allow direct subclassing by users per its documentation. >> Since I don't have a JBS account, I posted the content for the CSR in

Integrated: 8283237: CallSite should be a sealed class

2022-03-23 Thread liach
On Wed, 16 Mar 2022 13:09:30 GMT, liach wrote: > Change `CallSite` to a sealed class, as `CallSite` is an abstract class which > does not allow direct subclassing by users per its documentation. Since I > don't have a JBS account, I posted the content for the CSR in a GitHub Gist &

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

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: 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: JDK-8282798 java.lang.runtime.Carrier [v12]

2022-03-22 Thread liach
On Tue, 22 Mar 2022 13:00:14 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: JDK-8282798 java.lang.runtime.Carrier [v11]

2022-03-22 Thread liach
On Tue, 22 Mar 2022 12:56:02 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/lang/runtime/Carrier.java line 574: >> >>> 572: try { >>> 573: Lookup lookup = MethodHandles.lookup(); >>> 574: return lookup.defineHiddenClass(bytes, false, >>>

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: 8186958: Need method to create pre-sized HashMap

2022-03-23 Thread liach
On Wed, 23 Mar 2022 18:41:59 GMT, XenoAmess wrote: > 8186958: Need method to create pre-sized HashMap test/jdk/java/util/Collections/CalculateHashMapCapacityTestJMH.java line 42: > 40: public class CalculateHashMapCapacityTestJMH { > 41: > 42: private void consume(int tmp) { You should

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

2022-03-23 Thread liach
On Wed, 23 Mar 2022 18:41:59 GMT, XenoAmess wrote: > 8186958: Need method to create pre-sized HashMap src/java.base/share/classes/java/util/Collections.java line 5826: > 5824: * @since 19 > 5825: */ > 5826: public static HashMap newHashMap(int expectedSize) { Stuart [in a JBS

  1   2   3   >