public class GraphKit extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
GraphKit.IfState |
(package private) static class |
GraphKit.IfStructure |
(package private) static class |
GraphKit.Structure |
| Modifier and Type | Field and Description |
|---|---|
protected StructuredGraph |
graph |
protected GraphBuilderConfiguration.Plugins |
graphBuilderPlugins |
protected FixedWithNextNode |
lastFixedNode |
protected Providers |
providers |
private List<GraphKit.Structure> |
structures |
protected WordTypes |
wordTypes |
| Constructor and Description |
|---|
GraphKit(StructuredGraph graph,
Providers providers,
WordTypes wordTypes,
GraphBuilderConfiguration.Plugins graphBuilderPlugins) |
| Modifier and Type | Method and Description |
|---|---|
<T extends FixedNode> |
append(T node)
Appends a fixed node to the graph.
|
<T extends ValueNode> |
changeToWord(T node) |
boolean |
checkArgs(ResolvedJavaMethod method,
ValueNode... args)
Determines if a given set of arguments is compatible with the signature of a given method.
|
InvokeNode |
createInvoke(Class<?> declaringClass,
String name,
CallTargetNode.InvokeKind invokeKind,
FrameStateBuilder frameStateBuilder,
int bci,
ValueNode... args)
Creates and appends an
InvokeNode for a call to a given method with a given set of
arguments. |
InvokeNode |
createInvoke(Class<?> declaringClass,
String name,
ValueNode... args) |
InvokeNode |
createInvoke(ResolvedJavaMethod method,
CallTargetNode.InvokeKind invokeKind,
FrameStateBuilder frameStateBuilder,
int bci,
ValueNode... args)
Creates and appends an
InvokeNode for a call to a given method with a given set of
arguments. |
protected MethodCallTargetNode |
createMethodCallTarget(CallTargetNode.InvokeKind invokeKind,
ResolvedJavaMethod targetMethod,
ValueNode[] args,
JavaType returnType,
int bci) |
void |
elsePart() |
void |
endIf() |
ResolvedJavaMethod |
findMethod(Class<?> declaringClass,
String name,
boolean isStatic) |
StructuredGraph |
getGraph() |
protected <T extends GraphKit.Structure> |
getTopStructure(Class<T> expectedClass) |
void |
inline(InvokeNode invoke)
Inlines a given invocation to a method.
|
void |
inlineInvokes()
Recursively inlines all invocations currently in the graph.
|
protected void |
popStructure() |
protected void |
pushStructure(GraphKit.Structure structure) |
private GraphKit.IfStructure |
saveLastNode() |
void |
startIf(LogicNode condition,
double trueProbability)
Starts an if-block.
|
void |
thenPart() |
<T extends FloatingNode> |
unique(T node)
Ensures a floating node is added to or already present in the graph via
Graph.unique(T). |
protected final StructuredGraph graph
protected final GraphBuilderConfiguration.Plugins graphBuilderPlugins
protected FixedWithNextNode lastFixedNode
private final List<GraphKit.Structure> structures
public GraphKit(StructuredGraph graph, Providers providers, WordTypes wordTypes, GraphBuilderConfiguration.Plugins graphBuilderPlugins)
public StructuredGraph getGraph()
public <T extends FloatingNode> T unique(T node)
Graph.unique(T).node if one exists, otherwise nodepublic <T extends ValueNode> T changeToWord(T node)
public InvokeNode createInvoke(Class<?> declaringClass, String name, ValueNode... args)
public InvokeNode createInvoke(Class<?> declaringClass, String name, CallTargetNode.InvokeKind invokeKind, FrameStateBuilder frameStateBuilder, int bci, ValueNode... args)
InvokeNode for a call to a given method with a given set of
arguments. The method is looked up via reflection based on the declaring class and name.declaringClass - the class declaring the invoked methodname - the name of the invoked methodargs - the arguments to the invocationpublic ResolvedJavaMethod findMethod(Class<?> declaringClass, String name, boolean isStatic)
public InvokeNode createInvoke(ResolvedJavaMethod method, CallTargetNode.InvokeKind invokeKind, FrameStateBuilder frameStateBuilder, int bci, ValueNode... args)
InvokeNode for a call to a given method with a given set of
arguments.protected MethodCallTargetNode createMethodCallTarget(CallTargetNode.InvokeKind invokeKind, ResolvedJavaMethod targetMethod, ValueNode[] args, JavaType returnType, int bci)
public boolean checkArgs(ResolvedJavaMethod method, ValueNode... args)
args are compatible with the signature if methodAssertionError - if args are not compatible with the signature if
methodpublic void inlineInvokes()
public void inline(InvokeNode invoke)
protected void pushStructure(GraphKit.Structure structure)
protected <T extends GraphKit.Structure> T getTopStructure(Class<T> expectedClass)
protected void popStructure()
public void startIf(LogicNode condition, double trueProbability)
thenPart() to start
emitting the code executed when the condition hold; and a call to elsePart() to start
emititng the code when the condition does not hold. It must be followed by a call to
endIf() to close the if-block.condition - The condition for the if-blocktrueProbability - The estimated probability the the condition is trueprivate GraphKit.IfStructure saveLastNode()
public void thenPart()
public void elsePart()
public void endIf()