[foreign] RFR: avoid use of ids for upcall handlers
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Mon Jun 25 18:09:53 UTC 2018
Hi,
I've attempted to replace the use of integer ids to represent the upcall
handler we wish to call from native code. Instead, this patch stores the
address of the upcall handler object _inside_ the generate stub (and has
the stub jump over it). Since the GC can move objects around, what is
saved in the code buffer is a global jni handle. I also added logic to
deallocate both the stub and the global handle when the associated
UpcallStub Java object is no longer used - this never happened before
since all the UpcallHandler instances were kept alive inside a static
array list (which is now removed).
Webrev:
http://cr.openjdk.java.net/~mcimadamore/panama/upcall_cleanup/
Maurizio
More information about the panama-dev
mailing list