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

Ioi Lam ioi.lam at oracle.com
Fri Mar 26 03:34:33 UTC 2021


On 3/25/21 2:41 PM, Coleen Phillimore wrote:
> On Thu, 25 Mar 2021 19:14:29 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>
>>> How about if "ResourceMark rm(THREAD)" is changed to "ResourceMark rm;" ?  Then no Thread* is need in the function.
>> This seems fine to me.
> I think the primary goal should be not avoid calling Thread::current() as much as possible.  Passing Thread* thread around, even as the first parameter just for a ResourceMark seems like unnecessary typing to me.  Getting the current thread isn't expensive.  From experience, if we optimized all the Thread::currents away, we'd get no benefits to performance, and it's nice that it's hidden here.  If we have an impasse here, go ahead and add the Thread parameter at the beginning, but I'd rather not see this extra parameter.
>
> Some previous project that I did (I won't admit how long ago that was), was to go through all the sources in search of Thread::current() and use whatever current thread was passed in, usually via TRAPS. I didn't gain any performance from this but the code looked nicer in the end.
>

OK, I agree that whether passing the Thread probably won't make much 
difference. The current version looks good to me.

Thanks
- Ioi



More information about the hotspot-runtime-dev mailing list