RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v3]

David Holmes dholmes at openjdk.org
Wed Oct 29 06:27:13 UTC 2025


On Fri, 24 Oct 2025 14:19:44 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/runtime/synchronizer.hpp line 230:
>> 
>>> 228:   bool    _skip_exit;
>>> 229:  public:
>>> 230:   ObjectLocker(Handle obj, TRAPS);
>> 
>> I wonder if we should declare `PREEMPTABLE_TRAPS` as an indicator that the only exception expected to come out of a call is the preempted-exception?
>
> Not sure if I like that idea because then we might have to change other callers along the way for this new convention and everybody's already confused by TRAPS so then they'd be confused by a new TRAPS too.

I don't think we would have to. There are a handful of methods that now declare TRAPS but the only exception they should ever encounter is the PreemptException. It would be easier to understand the code if this was evident in their use of TRAPS. Also note it is purely documentation - the definition of `PREEMPTABLE_TRAPS` is exactly the same as `TRAPS`

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27802#discussion_r2471840756


More information about the hotspot-dev mailing list