On Thu, 2 Jul 2026 04:41:56 GMT, David Holmes <[email protected]> wrote:

>> No, I thought it had been mentioned by someone else in our internal 
>> discussions that the caller had to be a Java frame and so class-initializers 
>> did not have to have any special handling.
>
> Though I will say that it seems very inconsistent that two very similar 
> operations - terminate the current frame- would have different constraints in 
> this regard.

ForceEarlyReturn is simpler in that it just needs to arm the suspended target 
VM to return early when resumed. 

PopFrame is more complicated as it involves removing the current activation and 
restoring state to that the method can be re-invoked. Surprisingly, the spec 
doesn't prohibit PopFrame when the target thread is suspended in a class 
initializer. It fails with OPAQUE_FRAME of course because the caller is the VM. 
Maybe some other VM might allow it but it's seems an insane thing to do in the 
first place (the developer using a debugger wants to re-run the class 
initializer??). Maybe some future work in this area could have the spec 
prohibit it.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2604#discussion_r3510963407

Reply via email to