Skip to content

[Backport] [Oracle GraalVM] [GR-69291] Backport to 23.1: Do not inline hasNextTier in parsing.#271

Open
bulasevich wants to merge 1 commit intograalvm:masterfrom
bulasevich:GR-69291
Open

[Backport] [Oracle GraalVM] [GR-69291] Backport to 23.1: Do not inline hasNextTier in parsing.#271
bulasevich wants to merge 1 commit intograalvm:masterfrom
bulasevich:GR-69291

Conversation

@bulasevich
Copy link
Copy Markdown
Collaborator

@bulasevich bulasevich commented Apr 7, 2026

This PR backports:

Conflicts: Minor merge issues

Details

Merge issue: different context, missing testNativeCall test on graalvm-community-jdk21u branch

<<<<<<< HEAD:compiler/src/jdk.internal.vm.compiler.test/src/org/graalvm/compiler/truffle/test/HostInliningTest.java
=======
        runTest("testNativeCall");
        runTest("testBCDSLPrologIfVersion");
    }

    /*
     * Test for GR-69170
     */
    @BytecodeInterpreterSwitch
    static Object testBCDSLPrologIfVersion(int value) {
        Object o = null;
        if (!CompilerDirectives.inInterpreter() && CompilerDirectives.hasNextTier()) {
            GraalDirectives.deoptimize();
            o = new Object();
        }
        // must be inlined
        trivialMethod();
        return o;
>>>>>>> 3a3230502ee (do not inline hasNextTier in parsing, is required for correct host):compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/HostInliningTest.java

Merge issue: different context, missing types on graalvm-community-jdk21u branch

<<<<<<< HEAD:compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/truffle/compiler/host/TruffleKnownHostTypes.java
=======
    public final ResolvedJavaMethod CompilerDirectives_hasNextTier = findMethod(CompilerDirectives, "hasNextTier");
    public final ResolvedJavaType TruffleBoundary = lookupType("com.oracle.truffle.api.CompilerDirectives$TruffleBoundary");
    public final ResolvedJavaType BytecodeInterpreterSwitch = lookupType("com.oracle.truffle.api.HostCompilerDirectives$BytecodeInterpreterSwitch");
    public final ResolvedJavaType BytecodeInterpreterSwitchBoundary = lookupType("com.oracle.truffle.api.HostCompilerDirectives$BytecodeInterpreterSwitchBoundary");
    public final ResolvedJavaType InliningCutoff = lookupType("com.oracle.truffle.api.HostCompilerDirectives$InliningCutoff");
>>>>>>> 3a3230502ee (do not inline hasNextTier in parsing, is required for correct host):compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/host/TruffleKnownHostTypes.java

Additional change to address CI complaint "Parameter value not used":

   /*
     * Test for GR-69170
     */
+   @SuppressWarnings("unused")
    @BytecodeInterpreterSwitch
    static Object testBCDSLPrologIfVersion(int value) {
        Object o = null;
        if (!CompilerDirectives.inInterpreter() && CompilerDirectives.hasNextTier()) {
            GraalDirectives.deoptimize();
            o = new Object();
        }
        // must be inlined
        trivialMethod();
        return o;
    }

Closes: #252

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Apr 7, 2026
@jerboaa jerboaa added this to the 23.1.12 milestone Apr 7, 2026
inlining

(cherry picked from commit 3a3230502eeaa639588c830ed84f0cddd6a7e4a2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backport] [Oracle GraalVM] [GR-69291] Backport to 23.1: Do not inline hasNextTier in parsing.

3 participants