public abstract class NodeLIRBuilder extends Object implements NodeLIRBuilderTool, LIRGenerationDebugContext
Modifier and Type | Field and Description |
---|---|
private ValueNode |
currentInstruction |
private DebugInfoBuilder |
debugInfoBuilder |
protected LIRGeneratorTool |
gen |
private ValueNode |
lastInstructionPrinted |
private Map<Class<? extends Node>,List<MatchStatement>> |
matchRules |
private NodeMap<Value> |
nodeOperands |
Constructor and Description |
---|
NodeLIRBuilder(StructuredGraph graph,
LIRGeneratorTool gen) |
Modifier and Type | Method and Description |
---|---|
void |
append(LIRInstruction op) |
protected DebugInfoBuilder |
createDebugInfoBuilder(StructuredGraph graph,
NodeValueMap nodeValueMap) |
private Value[] |
createPhiIn(AbstractMergeNode merge) |
private Value[] |
createPhiOut(AbstractMergeNode merge,
AbstractEndNode pred) |
void |
doBlock(Block block,
StructuredGraph graph,
BlockMap<List<Node>> blockMap) |
private void |
doRoot(ValueNode instr) |
void |
emitBranch(LogicNode node,
LabelRef trueSuccessor,
LabelRef falseSuccessor,
double trueSuccessorProbability) |
void |
emitCompareBranch(CompareNode compare,
LabelRef trueSuccessor,
LabelRef falseSuccessor,
double trueSuccessorProbability) |
void |
emitConditional(ConditionalNode conditional) |
Variable |
emitConditional(LogicNode node,
Value trueValue,
Value falseValue) |
void |
emitConstantBranch(boolean value,
LabelRef trueSuccessorBlock,
LabelRef falseSuccessorBlock) |
protected abstract void |
emitDirectCall(DirectCallTargetNode callTarget,
Value result,
Value[] parameters,
Value[] temps,
LIRFrameState callState) |
void |
emitIf(IfNode x) |
protected abstract void |
emitIndirectCall(IndirectCallTargetNode callTarget,
Value result,
Value[] parameters,
Value[] temps,
LIRFrameState callState) |
void |
emitIntegerTestBranch(IntegerTestNode test,
LabelRef trueSuccessor,
LabelRef falseSuccessor,
double trueSuccessorProbability) |
void |
emitInvoke(Invoke x) |
protected void |
emitNode(ValueNode node) |
private void |
emitNullCheckBranch(IsNullNode node,
LabelRef trueSuccessor,
LabelRef falseSuccessor,
double trueSuccessorProbability) |
void |
emitOverflowCheckBranch(AbstractBeginNode overflowSuccessor,
AbstractBeginNode next,
Stamp stamp,
double probability) |
protected void |
emitPrologue(StructuredGraph graph) |
void |
emitSwitch(SwitchNode x)
This method tries to create a switch implementation that is optimal for the given switch.
|
DebugInfoBuilder |
getDebugInfoBuilder() |
protected LIRKind |
getExactPhiKind(PhiNode phi) |
private static FrameState |
getFrameState(DeoptimizingNode deopt) |
LabelRef |
getLIRBlock(FixedNode b) |
LIRGeneratorTool |
getLIRGeneratorTool() |
private Value |
getOperand(Node node) |
protected LIRKind |
getPhiKind(PhiNode phi) |
Object |
getSourceForOperand(Value value)
|
boolean |
hasOperand(Node node) |
private static boolean |
isPhiInputFromBackedge(PhiNode phi,
int index) |
protected void |
matchComplexExpressions(List<Node> nodes) |
private void |
moveToPhi(AbstractMergeNode merge,
AbstractEndNode pred) |
protected StandardOp.JumpOp |
newJumpOp(LabelRef ref) |
Value |
operand(Node node)
Returns the operand that has been previously initialized by
setResult(ValueNode, Value) with the result of an instruction. |
private Value |
operandForPhi(ValuePhiNode phi) |
protected abstract boolean |
peephole(ValueNode valueNode) |
void |
setMatchResult(Node x,
Value operand)
Used by the
MatchStatement machinery to override the generation LIR for some
ValueNodes. |
Value |
setResult(ValueNode x,
Value operand)
Associates
operand with the node in the current block. |
LIRFrameState |
state(DeoptimizingNode deopt) |
LIRFrameState |
stateFor(FrameState state) |
LIRFrameState |
stateForWithExceptionEdge(FrameState state,
LabelRef exceptionEdge) |
LIRFrameState |
stateWithExceptionEdge(DeoptimizingNode deopt,
LabelRef exceptionEdge) |
ValueNode |
valueForOperand(Value value)
Gets the the
ValueNode that produced a value . |
private static boolean |
verifyPHIKind(LIRKind derivedKind,
LIRKind phiKind) |
void |
visitEndNode(AbstractEndNode end) |
void |
visitFullInfopointNode(FullInfopointNode i) |
Value[] |
visitInvokeArguments(CallingConvention invokeCc,
Collection<ValueNode> arguments) |
void |
visitLoopEnd(LoopEndNode x)
Runtime specific classes can override this to insert a safepoint at the end of a loop.
|
void |
visitMerge(AbstractMergeNode x) |
void |
visitSimpleInfopointNode(SimpleInfopointNode i) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visitBreakpointNode, visitSafepointNode
getFromDebugContext, getSourceForOperandFromDebugContext
private final NodeMap<Value> nodeOperands
private final DebugInfoBuilder debugInfoBuilder
protected final LIRGeneratorTool gen
private ValueNode currentInstruction
private ValueNode lastInstructionPrinted
private Map<Class<? extends Node>,List<MatchStatement>> matchRules
public NodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool gen)
protected DebugInfoBuilder createDebugInfoBuilder(StructuredGraph graph, NodeValueMap nodeValueMap)
public Value operand(Node node)
setResult(ValueNode, Value)
with the result of an instruction. It's a code
generation error to ask for the operand of ValueNode that doesn't have one yet.operand
in interface NodeValueMap
node
- A node that produces a result value.public boolean hasOperand(Node node)
hasOperand
in interface NodeValueMap
true
if there is an operand
associated with the node
in
the current block.private Value getOperand(Node node)
public ValueNode valueForOperand(Value value)
NodeValueMap
ValueNode
that produced a value
. If the value
is not
associated with a ValueNode
null
is returned.
This method is intended for debugging purposes only.valueForOperand
in interface NodeValueMap
public Object getSourceForOperand(Value value)
LIRGenerationDebugContext
getSourceForOperand
in interface LIRGenerationDebugContext
public Value setResult(ValueNode x, Value operand)
NodeValueMap
operand
with the node
in the current block.setResult
in interface NodeValueMap
operand
public void setMatchResult(Node x, Value operand)
MatchStatement
machinery to override the generation LIR for some
ValueNodes.public LabelRef getLIRBlock(FixedNode b)
public final void append(LIRInstruction op)
protected LIRKind getExactPhiKind(PhiNode phi)
private static boolean verifyPHIKind(LIRKind derivedKind, LIRKind phiKind)
private static boolean isPhiInputFromBackedge(PhiNode phi, int index)
private Value[] createPhiIn(AbstractMergeNode merge)
private Value[] createPhiOut(AbstractMergeNode merge, AbstractEndNode pred)
public void doBlock(Block block, StructuredGraph graph, BlockMap<List<Node>> blockMap)
doBlock
in interface NodeLIRBuilderTool
protected void matchComplexExpressions(List<Node> nodes)
protected void emitPrologue(StructuredGraph graph)
public void visitMerge(AbstractMergeNode x)
visitMerge
in interface NodeLIRBuilderTool
public void visitEndNode(AbstractEndNode end)
visitEndNode
in interface NodeLIRBuilderTool
public void visitLoopEnd(LoopEndNode x)
visitLoopEnd
in interface NodeLIRBuilderTool
private void moveToPhi(AbstractMergeNode merge, AbstractEndNode pred)
protected StandardOp.JumpOp newJumpOp(LabelRef ref)
protected LIRKind getPhiKind(PhiNode phi)
private Value operandForPhi(ValuePhiNode phi)
public void emitIf(IfNode x)
emitIf
in interface NodeLIRBuilderTool
public void emitBranch(LogicNode node, LabelRef trueSuccessor, LabelRef falseSuccessor, double trueSuccessorProbability)
private void emitNullCheckBranch(IsNullNode node, LabelRef trueSuccessor, LabelRef falseSuccessor, double trueSuccessorProbability)
public void emitCompareBranch(CompareNode compare, LabelRef trueSuccessor, LabelRef falseSuccessor, double trueSuccessorProbability)
public void emitIntegerTestBranch(IntegerTestNode test, LabelRef trueSuccessor, LabelRef falseSuccessor, double trueSuccessorProbability)
public void emitConstantBranch(boolean value, LabelRef trueSuccessorBlock, LabelRef falseSuccessorBlock)
public void emitConditional(ConditionalNode conditional)
emitConditional
in interface NodeLIRBuilderTool
public Variable emitConditional(LogicNode node, Value trueValue, Value falseValue)
public void emitInvoke(Invoke x)
emitInvoke
in interface NodeLIRBuilderTool
protected abstract void emitDirectCall(DirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState)
protected abstract void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState)
public Value[] visitInvokeArguments(CallingConvention invokeCc, Collection<ValueNode> arguments)
visitInvokeArguments
in interface NodeLIRBuilderTool
public void emitSwitch(SwitchNode x)
emitSwitch
in interface NodeLIRBuilderTool
public DebugInfoBuilder getDebugInfoBuilder()
private static FrameState getFrameState(DeoptimizingNode deopt)
public LIRFrameState state(DeoptimizingNode deopt)
state
in interface NodeLIRBuilderTool
public LIRFrameState stateWithExceptionEdge(DeoptimizingNode deopt, LabelRef exceptionEdge)
public LIRFrameState stateFor(FrameState state)
public LIRFrameState stateForWithExceptionEdge(FrameState state, LabelRef exceptionEdge)
public void emitOverflowCheckBranch(AbstractBeginNode overflowSuccessor, AbstractBeginNode next, Stamp stamp, double probability)
emitOverflowCheckBranch
in interface NodeLIRBuilderTool
public void visitFullInfopointNode(FullInfopointNode i)
visitFullInfopointNode
in interface NodeLIRBuilderTool
public void visitSimpleInfopointNode(SimpleInfopointNode i)
visitSimpleInfopointNode
in interface NodeLIRBuilderTool
public LIRGeneratorTool getLIRGeneratorTool()
getLIRGeneratorTool
in interface NodeLIRBuilderTool