public static class SnippetTemplate.Arguments extends Object implements Formattable
add(java.lang.String, java.lang.Object)
,
addConst(java.lang.String, java.lang.Object)
, and addVarargs(java.lang.String, java.lang.Class<?>, com.oracle.graal.compiler.common.type.Stamp, java.lang.Object)
must be called in the same order as in the
signature of the snippet method. The parameter name is passed to the add methods for
assertion checking, i.e., to enforce that the order matches. Which method needs to be called
depends on the annotation of the snippet method parameter:
add(java.lang.String, java.lang.Object)
for a parameter without an annotation. The value is bound when the
SnippetTemplate
is instantiated
.
addConst(java.lang.String, java.lang.Object)
for a parameter annotated with Snippet.ConstantParameter
. The value
is bound when the SnippetTemplate
is created
.
addVarargs(java.lang.String, java.lang.Class<?>, com.oracle.graal.compiler.common.type.Stamp, java.lang.Object)
for an array parameter annotated with Snippet.VarargsParameter
. A
separate SnippetTemplate
is created
for every
distinct array length. The actual values are bound when the SnippetTemplate
is
instantiated
Modifier and Type | Field and Description |
---|---|
protected boolean |
cacheable |
protected SnippetTemplate.CacheKey |
cacheKey |
protected Stamp[] |
constStamps |
protected SnippetTemplate.SnippetInfo |
info |
protected int |
nextParamIdx |
protected Object[] |
values |
Constructor and Description |
---|
Arguments(SnippetTemplate.SnippetInfo info,
StructuredGraph.GuardsStage guardsStage,
LoweringTool.LoweringStage loweringStage) |
Modifier and Type | Method and Description |
---|---|
SnippetTemplate.Arguments |
add(String name,
Object value) |
SnippetTemplate.Arguments |
addConst(String name,
Object value) |
SnippetTemplate.Arguments |
addConst(String name,
Object value,
Stamp stamp) |
SnippetTemplate.Arguments |
addVarargs(String name,
Class<?> componentType,
Stamp argStamp,
Object value) |
private boolean |
check(String name,
boolean constParam,
boolean varargsParam) |
void |
formatTo(Formatter formatter,
int flags,
int width,
int precision) |
void |
setCacheable(boolean cacheable) |
String |
toString() |
protected final SnippetTemplate.SnippetInfo info
protected final SnippetTemplate.CacheKey cacheKey
protected final Stamp[] constStamps
protected boolean cacheable
protected int nextParamIdx
public Arguments(SnippetTemplate.SnippetInfo info, StructuredGraph.GuardsStage guardsStage, LoweringTool.LoweringStage loweringStage)
public SnippetTemplate.Arguments add(String name, Object value)
public SnippetTemplate.Arguments addConst(String name, Object value)
public SnippetTemplate.Arguments addConst(String name, Object value, Stamp stamp)
public SnippetTemplate.Arguments addVarargs(String name, Class<?> componentType, Stamp argStamp, Object value)
public void setCacheable(boolean cacheable)
public void formatTo(Formatter formatter, int flags, int width, int precision)
formatTo
in interface Formattable