[code-reflection] RFR: Aggregated work on Verifier and BytecodeLift deconstruction [v7]

Paul Sandoz psandoz at openjdk.org
Thu Nov 7 19:02:54 UTC 2024


On Thu, 7 Nov 2024 16:35:42 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> This PR is aggregated continuation of work on `Verifier` #247 and new simplified and deconstructed implementation of `BytecodeLift`.
>> 
>> Work on `Verifier` revealed bugs in `BytecodeLift`.
>> Fixing of the bugs adds more complexity to already very complex `BytecodeLift`.
>> The goal of this PR is to deconstruct `BytecodeLift` to its bare bones  and re-introduce a kind of bytecode dialect:
>> - `UnresolvedType.Ref` and `UnresolvedType.Int` represent references and int with all its possible sub-types
>> - `SlotOp` is an intermediate model of local variables
>> - `SlotToVarTransformer` transforms `SlotOp` to `CoreOp.VarOp`
>> - `UnresolvedTypesTransformer` transforms `UnresolvedType.Ref` and `UnresolvedType.Int` to `JavaType`.
>
> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
> 
>   BytecodeGenerator cleanup around unitialized variables + move of isDominatedBy to SlotToVarTransformer

Marked as reviewed by psandoz (Lead).

src/java.base/share/classes/java/lang/reflect/code/op/CoreOp.java line 1945:

> 1943: 
> 1944:             ArrayLoadOp(Value array, Value index) {
> 1945:                 this(array, index, ((ArrayType)array.type()).componentType());

Can you make a note to revisit this when the component type is not explicitly given (see `VarOp.resultType` as an example). The current approach allows for easier transformation of the type because it is a function of inputs (the operand type). I know we are not consistent in this area and need a better general solution.

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

PR Review: https://git.openjdk.org/babylon/pull/258#pullrequestreview-2421886268
PR Review Comment: https://git.openjdk.org/babylon/pull/258#discussion_r1833206418


More information about the babylon-dev mailing list