JDK-8230459: Test failed to resume JVMCI CompilerThread

Kim Barrett kim.barrett at oracle.com
Wed Oct 23 00:24:59 UTC 2019


> On Oct 22, 2019, at 9:18 AM, Doerr, Martin <martin.doerr at sap.com> wrote:
>> Sorry I don't follow. The initial Handle stored in the array was a
>> global handle. You just allocated a second global Handle. I don't see
>> any operator=() magic happening here to free one of those global
>> handles, so AFAICS you need to free one of them.
> 
> Sorry. I had implemented it differently than I wanted. Thanks for pointing me to it.
> 
> Fixed:
> http://cr.openjdk.java.net/~mdoerr/8230459_JVMCI_thread_objects/webrev.02/

Please don't do that. That's basically smashing through the JNHHandles
abstraction and writing a bunch of (lower level and tightly coupled)
code for no good reason. Just use JNIHandles::make_global and
JNHHandles::destroy_global as David suggested.

(Note that JNIHandles::make_global takes an AllocFailType argument; if
you aren't going to handle allocation failure (e.g. are just going to
call vm_exit_out_of_memory, as in webrev.02) the default will deal
with that for you.)

Alternatively, can you use JVMCI::make_global and JVMCI::destroy_global 
here?  Perhaps not, if some of this code is !UseJVMCICompiler or whatever.
That's kind of unfortunate.  (It's also unfortunate that those functions
deal with jobject, but that's a different problem.)




More information about the hotspot-compiler-dev mailing list