public final class DirectCompareAndSwapNode extends FixedWithNextNode implements LIRLowerable, MemoryCheckpoint.Single
CompareAndSwapNode in that it is not a
StateSplit and it #compareAndSwap(Address, Word, Word, LocationIdentity)
returns either the expected value or the compared against value instead of a boolean.Node.ConstantNodeParameter, Node.InjectedNodeParameter, Node.Input, Node.NodeIntrinsic, Node.OptionalInput, Node.Successor, Node.ValueNumberableMemoryCheckpoint.Multi, MemoryCheckpoint.Single, MemoryCheckpoint.TypeAssertion| Modifier and Type | Field and Description |
|---|---|
(package private) AddressNode |
address |
(package private) ValueNode |
expectedValue |
protected LocationIdentity |
locationIdentity |
(package private) ValueNode |
newValue |
static NodeClass<DirectCompareAndSwapNode> |
TYPE |
nextNODE_LIST, NOT_ITERABLE, USE_UNSAFE_TO_CLONE, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges| Constructor and Description |
|---|
DirectCompareAndSwapNode(ValueNode address,
ValueNode expected,
ValueNode newValue,
LocationIdentity locationIdentity) |
| Modifier and Type | Method and Description |
|---|---|
static Word |
compareAndSwap(AddressNode.Address address,
Word expectedValue,
Word newValue,
LocationIdentity locationIdentity)
Compares an expected value with the actual value in a location denoted by an address.
|
ValueNode |
expectedValue() |
void |
generate(NodeLIRBuilderTool gen) |
AddressNode |
getAddress() |
LocationIdentity |
getLocationIdentity()
This method is used to determine which memory location is killed by this node.
|
ValueNode |
newValue() |
asNode, next, setNextasConstant, asJavaConstant, getKind, graph, inferStamp, isAllowedUsageType, isConstant, isConstantPredicate, isNullConstant, setStamp, stamp, updateStampacceptInputs, acceptSuccessors, afterClone, assertFalse, assertTrue, cfgPredecessors, cfgSuccessors, clearInputs, clearSuccessors, copyWithInputs, copyWithInputs, equals, fail, formatTo, getDebugProperties, getDebugProperties, getId, getNodeClass, getUsageAt, getUsageCount, hashCode, hasNoUsages, hasUsages, inputs, isAlive, isDeleted, markDeleted, modCount, newIdentityMap, newIdentityMap, newIdentityMap, newMap, newMap, newMap, newSet, newSet, predecessor, pushInputs, removeUsage, replaceAndDelete, replaceAtMatchingUsages, replaceAtPredecessor, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceFirstInput, replaceFirstSuccessor, safeDelete, simplify, successors, toString, toString, updatePredecessor, updateUsages, updateUsagesInterface, usages, valueEquals, verifyEdges, verifyInputsclone, finalize, getClass, notify, notifyAll, wait, wait, waitasNodepublic static final NodeClass<DirectCompareAndSwapNode> TYPE
AddressNode address
ValueNode expectedValue
protected final LocationIdentity locationIdentity
public DirectCompareAndSwapNode(ValueNode address, ValueNode expected, ValueNode newValue, LocationIdentity locationIdentity)
public AddressNode getAddress()
public ValueNode expectedValue()
public LocationIdentity getLocationIdentity()
MemoryCheckpoint.SingleLocationIdentity.any() will kill all memory locations.getLocationIdentity in interface MemoryCheckpoint.Singlepublic void generate(NodeLIRBuilderTool gen)
generate in interface LIRLowerablepublic static Word compareAndSwap(AddressNode.Address address, Word expectedValue, Word newValue, LocationIdentity locationIdentity)
newValue is placed into the location and the expectedValue is
returned. Otherwise, the actual value is returned. All of the above is performed in one
atomic hardware transaction.address - the address to be atomically tested and updatedexpectedValue - if this value is currently in the field, perform the swapnewValue - the new value to put into the fieldexpectedValue or the actual value