Confusion about stack map verify of constructors
David Holmes
david.holmes at oracle.com
Tue Jun 29 20:53:05 UTC 2021
Hi,
On 29/06/2021 5:57 pm, NekoCaffeine wrote:
> Hi everyone,
>
>
> When a super constructor is called in a TryCatchBlock,
> none of the following exception handler locals will pass validation,
> uninitializedThis, referenceName, TOP, <empty>, java/lang/Object.
This is a deliberate design decision in the language. You are not
allowed to put a super constructor call in a try/catch because it would
result in partially constructed objects. If you super constructor fails
by throwing an exception then your constructor must also fail by
throwing the exception.
Cheers,
David
>
> Where uninitializedThis and referenceName are mutually exclusive,
> and either one will fail because it does not contain the other.
> TOP will fail because it is not compatible with the flags of uninitializedThis.
> <empty> will fail for incompatibility with uninitializedThis.
>
>
> Is there a stackframe that passes validation?
>
>
> Thanks in advance,
> NekoCaffeine
>
More information about the hotspot-runtime-dev
mailing list