Skip to content
Merged
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 @@ -52,6 +52,18 @@ final class Target_java_lang_invoke_MethodType {

@TargetClass(className = "java.lang.invoke.Invokers")
final class Target_java_lang_invoke_Invokers {

/**
* Substitute to remove the {@code @DontInline} from the original method.
*/
@Substitute
static void maybeCustomize(Target_java_lang_invoke_MethodHandle mh) {
/*
* MethodHandle.maybeCustomized() is _currently_ substituted by an empty method. We still
* call it here and represent the original behavior to make it future-proof.
*/
mh.maybeCustomize();
}
}

@TargetClass(className = "java.lang.invoke.InvokerBytecodeGenerator")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
import jdk.graal.compiler.phases.common.CanonicalizerPhase;
import jdk.graal.compiler.virtual.phases.ea.PartialEscapePhase;
import jdk.internal.loader.NativeLibraries;
import jdk.internal.vm.annotation.DontInline;
import jdk.vm.ci.meta.DeoptimizationReason;
import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.ResolvedJavaField;
Expand Down Expand Up @@ -810,6 +811,10 @@ public boolean hasNeverInlineDirective(ResolvedJavaMethod method) {
return true;
}

if (AnnotationAccess.isAnnotationPresent(method, DontInline.class)) {
return true;
}

if (!SubstrateOptions.NeverInline.hasBeenSet()) {
return false;
}
Expand Down
Loading