org.truffleruby.extra.AtomicReferenceNodesFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ruby-language Show documentation
Show all versions of ruby-language Show documentation
Core module of Ruby on Truffle
The newest version!
// CheckStyle: start generated
package org.truffleruby.extra;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.NodeFactory;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.api.dsl.InlineSupport.InlineTarget;
import com.oracle.truffle.api.dsl.InlineSupport.ReferenceField;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import java.lang.invoke.MethodHandles;
import java.util.List;
import org.truffleruby.builtins.CoreMethodArrayArgumentsNode;
import org.truffleruby.core.basicobject.ReferenceEqualNode;
import org.truffleruby.core.basicobject.ReferenceEqualNodeGen;
import org.truffleruby.core.klass.RubyClass;
import org.truffleruby.extra.AtomicReferenceNodes.AllocateNode;
import org.truffleruby.extra.AtomicReferenceNodes.CompareAndSetReferenceNode;
import org.truffleruby.extra.AtomicReferenceNodes.GetAndSetNode;
import org.truffleruby.extra.AtomicReferenceNodes.GetNode;
import org.truffleruby.extra.AtomicReferenceNodes.InitializeNode;
import org.truffleruby.extra.AtomicReferenceNodes.SetNode;
import org.truffleruby.language.Nil;
import org.truffleruby.language.NotProvided;
import org.truffleruby.language.RubyGuards;
import org.truffleruby.language.RubyNode;
import org.truffleruby.language.RubyTypes;
@GeneratedBy(AtomicReferenceNodes.class)
@SuppressWarnings("javadoc")
public final class AtomicReferenceNodesFactory {
public static List> getFactories() {
return List.of(AllocateNodeFactory.getInstance(), InitializeNodeFactory.getInstance(), GetNodeFactory.getInstance(), SetNodeFactory.getInstance(), GetAndSetNodeFactory.getInstance(), CompareAndSetReferenceNodeFactory.getInstance());
}
@GeneratedBy(AllocateNode.class)
public static final class AllocateNodeFactory implements NodeFactory {
private static final AllocateNodeFactory ALLOCATE_NODE_FACTORY_INSTANCE = new AllocateNodeFactory();
private AllocateNodeFactory() {
}
@Override
public Class getNodeClass() {
return AllocateNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of(RubyNode.class);
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public AllocateNode createNode(Object... arguments) {
if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
return create((RubyNode[]) arguments[0]);
} else {
throw new IllegalArgumentException("Invalid create signature.");
}
}
public static NodeFactory getInstance() {
return ALLOCATE_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static AllocateNode create(RubyNode[] argumentNodes) {
return new AllocateNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link AllocateNode#allocate}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(AllocateNode.class)
@SuppressWarnings("javadoc")
public static final class AllocateNodeGen extends AllocateNode {
@Child private RubyNode argumentNodes0_;
/**
* State Info:
* 0: SpecializationActive {@link AllocateNode#allocate}
*
*/
@CompilationFinal private int state_0_;
private AllocateNodeGen(RubyNode[] argumentNodes) {
this.argumentNodes0_ = argumentNodes != null && 0 < argumentNodes.length ? argumentNodes[0] : null;
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object argumentNodes0Value_ = this.argumentNodes0_.execute(frameValue);
if (state_0 != 0 /* is SpecializationActive[AtomicReferenceNodes.AllocateNode.allocate(RubyClass)] */ && argumentNodes0Value_ instanceof RubyClass) {
RubyClass argumentNodes0Value__ = (RubyClass) argumentNodes0Value_;
return allocate(argumentNodes0Value__);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_);
}
private RubyAtomicReference executeAndSpecialize(Object argumentNodes0Value) {
int state_0 = this.state_0_;
if (argumentNodes0Value instanceof RubyClass) {
RubyClass argumentNodes0Value_ = (RubyClass) argumentNodes0Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[AtomicReferenceNodes.AllocateNode.allocate(RubyClass)] */;
this.state_0_ = state_0;
return allocate(argumentNodes0Value_);
}
throw new UnsupportedSpecializationException(this, new Node[] {this.argumentNodes0_}, argumentNodes0Value);
}
}
}
@GeneratedBy(InitializeNode.class)
public static final class InitializeNodeFactory implements NodeFactory {
private static final InitializeNodeFactory INITIALIZE_NODE_FACTORY_INSTANCE = new InitializeNodeFactory();
private InitializeNodeFactory() {
}
@Override
public Class getNodeClass() {
return InitializeNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of(RubyNode.class, RubyNode.class);
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public InitializeNode createNode(Object... arguments) {
if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
return create((RubyNode[]) arguments[0]);
} else {
throw new IllegalArgumentException("Invalid create signature.");
}
}
public static NodeFactory getInstance() {
return INITIALIZE_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static InitializeNode create(RubyNode[] argumentNodes) {
return new InitializeNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link InitializeNode#initializeNoValue}
* Activation probability: 0.48333
* With/without class size: 9/0 bytes
* Specialization {@link InitializeNode#initializeNil}
* Activation probability: 0.33333
* With/without class size: 8/0 bytes
* Specialization {@link InitializeNode#initializeWithValue}
* Activation probability: 0.18333
* With/without class size: 6/0 bytes
*
*/
@GeneratedBy(InitializeNode.class)
@SuppressWarnings("javadoc")
public static final class InitializeNodeGen extends InitializeNode {
@Child private RubyNode argumentNodes0_;
@Child private RubyNode argumentNodes1_;
/**
* State Info:
* 0: SpecializationActive {@link InitializeNode#initializeNoValue}
* 1: SpecializationActive {@link InitializeNode#initializeNil}
* 2: SpecializationActive {@link InitializeNode#initializeWithValue}
*
*/
@CompilationFinal private int state_0_;
private InitializeNodeGen(RubyNode[] argumentNodes) {
this.argumentNodes0_ = argumentNodes != null && 0 < argumentNodes.length ? argumentNodes[0] : null;
this.argumentNodes1_ = argumentNodes != null && 1 < argumentNodes.length ? argumentNodes[1] : null;
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object argumentNodes0Value_ = this.argumentNodes0_.execute(frameValue);
Object argumentNodes1Value_ = this.argumentNodes1_.execute(frameValue);
if (state_0 != 0 /* is SpecializationActive[AtomicReferenceNodes.InitializeNode.initializeNoValue(RubyAtomicReference, NotProvided)] || SpecializationActive[AtomicReferenceNodes.InitializeNode.initializeNil(RubyAtomicReference, Nil)] || SpecializationActive[AtomicReferenceNodes.InitializeNode.initializeWithValue(RubyAtomicReference, Object)] */ && argumentNodes0Value_ instanceof RubyAtomicReference) {
RubyAtomicReference argumentNodes0Value__ = (RubyAtomicReference) argumentNodes0Value_;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[AtomicReferenceNodes.InitializeNode.initializeNoValue(RubyAtomicReference, NotProvided)] */ && RubyTypes.isNotProvided(argumentNodes1Value_)) {
NotProvided argumentNodes1Value__ = RubyTypes.asNotProvided(argumentNodes1Value_);
return initializeNoValue(argumentNodes0Value__, argumentNodes1Value__);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[AtomicReferenceNodes.InitializeNode.initializeNil(RubyAtomicReference, Nil)] */ && RubyTypes.isNil(argumentNodes1Value_)) {
Nil argumentNodes1Value__ = RubyTypes.asNil(argumentNodes1Value_);
return initializeNil(argumentNodes0Value__, argumentNodes1Value__);
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[AtomicReferenceNodes.InitializeNode.initializeWithValue(RubyAtomicReference, Object)] */) {
if ((!(RubyGuards.isNil(argumentNodes1Value_))) && (RubyGuards.wasProvided(argumentNodes1Value_))) {
return initializeWithValue(argumentNodes0Value__, argumentNodes1Value_);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_, argumentNodes1Value_);
}
private RubyAtomicReference executeAndSpecialize(Object argumentNodes0Value, Object argumentNodes1Value) {
int state_0 = this.state_0_;
if (argumentNodes0Value instanceof RubyAtomicReference) {
RubyAtomicReference argumentNodes0Value_ = (RubyAtomicReference) argumentNodes0Value;
if (RubyTypes.isNotProvided(argumentNodes1Value)) {
NotProvided argumentNodes1Value_ = RubyTypes.asNotProvided(argumentNodes1Value);
state_0 = state_0 | 0b1 /* add SpecializationActive[AtomicReferenceNodes.InitializeNode.initializeNoValue(RubyAtomicReference, NotProvided)] */;
this.state_0_ = state_0;
return initializeNoValue(argumentNodes0Value_, argumentNodes1Value_);
}
if (RubyTypes.isNil(argumentNodes1Value)) {
Nil argumentNodes1Value_ = RubyTypes.asNil(argumentNodes1Value);
state_0 = state_0 | 0b10 /* add SpecializationActive[AtomicReferenceNodes.InitializeNode.initializeNil(RubyAtomicReference, Nil)] */;
this.state_0_ = state_0;
return initializeNil(argumentNodes0Value_, argumentNodes1Value_);
}
if ((!(RubyGuards.isNil(argumentNodes1Value))) && (RubyGuards.wasProvided(argumentNodes1Value))) {
state_0 = state_0 | 0b100 /* add SpecializationActive[AtomicReferenceNodes.InitializeNode.initializeWithValue(RubyAtomicReference, Object)] */;
this.state_0_ = state_0;
return initializeWithValue(argumentNodes0Value_, argumentNodes1Value);
}
}
throw new UnsupportedSpecializationException(this, new Node[] {this.argumentNodes0_, this.argumentNodes1_}, argumentNodes0Value, argumentNodes1Value);
}
}
}
@GeneratedBy(GetNode.class)
public static final class GetNodeFactory implements NodeFactory {
private static final GetNodeFactory GET_NODE_FACTORY_INSTANCE = new GetNodeFactory();
private GetNodeFactory() {
}
@Override
public Class getNodeClass() {
return GetNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of(RubyNode.class);
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public GetNode createNode(Object... arguments) {
if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
return create((RubyNode[]) arguments[0]);
} else {
throw new IllegalArgumentException("Invalid create signature.");
}
}
public static NodeFactory getInstance() {
return GET_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static GetNode create(RubyNode[] argumentNodes) {
return new GetNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link GetNode#get}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(GetNode.class)
@SuppressWarnings("javadoc")
public static final class GetNodeGen extends GetNode {
@Child private RubyNode argumentNodes0_;
/**
* State Info:
* 0: SpecializationActive {@link GetNode#get}
*
*/
@CompilationFinal private int state_0_;
private GetNodeGen(RubyNode[] argumentNodes) {
this.argumentNodes0_ = argumentNodes != null && 0 < argumentNodes.length ? argumentNodes[0] : null;
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object argumentNodes0Value_ = this.argumentNodes0_.execute(frameValue);
if (state_0 != 0 /* is SpecializationActive[AtomicReferenceNodes.GetNode.get(RubyAtomicReference)] */ && argumentNodes0Value_ instanceof RubyAtomicReference) {
RubyAtomicReference argumentNodes0Value__ = (RubyAtomicReference) argumentNodes0Value_;
return get(argumentNodes0Value__);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_);
}
private Object executeAndSpecialize(Object argumentNodes0Value) {
int state_0 = this.state_0_;
if (argumentNodes0Value instanceof RubyAtomicReference) {
RubyAtomicReference argumentNodes0Value_ = (RubyAtomicReference) argumentNodes0Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[AtomicReferenceNodes.GetNode.get(RubyAtomicReference)] */;
this.state_0_ = state_0;
return get(argumentNodes0Value_);
}
throw new UnsupportedSpecializationException(this, new Node[] {this.argumentNodes0_}, argumentNodes0Value);
}
}
}
@GeneratedBy(SetNode.class)
public static final class SetNodeFactory implements NodeFactory {
private static final SetNodeFactory SET_NODE_FACTORY_INSTANCE = new SetNodeFactory();
private SetNodeFactory() {
}
@Override
public Class getNodeClass() {
return SetNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of(RubyNode.class, RubyNode.class);
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public SetNode createNode(Object... arguments) {
if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
return create((RubyNode[]) arguments[0]);
} else {
throw new IllegalArgumentException("Invalid create signature.");
}
}
public static NodeFactory getInstance() {
return SET_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static SetNode create(RubyNode[] argumentNodes) {
return new SetNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link SetNode#set}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(SetNode.class)
@SuppressWarnings("javadoc")
public static final class SetNodeGen extends SetNode {
@Child private RubyNode argumentNodes0_;
@Child private RubyNode argumentNodes1_;
/**
* State Info:
* 0: SpecializationActive {@link SetNode#set}
*
*/
@CompilationFinal private int state_0_;
private SetNodeGen(RubyNode[] argumentNodes) {
this.argumentNodes0_ = argumentNodes != null && 0 < argumentNodes.length ? argumentNodes[0] : null;
this.argumentNodes1_ = argumentNodes != null && 1 < argumentNodes.length ? argumentNodes[1] : null;
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object argumentNodes0Value_ = this.argumentNodes0_.execute(frameValue);
Object argumentNodes1Value_ = this.argumentNodes1_.execute(frameValue);
if (state_0 != 0 /* is SpecializationActive[AtomicReferenceNodes.SetNode.set(RubyAtomicReference, Object)] */ && argumentNodes0Value_ instanceof RubyAtomicReference) {
RubyAtomicReference argumentNodes0Value__ = (RubyAtomicReference) argumentNodes0Value_;
return set(argumentNodes0Value__, argumentNodes1Value_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_, argumentNodes1Value_);
}
private Object executeAndSpecialize(Object argumentNodes0Value, Object argumentNodes1Value) {
int state_0 = this.state_0_;
if (argumentNodes0Value instanceof RubyAtomicReference) {
RubyAtomicReference argumentNodes0Value_ = (RubyAtomicReference) argumentNodes0Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[AtomicReferenceNodes.SetNode.set(RubyAtomicReference, Object)] */;
this.state_0_ = state_0;
return set(argumentNodes0Value_, argumentNodes1Value);
}
throw new UnsupportedSpecializationException(this, new Node[] {this.argumentNodes0_, this.argumentNodes1_}, argumentNodes0Value, argumentNodes1Value);
}
}
}
@GeneratedBy(GetAndSetNode.class)
public static final class GetAndSetNodeFactory implements NodeFactory {
private static final GetAndSetNodeFactory GET_AND_SET_NODE_FACTORY_INSTANCE = new GetAndSetNodeFactory();
private GetAndSetNodeFactory() {
}
@Override
public Class getNodeClass() {
return GetAndSetNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of(RubyNode.class, RubyNode.class);
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public GetAndSetNode createNode(Object... arguments) {
if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
return create((RubyNode[]) arguments[0]);
} else {
throw new IllegalArgumentException("Invalid create signature.");
}
}
public static NodeFactory getInstance() {
return GET_AND_SET_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static GetAndSetNode create(RubyNode[] argumentNodes) {
return new GetAndSetNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link GetAndSetNode#getAndSet}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(GetAndSetNode.class)
@SuppressWarnings("javadoc")
public static final class GetAndSetNodeGen extends GetAndSetNode {
@Child private RubyNode argumentNodes0_;
@Child private RubyNode argumentNodes1_;
/**
* State Info:
* 0: SpecializationActive {@link GetAndSetNode#getAndSet}
*
*/
@CompilationFinal private int state_0_;
private GetAndSetNodeGen(RubyNode[] argumentNodes) {
this.argumentNodes0_ = argumentNodes != null && 0 < argumentNodes.length ? argumentNodes[0] : null;
this.argumentNodes1_ = argumentNodes != null && 1 < argumentNodes.length ? argumentNodes[1] : null;
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object argumentNodes0Value_ = this.argumentNodes0_.execute(frameValue);
Object argumentNodes1Value_ = this.argumentNodes1_.execute(frameValue);
if (state_0 != 0 /* is SpecializationActive[AtomicReferenceNodes.GetAndSetNode.getAndSet(RubyAtomicReference, Object)] */ && argumentNodes0Value_ instanceof RubyAtomicReference) {
RubyAtomicReference argumentNodes0Value__ = (RubyAtomicReference) argumentNodes0Value_;
return getAndSet(argumentNodes0Value__, argumentNodes1Value_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_, argumentNodes1Value_);
}
private Object executeAndSpecialize(Object argumentNodes0Value, Object argumentNodes1Value) {
int state_0 = this.state_0_;
if (argumentNodes0Value instanceof RubyAtomicReference) {
RubyAtomicReference argumentNodes0Value_ = (RubyAtomicReference) argumentNodes0Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[AtomicReferenceNodes.GetAndSetNode.getAndSet(RubyAtomicReference, Object)] */;
this.state_0_ = state_0;
return getAndSet(argumentNodes0Value_, argumentNodes1Value);
}
throw new UnsupportedSpecializationException(this, new Node[] {this.argumentNodes0_, this.argumentNodes1_}, argumentNodes0Value, argumentNodes1Value);
}
}
}
@GeneratedBy(CompareAndSetReferenceNode.class)
public static final class CompareAndSetReferenceNodeFactory implements NodeFactory {
private static final CompareAndSetReferenceNodeFactory COMPARE_AND_SET_REFERENCE_NODE_FACTORY_INSTANCE = new CompareAndSetReferenceNodeFactory();
private CompareAndSetReferenceNodeFactory() {
}
@Override
public Class getNodeClass() {
return CompareAndSetReferenceNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of(RubyNode.class, RubyNode.class, RubyNode.class);
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public CompareAndSetReferenceNode createNode(Object... arguments) {
if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
return create((RubyNode[]) arguments[0]);
} else {
throw new IllegalArgumentException("Invalid create signature.");
}
}
public static NodeFactory getInstance() {
return COMPARE_AND_SET_REFERENCE_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static CompareAndSetReferenceNode create(RubyNode[] argumentNodes) {
return new CompareAndSetReferenceNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link CompareAndSetReferenceNode#compareAndSetPrimitive}
* Activation probability: 0.65000
* With/without class size: 19/6 bytes
* Specialization {@link CompareAndSetReferenceNode#compareAndSetReference}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(CompareAndSetReferenceNode.class)
@SuppressWarnings("javadoc")
public static final class CompareAndSetReferenceNodeGen extends CompareAndSetReferenceNode {
private static final StateField STATE_0_CompareAndSetReferenceNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_");
/**
* Source Info:
* Specialization: {@link CompareAndSetReferenceNode#compareAndSetPrimitive}
* Parameter: {@link ReferenceEqualNode} equalNode
* Inline method: {@link ReferenceEqualNodeGen#inline}
*/
private static final ReferenceEqualNode INLINED_COMPARE_AND_SET_PRIMITIVE_EQUAL_NODE_ = ReferenceEqualNodeGen.inline(InlineTarget.create(ReferenceEqualNode.class, STATE_0_CompareAndSetReferenceNode_UPDATER.subUpdater(2, 14), ReferenceField.create(MethodHandles.lookup(), "compareAndSetPrimitive_equalNode__field1_", Node.class)));
@Child private RubyNode argumentNodes0_;
@Child private RubyNode argumentNodes1_;
@Child private RubyNode argumentNodes2_;
/**
* State Info:
* 0: SpecializationActive {@link CompareAndSetReferenceNode#compareAndSetPrimitive}
* 1: SpecializationActive {@link CompareAndSetReferenceNode#compareAndSetReference}
* 2-15: InlinedCache
* Specialization: {@link CompareAndSetReferenceNode#compareAndSetPrimitive}
* Parameter: {@link ReferenceEqualNode} equalNode
* Inline method: {@link ReferenceEqualNodeGen#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int state_0_;
/**
* Source Info:
* Specialization: {@link CompareAndSetReferenceNode#compareAndSetPrimitive}
* Parameter: {@link ReferenceEqualNode} equalNode
* Inline method: {@link ReferenceEqualNodeGen#inline}
* Inline field: {@link Node} field1
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node compareAndSetPrimitive_equalNode__field1_;
private CompareAndSetReferenceNodeGen(RubyNode[] argumentNodes) {
this.argumentNodes0_ = argumentNodes != null && 0 < argumentNodes.length ? argumentNodes[0] : null;
this.argumentNodes1_ = argumentNodes != null && 1 < argumentNodes.length ? argumentNodes[1] : null;
this.argumentNodes2_ = argumentNodes != null && 2 < argumentNodes.length ? argumentNodes[2] : null;
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object argumentNodes0Value_ = this.argumentNodes0_.execute(frameValue);
Object argumentNodes1Value_ = this.argumentNodes1_.execute(frameValue);
Object argumentNodes2Value_ = this.argumentNodes2_.execute(frameValue);
if ((state_0 & 0b11) != 0 /* is SpecializationActive[AtomicReferenceNodes.CompareAndSetReferenceNode.compareAndSetPrimitive(RubyAtomicReference, Object, Object, ReferenceEqualNode)] || SpecializationActive[AtomicReferenceNodes.CompareAndSetReferenceNode.compareAndSetReference(RubyAtomicReference, Object, Object)] */ && argumentNodes0Value_ instanceof RubyAtomicReference) {
RubyAtomicReference argumentNodes0Value__ = (RubyAtomicReference) argumentNodes0Value_;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[AtomicReferenceNodes.CompareAndSetReferenceNode.compareAndSetPrimitive(RubyAtomicReference, Object, Object, ReferenceEqualNode)] */) {
if ((RubyGuards.isPrimitive(argumentNodes1Value_))) {
return compareAndSetPrimitive(argumentNodes0Value__, argumentNodes1Value_, argumentNodes2Value_, INLINED_COMPARE_AND_SET_PRIMITIVE_EQUAL_NODE_);
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[AtomicReferenceNodes.CompareAndSetReferenceNode.compareAndSetReference(RubyAtomicReference, Object, Object)] */) {
if ((!(RubyGuards.isPrimitive(argumentNodes1Value_)))) {
return compareAndSetReference(argumentNodes0Value__, argumentNodes1Value_, argumentNodes2Value_);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_, argumentNodes1Value_, argumentNodes2Value_);
}
private boolean executeAndSpecialize(Object argumentNodes0Value, Object argumentNodes1Value, Object argumentNodes2Value) {
int state_0 = this.state_0_;
if (argumentNodes0Value instanceof RubyAtomicReference) {
RubyAtomicReference argumentNodes0Value_ = (RubyAtomicReference) argumentNodes0Value;
if ((RubyGuards.isPrimitive(argumentNodes1Value))) {
state_0 = state_0 | 0b1 /* add SpecializationActive[AtomicReferenceNodes.CompareAndSetReferenceNode.compareAndSetPrimitive(RubyAtomicReference, Object, Object, ReferenceEqualNode)] */;
this.state_0_ = state_0;
return compareAndSetPrimitive(argumentNodes0Value_, argumentNodes1Value, argumentNodes2Value, INLINED_COMPARE_AND_SET_PRIMITIVE_EQUAL_NODE_);
}
if ((!(RubyGuards.isPrimitive(argumentNodes1Value)))) {
state_0 = state_0 | 0b10 /* add SpecializationActive[AtomicReferenceNodes.CompareAndSetReferenceNode.compareAndSetReference(RubyAtomicReference, Object, Object)] */;
this.state_0_ = state_0;
return compareAndSetReference(argumentNodes0Value_, argumentNodes1Value, argumentNodes2Value);
}
}
throw new UnsupportedSpecializationException(this, new Node[] {this.argumentNodes0_, this.argumentNodes1_, this.argumentNodes2_}, argumentNodes0Value, argumentNodes1Value, argumentNodes2Value);
}
}
}
}