use of jdk.vm.ci.meta.TriState in project graal by oracle.
the class InstanceOfNode method virtualize.
@Override
public void virtualize(VirtualizerTool tool) {
ValueNode alias = tool.getAlias(getValue());
TriState fold = tryFold(alias.stamp(NodeView.DEFAULT));
if (fold != TriState.UNKNOWN) {
tool.replaceWithValue(LogicConstantNode.forBoolean(fold.isTrue(), graph()));
}
}
use of jdk.vm.ci.meta.TriState in project graal by oracle.
the class IsNullNode method virtualize.
@Override
public void virtualize(VirtualizerTool tool) {
ValueNode alias = tool.getAlias(getValue());
TriState fold = tryFold(alias.stamp(NodeView.DEFAULT));
if (fold != TriState.UNKNOWN) {
tool.replaceWithValue(LogicConstantNode.forBoolean(fold.isTrue(), graph()));
}
}
use of jdk.vm.ci.meta.TriState in project graal by oracle.
the class LoopFragment method markFloating.
private static void markFloating(Deque<WorkListEntry> workList, Node start, NodeBitMap loopNodes, NodeBitMap nonLoopNodes) {
if (isLoopNode(start, loopNodes, nonLoopNodes).isKnown()) {
return;
}
pushWorkList(workList, start, loopNodes);
while (!workList.isEmpty()) {
WorkListEntry currentEntry = workList.peek();
if (currentEntry.usages.hasNext()) {
Node current = currentEntry.usages.next();
TriState result = isLoopNode(current, loopNodes, nonLoopNodes);
if (result.isKnown()) {
if (result.toBoolean()) {
currentEntry.isLoopNode = true;
}
} else {
pushWorkList(workList, current, loopNodes);
}
} else {
workList.pop();
boolean isLoopNode = currentEntry.isLoopNode;
Node current = currentEntry.n;
if (!isLoopNode && current instanceof GuardNode) {
/*
* (gd) this is only OK if we are not going to make loop transforms based on
* this
*/
assert !((GuardNode) current).graph().hasValueProxies();
isLoopNode = true;
}
if (isLoopNode) {
loopNodes.mark(current);
for (WorkListEntry e : workList) {
e.isLoopNode = true;
}
} else {
nonLoopNodes.mark(current);
}
}
}
}
Aggregations