RFR: 8259486: Remove CautiouslyPreserveExceptionMark

David Holmes david.holmes at oracle.com
Tue Jan 12 09:02:08 UTC 2021


On 11/01/2021 10:58 pm, Coleen Phillimore wrote:
> On Mon, 11 Jan 2021 01:13:25 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> src/hotspot/share/classfile/javaClasses.cpp line 2556:
>>
>>> 2554:
>>> 2555:   JavaThread* thread = JavaThread::active();
>>> 2556:   PreserveExceptionMark pm(thread);
>>
>> The result of JavaThread::active() is not necessarily the current thread. So either the new code is wrong or else we should just be using JavaThread::current()
> 
> My first iteration of this change knew there was a difference then I cleaned it up.  I'll restore the Thread::current() in the PEM constructor.

I'm not so sure the use of JavaThread::active() is correct. It implies 
that we will throw an exception via the VMThread, which surely is not 
allowed! ??

David
-----

> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/2007
> 


More information about the serviceability-dev mailing list