[lworld] RFR: 8378672: [lworld] Consolidate a factory to create a GraphKit from a SafePointNode [v2]

Tobias Hartmann thartmann at openjdk.org
Wed Feb 25 13:33:29 UTC 2026


On Wed, 25 Feb 2026 13:30:15 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Hi,
>> 
>> I find it is a common occurrence that we want to expand a `SafePointNode` into a subgraph, and to do that we may need to create a `JVMState` ourselves, which may easily results in cumbersome errors because the kit state is not created properly. I tried using `GraphKit` to expand generate code after a `SafePointNode` (in particular, I tried to emit an uncommon trap there), which leads to this PR which consolidates the creation of a `GraphKit` from a `SafePointNode` that we want to use its debug state.
>> 
>> Please take a look and leave your reviews, thanks a lot.
>
> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Collateral damage

test/hotspot/jtreg/compiler/c2/irTests/ProfileAtTypeCheck.java line 242:

> 240:     @IR(phase = { CompilePhase.AFTER_PARSING }, counts = { IRNode.SUBTYPE_CHECK, "2" })
> 241:     // TODO 8375442: Should be folded as early as ITER_GVN1
> 242:     @IR(phase = { CompilePhase.BEFORE_MACRO_EXPANSION }, counts = { IRNode.SUBTYPE_CHECK, "1" })

Why is this needed?

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/2163#discussion_r2853065266


More information about the valhalla-dev mailing list