[foreign] RFR: 8227125: java/foreign/pthread/Threads.java asserts on debug build

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Jul 3 09:09:31 UTC 2019


Looks great - one question - in the universal invokers there's no assert 
for whether the thread you get back is indeed a Java thread, whereas the 
assert is there in the upcall handlers. Why?

Maurizio

On 03/07/2019 07:33, Nick Gasson wrote:
> Hi,
>
> The fix for 8226250 checks the result of JavaThread::current() for 
> NULL to see if this thread is attached to the VM or not. But this 
> function will assert on a debug build rather than return NULL. This 
> patch uses Thread::current_or_null() instead which allows a NULL result.
>
> Made this change in both the universal upcall handler and the direct 
> fast-path. The universal handler also has an issue where 
> JavaCallArguments will do an allocation if the number of arguments is 
> greater than 8. But when the thread has just attached to the VM there 
> is no ResourceMark on the stack to associate the allocation with. I 
> changed the test to run a second time without the fast-path to catch 
> this.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8227125
> Webrev: http://cr.openjdk.java.net/~ngasson/foreign/8227125/webrev.0/
>
> Thanks,
> Nick


More information about the panama-dev mailing list