org.truffleruby.stdlib.readline.ReadlineNodesFactory 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.stdlib.readline;
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.DSLSupport.SpecializationDataNode;
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.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.strings.TruffleString.FromJavaStringNode;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.lang.invoke.MethodHandles.Lookup;
import java.util.List;
import java.util.Objects;
import org.truffleruby.core.basicobject.RubyBasicObject;
import org.truffleruby.core.cast.BooleanCastWithDefaultNode;
import org.truffleruby.core.cast.BooleanCastWithDefaultNodeGen;
import org.truffleruby.core.cast.ToStrNode;
import org.truffleruby.core.cast.ToStrNodeGen;
import org.truffleruby.core.proc.RubyProc;
import org.truffleruby.core.support.RubyIO;
import org.truffleruby.interop.ToJavaStringNode;
import org.truffleruby.interop.ToJavaStringNodeGen;
import org.truffleruby.interop.ToJavaStringWithDefaultNode;
import org.truffleruby.interop.ToJavaStringWithDefaultNodeGen;
import org.truffleruby.language.RubyBaseNodeWithExecute;
import org.truffleruby.language.RubyContextSourceNode;
import org.truffleruby.language.RubyNode;
import org.truffleruby.language.library.RubyStringLibrary;
import org.truffleruby.stdlib.readline.ReadlineNodes.BasicWordBreakCharactersNode;
import org.truffleruby.stdlib.readline.ReadlineNodes.CompletionProcSetNode;
import org.truffleruby.stdlib.readline.ReadlineNodes.DeleteTextNode;
import org.truffleruby.stdlib.readline.ReadlineNodes.GetScreenSizeNode;
import org.truffleruby.stdlib.readline.ReadlineNodes.InsertTextNode;
import org.truffleruby.stdlib.readline.ReadlineNodes.LineBufferNode;
import org.truffleruby.stdlib.readline.ReadlineNodes.PointNode;
import org.truffleruby.stdlib.readline.ReadlineNodes.ReadlineNode;
import org.truffleruby.stdlib.readline.ReadlineNodes.SetBasicWordBreakCharactersNode;
import org.truffleruby.stdlib.readline.ReadlineNodes.SetInputNode;
import org.truffleruby.stdlib.readline.ReadlineNodes.SetOutputNode;
@GeneratedBy(ReadlineNodes.class)
@SuppressWarnings({"javadoc", "unused"})
public final class ReadlineNodesFactory {
public static List> getFactories() {
return List.of(BasicWordBreakCharactersNodeFactory.getInstance(), SetBasicWordBreakCharactersNodeFactory.getInstance(), CompletionProcSetNodeFactory.getInstance(), GetScreenSizeNodeFactory.getInstance(), ReadlineNodeFactory.getInstance(), PointNodeFactory.getInstance(), InsertTextNodeFactory.getInstance(), DeleteTextNodeFactory.getInstance(), LineBufferNodeFactory.getInstance(), SetInputNodeFactory.getInstance(), SetOutputNodeFactory.getInstance());
}
@GeneratedBy(BasicWordBreakCharactersNode.class)
public static final class BasicWordBreakCharactersNodeFactory implements NodeFactory {
private static final BasicWordBreakCharactersNodeFactory BASIC_WORD_BREAK_CHARACTERS_NODE_FACTORY_INSTANCE = new BasicWordBreakCharactersNodeFactory();
private BasicWordBreakCharactersNodeFactory() {
}
@Override
public Class getNodeClass() {
return BasicWordBreakCharactersNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of();
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public BasicWordBreakCharactersNode 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 BASIC_WORD_BREAK_CHARACTERS_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static BasicWordBreakCharactersNode create(RubyNode[] argumentNodes) {
return new BasicWordBreakCharactersNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link BasicWordBreakCharactersNode#basicWordBreakCharacters}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(BasicWordBreakCharactersNode.class)
@SuppressWarnings("javadoc")
public static final class BasicWordBreakCharactersNodeGen extends BasicWordBreakCharactersNode {
private BasicWordBreakCharactersNodeGen(RubyNode[] argumentNodes) {
}
@Override
public Object execute(VirtualFrame frameValue) {
return basicWordBreakCharacters();
}
}
}
@GeneratedBy(SetBasicWordBreakCharactersNode.class)
public static final class SetBasicWordBreakCharactersNodeFactory implements NodeFactory {
private static final SetBasicWordBreakCharactersNodeFactory SET_BASIC_WORD_BREAK_CHARACTERS_NODE_FACTORY_INSTANCE = new SetBasicWordBreakCharactersNodeFactory();
private SetBasicWordBreakCharactersNodeFactory() {
}
@Override
public Class getNodeClass() {
return SetBasicWordBreakCharactersNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of(RubyBaseNodeWithExecute.class);
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyBaseNodeWithExecute.class));
}
@Override
public SetBasicWordBreakCharactersNode createNode(Object... arguments) {
if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyBaseNodeWithExecute)) {
return create((RubyBaseNodeWithExecute) arguments[0]);
} else {
throw new IllegalArgumentException("Invalid create signature.");
}
}
public static NodeFactory getInstance() {
return SET_BASIC_WORD_BREAK_CHARACTERS_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static SetBasicWordBreakCharactersNode create(RubyBaseNodeWithExecute characters) {
return new SetBasicWordBreakCharactersNodeGen(characters);
}
/**
* Debug Info:
* Specialization {@link SetBasicWordBreakCharactersNode#setBasicWordBreakCharacters}
* Activation probability: 1.00000
* With/without class size: 32/9 bytes
*
*/
@GeneratedBy(SetBasicWordBreakCharactersNode.class)
@SuppressWarnings("javadoc")
public static final class SetBasicWordBreakCharactersNodeGen extends SetBasicWordBreakCharactersNode {
private static final StateField SET_BASIC_WORD_BREAK_CHARACTERS__SET_BASIC_WORD_BREAK_CHARACTERS_NODE_SET_BASIC_WORD_BREAK_CHARACTERS_STATE_0_UPDATER = StateField.create(SetBasicWordBreakCharactersData.lookup_(), "setBasicWordBreakCharacters_state_0_");
static final ReferenceField SET_BASIC_WORD_BREAK_CHARACTERS_CACHE_UPDATER = ReferenceField.create(MethodHandles.lookup(), "setBasicWordBreakCharacters_cache", SetBasicWordBreakCharactersData.class);
/**
* Source Info:
* Specialization: {@link SetBasicWordBreakCharactersNode#setBasicWordBreakCharacters}
* Parameter: {@link ToStrNode} toStrNode
* Inline method: {@link ToStrNodeGen#inline}
*/
private static final ToStrNode INLINED_TO_STR_NODE_ = ToStrNodeGen.inline(InlineTarget.create(ToStrNode.class, SET_BASIC_WORD_BREAK_CHARACTERS__SET_BASIC_WORD_BREAK_CHARACTERS_NODE_SET_BASIC_WORD_BREAK_CHARACTERS_STATE_0_UPDATER.subUpdater(0, 3), ReferenceField.create(SetBasicWordBreakCharactersData.lookup_(), "toStrNode__field1_", Node.class)));
@Child private RubyBaseNodeWithExecute characters_;
/**
* State Info:
* 0: SpecializationActive {@link SetBasicWordBreakCharactersNode#setBasicWordBreakCharacters}
*
*/
@CompilationFinal private int state_0_;
@UnsafeAccessedField @Child private SetBasicWordBreakCharactersData setBasicWordBreakCharacters_cache;
private SetBasicWordBreakCharactersNodeGen(RubyBaseNodeWithExecute characters) {
this.characters_ = characters;
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object charactersValue_ = this.characters_.execute(frameValue);
if (state_0 != 0 /* is SpecializationActive[ReadlineNodes.SetBasicWordBreakCharactersNode.setBasicWordBreakCharacters(Object, ToStrNode, RubyStringLibrary, Node, Object)] */) {
SetBasicWordBreakCharactersData s0_ = this.setBasicWordBreakCharacters_cache;
if (s0_ != null) {
{
Node node__ = (s0_);
Object charactersAsString__ = (INLINED_TO_STR_NODE_.execute(node__, charactersValue_));
if ((s0_.strings_.isRubyString(charactersAsString__))) {
return SetBasicWordBreakCharactersNode.setBasicWordBreakCharacters(charactersValue_, INLINED_TO_STR_NODE_, s0_.strings_, node__, charactersAsString__);
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(charactersValue_);
}
@SuppressWarnings("unused")
private Object executeAndSpecialize(Object charactersValue) {
int state_0 = this.state_0_;
{
Object charactersAsString__ = null;
Node node__ = null;
while (true) {
int count0_ = 0;
SetBasicWordBreakCharactersData s0_ = SET_BASIC_WORD_BREAK_CHARACTERS_CACHE_UPDATER.getVolatile(this);
SetBasicWordBreakCharactersData s0_original = s0_;
while (s0_ != null) {
{
node__ = (s0_);
charactersAsString__ = (INLINED_TO_STR_NODE_.execute(node__, charactersValue));
if ((s0_.strings_.isRubyString(charactersAsString__))) {
break;
}
}
count0_++;
s0_ = null;
break;
}
if (s0_ == null && count0_ < 1) {
{
RubyStringLibrary strings__ = (RubyStringLibrary.create());
s0_ = this.insert(new SetBasicWordBreakCharactersData());
node__ = (s0_);
charactersAsString__ = (INLINED_TO_STR_NODE_.execute(node__, charactersValue));
if ((strings__.isRubyString(charactersAsString__))) {
Objects.requireNonNull(strings__, "A specialization cache returned a default value. The cache initializer must never return a default value for this cache. Use @Cached(neverDefault=false) to allow default values for this cached value or make sure the cache initializer never returns the default value.");
s0_.strings_ = strings__;
if (!SET_BASIC_WORD_BREAK_CHARACTERS_CACHE_UPDATER.compareAndSet(this, s0_original, s0_)) {
continue;
}
state_0 = state_0 | 0b1 /* add SpecializationActive[ReadlineNodes.SetBasicWordBreakCharactersNode.setBasicWordBreakCharacters(Object, ToStrNode, RubyStringLibrary, Node, Object)] */;
this.state_0_ = state_0;
} else {
s0_ = null;
}
}
}
if (s0_ != null) {
return SetBasicWordBreakCharactersNode.setBasicWordBreakCharacters(charactersValue, INLINED_TO_STR_NODE_, s0_.strings_, node__, charactersAsString__);
}
break;
}
}
throw new UnsupportedSpecializationException(this, new Node[] {this.characters_}, charactersValue);
}
@GeneratedBy(SetBasicWordBreakCharactersNode.class)
@DenyReplace
private static final class SetBasicWordBreakCharactersData extends Node implements SpecializationDataNode {
/**
* State Info:
* 0-2: InlinedCache
* Specialization: {@link SetBasicWordBreakCharactersNode#setBasicWordBreakCharacters}
* Parameter: {@link ToStrNode} toStrNode
* Inline method: {@link ToStrNodeGen#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int setBasicWordBreakCharacters_state_0_;
/**
* Source Info:
* Specialization: {@link SetBasicWordBreakCharactersNode#setBasicWordBreakCharacters}
* Parameter: {@link ToStrNode} toStrNode
* Inline method: {@link ToStrNodeGen#inline}
* Inline field: {@link Node} field1
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node toStrNode__field1_;
/**
* Source Info:
* Specialization: {@link SetBasicWordBreakCharactersNode#setBasicWordBreakCharacters}
* Parameter: {@link RubyStringLibrary} strings
*/
@CompilationFinal RubyStringLibrary strings_;
SetBasicWordBreakCharactersData() {
}
private static Lookup lookup_() {
return MethodHandles.lookup();
}
}
}
}
@GeneratedBy(CompletionProcSetNode.class)
public static final class CompletionProcSetNodeFactory implements NodeFactory {
private static final CompletionProcSetNodeFactory COMPLETION_PROC_SET_NODE_FACTORY_INSTANCE = new CompletionProcSetNodeFactory();
private CompletionProcSetNodeFactory() {
}
@Override
public Class getNodeClass() {
return CompletionProcSetNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of(RubyNode.class);
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public CompletionProcSetNode 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 COMPLETION_PROC_SET_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static CompletionProcSetNode create(RubyNode[] argumentNodes) {
return new CompletionProcSetNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link CompletionProcSetNode#setCompletionProc}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(CompletionProcSetNode.class)
@SuppressWarnings("javadoc")
public static final class CompletionProcSetNodeGen extends CompletionProcSetNode {
@Child private RubyNode argumentNodes0_;
/**
* State Info:
* 0: SpecializationActive {@link CompletionProcSetNode#setCompletionProc}
*
*/
@CompilationFinal private int state_0_;
private CompletionProcSetNodeGen(RubyNode[] argumentNodes) {
this.argumentNodes0_ = argumentNodes != null && 0 < argumentNodes.length ? argumentNodes[0] : null;
}
@Override
public RubyNode[] getArgumentNodes() {
return new RubyNode[] {this.argumentNodes0_};
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object argumentNodes0Value_ = this.argumentNodes0_.execute(frameValue);
if (state_0 != 0 /* is SpecializationActive[ReadlineNodes.CompletionProcSetNode.setCompletionProc(RubyProc)] */ && argumentNodes0Value_ instanceof RubyProc) {
RubyProc argumentNodes0Value__ = (RubyProc) argumentNodes0Value_;
return setCompletionProc(argumentNodes0Value__);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_);
}
private RubyProc executeAndSpecialize(Object argumentNodes0Value) {
int state_0 = this.state_0_;
if (argumentNodes0Value instanceof RubyProc) {
RubyProc argumentNodes0Value_ = (RubyProc) argumentNodes0Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[ReadlineNodes.CompletionProcSetNode.setCompletionProc(RubyProc)] */;
this.state_0_ = state_0;
return setCompletionProc(argumentNodes0Value_);
}
throw new UnsupportedSpecializationException(this, new Node[] {this.argumentNodes0_}, argumentNodes0Value);
}
}
}
@GeneratedBy(GetScreenSizeNode.class)
public static final class GetScreenSizeNodeFactory implements NodeFactory {
private static final GetScreenSizeNodeFactory GET_SCREEN_SIZE_NODE_FACTORY_INSTANCE = new GetScreenSizeNodeFactory();
private GetScreenSizeNodeFactory() {
}
@Override
public Class getNodeClass() {
return GetScreenSizeNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of();
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public GetScreenSizeNode 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_SCREEN_SIZE_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static GetScreenSizeNode create(RubyNode[] argumentNodes) {
return new GetScreenSizeNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link GetScreenSizeNode#getScreenSize}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(GetScreenSizeNode.class)
@SuppressWarnings("javadoc")
public static final class GetScreenSizeNodeGen extends GetScreenSizeNode {
private GetScreenSizeNodeGen(RubyNode[] argumentNodes) {
}
@Override
public Object execute(VirtualFrame frameValue) {
return getScreenSize();
}
}
}
@GeneratedBy(ReadlineNode.class)
public static final class ReadlineNodeFactory implements NodeFactory {
private static final ReadlineNodeFactory READLINE_NODE_FACTORY_INSTANCE = new ReadlineNodeFactory();
private ReadlineNodeFactory() {
}
@Override
public Class getNodeClass() {
return ReadlineNode.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 ReadlineNode 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 READLINE_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static ReadlineNode create(RubyNode[] argumentNodes) {
return new ReadlineNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link ReadlineNode#readline}
* Activation probability: 1.00000
* With/without class size: 40/20 bytes
*
*/
@GeneratedBy(ReadlineNode.class)
@SuppressWarnings("javadoc")
public static final class ReadlineNodeGen extends ReadlineNode {
private static final StateField STATE_0_ReadlineNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_");
private static final StateField STATE_1_ReadlineNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_1_");
/**
* Source Info:
* Specialization: {@link ReadlineNode#readline}
* Parameter: {@link ToJavaStringWithDefaultNode} toJavaStringWithDefaultNode
* Inline method: {@link ToJavaStringWithDefaultNodeGen#inline}
*/
private static final ToJavaStringWithDefaultNode INLINED_TO_JAVA_STRING_WITH_DEFAULT_NODE_ = ToJavaStringWithDefaultNodeGen.inline(InlineTarget.create(ToJavaStringWithDefaultNode.class, STATE_0_ReadlineNode_UPDATER.subUpdater(1, 14), ReferenceField.create(MethodHandles.lookup(), "toJavaStringWithDefaultNode__field1_", Node.class), ReferenceField.create(MethodHandles.lookup(), "toJavaStringWithDefaultNode__field2_", Node.class)));
/**
* Source Info:
* Specialization: {@link ReadlineNode#readline}
* Parameter: {@link BooleanCastWithDefaultNode} booleanCastWithDefaultNode
* Inline method: {@link BooleanCastWithDefaultNodeGen#inline}
*/
private static final BooleanCastWithDefaultNode INLINED_BOOLEAN_CAST_WITH_DEFAULT_NODE_ = BooleanCastWithDefaultNodeGen.inline(InlineTarget.create(BooleanCastWithDefaultNode.class, STATE_1_ReadlineNode_UPDATER.subUpdater(0, 18), ReferenceField.create(MethodHandles.lookup(), "booleanCastWithDefaultNode__field1_", Node.class)));
@Child private RubyNode argumentNodes0_;
@Child private RubyNode argumentNodes1_;
/**
* State Info:
* 0: SpecializationActive {@link ReadlineNode#readline}
* 1-14: InlinedCache
* Specialization: {@link ReadlineNode#readline}
* Parameter: {@link ToJavaStringWithDefaultNode} toJavaStringWithDefaultNode
* Inline method: {@link ToJavaStringWithDefaultNodeGen#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int state_0_;
/**
* State Info:
* 0-17: InlinedCache
* Specialization: {@link ReadlineNode#readline}
* Parameter: {@link BooleanCastWithDefaultNode} booleanCastWithDefaultNode
* Inline method: {@link BooleanCastWithDefaultNodeGen#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int state_1_;
/**
* Source Info:
* Specialization: {@link ReadlineNode#readline}
* Parameter: {@link ToJavaStringWithDefaultNode} toJavaStringWithDefaultNode
* Inline method: {@link ToJavaStringWithDefaultNodeGen#inline}
* Inline field: {@link Node} field1
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node toJavaStringWithDefaultNode__field1_;
/**
* Source Info:
* Specialization: {@link ReadlineNode#readline}
* Parameter: {@link ToJavaStringWithDefaultNode} toJavaStringWithDefaultNode
* Inline method: {@link ToJavaStringWithDefaultNodeGen#inline}
* Inline field: {@link Node} field2
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node toJavaStringWithDefaultNode__field2_;
/**
* Source Info:
* Specialization: {@link ReadlineNode#readline}
* Parameter: {@link FromJavaStringNode} fromJavaStringNode
*/
@Child private FromJavaStringNode fromJavaStringNode_;
/**
* Source Info:
* Specialization: {@link ReadlineNode#readline}
* Parameter: {@link BooleanCastWithDefaultNode} booleanCastWithDefaultNode
* Inline method: {@link BooleanCastWithDefaultNodeGen#inline}
* Inline field: {@link Node} field1
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node booleanCastWithDefaultNode__field1_;
private ReadlineNodeGen(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 & 0b1) != 0 /* is SpecializationActive[ReadlineNodes.ReadlineNode.readline(Object, Object, ToJavaStringWithDefaultNode, FromJavaStringNode, BooleanCastWithDefaultNode)] */) {
{
FromJavaStringNode fromJavaStringNode__ = this.fromJavaStringNode_;
if (fromJavaStringNode__ != null) {
return readline(argumentNodes0Value_, argumentNodes1Value_, INLINED_TO_JAVA_STRING_WITH_DEFAULT_NODE_, fromJavaStringNode__, INLINED_BOOLEAN_CAST_WITH_DEFAULT_NODE_);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_, argumentNodes1Value_);
}
private Object executeAndSpecialize(Object argumentNodes0Value, Object argumentNodes1Value) {
int state_0 = this.state_0_;
FromJavaStringNode fromJavaStringNode__ = this.insert((FromJavaStringNode.create()));
Objects.requireNonNull(fromJavaStringNode__, "A specialization cache returned a default value. The cache initializer must never return a default value for this cache. Use @Cached(neverDefault=false) to allow default values for this cached value or make sure the cache initializer never returns the default value.");
VarHandle.storeStoreFence();
this.fromJavaStringNode_ = fromJavaStringNode__;
state_0 = state_0 | 0b1 /* add SpecializationActive[ReadlineNodes.ReadlineNode.readline(Object, Object, ToJavaStringWithDefaultNode, FromJavaStringNode, BooleanCastWithDefaultNode)] */;
this.state_0_ = state_0;
return readline(argumentNodes0Value, argumentNodes1Value, INLINED_TO_JAVA_STRING_WITH_DEFAULT_NODE_, fromJavaStringNode__, INLINED_BOOLEAN_CAST_WITH_DEFAULT_NODE_);
}
}
}
@GeneratedBy(PointNode.class)
public static final class PointNodeFactory implements NodeFactory {
private static final PointNodeFactory POINT_NODE_FACTORY_INSTANCE = new PointNodeFactory();
private PointNodeFactory() {
}
@Override
public Class getNodeClass() {
return PointNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of();
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public PointNode 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 POINT_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static PointNode create(RubyNode[] argumentNodes) {
return new PointNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link PointNode#point}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(PointNode.class)
@SuppressWarnings("javadoc")
public static final class PointNodeGen extends PointNode {
private PointNodeGen(RubyNode[] argumentNodes) {
}
@Override
public Object execute(VirtualFrame frameValue) {
return point();
}
}
}
@GeneratedBy(InsertTextNode.class)
public static final class InsertTextNodeFactory implements NodeFactory {
private static final InsertTextNodeFactory INSERT_TEXT_NODE_FACTORY_INSTANCE = new InsertTextNodeFactory();
private InsertTextNodeFactory() {
}
@Override
public Class getNodeClass() {
return InsertTextNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of(RubyNode.class, RubyNode.class);
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode.class, RubyNode.class));
}
@Override
public InsertTextNode createNode(Object... arguments) {
if (arguments.length == 2 && (arguments[0] == null || arguments[0] instanceof RubyNode) && (arguments[1] == null || arguments[1] instanceof RubyNode)) {
return create((RubyNode) arguments[0], (RubyNode) arguments[1]);
} else {
throw new IllegalArgumentException("Invalid create signature.");
}
}
public static NodeFactory getInstance() {
return INSERT_TEXT_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static InsertTextNode create(RubyNode self, RubyNode text) {
return new InsertTextNodeGen(self, text);
}
/**
* Debug Info:
* Specialization {@link InsertTextNode#insertText}
* Activation probability: 1.00000
* With/without class size: 32/10 bytes
*
*/
@GeneratedBy(InsertTextNode.class)
@SuppressWarnings("javadoc")
public static final class InsertTextNodeGen extends InsertTextNode {
private static final StateField STATE_0_InsertTextNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_");
/**
* Source Info:
* Specialization: {@link InsertTextNode#insertText}
* Parameter: {@link ToJavaStringNode} toJavaStringNode
* Inline method: {@link ToJavaStringNodeGen#inline}
*/
private static final ToJavaStringNode INLINED_TO_JAVA_STRING_NODE_ = ToJavaStringNodeGen.inline(InlineTarget.create(ToJavaStringNode.class, STATE_0_InsertTextNode_UPDATER.subUpdater(1, 12), ReferenceField.create(MethodHandles.lookup(), "toJavaStringNode__field1_", Node.class), ReferenceField.create(MethodHandles.lookup(), "toJavaStringNode__field2_", Node.class)));
@Child private RubyNode self_;
@Child private RubyNode text_;
/**
* State Info:
* 0: SpecializationActive {@link InsertTextNode#insertText}
* 1-12: InlinedCache
* Specialization: {@link InsertTextNode#insertText}
* Parameter: {@link ToJavaStringNode} toJavaStringNode
* Inline method: {@link ToJavaStringNodeGen#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int state_0_;
/**
* Source Info:
* Specialization: {@link InsertTextNode#insertText}
* Parameter: {@link ToJavaStringNode} toJavaStringNode
* Inline method: {@link ToJavaStringNodeGen#inline}
* Inline field: {@link Node} field1
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node toJavaStringNode__field1_;
/**
* Source Info:
* Specialization: {@link InsertTextNode#insertText}
* Parameter: {@link ToJavaStringNode} toJavaStringNode
* Inline method: {@link ToJavaStringNodeGen#inline}
* Inline field: {@link Node} field2
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node toJavaStringNode__field2_;
private InsertTextNodeGen(RubyNode self, RubyNode text) {
this.self_ = self;
this.text_ = text;
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object selfValue_ = this.self_.execute(frameValue);
Object textValue_ = this.text_.execute(frameValue);
if ((state_0 & 0b1) != 0 /* is SpecializationActive[ReadlineNodes.InsertTextNode.insertText(RubyBasicObject, Object, ToJavaStringNode)] */ && selfValue_ instanceof RubyBasicObject) {
RubyBasicObject selfValue__ = (RubyBasicObject) selfValue_;
return insertText(selfValue__, textValue_, INLINED_TO_JAVA_STRING_NODE_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(selfValue_, textValue_);
}
private RubyBasicObject executeAndSpecialize(Object selfValue, Object textValue) {
int state_0 = this.state_0_;
if (selfValue instanceof RubyBasicObject) {
RubyBasicObject selfValue_ = (RubyBasicObject) selfValue;
state_0 = state_0 | 0b1 /* add SpecializationActive[ReadlineNodes.InsertTextNode.insertText(RubyBasicObject, Object, ToJavaStringNode)] */;
this.state_0_ = state_0;
return insertText(selfValue_, textValue, INLINED_TO_JAVA_STRING_NODE_);
}
throw new UnsupportedSpecializationException(this, new Node[] {this.self_, this.text_}, selfValue, textValue);
}
}
}
@GeneratedBy(DeleteTextNode.class)
public static final class DeleteTextNodeFactory implements NodeFactory {
private static final DeleteTextNodeFactory DELETE_TEXT_NODE_FACTORY_INSTANCE = new DeleteTextNodeFactory();
private DeleteTextNodeFactory() {
}
@Override
public Class getNodeClass() {
return DeleteTextNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of(RubyNode.class);
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public DeleteTextNode 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 DELETE_TEXT_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static DeleteTextNode create(RubyNode[] argumentNodes) {
return new DeleteTextNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link DeleteTextNode#deleteText}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(DeleteTextNode.class)
@SuppressWarnings("javadoc")
public static final class DeleteTextNodeGen extends DeleteTextNode {
@Child private RubyNode argumentNodes0_;
/**
* State Info:
* 0: SpecializationActive {@link DeleteTextNode#deleteText}
*
*/
@CompilationFinal private int state_0_;
private DeleteTextNodeGen(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[ReadlineNodes.DeleteTextNode.deleteText(RubyBasicObject)] */ && argumentNodes0Value_ instanceof RubyBasicObject) {
RubyBasicObject argumentNodes0Value__ = (RubyBasicObject) argumentNodes0Value_;
return deleteText(argumentNodes0Value__);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_);
}
private RubyBasicObject executeAndSpecialize(Object argumentNodes0Value) {
int state_0 = this.state_0_;
if (argumentNodes0Value instanceof RubyBasicObject) {
RubyBasicObject argumentNodes0Value_ = (RubyBasicObject) argumentNodes0Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[ReadlineNodes.DeleteTextNode.deleteText(RubyBasicObject)] */;
this.state_0_ = state_0;
return deleteText(argumentNodes0Value_);
}
throw new UnsupportedSpecializationException(this, new Node[] {this.argumentNodes0_}, argumentNodes0Value);
}
}
}
@GeneratedBy(LineBufferNode.class)
public static final class LineBufferNodeFactory implements NodeFactory {
private static final LineBufferNodeFactory LINE_BUFFER_NODE_FACTORY_INSTANCE = new LineBufferNodeFactory();
private LineBufferNodeFactory() {
}
@Override
public Class getNodeClass() {
return LineBufferNode.class;
}
@Override
public List> getExecutionSignature() {
return List.of();
}
@Override
public List>> getNodeSignatures() {
return List.of(List.of(RubyNode[].class));
}
@Override
public LineBufferNode 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 LINE_BUFFER_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static LineBufferNode create(RubyNode[] argumentNodes) {
return new LineBufferNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link LineBufferNode#lineBuffer}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(LineBufferNode.class)
@SuppressWarnings("javadoc")
public static final class LineBufferNodeGen extends LineBufferNode {
private LineBufferNodeGen(RubyNode[] argumentNodes) {
}
@Override
public Object execute(VirtualFrame frameValue) {
return lineBuffer();
}
}
}
@GeneratedBy(SetInputNode.class)
public static final class SetInputNodeFactory implements NodeFactory {
private static final SetInputNodeFactory SET_INPUT_NODE_FACTORY_INSTANCE = new SetInputNodeFactory();
private SetInputNodeFactory() {
}
@Override
public Class getNodeClass() {
return SetInputNode.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 SetInputNode 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_INPUT_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static SetInputNode create(RubyNode[] argumentNodes) {
return new SetInputNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link SetInputNode#setInput}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(SetInputNode.class)
@SuppressWarnings("javadoc")
public static final class SetInputNodeGen extends SetInputNode {
@Child private RubyNode argumentNodes0_;
@Child private RubyNode argumentNodes1_;
/**
* State Info:
* 0: SpecializationActive {@link SetInputNode#setInput}
*
*/
@CompilationFinal private int state_0_;
private SetInputNodeGen(RubyNode[] argumentNodes) {
this.argumentNodes0_ = argumentNodes != null && 0 < argumentNodes.length ? argumentNodes[0] : null;
this.argumentNodes1_ = argumentNodes != null && 1 < argumentNodes.length ? argumentNodes[1] : null;
}
@Override
public RubyNode[] getArgumentNodes() {
return new RubyNode[] {this.argumentNodes0_, this.argumentNodes1_};
}
@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[ReadlineNodes.SetInputNode.setInput(int, RubyIO)] */ && argumentNodes0Value_ instanceof Integer) {
int argumentNodes0Value__ = (int) argumentNodes0Value_;
if (argumentNodes1Value_ instanceof RubyIO) {
RubyIO argumentNodes1Value__ = (RubyIO) argumentNodes1Value_;
return setInput(argumentNodes0Value__, argumentNodes1Value__);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_, argumentNodes1Value_);
}
private int executeAndSpecialize(Object argumentNodes0Value, Object argumentNodes1Value) {
int state_0 = this.state_0_;
if (argumentNodes0Value instanceof Integer) {
int argumentNodes0Value_ = (int) argumentNodes0Value;
if (argumentNodes1Value instanceof RubyIO) {
RubyIO argumentNodes1Value_ = (RubyIO) argumentNodes1Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[ReadlineNodes.SetInputNode.setInput(int, RubyIO)] */;
this.state_0_ = state_0;
return setInput(argumentNodes0Value_, argumentNodes1Value_);
}
}
throw new UnsupportedSpecializationException(this, new Node[] {this.argumentNodes0_, this.argumentNodes1_}, argumentNodes0Value, argumentNodes1Value);
}
}
}
@GeneratedBy(SetOutputNode.class)
public static final class SetOutputNodeFactory implements NodeFactory {
private static final SetOutputNodeFactory SET_OUTPUT_NODE_FACTORY_INSTANCE = new SetOutputNodeFactory();
private SetOutputNodeFactory() {
}
@Override
public Class getNodeClass() {
return SetOutputNode.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 SetOutputNode 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_OUTPUT_NODE_FACTORY_INSTANCE;
}
@NeverDefault
public static SetOutputNode create(RubyNode[] argumentNodes) {
return new SetOutputNodeGen(argumentNodes);
}
/**
* Debug Info:
* Specialization {@link SetOutputNode#setOutput}
* Activation probability: 1.00000
* With/without class size: 16/0 bytes
*
*/
@GeneratedBy(SetOutputNode.class)
@SuppressWarnings("javadoc")
public static final class SetOutputNodeGen extends SetOutputNode {
@Child private RubyNode argumentNodes0_;
@Child private RubyNode argumentNodes1_;
/**
* State Info:
* 0: SpecializationActive {@link SetOutputNode#setOutput}
*
*/
@CompilationFinal private int state_0_;
private SetOutputNodeGen(RubyNode[] argumentNodes) {
this.argumentNodes0_ = argumentNodes != null && 0 < argumentNodes.length ? argumentNodes[0] : null;
this.argumentNodes1_ = argumentNodes != null && 1 < argumentNodes.length ? argumentNodes[1] : null;
}
@Override
public RubyNode[] getArgumentNodes() {
return new RubyNode[] {this.argumentNodes0_, this.argumentNodes1_};
}
@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[ReadlineNodes.SetOutputNode.setOutput(int, RubyIO)] */ && argumentNodes0Value_ instanceof Integer) {
int argumentNodes0Value__ = (int) argumentNodes0Value_;
if (argumentNodes1Value_ instanceof RubyIO) {
RubyIO argumentNodes1Value__ = (RubyIO) argumentNodes1Value_;
return setOutput(argumentNodes0Value__, argumentNodes1Value__);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(argumentNodes0Value_, argumentNodes1Value_);
}
private int executeAndSpecialize(Object argumentNodes0Value, Object argumentNodes1Value) {
int state_0 = this.state_0_;
if (argumentNodes0Value instanceof Integer) {
int argumentNodes0Value_ = (int) argumentNodes0Value;
if (argumentNodes1Value instanceof RubyIO) {
RubyIO argumentNodes1Value_ = (RubyIO) argumentNodes1Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[ReadlineNodes.SetOutputNode.setOutput(int, RubyIO)] */;
this.state_0_ = state_0;
return setOutput(argumentNodes0Value_, argumentNodes1Value_);
}
}
throw new UnsupportedSpecializationException(this, new Node[] {this.argumentNodes0_, this.argumentNodes1_}, argumentNodes0Value, argumentNodes1Value);
}
}
}
}