Search in sources :

Example 1 with LoadVMThreadLocalNode

use of com.oracle.svm.core.graal.thread.LoadVMThreadLocalNode in project graal by oracle.

the class VMThreadMTFeature method handleGet.

private boolean handleGet(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode threadNode, boolean isVolatile) {
    VMThreadLocalInfo threadLocalInfo = threadLocalCollector.findInfo(b, receiver.get());
    if (isVolatile) {
        b.add(new MembarNode(MemoryBarriers.JMM_PRE_VOLATILE_READ));
    }
    b.addPush(targetMethod.getSignature().getReturnKind(), new LoadVMThreadLocalNode(b.getMetaAccess(), threadLocalInfo, threadNode, BarrierType.NONE));
    if (isVolatile) {
        b.add(new MembarNode(MemoryBarriers.JMM_POST_VOLATILE_READ));
    }
    return true;
}
Also used : MembarNode(org.graalvm.compiler.nodes.extended.MembarNode) VMThreadLocalInfo(com.oracle.svm.core.threadlocal.VMThreadLocalInfo) LoadVMThreadLocalNode(com.oracle.svm.core.graal.thread.LoadVMThreadLocalNode)

Example 2 with LoadVMThreadLocalNode

use of com.oracle.svm.core.graal.thread.LoadVMThreadLocalNode in project graal by oracle.

the class VMThreadSTFeature method handleGet.

private boolean handleGet(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
    VMThreadLocalInfo info = threadLocalCollector.findInfo(b, receiver.get());
    VMThreadLocalSTHolderNode holder = b.add(new VMThreadLocalSTHolderNode(info));
    b.addPush(targetMethod.getSignature().getReturnKind(), new LoadVMThreadLocalNode(b.getMetaAccess(), info, holder, BarrierType.PRECISE));
    return true;
}
Also used : VMThreadLocalSTHolderNode(com.oracle.svm.core.graal.thread.VMThreadLocalSTHolderNode) VMThreadLocalInfo(com.oracle.svm.core.threadlocal.VMThreadLocalInfo) LoadVMThreadLocalNode(com.oracle.svm.core.graal.thread.LoadVMThreadLocalNode)

Aggregations

LoadVMThreadLocalNode (com.oracle.svm.core.graal.thread.LoadVMThreadLocalNode)2 VMThreadLocalInfo (com.oracle.svm.core.threadlocal.VMThreadLocalInfo)2 VMThreadLocalSTHolderNode (com.oracle.svm.core.graal.thread.VMThreadLocalSTHolderNode)1 MembarNode (org.graalvm.compiler.nodes.extended.MembarNode)1