On Tue, 27 Jan 2026 09:55:15 GMT, Joel Sikström <[email protected]> wrote:

>> No, I didn't consider any pending exceptions when I added the CHECK. I see 
>> that we have an `assert(false, ...)` down in the Metaspace allocation if 
>> there's a pending exception, so we really shouldn't try to allocate the 
>> array of InlineLayoutInfo if there's a pending exception, which makes sense.
>> 
>> Looking at the code, I think we should re-arrange it so that we clear any 
>> pending exception before calling `set_inline_layout_info_klass`, while 
>> keeping the `CHECK` so that we exit from 
>> `ClassFileParser::post_process_parsed_stream` if we fail to allocate in 
>> Metaspace. This seems to me to be consistent with the old behavior, but it 
>> would be nice for someone to fill in here.
>
> After looking at this for a bit longer I argue that we should never get a 
> resolved klass (non-nullptr) with a pending exception, so the code can be 
> simplified a bit further.

Correct, if SystemDictionary::resolve_super_or_fail() returns a non-null 
pointer, no exception should have been set by this method, and the methods call 
before resolve_super_or_fail() have a CHECK argument, ensuring the call to 
SystemDictionary::resolve_super_or_fail() cannot be reached with a pending 
exception.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1966#discussion_r2743559749

Reply via email to