[code-reflection] RFR: BytecodeLift implementation progress + SlotOp [v2]

Paul Sandoz psandoz at openjdk.org
Thu May 23 21:22:15 UTC 2024


On Thu, 23 May 2024 09:12:33 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> In this patch:
>> - lifting of shifts, instanceof, stack ops
>> - fixes of types resolution and conversions in generator
>> - enabled stack for conditional branches
>> - fixed lift to survive additional labels in the code
>> - implemented LocalsTypeMapper to support SlotOp for lift
>> - implemented SlotOp and SlotSSA for lift
>
> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
> 
>   minor revert in TestSmallCorpus

Marked as reviewed by psandoz (Lead).

src/java.base/share/classes/java/lang/reflect/code/bytecode/LocalsTypeMapper.java line 50:

> 48: import java.util.IdentityHashMap;
> 49: 
> 50: public final class LocalsTypeMapper {

Make package private, likewise for the slot related classes.

src/java.base/share/classes/java/lang/reflect/code/bytecode/SlotSSA.java line 277:

> 275:                     }
> 276:                 }
> 277:             }

IIUC it should be possible to move this computation into `findSlots` or before the for loop, as it is not dependent on `df`, it uses the `work` to avoid cycles, and conditionally adds to the consumers.

src/java.base/share/classes/java/lang/reflect/code/bytecode/SlotSSA.java line 304:

> 302:     }
> 303: 
> 304:     record PaC(Set<Block> producers, Set<Block> consumers) {

Suggestion:

    record SlotAccesses(Set<Block> stores, Set<Block> loadsBeforeStores) {

?

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

PR Review: https://git.openjdk.org/babylon/pull/80#pullrequestreview-2074841828
PR Review Comment: https://git.openjdk.org/babylon/pull/80#discussion_r1612208646
PR Review Comment: https://git.openjdk.org/babylon/pull/80#discussion_r1612236847
PR Review Comment: https://git.openjdk.org/babylon/pull/80#discussion_r1612219907


More information about the babylon-dev mailing list