Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,23 @@ public void test() {
runTest("testThrow");
runTest("testRangeCheck");
runTest("testImplicitCast");
runTest("testBCDSLPrologIfVersion");
}

/*
* 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;
}

@SuppressWarnings("try")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,7 @@ public static boolean shouldDenyTrivialInlining(TruffleHostEnvironment env, Reso
info.isTruffleBoundary() ||
types.isInInterpreter(callee) ||
types.isInInterpreterFastPath(callee) ||
types.isHasNextTier(callee) ||
types.isTransferToInterpreterMethod(callee));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public final class TruffleKnownHostTypes extends AbstractKnownTruffleTypes {
public final ResolvedJavaMethod CompilerDirectives_transferToInterpreter = findMethod(CompilerDirectives, "transferToInterpreter");
public final ResolvedJavaMethod CompilerDirectives_transferToInterpreterAndInvalidate = findMethod(CompilerDirectives, "transferToInterpreterAndInvalidate");
public final ResolvedJavaMethod CompilerDirectives_inInterpreter = findMethod(CompilerDirectives, "inInterpreter");
public final ResolvedJavaMethod CompilerDirectives_hasNextTier = findMethod(CompilerDirectives, "hasNextTier");

public final ResolvedJavaType HostCompilerDirectives = lookupTypeCached("com.oracle.truffle.api.HostCompilerDirectives");
public final ResolvedJavaMethod HostCompilerDirectives_inInterpreterFastPath = findMethod(HostCompilerDirectives, "inInterpreterFastPath");
Expand All @@ -75,6 +76,10 @@ public boolean isInInterpreterFastPath(ResolvedJavaMethod method) {
return method.equals(HostCompilerDirectives_inInterpreterFastPath);
}

public boolean isHasNextTier(ResolvedJavaMethod method) {
return method.equals(CompilerDirectives_hasNextTier);
}

/**
* Determines if {@code method} is a method is a transferToInterpreter method from
* CompilerDirectives.
Expand Down
Loading