ExceptionRegion modeling issues and proposed improvements
Adam Sotona
adam.sotona at oracle.com
Thu Oct 10 08:04:19 UTC 2024
From: Paul Sandoz <paul.sandoz at oracle.com>
> Is the catch block stack order important? Can we encounter an exception region exit that refers to B when the top of the stack is C?
Intuitively I would say the order should be preserved and my brain model for that is a lifo stack, however that idea is inferred from JLS.
Practically there is nothing preventing to have a bytecode with exception table entries starting and ending independently of each other.
Absolute order of the exception table entries is critical, however the whole exception region (a section of bytecode handling specific exception by a specific handler) can consist of multiple exception table entries and can (theoretically) appear in a different relative order to other regions in different situations.
I'll scan some code to collect all real situations versus what is theoretically possible. I think I've seen gaps (instructions exclusions) of a top level try block, while the nested was uninterrupted (however need to find it to confirm).
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/babylon-dev/attachments/20241010/2b826897/attachment-0001.htm>
More information about the babylon-dev
mailing list