public interface Replacements
Modifier and Type | Method and Description |
---|---|
Collection<ResolvedJavaMethod> |
getAllReplacements()
Returns all methods that are currently registered as method/macro substitution or as a
snippet.
|
StructuredGraph |
getSnippet(ResolvedJavaMethod method,
Object[] args)
Gets the snippet graph derived from a given method.
|
StructuredGraph |
getSnippet(ResolvedJavaMethod method,
ResolvedJavaMethod recursiveEntry,
Object[] args)
Gets the snippet graph derived from a given method.
|
<T extends SnippetTemplateCache> |
getSnippetTemplateCache(Class<T> templatesClass)
Get snippet templates that were registered with
registerSnippetTemplateCache(SnippetTemplateCache) . |
StructuredGraph |
getSubstitution(ResolvedJavaMethod method,
boolean fromBytecodeOnly,
int invokeBci)
Gets a graph that is a substitution for a given method.
|
default StructuredGraph |
getSubstitution(ResolvedJavaMethod method,
int invokeBci)
Gets a graph that is a substitution for a given method.
|
ResolvedJavaMethod |
getSubstitutionMethod(ResolvedJavaMethod method)
Gets a method that is a substitution for a given method.
|
boolean |
hasSubstitution(ResolvedJavaMethod method,
boolean fromBytecodeOnly,
int invokeBci)
Determines if there is a substitution
graph for a given method.
|
default boolean |
hasSubstitution(ResolvedJavaMethod method,
int invokeBci)
Determines if there is a substitution
graph for a given method.
|
void |
registerSnippet(ResolvedJavaMethod method)
Registers a method as snippet.
|
void |
registerSnippetTemplateCache(SnippetTemplateCache snippetTemplates)
Register snippet templates.
|
void |
registerSubstitutions(Type original,
Class<?> substitutions)
Registers all the method substitutions defined by a given
class.
|
StructuredGraph getSnippet(ResolvedJavaMethod method, Object[] args)
args
- arguments to the snippet if available, otherwise null
method
StructuredGraph getSnippet(ResolvedJavaMethod method, ResolvedJavaMethod recursiveEntry, Object[] args)
recursiveEntry
- if the snippet contains a call to this method, it's considered as
recursive call and won't be processed for substitutions.args
- arguments to the snippet if available, otherwise null
method
void registerSnippet(ResolvedJavaMethod method)
default StructuredGraph getSubstitution(ResolvedJavaMethod method, int invokeBci)
invokeBci
- the call site BCI if this request is made for inlining a substitute
otherwise -1
method
StructuredGraph getSubstitution(ResolvedJavaMethod method, boolean fromBytecodeOnly, int invokeBci)
fromBytecodeOnly
- only return a graph created by parsing the bytecode of another methodinvokeBci
- the call site BCI if this request is made for inlining a substitute
otherwise -1
method
ResolvedJavaMethod getSubstitutionMethod(ResolvedJavaMethod method)
method
default boolean hasSubstitution(ResolvedJavaMethod method, int invokeBci)
invokeBci
- the call site BCI if this request is made for inlining a substitute
otherwise -1
method
boolean hasSubstitution(ResolvedJavaMethod method, boolean fromBytecodeOnly, int invokeBci)
fromBytecodeOnly
- only consider graphs created by parsing the bytecode of another
methodinvokeBci
- the call site BCI if this request is made for inlining a substitute
otherwise -1
method
void registerSubstitutions(Type original, Class<?> substitutions)
original
- the original class for which substitutions are being registered. This must be
the same type denoted by the ClassSubstitution
annotation on
substitutions
. It is required here so that an implementation is not forced
to read annotations during registration.substitutions
- the class defining substitutions for original
. This class must
be annotated with ClassSubstitution
.Collection<ResolvedJavaMethod> getAllReplacements()
void registerSnippetTemplateCache(SnippetTemplateCache snippetTemplates)
<T extends SnippetTemplateCache> T getSnippetTemplateCache(Class<T> templatesClass)
registerSnippetTemplateCache(SnippetTemplateCache)
.