[External] : Re: jvmci return array
Douglas Simon
doug.simon at oracle.com
Tue Jan 18 22:40:52 UTC 2022
I think we’re going to be able to better help if you put up a PR on GitHub (preferably a PR on your personal fork of https://github.com/openjdk/jdk). That way, there’s no need to guess at missing details of your problem.
-Doug
> On 19 Jan 2022, at 08:31, Fotios Kounelis <foths.kounelhs at gmail.com> wrote:
>
> Hi Tom,
>
> Thank you for your reply. My bad example was an attempt to use jni in the HotSpot internals. What I am trying to do is: a function returning an int[] array, filled with values of another existing array.
>
> So, my function 1) needs to return void 2) have an oop obj initialized with new_intArray 3) fill the values using int_at_put(0...size-1, arrayWithValues[0...size-1]) and 4) use the set_vm_result() to return my array.
>
> I am not sure what you meant by "proper unpacking logic by a stub caller" for the set_vm_result, as in the same file the common use is something like "thread->set_vm_resutl(obj)", initializing just the oop obj properly with a new_typeArray.
>
> I would appreciate a quick example in case the above is not how it should work.
>
> Thank you for your time!
>
> I couldn't find (or maybe I didn't understand) the set*ArrayRegion initialization in the jni.cpp with the macros, that is why I didn't mention it above.
>
> Best regards,
>
> Fotis
>
> On 18/01/2022 21:15, Tom Rodriguez wrote:
>> proper unpacking logic by a stub caller
More information about the hotspot-dev
mailing list