RFR: 8332749: Broken link in MemorySegment.Scope.html

2024-05-23 Thread Per Minborg
This PR proposes to fix a broken link in the `MemorySegment.Scope` class. - Commit messages: - Fix link to section Changes: https://git.openjdk.org/jdk/pull/19366/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19366&range=00 Issue: https://bugs.openjdk.org/browse/JDK-833

Re: RFR: 8332749: Broken link in MemorySegment.Scope.html

2024-05-23 Thread Per Minborg
On Thu, 23 May 2024 11:39:11 GMT, Per Minborg wrote: > This PR proposes to fix a broken link in the `MemorySegment.Scope` class. Seams to work after the patch: ![image](https://github.com/openjdk/jdk/assets/7457876/6a48599b-0e08-40b0-938e-f7cb13b74ae6) .../api/java.base/java/lang/fore

Integrated: 8332749: Broken link in MemorySegment.Scope.html

2024-05-23 Thread Per Minborg
On Thu, 23 May 2024 11:39:11 GMT, Per Minborg wrote: > This PR proposes to fix a broken link in the `MemorySegment.Scope` class. This pull request has now been integrated. Changeset: 0a9d1f8c Author: Per Minborg URL: https://git.openjdk.org/jdk/com

Re: RFR: 8328821: Map.of().entrySet() mutators should throw UnsupportedOperationException

2024-05-27 Thread Per Minborg
On Wed, 27 Mar 2024 17:36:28 GMT, Liam Miller-Cushon wrote: > This change overrides mutator methods in the implementation returned by > `Map.of().entrySet()` to throw `UnsupportedOperationException`. src/java.base/share/classes/java/util/ImmutableCollections.java line 1323: > 1321:

Re: RFR: 8292955: Collections.checkedMap Map.merge does not properly check key and value [v3]

2024-05-27 Thread Per Minborg
On Mon, 27 May 2024 12:40:07 GMT, Chen Liang wrote: > @minborg Is it possible for you to review this collection bugfix? Will do! Thanks for the heads up. - PR Comment: https://git.openjdk.org/jdk/pull/18141#issuecomment-2134446236

Re: RFR: 8292955: Collections.checkedMap Map.merge does not properly check key and value [v3]

2024-05-27 Thread Per Minborg
On Thu, 7 Mar 2024 05:33:16 GMT, Lei Zhu wrote: >> When the specified key did not associated with a value, should check the >> `key` and `value` type. > > Lei Zhu has updated the pull request incrementally with one additional commit > since the last revision: > > Use testNG builtin functiona

Re: RFR: 8333236: Test java/foreign/TestAccessModes.java is timing out after passing [v2]

2024-05-31 Thread Per Minborg
On Fri, 31 May 2024 16:18:33 GMT, Maurizio Cimadamore wrote: >> This PR restores a var handle cache in `Utils::makeSegmentViewVarHandle`. >> The cache was moved to `ValueLayouts::varHandle` as part of >> [pull/19251](https://git.openjdk.org/jdk/pull/19251), on the basis that we >> want to opt

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread Per Minborg
On Wed, 29 May 2024 15:20:15 GMT, Chen Liang wrote: >> This was something that I tried and I observed a performance regression on >> the ARM platform that I was testing. From my understanding, `@Stable` tells >> the compiler to trust the contents of this field which is only given when >> the f

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread Per Minborg
On Wed, 5 Jun 2024 13:37:15 GMT, Per Minborg wrote: >> Interesting, don't know about hotspot internals so I can't diagnose the >> exact cause of this regression. > > In order to be eligible for constant folding, the benchmark must declare the > `Method ha

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread Per Minborg
On Wed, 5 Jun 2024 13:41:10 GMT, Per Minborg wrote: >> In order to be eligible for constant folding, the benchmark must declare the >> `Method hashCodeMethod;` as `static final`. >> >> It is hard for me to understand why a `@Stable` annotation should have a >>

Re: RFR: 8333774: Avoid eagerly loading various EmptySpliterator classes [v3]

2024-06-07 Thread Per Minborg
On Fri, 7 Jun 2024 13:08:24 GMT, Claes Redestad wrote: >> Trivially move a few private static finals to their respective source type >> to avoid eagerly loading a few small classes. > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revisio

Re: RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe [v2]

2024-06-10 Thread Per Minborg
On Mon, 10 Jun 2024 03:51:40 GMT, Glavo wrote: >> Things have changed since https://github.com/openjdk/jdk/pull/14636 was >> closed, so let me reopen it. >> >> https://github.com/openjdk/jdk/pull/15386 confirmed that `VarHandle` in BALE >> caused a startup regression. In order to not have any

Re: RFR: 8330465: Stable Values and Collections (Internal) [v20]

2024-06-10 Thread Per Minborg
On Fri, 17 May 2024 09:31:33 GMT, Per Minborg wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are

Withdrawn: 8330465: Stable Values and Collections (Internal)

2024-06-10 Thread Per Minborg
On Tue, 16 Apr 2024 11:47:23 GMT, Per Minborg wrote: > # Stable Values & Collections (Internal) > > ## Summary > This PR proposes to introduce an internal _Stable Values & Collections_ API, > which provides immutable value holders where elements are initialized _at >

RFR: 8333884: MemorySegment::reinterpret removes read-only property

2024-06-10 Thread Per Minborg
This PR proposes to retain the read-only state when any of the `MemorySegment::reinterpret` methods is called. Previously, the read-only state was lost and the returned `MemorySegment` was always writable regardless of the original segment's read-only state. - Commit messages: - M

Re: RFR: 8333884: MemorySegment::reinterpret removes read-only property [v2]

2024-06-10 Thread Per Minborg
> This PR proposes to retain the read-only state when any of the > `MemorySegment::reinterpret` methods is called. > > Previously, the read-only state was lost and the returned `MemorySegment` was > always writable regardless of the original segment's read-only state. Per

Re: RFR: 8333884: MemorySegment::reinterpret removes read-only property [v2]

2024-06-10 Thread Per Minborg
On Mon, 10 Jun 2024 13:45:16 GMT, Maurizio Cimadamore wrote: > Note that `asSlice` methods also lacks a similar guarantee on read-only (but > the impl works fine there) Even though not mentioned in the original issue, we could add documentation for this here as well. Or maybe via https://bugs

Re: RFR: 8333884: MemorySegment::reinterpret removes read-only property [v3]

2024-06-10 Thread Per Minborg
> This PR proposes to retain the read-only state when any of the > `MemorySegment::reinterpret` methods is called. > > Previously, the read-only state was lost and the returned `MemorySegment` was > always writable regardless of the original segment's read-only state. Per

RFR: 8333886: Explicitly specify that asSlice and reinterpret return a memory segment backed by the same region of memory.

2024-06-10 Thread Per Minborg
This PR proposes to explicitly state that returned segments form the `asSlice` and `reinterpret` method share memory regions with `this` memory segment. Note: The term "subset" means a true subset or the same set. - Commit messages: - Add segments share the same backing store in d

Re: RFR: 8316493: Remove the caching fields in AbstractMap [v11]

2024-06-10 Thread Per Minborg
On Fri, 10 Nov 2023 08:17:22 GMT, Per Minborg wrote: >> This PR outlines a solution for making immutable maps `@ValueBased` by >> removing cacheing of certain values in `AbstractMap`. >> >> By removing these caching fields in `AbstractMap`, we can make the immutable &

Re: RFR: 8333886: Explicitly specify that asSlice and reinterpret return a memory segment backed by the same region of memory.

2024-06-11 Thread Per Minborg
On Mon, 10 Jun 2024 15:45:07 GMT, Per Minborg wrote: > This PR proposes to explicitly state that returned segments form the > `asSlice` and `reinterpret` method share memory regions with `this` memory > segment. > > Note: The term "subset" means a true subset

Re: RFR: 8333886: Explicitly specify that asSlice and reinterpret return a memory segment backed by the same region of memory. [v2]

2024-06-11 Thread Per Minborg
> This PR proposes to explicitly state that returned segments form the > `asSlice` and `reinterpret` method share memory regions with `this` memory > segment. > > Note: The term "subset" means a true subset or the same set. Per Minborg has updated the pull reque

Integrated: 8333886: Explicitly specify that asSlice and reinterpret return a memory segment backed by the same region of memory.

2024-06-12 Thread Per Minborg
On Mon, 10 Jun 2024 15:45:07 GMT, Per Minborg wrote: > This PR proposes to explicitly state that returned segments form the > `asSlice` and `reinterpret` method share memory regions with `this` memory > segment. > > Note: The term "subset" means a true subset or

Re: RFR: 8333884: MemorySegment::reinterpret removes read-only property [v4]

2024-07-05 Thread Per Minborg
> This PR proposes to retain the read-only state when any of the > `MemorySegment::reinterpret` methods is called. > > Previously, the read-only state was lost and the returned `MemorySegment` was > always writable regardless of the original segment's read-only state. Per

Integrated: 8333884: MemorySegment::reinterpret removes read-only property

2024-07-06 Thread Per Minborg
On Mon, 10 Jun 2024 13:18:43 GMT, Per Minborg wrote: > This PR proposes to retain the read-only state when any of the > `MemorySegment::reinterpret` methods is called. > > Previously, the read-only state was lost and the returned `MemorySegment` was > always writable re

Re: RFR: 8337712: Wrong javadoc in java.util.Date#toString(): "61" and right parenthesis

2024-08-02 Thread Per Minborg
On Fri, 2 Aug 2024 07:20:39 GMT, Per Minborg wrote: > This trivial PR proposes to add a missing parenthesis in > `java.util.Date::toString`. src/java.base/share/classes/java/util/Date.java line 1015: > 1013: * {@code 59}), as two decimal digits. > 1014: * {@cod

RFR: 8337712: Wrong javadoc in java.util.Date#toString(): "61" and right parenthesis

2024-08-02 Thread Per Minborg
This trivial PR proposes to add a missing parenthesis in `java.util.Date::toString`. - Commit messages: - Update copyright year - Add missing parenthesis in Date::toString Changes: https://git.openjdk.org/jdk/pull/20439/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=2043

Re: RFR: 8337712: Wrong javadoc in java.util.Date#toString(): "61" and right parenthesis

2024-08-02 Thread Per Minborg
On Fri, 2 Aug 2024 07:24:20 GMT, Per Minborg wrote: >> This trivial PR proposes to add a missing parenthesis in >> `java.util.Date::toString`. > > src/java.base/share/classes/java/util/Date.java line 1015: > >> 1013: * {@code 59}), as two decimal digits. &g

Integrated: 8337712: Wrong javadoc in java.util.Date#toString(): "61" and right parenthesis

2024-08-05 Thread Per Minborg
On Fri, 2 Aug 2024 07:20:39 GMT, Per Minborg wrote: > This trivial PR proposes to add a missing parenthesis in > `java.util.Date::toString`. This pull request has now been integrated. Changeset: 219e1eb1 Author: Per Minborg URL: https://git.openjdk.org/jdk/

Re: RFR: 8337205: Typo in Stack vs Deque Method table in Deque specification

2024-08-06 Thread Per Minborg
On Fri, 26 Jul 2024 21:06:31 GMT, Turkhan wrote: > This PR fixes `java.util.Deque`'s specification to name `peekFirst()` as an > equivalent to Stack's `peek()` method since both of them don't throw when a > collection is empty. This is not the case with the current `getFirst()` > method. > >

Re: RFR: 8338728: Misc issues in memory layout javadoc [v2]

2024-08-23 Thread Per Minborg
On Wed, 21 Aug 2024 13:24:15 GMT, Maurizio Cimadamore wrote: >> This PR fixes two minor issues in the `MemoryLayout` javadoc: >> * the section describing dereference path talks about `P` and `P'` but then >> only uses `P` in the code; >> * the `ceilDiv` math on the `PathElement::sequenceElement

Re: RFR: 8338731: MemoryLayout::offsetHandle can return a negative offset

2024-08-23 Thread Per Minborg
On Wed, 21 Aug 2024 13:26:58 GMT, Maurizio Cimadamore wrote: > When working on startup improvements, I noticed that the method handle > returned by `MemoryLayout::offsetHandle` can overflow if the client calls the > handle with a base offset that is too big. > > In other similar situations, t

RFR: 8338967: Improve performance for MemorySegment::fill

2024-08-26 Thread Per Minborg
The performance of the `MemorySegment::fil` can be improved by replacing the `checkAccess()` method call with calling `checkReadOnly()` instead (as the bounds of the segment itself do not need to be checked). Also, smaller segments can be handled directly by Java code rather than transitioning

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v2]

2024-08-26 Thread Per Minborg
ed to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request incre

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v3]

2024-08-26 Thread Per Minborg
ed to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request incre

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v4]

2024-08-26 Thread Per Minborg
ed to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request incre

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v3]

2024-08-26 Thread Per Minborg
On Mon, 26 Aug 2024 11:59:44 GMT, Per Minborg wrote: >> The performance of the `MemorySegment::fil` can be improved by replacing the >> `checkAccess()` method call with calling `checkReadOnly()` instead (as the >> bounds of the segment itself do not need to be checked). &g

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v4]

2024-08-26 Thread Per Minborg
On Mon, 26 Aug 2024 12:50:53 GMT, Francesco Nigro wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix typo > > src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentIm

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v3]

2024-08-26 Thread Per Minborg
On Mon, 26 Aug 2024 12:07:02 GMT, Per Minborg wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add a comment about the old switch type > > Here is what it looks like for Windows x64: &g

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v4]

2024-08-26 Thread Per Minborg
On Mon, 26 Aug 2024 13:29:40 GMT, Per Minborg wrote: >> src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java >> line 200: >> >>> 198: switch ((int) length) { >>> 199: case 0 : checkReadOnly(f

Re: RFR: 8338979: Avoid bootstrapped switches in the classfile API [v2]

2024-08-26 Thread Per Minborg
On Mon, 26 Aug 2024 13:52:35 GMT, Claes Redestad wrote: >> Noticed these on a few startup tests in code generating proxies. Desugaring >> switch expressions reduce risk of bootstrap circularity from any future >> changes to switch bootstrapping (which itself depends on the classfile API). >> I

RFR: 8333843: Provide methods on MemorySegment to read strings with known lengths

2024-08-27 Thread Per Minborg
This PR proposes to add a new overload to `MemorySegment::getString` whereby it is possible to pass in a known byte length of the content in a segment that should be converted to a String. This is useful in case one already knows the byte length and thereby does not need to scan for a null termi

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v4]

2024-08-27 Thread Per Minborg
On Mon, 26 Aug 2024 21:38:37 GMT, Maurizio Cimadamore wrote: >> Here is a benchmark that fills segments of various random sizes: >> >> >> >> @BenchmarkMode(Mode.AverageTime) >> @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) >> @Measurement(iterations = 10, time = 500, t

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v5]

2024-08-27 Thread Per Minborg
ed to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request with

RFR: 8338489: Typo in MemorySegment doc

2024-08-27 Thread Per Minborg
This trivial PR proposes to fix a typo in the `MemorySegment` docs. - Commit messages: - Fix typo in MemorySegment docs Changes: https://git.openjdk.org/jdk/pull/20727/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20727&range=00 Issue: https://bugs.openjdk.org/browse/JD

Integrated: 8338489: Typo in MemorySegment doc

2024-08-27 Thread Per Minborg
On Tue, 27 Aug 2024 10:42:08 GMT, Per Minborg wrote: > This trivial PR proposes to fix a typo in the `MemorySegment` docs. This pull request has now been integrated. Changeset: 2e96f159 Author: Per Minborg URL: https://git.openjdk.org/jdk/com

Re: RFR: 8338731: MemoryLayout::offsetHandle can return a negative offset [v2]

2024-08-28 Thread Per Minborg
On Tue, 27 Aug 2024 14:45:37 GMT, Maurizio Cimadamore wrote: >> When working on startup improvements, I noticed that the method handle >> returned by `MemoryLayout::offsetHandle` can overflow if the client calls >> the handle with a base offset that is too big. >> >> In other similar situatio

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v5]

2024-08-28 Thread Per Minborg
On Tue, 27 Aug 2024 20:25:46 GMT, Paul Sandoz wrote: > How fast do we need to be here given we are measuring in a few nanoseconds > per operation? > > What if the goal is not to regress from say explicitly filling in a small > sized segment or a comparable array (e.g., < 8 bytes) then maybe a

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v6]

2024-08-28 Thread Per Minborg
ed to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request incre

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v7]

2024-08-28 Thread Per Minborg
ed to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request incre

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v9]

2024-08-30 Thread Per Minborg
ed to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request incre

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v8]

2024-08-30 Thread Per Minborg
ed to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request incre

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v10]

2024-08-30 Thread Per Minborg
ed to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request increm

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v5]

2024-08-30 Thread Per Minborg
On Wed, 28 Aug 2024 15:32:40 GMT, Francesco Nigro wrote: >>> How fast do we need to be here given we are measuring in a few nanoseconds >>> per operation? >>> >>> What if the goal is not to regress from say explicitly filling in a small >>> sized segment or a comparable array (e.g., < 8 bytes)

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v10]

2024-09-02 Thread Per Minborg
On Fri, 30 Aug 2024 10:51:59 GMT, Per Minborg wrote: >> The performance of the `MemorySegment::fil` can be improved by replacing the >> `checkAccess()` method call with calling `checkReadOnly()` instead (as the >> bounds of the segment itself do not need to be checked). &g

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v10]

2024-09-02 Thread Per Minborg
On Fri, 30 Aug 2024 14:15:24 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java >> line 208: >> >>> 206: } >>> 207: final long u = Byte.toUnsignedLong(value); >>> 208: final long longValue = u <

RFR: 8338591: Improve performance of MemorySegment::copy

2024-09-03 Thread Per Minborg
This PR proposes to handle smaller FFM copy operations with Java code rather than transitioning to native code. This will improve performance. In this PR, copy operations involving zero to 63 bytes will be handled by Java code. Here is what it looks like for Windows x64: ![image](https://github

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v11]

2024-09-03 Thread Per Minborg
gated to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request w

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v10]

2024-09-03 Thread Per Minborg
On Mon, 2 Sep 2024 09:32:56 GMT, Maurizio Cimadamore wrote: >> If I run: >> >> >> @Benchmark >> public long shift() { >> return ELEM_SIZE << 56 | ELEM_SIZE << 48 | ELEM_SIZE << 40 | >> ELEM_SIZE << 32 | ELEM_SIZE << 24 | ELEM_SIZE << 16 | ELEM_SIZE << 8 | >> ELEM_SIZE; >>

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v12]

2024-09-03 Thread Per Minborg
gated to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance. Per Minborg has updated the pull request in

Re: RFR: 8338967: Improve performance for MemorySegment::fill [v10]

2024-09-03 Thread Per Minborg
On Tue, 3 Sep 2024 08:49:58 GMT, Francesco Nigro wrote: >> I've tried >> >> >> final long longValue = Byte.toUnsignedLong(value) * 0x0101010101010101L; >> >> >> But it had the same performance as explicit bit shifting on M1. > > @minborg the ` ELEM_SIZE` is a `Param` field right? Just to be

Integrated: 8338967: Improve performance for MemorySegment::fill

2024-09-03 Thread Per Minborg
On Mon, 26 Aug 2024 11:47:11 GMT, Per Minborg wrote: > The performance of the `MemorySegment::fil` can be improved by replacing the > `checkAccess()` method call with calling `checkReadOnly()` instead (as the > bounds of the segment itself do not need to be checked). > >

Re: RFR: 8338591: Improve performance of MemorySegment::copy

2024-09-03 Thread Per Minborg
On Tue, 3 Sep 2024 11:32:26 GMT, Maurizio Cimadamore wrote: >> This PR proposes to handle smaller FFM copy operations with Java code rather >> than transitioning to native code. This will improve performance. In this >> PR, copy operations involving zero to 63 bytes will be handled by Java cod

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v22]

2022-11-15 Thread Per Minborg
On Tue, 15 Nov 2022 12:34:43 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-434 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v22]

2022-11-15 Thread Per Minborg
On Tue, 15 Nov 2022 12:34:43 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-434 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v22]

2022-11-15 Thread Per Minborg
On Tue, 15 Nov 2022 12:34:43 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-434 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v22]

2022-11-15 Thread Per Minborg
On Tue, 15 Nov 2022 14:49:30 GMT, Per Minborg wrote: >> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add `since` tag in Module/ModuleLayer preview methods > > src/java.base/s

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v22]

2022-11-15 Thread Per Minborg
On Tue, 15 Nov 2022 12:34:43 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-434 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v22]

2022-11-15 Thread Per Minborg
On Tue, 15 Nov 2022 12:34:43 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-434 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v22]

2022-11-15 Thread Per Minborg
On Tue, 15 Nov 2022 12:34:43 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-434 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v22]

2022-11-15 Thread Per Minborg
On Tue, 15 Nov 2022 12:34:43 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-434 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v22]

2022-11-15 Thread Per Minborg
On Tue, 15 Nov 2022 12:34:43 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-434 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v22]

2022-11-15 Thread Per Minborg
On Tue, 15 Nov 2022 12:34:43 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-434 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

RFR: 8297145: Add a @sealedGraph tag to ConstantDesc

2022-11-16 Thread Per Minborg
This PR proposes to opt in for graphic rendering of the sealed hierarchy of the ConstantDesc class. Rendering capability was added via https://bugs.openjdk.org/browse/JDK-8295653 Here is how it would look like: https://user-images.githubusercontent.com/7457876/202216017-ec996722-2956-4b0a-adb5

RFR: 8297148: Add a @sealedGraph tag to CallSite

2022-11-16 Thread Per Minborg
This PR proposes to opt in for graphic rendering of the sealed hierarchy of the CallSite class. Rendering capability was added via https://bugs.openjdk.org/browse/JDK-8295653 Here is how it would look like: https://user-images.githubusercontent.com/7457876/202234105-8029ade2-4feb-456c-a010-b801

RFR: 8297150: Add a @sealedGraph tag to Reference

2022-11-16 Thread Per Minborg
This PR proposes to opt in for graphic rendering of the sealed hierarchy of the `Reference` class. Rendering capability was added via https://bugs.openjdk.org/browse/JDK-8295653 Here is how it would look like: https://user-images.githubusercontent.com/7457876/202243138-7f2a799a-dc67-4c4e-9322-c

Re: RFR: 8297148: Add a @sealedGraph tag to CallSite

2022-11-17 Thread Per Minborg
On Wed, 16 Nov 2022 16:41:18 GMT, Joe Darcy wrote: > Helpful improvement. > > Are the type names in the diagram links? The diagram is an SVG image rendered via the DOT description language. I think, in theory, it would be possible to add links. I did some experiments with this but decided we

RFR: 8296024: Usage of DIrectBuffer::address should be guarded

2022-11-21 Thread Per Minborg
This PR proposes the introduction of **guarding** of the use of `DirectBuffer::address` within the JDK. With the introduction of the Foreign Function and Memory access, it is possible to derive Buffer instances that are backed by native memory that, in turn, can be closed asynchronously by the u

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded

2022-11-21 Thread Per Minborg
On Mon, 21 Nov 2022 11:29:07 GMT, Alan Bateman wrote: >> This PR proposes the introduction of **guarding** of the use of >> `DirectBuffer::address` within the JDK. With the introduction of the Foreign >> Function and Memory access, it is possible to derive Buffer instances that >> are backed b

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded

2022-11-21 Thread Per Minborg
On Mon, 21 Nov 2022 11:32:35 GMT, Alan Bateman wrote: >> This PR proposes the introduction of **guarding** of the use of >> `DirectBuffer::address` within the JDK. With the introduction of the Foreign >> Function and Memory access, it is possible to derive Buffer instances that >> are backed b

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v2]

2022-11-21 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull request incrementally

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v3]

2022-11-21 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull request increm

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v3]

2022-11-21 Thread Per Minborg
On Mon, 21 Nov 2022 12:19:21 GMT, Alan Bateman wrote: >> maybe just `bufferLock` and and just `acquireBuffer` ? > > Would it be possible to re-examine acquireSession returning Runnable and > acquireSessionAsAutoCloseable returning AutoCloseable. The naming is bit > awkward at most of the use si

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v4]

2022-11-21 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull request incre

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v5]

2022-11-21 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull request inc

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v4]

2022-11-21 Thread Per Minborg
On Mon, 21 Nov 2022 13:32:43 GMT, ExE Boss wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rename methods > > src/java.base/share/classes/sun/nio/ch/DirectBuffer.java line 41: &g

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v6]

2022-11-21 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull request incr

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v7]

2022-11-21 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has refreshed the contents of this p

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v6]

2022-11-21 Thread Per Minborg
On Mon, 21 Nov 2022 14:14:14 GMT, Alan Bateman wrote: >> Per Minborg has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Update src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java >>

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v8]

2022-11-21 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull request increment

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v4]

2022-11-21 Thread Per Minborg
On Mon, 21 Nov 2022 14:07:38 GMT, Alan Bateman wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rename methods > > src/java.base/share/classes/java/util/zip/Adler32.java line 105: &g

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v9]

2022-11-22 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull request increment

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v4]

2022-11-22 Thread Per Minborg
On Mon, 21 Nov 2022 20:06:20 GMT, Alan Bateman wrote: >>> > Although this looks much simpler and concise, it means "a new object is >>> > created for each invocation" >>> >>> My comment was actually to see if DirectBuffer could extend AutoCloseable >>> so that the acquire returns "this" for th

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v9]

2022-11-22 Thread Per Minborg
On Tue, 22 Nov 2022 09:23:40 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rework Acquisition > > src/java.base/share/classes/com/sun/crypto/provider/Galo

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v10]

2022-11-22 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull request increment

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v11]

2022-11-23 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull request incremen

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v12]

2022-11-23 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull reques

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v12]

2022-11-23 Thread Per Minborg
On Wed, 23 Nov 2022 16:14:52 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Cleanup > > src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java li

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Per Minborg
ress` method, that the use of the returned > address needs to be guarded. It can be discussed if this is preferable or not. > > This PR spawns several areas of responsibility and so, I expect more than one > reviewer before promoting the PR. Per Minborg has updated the pull request increme

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread Per Minborg
On Thu, 24 Nov 2022 11:58:12 GMT, Maurizio Cimadamore wrote: >> Separately, also (optional) stylistic: the indenting on this and following >> class is a bit odd. There is a certain tendency to compress lines - e.g. to >> reach for one-liners, when in reality the body is not that trivial. If I

  1   2   3   4   5   6   7   8   9   10   >