Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v7]

2024-06-21 Thread Jorn Vernee
On Fri, 21 Jun 2024 18:31:00 GMT, Jan Lahoda wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> add extra test for missing root modules > > src/jdk.jdeps/share/classes/com/sun/tool

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v7]

2024-06-20 Thread Jorn Vernee
libclang bindings, which use the FFM API, > and thus has a lot of references to `@Restricted` methods. > - tier 1-3 Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: add extra test for missing root modules

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v5]

2024-06-20 Thread Jorn Vernee
On Thu, 20 Jun 2024 12:11:25 GMT, Jorn Vernee wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v6]

2024-06-20 Thread Jorn Vernee
libclang bindings, which use the FFM API, > and thus has a lot of references to `@Restricted` methods. > - tier 1-3 Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: review comments Alan - Changes: - all: https://

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v5]

2024-06-20 Thread Jorn Vernee
On Thu, 20 Jun 2024 16:13:04 GMT, Alan Bateman wrote: > Another thing is that using joptsimple gives up a bit of control, e.g. the > help output shows the parameter for --class-path as `` where the java > launcher and other tools will show "path" or "class path". Same thing with > `--release`

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v5]

2024-06-20 Thread Jorn Vernee
On Thu, 20 Jun 2024 12:51:22 GMT, Evemose wrote: > wouldn't it be better to create one uniform tool See my reply here: https://github.com/openjdk/jdk/pull/19774#issuecomment-2179078565 - PR Comment: https://git.openjdk.org/jdk/pull/19774#issuecomment-2180653743

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v5]

2024-06-20 Thread Jorn Vernee
libclang bindings, which use the FFM API, > and thus has a lot of references to `@Restricted` methods. > - tier 1-3 Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: update man page header to be consisten with the others

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v4]

2024-06-20 Thread Jorn Vernee
libclang bindings, which use the FFM API, > and thus has a lot of references to `@Restricted` methods. > - tier 1-3 Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: man page review comments - Changes: - all: ht

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v3]

2024-06-20 Thread Jorn Vernee
On Wed, 19 Jun 2024 21:35:07 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - review comments >> - add man page > > src/jdk.jdeps/share/man/jnativesc

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v3]

2024-06-20 Thread Jorn Vernee
On Thu, 20 Jun 2024 11:42:04 GMT, Jorn Vernee wrote: >> src/jdk.jdeps/share/man/jnativescan.1 line 127: >> >>> 125: This option should be set to the version of the runtime under which the >>> 126: application is eventually intended to be run. >>> 127: If

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v3]

2024-06-20 Thread Jorn Vernee
On Wed, 19 Jun 2024 21:30:49 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - review comments >> - add man page > > src/jdk.jdeps/share/man/jnativesc

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v3]

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 18:57:43 GMT, Jorn Vernee wrote: >> I can do that, but I think this will always be a bit awkward since these >> types don't have a common super type that exposes the needed information. > >> these types don't have a common super type that exposes the n

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v3]

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 21:13:33 GMT, Jorn Vernee wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v3]

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 18:02:08 GMT, Jorn Vernee wrote: >> src/jdk.jdeps/share/classes/com/sun/tools/jnativescan/ClassResolver.java >> line 126: >> >>> 124: >>> 125: private static Map packageToSystemModule() { >>> 126:

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v2]

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 19:00:22 GMT, Jorn Vernee wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v3]

2024-06-19 Thread Jorn Vernee
libclang bindings, which use the FFM API, > and thus has a lot of references to `@Restricted` methods. > - tier 1-3 Jorn Vernee has updated the pull request incrementally with two additional commits since the last revision: - review comments - add man page - Changes: - al

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v2]

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 17:41:36 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update src/jdk.jdeps/share/classes/com/sun/tools/jnativescan/Main.java >>

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v2]

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 17:45:14 GMT, Jorn Vernee wrote: >> src/jdk.jdeps/share/classes/com/sun/tools/jnativescan/RestrictedMethodFinder.java >> line 120: >> >>> 118: Optional info = >>> systemClassResolver.lookup(methodRef.owner()); >

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v2]

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 18:09:15 GMT, Jorn Vernee wrote: > these types don't have a common super type that exposes the needed information No wait, they actually do :) That's just `MemberRefEntry`. - PR Review Comment: https://git.openjdk.org/jdk/pull/19774#discussion_r1646604479

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v2]

2024-06-19 Thread Jorn Vernee
libclang bindings, which use the FFM API, > and thus has a lot of references to `@Restricted` methods. > - tier 1-3 Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: Update src/jdk.jdeps/share/classes/com/sun/tool

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 17:28:23 GMT, Maurizio Cimadamore wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted`. >> >> The

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 17:53:12 GMT, Maurizio Cimadamore wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted`. >> >> The

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 17:30:08 GMT, Maurizio Cimadamore wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted`. >> >> The

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 17:16:54 GMT, Maurizio Cimadamore wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted`. >> >> The

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods

2024-06-19 Thread Jorn Vernee
On Wed, 19 Jun 2024 14:30:23 GMT, Roger Riggs wrote: > One more tool. or... Could this be coalesced into a tool that does deprscan > and restricted methods, and other "lint" type checks? I might go so far as to > suggest it be extensible and accept patterns or regular expressions for >

RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods

2024-06-19 Thread Jorn Vernee
This PR adds a new JDK tool, called `jnativescan`, that can be used to find code that accesses native functionality. Currently this includes `native` method declarations, and methods marked with `@Restricted`. The tool accepts a list of class path and module path entries through `--class-path`

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods

2024-06-19 Thread Jorn Vernee
On Tue, 18 Jun 2024 16:30:37 GMT, Jorn Vernee wrote: > This PR adds a new JDK tool, called `jnativescan`, that can be used to find > code that accesses native functionality. Currently this includes `native` > method declarations, and methods marked with `@Restricted`. > > T

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 Jorn Vernee
On Tue, 11 Jun 2024 12:22:24 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 the same set. > > Per

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

2024-06-11 Thread Jorn Vernee
On Tue, 11 Jun 2024 09:18:23 GMT, Per Minborg wrote: > If a segment is reinterpreted to be larger than this segment, then the extra > memory is not a part of this segment's backing part. Another way to think about this is: a segment's backing region can be larger or smaller than the bounds

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

2024-06-10 Thread Jorn Vernee
On Mon, 10 Jun 2024 17:09:27 GMT, Jorn Vernee wrote: > The term 'subset' doesn't feel right to me here, since we're only talking > about a single memory region (not a set of memory region**s**). I suggest > 'sub-region' instead. Actually, nvm, that doesn't work for `reinterpr

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

2024-06-10 Thread Jorn Vernee
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 the same set. The term

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

2024-06-10 Thread Jorn Vernee
On Mon, 10 Jun 2024 15:30:39 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 regardless of the

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator [v2]

2024-06-10 Thread Jorn Vernee
On Fri, 7 Jun 2024 18:58:36 GMT, Claes Redestad wrote: >> This PR refactors type matching in BootstrapMethodInvoker and adds a few >> types, seeking to improve bootstrap overheads of some ConstantBootstraps and >> in particular the ProxyGenerator condys generated for e.g. annotation >>

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator [v2]

2024-06-10 Thread Jorn Vernee
On Fri, 7 Jun 2024 18:58:36 GMT, Claes Redestad wrote: >> This PR refactors type matching in BootstrapMethodInvoker and adds a few >> types, seeking to improve bootstrap overheads of some ConstantBootstraps and >> in particular the ProxyGenerator condys generated for e.g. annotation >>

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator [v2]

2024-06-10 Thread Jorn Vernee
On Mon, 10 Jun 2024 07:56:03 GMT, Claes Redestad wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Adress review comments, add ConstantBootstraps#invoke to list of >> recognized type signatures > > Sure. If you

Integrated: 8325984: 4 jcstress tests are failing in Tier6 4 times each

2024-06-07 Thread Jorn Vernee
On Wed, 5 Jun 2024 19:21:56 GMT, Jorn Vernee wrote: > These 4 tests were failing due to an incompatibility with jcstress. They were > problemlisted in past (https://bugs.openjdk.org/browse/JDK-8326062). > > Now that jcstress has been updated > (https://github.com/openjdk

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator

2024-06-07 Thread Jorn Vernee
On Fri, 7 Jun 2024 12:12:44 GMT, Claes Redestad wrote: > This PR refactors type matching in BootstrapMethodInvoker and adds a few > types, seeking to improve bootstrap overheads of some ConstantBootstraps and > in particular the ProxyGenerator condys generated for e.g. annotation proxies >

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator

2024-06-07 Thread Jorn Vernee
On Fri, 7 Jun 2024 12:12:44 GMT, Claes Redestad wrote: > This PR refactors type matching in BootstrapMethodInvoker and adds a few > types, seeking to improve bootstrap overheads of some ConstantBootstraps and > in particular the ProxyGenerator condys generated for e.g. annotation proxies >

Re: RFR: 8325984: 4 jcstress tests are failing in Tier6 4 times each

2024-06-07 Thread Jorn Vernee
On Thu, 6 Jun 2024 10:48:51 GMT, Aleksey Shipilev wrote: >> These 4 tests were failing due to an incompatibility with jcstress. They >> were problemlisted in past (https://bugs.openjdk.org/browse/JDK-8326062). >> >> Now that jcstress has been updated >>

Re: RFR: 8333749: Consolidate ConstantDesc conversion in java.base [v5]

2024-06-07 Thread Jorn Vernee
On Fri, 7 Jun 2024 12:35:37 GMT, Chen Liang wrote: >> In java.base, especially in bytecode generators, we have many different >> methods converting known valid Class and MethodType into ClassDesc and >> MethodTypeDesc. These conversions should be consolidated into the same >> utility method

Re: RFR: 8333749: Consolidate ConstantDesc conversion in java.base [v2]

2024-06-06 Thread Jorn Vernee
On Thu, 6 Jun 2024 19:24:14 GMT, Chen Liang wrote: >> In java.base, especially in bytecode generators, we have many different >> methods converting known valid Class and MethodType into ClassDesc and >> MethodTypeDesc. These conversions should be consolidated into the same >> utility method

Re: RFR: 8325984: 4 jcstress tests are failing in Tier6 4 times each

2024-06-06 Thread Jorn Vernee
On Thu, 6 Jun 2024 10:48:51 GMT, Aleksey Shipilev wrote: > I think only Oracle CIs run these tests through jtreg wrappers? We do run them in our CI. Not sure who else runs them that way. - PR Comment: https://git.openjdk.org/jdk/pull/19565#issuecomment-2152799029

RFR: 8325984: 4 jcstress tests are failing in Tier6 4 times each

2024-06-05 Thread Jorn Vernee
These 4 tests were failing due to an incompatibility with jcstress. They were problemlisted in past (https://bugs.openjdk.org/browse/JDK-8326062). Now that jcstress has been updated (https://github.com/openjdk/jdk/pull/19332) with the relevant fix (https://github.com/openjdk/jcstress/pull/147),

Re: RFR: 8332547: Unloaded signature classes in DirectMethodHandles [v2]

2024-06-03 Thread Jorn Vernee
On Mon, 3 Jun 2024 19:36:58 GMT, Vladimir Ivanov wrote: >> JVM routinely installs loader constraints for unloaded signature classes >> when method resolution takes place. MethodHandle resolution took a different >> route and eagerly resolves signature classes instead (see >>

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

2024-05-31 Thread Jorn Vernee
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

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

2024-05-30 Thread Jorn Vernee
On Thu, 30 May 2024 16:15:22 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

Re: RFR: 8332826: Make hashCode methods in ArraysSupport friendlier [v2]

2024-05-28 Thread Jorn Vernee
On Mon, 27 May 2024 20:55:29 GMT, Pavel Rappo wrote: >> Please review this PR, which supersedes a now withdrawn >> https://github.com/openjdk/jdk/pull/14831. >> >> This PR replaces `ArraysSupport.vectorizedHashCode` with a set of more >> user-friendly methods. Here's a summary: >> >> - Made

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v3]

2024-05-22 Thread Jorn Vernee
On Tue, 21 May 2024 10:20:27 GMT, Maurizio Cimadamore wrote: >> When creating a nested memory access var handle, we ensure that the segment >> is accessed at the correct alignment for the root layout being accessed. But >> we do not ensure that the segment has at least the size of the

Re: RFR: 8332547: Unloaded signature classes in DirectMethodHandles

2024-05-21 Thread Jorn Vernee
On Tue, 21 May 2024 18:02:45 GMT, Vladimir Ivanov wrote: > I can definitely name it differently (e.g, ensureTypeVisible), but making a > separate class loading pass across signature classes doesn't make much sense. Ok, in that case I suggest also renaming `MemberName::checkForTypeAlias`, maybe

Re: RFR: 8332547: Unloaded signature classes in DirectMethodHandles

2024-05-21 Thread Jorn Vernee
On Mon, 20 May 2024 21:29:20 GMT, Vladimir Ivanov wrote: > JVM routinely installs loader constraints for unloaded signature classes when > method resolution takes place. MethodHandle resolution took a different route > and eagerly resolves signature classes instead (see >

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Jorn Vernee
On Fri, 26 Apr 2024 11:51:51 GMT, Claes Redestad wrote: >> This PR makes ClassDesc.ofDescriptor return the shared constant for >> primitive descriptor strings ("I" etc..), and leverages this further by >> refactoring `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate >> substring for

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v2]

2024-04-26 Thread Jorn Vernee
On Fri, 26 Apr 2024 11:49:19 GMT, Claes Redestad wrote: > > Does removing the explicit null checks make that much difference for > > performance? They are kind of nice for clarity. > > It helps startup at least. The redundant array depth check mattered a bit for > peak performance, but not

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v2]

2024-04-26 Thread Jorn Vernee
On Fri, 26 Apr 2024 10:54:49 GMT, Claes Redestad wrote: >> This PR makes ClassDesc.ofDescriptor return the shared constant for >> primitive descriptor strings ("I" etc..), and leverages this further by >> refactoring `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate >> substring for

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-19 Thread Jorn Vernee
On Fri, 19 Apr 2024 19:18:13 GMT, Scott Gibbons wrote: >> src/hotspot/share/opto/runtime.cpp line 786: >> >>> 784: fields[argp++] = TypePtr::NOTNULL;// dest >>> 785: fields[argp++] = TypeLong::LONG; // size >>> 786: fields[argp++] = Type::HALF; // size >> >> Since the

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v22]

2024-04-19 Thread Jorn Vernee
On Fri, 19 Apr 2024 16:25:28 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-19 Thread Jorn Vernee
On Tue, 16 Apr 2024 00:04:15 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v6]

2024-04-18 Thread Jorn Vernee
On Thu, 18 Apr 2024 11:32:13 GMT, Per Minborg wrote: >> While `SymbolLookup` correctly uses an `Optional` return to denote whether a >> symbol has been found by the lookup or not (which enables composition of >> symbol lookups), many clients end up just calling `Optional::get`, or >>

Re: RFR: 8330467: NoClassDefFoundError when lambda is in a hidden class

2024-04-17 Thread Jorn Vernee
On Wed, 17 Apr 2024 08:46:59 GMT, Adam Sotona wrote: > Current implementation of `LambdaMetafactory` does not allow to use lambdas > in hidden classes. Invocation throws `NoClassDefFoundError` instead. > > This patch includes lambda implementation in a hidden class under the special >

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v4]

2024-04-16 Thread Jorn Vernee
On Mon, 15 Apr 2024 14:02:56 GMT, Per Minborg wrote: >> While `SymbolLookup` correctly uses an `Optional` return to denote whether a >> symbol has been found by the lookup or not (which enables composition of >> symbol lookups), many clients end up just calling `Optional::get`, or >>

Re: RFR: 8330272: Wrong javadoc for ValueLayout.JAVA_LONG/JAVA_DOUBLE on x86 32bit

2024-04-16 Thread Jorn Vernee
On Tue, 16 Apr 2024 07:09:55 GMT, Per Minborg wrote: > This PR proposes to update the javadocs for `ValueLayout.JAVA_LONG` and > `ValueLayout.JAVA_DOUBLE` to reflect the changes made in > https://bugs.openjdk.org/browse/JDK-8326172 (we forgot to update the docs > when that issue was fixed)

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v20]

2024-04-15 Thread Jorn Vernee
On Mon, 15 Apr 2024 22:22:38 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix memory mark after sync to upstream > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2686:

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v3]

2024-04-15 Thread Jorn Vernee
changes > brought in by the merge/rebase. The pull request contains ten additional > commits since the last revision: > > - Update after comments > - Merge branch 'master' into ms-reinterpret2 > - Update > src/java.base/share/classes/jdk/internal/foreign/HeapMemorySeg

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v4]

2024-04-15 Thread Jorn Vernee
On Mon, 15 Apr 2024 14:02:56 GMT, Per Minborg wrote: >> While `SymbolLookup` correctly uses an `Optional` return to denote whether a >> symbol has been found by the lookup or not (which enables composition of >> symbol lookups), many clients end up just calling `Optional::get`, or >>

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints

2024-04-15 Thread Jorn Vernee
On Mon, 15 Apr 2024 07:50:24 GMT, Per Minborg wrote: > This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segment is properly >

Integrated: 8330049: Remove unused AbstractLinker::linkerByteOrder

2024-04-11 Thread Jorn Vernee
On Wed, 10 Apr 2024 15:38:22 GMT, Jorn Vernee wrote: > Please review this simple cleanup which removes the > `AbstractLinker::linkerByteOrder` method. It was only used in > `AixPPC64Linker`, where we know it will always return `ByteOrder.BIG_ENDIAN` > so we can just repl

Re: RFR: 8330049: Remove unused AbstractLinker::linkerByteOrder [v2]

2024-04-10 Thread Jorn Vernee
n-test-jdk_foreign`. Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: update copyright years - Changes: - all: https://git.openjdk.org/jdk/pull/18726/files - new: https://git.openjdk.org/jdk/pull/18726/files/12ccb842.

RFR: 8330049: Remove unused AbstractLinker::linkerByteOrder

2024-04-10 Thread Jorn Vernee
Please review this simple cleanup which removes the `AbstractLinker::linkerByteOrder` method. It was only used in `AixPPC64Linker`, where we know it will always return `ByteOrder.BIG_ENDIAN` so we can just replace the call with that. Testing: Local run of `run-test-jdk_foreign`. -

Re: RFR: 8329997: Add MemorySegment::reinterpretate overloads for alignment constraints

2024-04-10 Thread Jorn Vernee
On Wed, 10 Apr 2024 12:49:11 GMT, Per Minborg wrote: > This PR proposes to add two overloads `MemorySegment::reinterpretate` to > allow aligned reinterpretation. src/java.base/share/classes/jdk/internal/foreign/SegmentFactories.java line 72: > 70:

Re: RFR: JDK-8319516 - Native library suffix impact on the library loading in AIX- Java Class Loader [v4]

2024-03-21 Thread Jorn Vernee
On Mon, 18 Mar 2024 17:43:45 GMT, Suchismith Roy wrote: >> Allow support for both .a and .so files in AIX. >> If .so file is not found, allow fallback to .a extension. >> JBS Issue: [JDK-8319516](https://bugs.openjdk.org/browse/JDK-8319516) > > Suchismith Roy has updated the pull request

Integrated: 8327994: Update code gen in CallGeneratorHelper

2024-03-21 Thread Jorn Vernee
On Wed, 13 Mar 2024 11:28:27 GMT, Jorn Vernee wrote: > Update the code gen code in CallGeneratorHelper to reflect the latest state > of the libTest(Downcall/Upcall)(Stack).c and shared.h files. > > - The previous code wanted users to pipe stdout into a file. But, since we &g

Re: RFR: 8327994: Update code gen in CallGeneratorHelper [v2]

2024-03-20 Thread Jorn Vernee
On Wed, 20 Mar 2024 17:49:51 GMT, Maurizio Cimadamore wrote: > No changes in libTestDowncallStack.c (not even minor ones) ? No, there was a 'missing' space between the prefix parameters and the actual parameters of the stack variants, and between the arguments passed when that callback was

Re: RFR: 8327994: Update code gen in CallGeneratorHelper [v2]

2024-03-16 Thread Jorn Vernee
files, but those files > only contain either white space changes (some missing spaces after `,`), and > copyright header updates. Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: Delete extra space Co-authored-by: Andrey Turban

RFR: 8327994: Update code gen in CallGeneratorHelper

2024-03-13 Thread Jorn Vernee
Update the code gen code in CallGeneratorHelper to reflect the latest state of the libTest(Downcall/Upcall)(Stack).c and shared.h files. - The previous code wanted users to pipe stdout into a file. But, since we have 5 files that need to be created, and the names of those files is important

Re: RFR: 8327460: Compile tests with the same visibility rules as product code [v2]

2024-03-12 Thread Jorn Vernee
On Tue, 12 Mar 2024 13:51:28 GMT, Magnus Ihse Bursie wrote: >> test/jdk/java/foreign/CallGeneratorHelper.java line 216: >> >>> 214: if (header) { >>> 215: System.out.println( >>> 216: "#include \"export.h\"\n" >> >> We don't generate these header files any

Re: RFR: 8327460: Compile tests with the same visibility rules as product code [v2]

2024-03-08 Thread Jorn Vernee
On Wed, 6 Mar 2024 13: 43: 00 GMT, Magnus Ihse Bursie wrote: >> Currently, our symbol visibility handling for tests are sloppy; we only handle it properly on Windows. We need to bring it up to the same levels as ZjQcmQRYFpfptBannerStart This Message Is From an

Integrated: 8326172: Dubious claim on long[]/double[] alignment in MemorySegment javadoc

2024-03-05 Thread Jorn Vernee
On Mon, 26 Feb 2024 13:24:11 GMT, Jorn Vernee wrote: > This patch changes the alignment for `JAVA_LONG` and `JAVA_DOUBLE` to 8, > regardless of the underlying platform. This means that atomic access modes > work on memory segments wrapping `long[]` or `double[]`, as they already d

Re: RFR: 8326172: Dubious claim on long[]/double[] alignment in MemorySegment javadoc [v2]

2024-02-26 Thread Jorn Vernee
On Mon, 26 Feb 2024 19:13:41 GMT, Jorn Vernee wrote: >> That doesn't seem to be the right PR link? > > Found the right one: > https://github.com/openjdk/jdk/commit/44218b1c9e5daa33557aac9336251cf8398d81eb Switched back to using the old generator (and removed the newer one): htt

Re: RFR: 8326172: Dubious claim on long[]/double[] alignment in MemorySegment javadoc [v2]

2024-02-26 Thread Jorn Vernee
On Mon, 26 Feb 2024 19:10:39 GMT, Jorn Vernee wrote: >> test/jdk/java/foreign/TestLayouts.java line 164: >> >>> 162: ); >>> 163: assertEquals(struct.byteSize(), 1 + 1 + 2 + 4 + 8); >>> 164: assertEquals(struct.byteAlignment(),

Re: RFR: 8326172: Dubious claim on long[]/double[] alignment in MemorySegment javadoc [v3]

2024-02-26 Thread Jorn Vernee
ing a stack overflow when running > test/jdk/java/foreign/stackwalk/TestReentrantUpcalls.java on x86, so I've > lowered the recursion to 50 (which is still more than enough I think). > > Testing: `jdk_foreign` on x64 Windows, x64 Windows + fallback linker, and x86 > Linux (uses fa

Re: RFR: 8326172: Dubious claim on long[]/double[] alignment in MemorySegment javadoc [v2]

2024-02-26 Thread Jorn Vernee
On Mon, 26 Feb 2024 16:21:38 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> review comments > > test/jdk/java/foreign/TestLayouts.java line 164

Re: RFR: 8326172: Dubious claim on long[]/double[] alignment in MemorySegment javadoc [v2]

2024-02-26 Thread Jorn Vernee
On Mon, 26 Feb 2024 15:10:55 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> review comments > > src/java.base/share/classes/java/lang/foreign/MemorySe

Re: RFR: 8326172: Dubious claim on long[]/double[] alignment in MemorySegment javadoc [v2]

2024-02-26 Thread Jorn Vernee
ing a stack overflow when running > test/jdk/java/foreign/stackwalk/TestReentrantUpcalls.java on x86, so I've > lowered the recursion to 50 (which is still more than enough I think). > > Testing: `jdk_foreign` on x64 Windows, x64 Windows + fallback linker, and x86 > Linux (uses fa

RFR: 8326172: Dubious claim on long[]/double[] alignment in MemorySegment javadoc

2024-02-26 Thread Jorn Vernee
This patch changes the alignment for `JAVA_LONG` and `JAVA_DOUBLE` to 8, regardless of the underlying platform. This means that atomic access modes work on memory segments wrapping `long[]` or `double[]`, as they already do when using `MethodHandless::arrayAccessVarHandle`. After discussion,

Re: RFR: 8326112: Javadoc snippet for Linker.Option.captureCallState is wrong

2024-02-19 Thread Jorn Vernee
On Mon, 19 Feb 2024 08:19:58 GMT, Per Minborg wrote: > This PR proposes to add an offset parameter for a `VarHandle` invocation in > the Javadoc snippet for `Linker.Option.captureCallState()`. The offset > parameter was added in 22 but it was forgotten to add it in said Javadoc. Marked as

Re: RFR: 8326062: ProblemList jcstress tests that are failing due to JDK-8325984

2024-02-16 Thread Jorn Vernee
On Fri, 16 Feb 2024 15:54:27 GMT, Daniel D. Daugherty wrote: > A trivial fix to ProblemList jcstress tests that are failing due to > JDK-8325984. Thanks! - Marked as reviewed by jvernee (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17890#pullrequestreview-1885494458

Integrated: 8318966: Some methods make promises about Java array element alignment that are too strong

2024-02-14 Thread Jorn Vernee
On Wed, 15 Nov 2023 22:46:03 GMT, Jorn Vernee wrote: > See the JBS issue for an extended problem description. > > This patch changes the specification and implementation of > `MethodHandles::byteArrayViewVarHandle`, > `MethodHandles::byteBufferViewVarHandle`, `ByteBuffe

Re: RFR: 8318966: Some methods make promises about Java array element alignment that are too strong [v3]

2024-02-13 Thread Jorn Vernee
* If the native platform does not guarantee stable alignment > offset > * values for the given unit size when managing the memory regions > * of buffers of the same kind as this buffer (direct or > * non-direct). For example, i

Re: RFR: 8318966: Some methods make promises about Java array element alignment that are too strong [v2]

2024-02-13 Thread Jorn Vernee
On Thu, 1 Feb 2024 20:10:29 GMT, Jorn Vernee wrote: >> See the JBS issue for an extended problem description. >> >> This patch changes the specification and implementation of >> `MethodHandles::byteArrayViewVarHandle`, >> `MethodHandles::byteBufferViewVarHand

Re: RFR: 8323552: AbstractMemorySegmentImpl#mismatch returns -1 when comparing distinct areas of the same instance of MemorySegment [v3]

2024-02-08 Thread Jorn Vernee
On Thu, 11 Jan 2024 16:21:38 GMT, Peter Levart wrote: >> I belive there is a bug in `AbstractMemorySegmentImpl#mismatch` method. It >> returns `-1` (meaning that regions are equal) when passing the same instance >> of MemorySegment as both `srcSegment` and `dstSegment` parameters regardless

Re: RFR: JDK-8325148: Enable restricted javac warning in java.base

2024-02-01 Thread Jorn Vernee
On Thu, 1 Feb 2024 21:10:48 GMT, Joe Darcy wrote: > The restricted javac warning is disabled for java.base, but could be enabled > by suppressing the warning in a handful of files. This looks good to me. It will be easier to find where we are doing restricted operations like this.

Re: RFR: 8318966: Some methods make promises about Java array element alignment that are too strong [v2]

2024-02-01 Thread Jorn Vernee
* If the native platform does not guarantee stable alignment > offset > * values for the given unit size when managing the memory regions > * of buffers of the same kind as this buffer (direct or > * non-direct). For example, i

Re: RFR: 8323601: Improve LayoutPath.PathElement::toString [v4]

2024-01-30 Thread Jorn Vernee
On Tue, 30 Jan 2024 16:58:35 GMT, Per Minborg wrote: >> This PR proposes to add an improved Improve >> `LayoutPath.PathElement::toString` method simplifying debugging. >> >> Opinions and suggestions for `static PathElement sequenceElement(long start, >> long step)` are welcome. > > Per

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

2024-01-26 Thread Jorn Vernee
On Fri, 26 Jan 2024 09:12:53 GMT, Alan Bateman wrote: > The target class is transformed in such a way to call the auxiliary class, > which necessitates the the aux-class to be in the same classloader as the > target class. But because the aux-class is defined while the target class is > still

Re: RFR: 8318966: Some methods make promises about Java array element alignment that are too strong

2024-01-23 Thread Jorn Vernee
On Tue, 23 Jan 2024 14:43:24 GMT, Chen Liang wrote: > Also curious, is there any documentation (like JVMS) that allows JVMs to make > no offset into byte arrays aligned for larger access? Would be helpful if we > can have a reference here. There is simply no guarantee in the JVMS that array

Re: RFR: 8318966: Some methods make promises about Java array element alignment that are too strong

2024-01-23 Thread Jorn Vernee
On Tue, 23 Jan 2024 14:30:08 GMT, Chen Liang wrote: >> Good idea. Thanks > > Should we make these unaligned access modes throw ISE like before, when the > given index is unaligned? You mean `get` and `set`? They should never throw, as unaligned access is fine. For other access modes, we can

Re: RFR: 8323601: Improve LayoutPath.PathElement::toString [v2]

2024-01-15 Thread Jorn Vernee
On Mon, 15 Jan 2024 16:01:32 GMT, Per Minborg wrote: >> This PR proposes to add an improved Improve >> `LayoutPath.PathElement::toString` method simplifying debugging. >> >> Opinions and suggestions for `static PathElement sequenceElement(long start, >> long step)` are welcome. > > Per

Re: RFR: 8323159: Consider adding some text re. memory zeroing in Arena::allocate [v3]

2024-01-12 Thread Jorn Vernee
On Fri, 12 Jan 2024 13:06:39 GMT, Per Minborg wrote: >> This PR proposes to add a clarification that an `Arena` always returns >> zeroed-out segments for `Arena::allocate` methods. >> >> Note that other overloaded methods refer to the abstract `Arena::allocate` >> method via implementation

Re: RFR: 8323159: Consider adding some text re. memory zeroing in Arena::allocate [v2]

2024-01-12 Thread Jorn Vernee
On Thu, 11 Jan 2024 07:59:37 GMT, Per Minborg wrote: >> This PR proposes to add a clarification that an `Arena` always returns >> zeroed-out segments for `Arena::allocate` methods. >> >> Note that other overloaded methods refer to the abstract `Arena::allocate` >> method via implementation

Re: RFR: 8323552: AbstractMemorySegmentImpl#mismatch returns -1 when comparing distinct areas of the same instance of MemorySegment [v2]

2024-01-11 Thread Jorn Vernee
On Thu, 11 Jan 2024 13:30:44 GMT, Peter Levart wrote: >> I belive there is a bug in `AbstractMemorySegmentImpl#mismatch` method. It >> returns `-1` (meaning that regions are equal) when passing the same instance >> of MemorySegment as both `srcSegment` and `dstSegment` parameters regardless

[jdk22] Integrated: 8322324: java/foreign/TestStubAllocFailure.java times out while waiting for forked process

2024-01-11 Thread Jorn Vernee
On Wed, 10 Jan 2024 13:18:17 GMT, Jorn Vernee wrote: > Hi all, > > This pull request contains a backport of commit > [d2d58dd6](https://github.com/openjdk/jdk/commit/d2d58dd6a8ec366a4bc3eb12a253b252de24557e) > from the [openjdk/jdk](https://git.openjdk.org/jdk) repository.

  1   2   3   4   5   6   7   8   9   >