Search in sources :

Example 1 with AbstractCompareAndSwapNode

use of org.graalvm.compiler.nodes.java.AbstractCompareAndSwapNode in project graal by oracle.

the class WordOperationPlugin method casOp.

protected AbstractCompareAndSwapNode casOp(JavaKind writeKind, JavaKind returnKind, AddressNode address, LocationIdentity location, ValueNode expectedValue, ValueNode newValue) {
    boolean isLogic = returnKind == JavaKind.Boolean;
    assert isLogic || writeKind == returnKind : writeKind + " != " + returnKind;
    AbstractCompareAndSwapNode cas;
    if (isLogic) {
        cas = new LogicCompareAndSwapNode(address, expectedValue, newValue, location);
    } else {
        cas = new ValueCompareAndSwapNode(address, expectedValue, newValue, location);
    }
    return cas;
}
Also used : LogicCompareAndSwapNode(org.graalvm.compiler.nodes.java.LogicCompareAndSwapNode) ValueCompareAndSwapNode(org.graalvm.compiler.nodes.java.ValueCompareAndSwapNode) AbstractCompareAndSwapNode(org.graalvm.compiler.nodes.java.AbstractCompareAndSwapNode)

Example 2 with AbstractCompareAndSwapNode

use of org.graalvm.compiler.nodes.java.AbstractCompareAndSwapNode in project graal by oracle.

the class WriteBarrierAdditionPhase method run.

@SuppressWarnings("try")
@Override
protected void run(StructuredGraph graph) {
    for (Node n : graph.getNodes()) {
        try (DebugCloseable scope = n.graph().withNodeSourcePosition(n)) {
            if (n instanceof ReadNode) {
                addReadNodeBarriers((ReadNode) n, graph);
            } else if (n instanceof WriteNode) {
                addWriteNodeBarriers((WriteNode) n, graph);
            } else if (n instanceof LoweredAtomicReadAndWriteNode) {
                LoweredAtomicReadAndWriteNode loweredAtomicReadAndWriteNode = (LoweredAtomicReadAndWriteNode) n;
                addAtomicReadWriteNodeBarriers(loweredAtomicReadAndWriteNode, graph);
            } else if (n instanceof AbstractCompareAndSwapNode) {
                addCASBarriers((AbstractCompareAndSwapNode) n, graph);
            } else if (n instanceof ArrayRangeWrite) {
                ArrayRangeWrite node = (ArrayRangeWrite) n;
                if (node.writesObjectArray()) {
                    addArrayRangeBarriers(node, graph);
                }
            }
        }
    }
}
Also used : ArrayRangeWrite(org.graalvm.compiler.nodes.extended.ArrayRangeWrite) WriteNode(org.graalvm.compiler.nodes.memory.WriteNode) AbstractCompareAndSwapNode(org.graalvm.compiler.nodes.java.AbstractCompareAndSwapNode) LoweredAtomicReadAndWriteNode(org.graalvm.compiler.nodes.java.LoweredAtomicReadAndWriteNode) ReadNode(org.graalvm.compiler.nodes.memory.ReadNode) AddressNode(org.graalvm.compiler.nodes.memory.address.AddressNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) FixedAccessNode(org.graalvm.compiler.nodes.memory.FixedAccessNode) Node(org.graalvm.compiler.graph.Node) ReadNode(org.graalvm.compiler.nodes.memory.ReadNode) DebugCloseable(org.graalvm.compiler.debug.DebugCloseable) WriteNode(org.graalvm.compiler.nodes.memory.WriteNode) LoweredAtomicReadAndWriteNode(org.graalvm.compiler.nodes.java.LoweredAtomicReadAndWriteNode) LoweredAtomicReadAndWriteNode(org.graalvm.compiler.nodes.java.LoweredAtomicReadAndWriteNode) AbstractCompareAndSwapNode(org.graalvm.compiler.nodes.java.AbstractCompareAndSwapNode)

Aggregations

AbstractCompareAndSwapNode (org.graalvm.compiler.nodes.java.AbstractCompareAndSwapNode)2 DebugCloseable (org.graalvm.compiler.debug.DebugCloseable)1 Node (org.graalvm.compiler.graph.Node)1 ValueNode (org.graalvm.compiler.nodes.ValueNode)1 ArrayRangeWrite (org.graalvm.compiler.nodes.extended.ArrayRangeWrite)1 LogicCompareAndSwapNode (org.graalvm.compiler.nodes.java.LogicCompareAndSwapNode)1 LoweredAtomicReadAndWriteNode (org.graalvm.compiler.nodes.java.LoweredAtomicReadAndWriteNode)1 ValueCompareAndSwapNode (org.graalvm.compiler.nodes.java.ValueCompareAndSwapNode)1 FixedAccessNode (org.graalvm.compiler.nodes.memory.FixedAccessNode)1 ReadNode (org.graalvm.compiler.nodes.memory.ReadNode)1 WriteNode (org.graalvm.compiler.nodes.memory.WriteNode)1 AddressNode (org.graalvm.compiler.nodes.memory.address.AddressNode)1