Search in sources :

Example 1 with FloatingWordCastNode

use of com.oracle.svm.core.graal.nodes.FloatingWordCastNode in project graal by oracle.

the class AddressOfVMThreadLocalNode method lower.

@Override
public void lower(LoweringTool tool) {
    assert threadLocalInfo.offset >= 0;
    ValueNode base = holder;
    if (base.getStackKind() == JavaKind.Object) {
        base = graph().unique(new FloatingWordCastNode(FrameAccess.getWordStamp(), base));
    }
    assert base.getStackKind() == FrameAccess.getWordKind();
    ConstantNode offset = ConstantNode.forIntegerKind(FrameAccess.getWordKind(), threadLocalInfo.offset, graph());
    ValueNode address = graph().unique(new AddNode(base, offset));
    replaceAtUsagesAndDelete(address);
}
Also used : ConstantNode(org.graalvm.compiler.nodes.ConstantNode) FloatingWordCastNode(com.oracle.svm.core.graal.nodes.FloatingWordCastNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) AddNode(org.graalvm.compiler.nodes.calc.AddNode)

Example 2 with FloatingWordCastNode

use of com.oracle.svm.core.graal.nodes.FloatingWordCastNode in project graal by oracle.

the class SubstrateBasicLoweringProvider method createReadHub.

@Override
protected ValueNode createReadHub(StructuredGraph graph, ValueNode object, LoweringTool tool) {
    if (tool.getLoweringStage() != LoweringTool.StandardLoweringStage.LOW_TIER) {
        return graph.unique(new LoadHubNode(tool.getStampProvider(), object));
    }
    assert !object.isConstant() || object.asJavaConstant().isNull();
    ValueNode memoryRead = createReadBaseWithOffset(graph, object, getObjectLayout().getHubOffset(), FrameAccess.getWordStamp());
    ValueNode masked = graph.unique(new AndNode(memoryRead, ConstantNode.forIntegerKind(FrameAccess.getWordKind(), ObjectHeader.BITS_CLEAR.rawValue(), graph)));
    return uncompress(graph.unique(new FloatingWordCastNode(dynamicHubStamp, masked)));
}
Also used : LoadHubNode(org.graalvm.compiler.nodes.extended.LoadHubNode) FloatingWordCastNode(com.oracle.svm.core.graal.nodes.FloatingWordCastNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) AndNode(org.graalvm.compiler.nodes.calc.AndNode)

Aggregations

FloatingWordCastNode (com.oracle.svm.core.graal.nodes.FloatingWordCastNode)2 ValueNode (org.graalvm.compiler.nodes.ValueNode)2 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)1 AddNode (org.graalvm.compiler.nodes.calc.AddNode)1 AndNode (org.graalvm.compiler.nodes.calc.AndNode)1 LoadHubNode (org.graalvm.compiler.nodes.extended.LoadHubNode)1