RFR: 8330578: The VM creates instance of abstract class VirtualMachineError [v3]

Doug Simon dnsimon at openjdk.org
Fri Apr 19 12:42:57 UTC 2024


On Fri, 19 Apr 2024 12:18:14 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> It's a bug that the VM creates an instance of the abstract class VirtualMachineError.  In the cases where we throw VME, we should throw OOM or StackOverflowError instead.
>> 
>> Tested with tier1-4.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   We don't need to link and initialize VirtualMachineError class because the lines just below it that link and initialize and create an instance of StackOverflowError will do that, since VME is a subclass of SOE.

src/hotspot/share/classfile/verifier.cpp line 257:

> 255:         // or one of it's superclasses, we're in trouble and are going
> 256:         // to infinitely recurse when we try to initialize the exception.
> 257:         // So bail out here by throwing the preallocated VM error.

The comment looks wrong now as I think `THROW_MSG_` creates a new object.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18847#discussion_r1572301454


More information about the hotspot-dev mailing list