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

David Holmes dholmes at openjdk.org
Mon Apr 22 08:00:29 UTC 2024


On Fri, 19 Apr 2024 15:30:27 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 with a new target base due to a merge or a rebase. The pull request now contains five commits:
> 
>  - Merge branch 'master' into vme
>  - Throw preallocated SOE object.
>  - 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.
>  - Remove newline
>  - 8330578: The VM creates instance of abstract class VirtualMachineError

There are a couple of uses of NPE that may be better handled by `InternalError` - so you could just replace the `_virtual_machine_error` bits with `_internal_error` instead.

Thanks.

src/hotspot/share/utilities/exceptions.cpp line 124:

> 122:                         exc_value, message ? ": " : "", message ? message : "",
> 123:                         p2i(h_exception()), file, line, p2i(thread),
> 124:                         Universe::null_ptr_exception_instance()->print_value_string());

I think this will look odd. Throwing `InternalError` may be more appropriate.

src/hotspot/share/utilities/exceptions.cpp line 127:

> 125:     // We do not care what kind of exception we get for a thread which
> 126:     // is compiling.  We just install a dummy exception object
> 127:     thread->set_pending_exception(Universe::null_ptr_exception_instance(), file, line);

Ditto - throw `InternalError`.

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

PR Review: https://git.openjdk.org/jdk/pull/18847#pullrequestreview-2013977402
PR Review Comment: https://git.openjdk.org/jdk/pull/18847#discussion_r1574265874
PR Review Comment: https://git.openjdk.org/jdk/pull/18847#discussion_r1574266066


More information about the hotspot-dev mailing list