RFR: 8264142: Remove TRAPS/THREAD parameters for verifier related functions

Ioi Lam ioi.lam at oracle.com
Thu Mar 25 19:59:48 UTC 2021



On 3/25/21 11:02 AM, Harold Seigel wrote:
> On Thu, 25 Mar 2021 17:54:53 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>
>>
>>> 5634: // its _class_name field.
>>> 5635: void ClassFileParser::prepend_host_package_name(const InstanceKlass* unsafe_anonymous_host) {
>>> 5636:   JavaThread* current = JavaThread::current();
>> Can you pass Thread* current as the first parameter instead?  We're trying to minimize materializing the current thread.
> How about if "ResourceMark rm(THREAD)" is changed to "ResourceMark rm;" ?  Then no Thread* is need in the function.

But we have:

   ResourceMark() : ResourceMark(Thread::current()) {}

So if the goal is to avoid calling Thread::current(), we do need to pass 
in the thread.

Thanks
- Ioi


More information about the hotspot-runtime-dev mailing list