src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/VolatileReadNode.java
changeset 58877 aec7bf35d6f5
equal deleted inserted replaced
58876:1a8d65e71a66 58877:aec7bf35d6f5
       
     1 /*
       
     2  * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
       
     3  * Copyright (c) 2019, Red Hat Inc. All rights reserved.
       
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     5  *
       
     6  * This code is free software; you can redistribute it and/or modify it
       
     7  * under the terms of the GNU General Public License version 2 only, as
       
     8  * published by the Free Software Foundation.
       
     9  *
       
    10  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    13  * version 2 for more details (a copy is included in the LICENSE file that
       
    14  * accompanied this code).
       
    15  *
       
    16  * You should have received a copy of the GNU General Public License version
       
    17  * 2 along with this work; if not, write to the Free Software Foundation,
       
    18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    19  *
       
    20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    21  * or visit www.oracle.com if you need additional information or have any
       
    22  * questions.
       
    23  */
       
    24 
       
    25 
       
    26 
       
    27 package org.graalvm.compiler.nodes.memory;
       
    28 
       
    29 import org.graalvm.compiler.core.common.GraalOptions;
       
    30 import org.graalvm.compiler.core.common.type.Stamp;
       
    31 import org.graalvm.compiler.graph.NodeClass;
       
    32 import org.graalvm.compiler.nodeinfo.NodeInfo;
       
    33 import org.graalvm.compiler.nodes.memory.address.AddressNode;
       
    34 import jdk.internal.vm.compiler.word.LocationIdentity;
       
    35 
       
    36 import static org.graalvm.compiler.nodeinfo.InputType.Memory;
       
    37 import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2;
       
    38 import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_1;
       
    39 
       
    40 @NodeInfo(nameTemplate = "Read#{p#location/s}", allowedUsageTypes = Memory, cycles = CYCLES_2, size = SIZE_1)
       
    41 public class VolatileReadNode extends ReadNode implements MemoryCheckpoint.Single {
       
    42     public static final NodeClass<VolatileReadNode> TYPE = NodeClass.create(VolatileReadNode.class);
       
    43 
       
    44     public VolatileReadNode(AddressNode address, LocationIdentity location, Stamp stamp, BarrierType barrierType) {
       
    45         super(TYPE, address, location, stamp, null, barrierType, false, null);
       
    46         assert GraalOptions.LateMembars.getValue(address.getOptions());
       
    47     }
       
    48 
       
    49     @SuppressWarnings("try")
       
    50     @Override
       
    51     public FloatingAccessNode asFloatingNode() {
       
    52         throw new RuntimeException();
       
    53     }
       
    54 
       
    55     @Override
       
    56     public boolean canFloat() {
       
    57         return false;
       
    58     }
       
    59 
       
    60     @Override
       
    61     public LocationIdentity getKilledLocationIdentity() {
       
    62         return LocationIdentity.any();
       
    63     }
       
    64 
       
    65     @Override
       
    66     public boolean canNullCheck() {
       
    67         return false;
       
    68     }
       
    69 
       
    70 }