Classfile API cleanup of labelToBci from CodeModel and CodeBuilder and removal of impl.LabelResolver
Michael van Acken
michael.van.acken at gmail.com
Thu Aug 18 17:24:53 UTC 2022
[Mail delivery is flaky today. Trying again...]
Am Do., 18. Aug. 2022 um 17:41 Uhr schrieb Adam Sotona <
adam.sotona at oracle.com>:
> Hi,
>
> I have another Classfile API change proposal to discuss.
>
> Method labelToBci from impl.LabelResolver is exposed through CodeModel.
>
> I propose to completely remove impl.LabelResolver and move the label
> resolution functionality to CodeAttribute::labelToBci.
>
> CodeAttribute is the only API subclass of CodeModel where the bytecode
> index can be successfully resolved and where it makes sense to use it
> together with CodeAttribute::codeArray.
>
>
>
> Also CodeBuilder exposes method labelToBci, even it does not subclass
> LabelResolver.
>
> I propose to remove CodeBuilder::labelToBci as it is just another exposure
> of internal functionality and should not serve to users.
>
I have a single use of CodeBuilder.labelToBci(): decide whether the labels
marking
the start and end of a try block refer to the same position, as a proxy for
"enclosed
region is empty". If this is the case, then no exceptionCatch can be
installed and
all exception handlers become unreachable.
How can this scenario still be supported?
-- mva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20220818/d670aeab/attachment.htm>
More information about the classfile-api-dev
mailing list