public abstract class InvocationPlugin extends Object implements GraphBuilderPlugin
| Modifier and Type | Class and Description |
|---|---|
static class |
InvocationPlugin.InlineOnlyInvocationPlugin |
static class |
InvocationPlugin.OptionalInvocationPlugin |
static interface |
InvocationPlugin.Receiver
The receiver in a non-static method.
|
static class |
InvocationPlugin.RequiredInlineOnlyInvocationPlugin |
static class |
InvocationPlugin.RequiredInvocationPlugin |
| Modifier and Type | Field and Description |
|---|---|
String |
argumentsDescriptor
Argument descriptor of the method.
|
boolean |
isStatic
Determines if the method is static.
|
String |
name
Name of the method.
|
| Constructor and Description |
|---|
InvocationPlugin(String name,
Type... argumentTypes) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3,
ValueNode arg4) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3,
ValueNode arg4,
ValueNode arg5) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3,
ValueNode arg4,
ValueNode arg5,
ValueNode arg6) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3,
ValueNode arg4,
ValueNode arg5,
ValueNode arg6,
ValueNode arg7) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3,
ValueNode arg4,
ValueNode arg5,
ValueNode arg6,
ValueNode arg7,
ValueNode arg8) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3,
ValueNode arg4,
ValueNode arg5,
ValueNode arg6,
ValueNode arg7,
ValueNode arg8,
ValueNode arg9) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3,
ValueNode arg4,
ValueNode arg5,
ValueNode arg6,
ValueNode arg7,
ValueNode arg8,
ValueNode arg9,
ValueNode arg10) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3,
ValueNode arg4,
ValueNode arg5,
ValueNode arg6,
ValueNode arg7,
ValueNode arg8,
ValueNode arg9,
ValueNode arg10,
ValueNode arg11) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3,
ValueNode arg4,
ValueNode arg5,
ValueNode arg6,
ValueNode arg7,
ValueNode arg8,
ValueNode arg9,
ValueNode arg10,
ValueNode arg11,
ValueNode arg12) |
boolean |
apply(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode arg1,
ValueNode arg2,
ValueNode arg3,
ValueNode arg4,
ValueNode arg5,
ValueNode arg6,
ValueNode arg7,
ValueNode arg8,
ValueNode arg9,
ValueNode arg10,
ValueNode arg11,
ValueNode arg12,
ValueNode arg13) |
boolean |
canBeDisabled()
Determines if this plugin can be disabled.
|
boolean |
defaultHandler(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode... args)
Handles an invocation when a specific
apply method is not available. |
boolean |
execute(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode[] argsIncludingReceiver)
Executes this plugin against a set of invocation arguments.
|
int |
getArgumentsSize() |
String |
getMethodNameWithArgumentsDescriptor() |
String |
getSourceLocation() |
boolean |
inlineOnly()
Determines if this plugin can only be used when inlining the method is it associated with.
|
boolean |
isDecorator()
Determines if this plugin only decorates the method is it associated with.
|
boolean |
isOptional()
Determines if this plugin requires the original method to be resolvable.
|
boolean |
match(InvocationPlugin other) |
boolean |
match(ResolvedJavaMethod method) |
void |
rewriteReceiverType(Type receiverType)
Rewrite the first element of
InvocationPlugin.argumentTypes to receiverType for non-static
method. |
public final String name
public final boolean isStatic
public final String argumentsDescriptor
public boolean inlineOnly()
public boolean isDecorator()
public boolean isOptional()
Reference#refersTo0 is introduced in Java 16 and is optional in earlier versions in
case it may be backported.public boolean canBeDisabled()
InvocationPlugins.Options.DisableIntrinsics.public void rewriteReceiverType(Type receiverType)
InvocationPlugin.argumentTypes to receiverType for non-static
method.public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3, ValueNode arg4)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3, ValueNode arg4, ValueNode arg5)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3, ValueNode arg4, ValueNode arg5, ValueNode arg6)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3, ValueNode arg4, ValueNode arg5, ValueNode arg6, ValueNode arg7)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3, ValueNode arg4, ValueNode arg5, ValueNode arg6, ValueNode arg7, ValueNode arg8)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3, ValueNode arg4, ValueNode arg5, ValueNode arg6, ValueNode arg7, ValueNode arg8, ValueNode arg9)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3, ValueNode arg4, ValueNode arg5, ValueNode arg6, ValueNode arg7, ValueNode arg8, ValueNode arg9, ValueNode arg10)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3, ValueNode arg4, ValueNode arg5, ValueNode arg6, ValueNode arg7, ValueNode arg8, ValueNode arg9, ValueNode arg10, ValueNode arg11)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3, ValueNode arg4, ValueNode arg5, ValueNode arg6, ValueNode arg7, ValueNode arg8, ValueNode arg9, ValueNode arg10, ValueNode arg11, ValueNode arg12)
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode arg1, ValueNode arg2, ValueNode arg3, ValueNode arg4, ValueNode arg5, ValueNode arg6, ValueNode arg7, ValueNode arg8, ValueNode arg9, ValueNode arg10, ValueNode arg11, ValueNode arg12, ValueNode arg13)
public boolean execute(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode[] argsIncludingReceiver)
InvocationPlugin dispatches to the apply(...)
method that matches the number of arguments.targetMethod - the method for which this plugin is being appliedreceiver - access to the receiver, null if targetMethod is staticargsIncludingReceiver - all arguments to the invocation include the receiver in position
0 if targetMethod is not statictrue if this plugin handled the invocation of targetMethod
false if the graph builder should process the invoke further (e.g., by
inlining it or creating an Invoke node). A plugin that does not handle an
invocation must not modify the graph being constructed unless it is a
decorator.public boolean defaultHandler(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode... args)
apply method is not available.public String getSourceLocation()
public int getArgumentsSize()
public String getMethodNameWithArgumentsDescriptor()
public boolean match(InvocationPlugin other)
public boolean match(ResolvedJavaMethod method)