Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-11-13 Thread Jorn Vernee
On Thu, 9 Nov 2023 15:39:54 GMT, Jorn Vernee wrote: >> src/hotspot/cpu/aarch64/downcallLinker_aarch64.cpp line 182: >> >>> 180: ArgumentShuffle arg_shuffle(filtered_java_regs, out_regs, >>> shuffle_reg); >>> 181: >>> 182: #ifndef PRODUCT >> >> Any particular reason to exclude the logging in

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-11-09 Thread Maurizio Cimadamore
On Thu, 9 Nov 2023 15:34:38 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/java/lang/foreign/Linker.java line 792: >> >>> 790: * @param allowHeapAccess whether the linked function should >>> allow access to the Java heap. >>> 791: */ >>> 792: static Option crit

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-11-09 Thread Jorn Vernee
On Thu, 9 Nov 2023 00:27:46 GMT, Vladimir Ivanov wrote: > Even though it's straightforward to support on-heap accesses during critical > function calls, object pinning would support that for non-critical function > calls as well, but proposed API doesn't cover it and new API will be > required

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-11-09 Thread Jorn Vernee
On Wed, 8 Nov 2023 19:52:00 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - a -> an >> - add note to downcallHandle about passing heap segments by-reference > > src/hotspot/cpu/aarch64/downca

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-11-08 Thread Vladimir Ivanov
On Tue, 24 Oct 2023 15:09:57 GMT, Jorn Vernee wrote: >> Add the ability to pass heap segments to native code. This requires using >> `Linker.Option.critical(true)` as a linker option. It has the same >> limitations as normal critical calls, namely: upcalls into Java are not >> allowed, and the

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-10-27 Thread Yasumasa Suenaga
On Fri, 27 Oct 2023 11:28:29 GMT, Martin Doerr wrote: >> @YaSuenag `r12` is restored in `reinit_heapbase()` if needed and no, `r12` >> does not need remembering because it is a constant and can be restored from >> somewhere else. > > I think your code is fine. Restoring `r12_heapbase` at this p

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-10-27 Thread Martin Doerr
On Fri, 27 Oct 2023 10:23:43 GMT, Quan Anh Mai wrote: >> Question: `r12` does not need to remember? >> >> According to [CallingSequences in OpenJDK >> Wiki](https://wiki.openjdk.org/display/HotSpot/CallingSequences), `r12` may >> be reserved for HeapBase if COOP is enabled. >> (`r12` is also

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-10-27 Thread Quan Anh Mai
On Fri, 27 Oct 2023 03:49:17 GMT, Yasumasa Suenaga wrote: >> src/hotspot/cpu/x86/downcallLinker_x86_64.cpp line 110: >> >>> 108: __ mov(rsp, r12); // restore sp >>> 109: __ reinit_heapbase(); >>> 110: } >> >> This is a minor cleanup to share this code for the three use sites below. > > Ques

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-10-27 Thread Jorn Vernee
On Fri, 27 Oct 2023 03:49:17 GMT, Yasumasa Suenaga wrote: >> src/hotspot/cpu/x86/downcallLinker_x86_64.cpp line 110: >> >>> 108: __ mov(rsp, r12); // restore sp >>> 109: __ reinit_heapbase(); >>> 110: } >> >> This is a minor cleanup to share this code for the three use sites below. > > Ques

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-10-26 Thread Yasumasa Suenaga
On Wed, 25 Oct 2023 13:18:33 GMT, Jorn Vernee wrote: >> Jorn Vernee has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - a -> an >> - add note to downcallHandle about passing heap segments by-reference > > src/hotspot/cpu/x86/downcallLinke

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-10-26 Thread Andrey Turbanov
On Tue, 24 Oct 2023 15:09:57 GMT, Jorn Vernee wrote: >> Add the ability to pass heap segments to native code. This requires using >> `Linker.Option.critical(true)` as a linker option. It has the same >> limitations as normal critical calls, namely: upcalls into Java are not >> allowed, and the

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-10-25 Thread Jorn Vernee
On Tue, 24 Oct 2023 15:09:57 GMT, Jorn Vernee wrote: >> Add the ability to pass heap segments to native code. This requires using >> `Linker.Option.critical(true)` as a linker option. It has the same >> limitations as normal critical calls, namely: upcalls into Java are not >> allowed, and the

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-10-25 Thread Jorn Vernee
On Tue, 24 Oct 2023 15:09:57 GMT, Jorn Vernee wrote: >> Add the ability to pass heap segments to native code. This requires using >> `Linker.Option.critical(true)` as a linker option. It has the same >> limitations as normal critical calls, namely: upcalls into Java are not >> allowed, and the

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-10-24 Thread Maurizio Cimadamore
On Tue, 24 Oct 2023 15:09:57 GMT, Jorn Vernee wrote: >> Add the ability to pass heap segments to native code. This requires using >> `Linker.Option.critical(true)` as a linker option. It has the same >> limitations as normal critical calls, namely: upcalls into Java are not >> allowed, and the

Re: RFR: 8254693: Add Panama feature to pass heap segments to native code [v12]

2023-10-24 Thread Jorn Vernee
> Add the ability to pass heap segments to native code. This requires using > `Linker.Option.critical(true)` as a linker option. It has the same > limitations as normal critical calls, namely: upcalls into Java are not > allowed, and the native function should return relatively quickly. Heap >