org.jruby.truffle.stdlib.digest.DigestNodesFactory Maven / Gradle / Ivy
The newest version!
// CheckStyle: start generated
package org.jruby.truffle.stdlib.digest;
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.NodeFactory;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.nodes.UnexpectedResultException;
import com.oracle.truffle.api.object.DynamicObject;
import java.util.Arrays;
import java.util.List;
import org.jruby.truffle.builtins.CoreMethodArrayArgumentsNode;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.stdlib.digest.DigestNodes.BubbleBabbleNode;
import org.jruby.truffle.stdlib.digest.DigestNodes.DigestLengthNode;
import org.jruby.truffle.stdlib.digest.DigestNodes.DigestNode;
import org.jruby.truffle.stdlib.digest.DigestNodes.MD5Node;
import org.jruby.truffle.stdlib.digest.DigestNodes.ResetNode;
import org.jruby.truffle.stdlib.digest.DigestNodes.SHA1Node;
import org.jruby.truffle.stdlib.digest.DigestNodes.SHA256Node;
import org.jruby.truffle.stdlib.digest.DigestNodes.SHA384Node;
import org.jruby.truffle.stdlib.digest.DigestNodes.SHA512Node;
import org.jruby.truffle.stdlib.digest.DigestNodes.UpdateNode;
@GeneratedBy(DigestNodes.class)
public final class DigestNodesFactory {
public static List> getFactories() {
return Arrays.asList(MD5NodeFactory.getInstance(), SHA1NodeFactory.getInstance(), SHA256NodeFactory.getInstance(), SHA384NodeFactory.getInstance(), SHA512NodeFactory.getInstance(), UpdateNodeFactory.getInstance(), ResetNodeFactory.getInstance(), DigestNodeFactory.getInstance(), DigestLengthNodeFactory.getInstance(), BubbleBabbleNodeFactory.getInstance());
}
@GeneratedBy(MD5Node.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public static final class MD5NodeFactory implements NodeFactory {
private static MD5NodeFactory mD5NodeFactoryInstance;
private MD5NodeFactory() {
}
@Override
public Class getNodeClass() {
return MD5Node.class;
}
@Override
public List getExecutionSignature() {
return Arrays.asList();
}
@Override
public List getNodeSignatures() {
return Arrays.asList(Arrays.asList(RubyNode[].class));
}
@Override
public MD5Node 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() {
if (mD5NodeFactoryInstance == null) {
mD5NodeFactoryInstance = new MD5NodeFactory();
}
return mD5NodeFactoryInstance;
}
public static MD5Node create(RubyNode[] arguments) {
return new MD5NodeGen(arguments);
}
@GeneratedBy(MD5Node.class)
public static final class MD5NodeGen extends MD5Node {
@SuppressWarnings("unused")
private MD5NodeGen(RubyNode[] arguments) {
}
@Override
public NodeCost getCost() {
return NodeCost.MONOMORPHIC;
}
@Override
public Object execute(VirtualFrame frameValue) {
return this.md5();
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
}
}
@GeneratedBy(SHA1Node.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public static final class SHA1NodeFactory implements NodeFactory {
private static SHA1NodeFactory sHA1NodeFactoryInstance;
private SHA1NodeFactory() {
}
@Override
public Class getNodeClass() {
return SHA1Node.class;
}
@Override
public List getExecutionSignature() {
return Arrays.asList();
}
@Override
public List getNodeSignatures() {
return Arrays.asList(Arrays.asList(RubyNode[].class));
}
@Override
public SHA1Node 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() {
if (sHA1NodeFactoryInstance == null) {
sHA1NodeFactoryInstance = new SHA1NodeFactory();
}
return sHA1NodeFactoryInstance;
}
public static SHA1Node create(RubyNode[] arguments) {
return new SHA1NodeGen(arguments);
}
@GeneratedBy(SHA1Node.class)
public static final class SHA1NodeGen extends SHA1Node {
@SuppressWarnings("unused")
private SHA1NodeGen(RubyNode[] arguments) {
}
@Override
public NodeCost getCost() {
return NodeCost.MONOMORPHIC;
}
@Override
public Object execute(VirtualFrame frameValue) {
return this.sha1();
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
}
}
@GeneratedBy(SHA256Node.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public static final class SHA256NodeFactory implements NodeFactory {
private static SHA256NodeFactory sHA256NodeFactoryInstance;
private SHA256NodeFactory() {
}
@Override
public Class getNodeClass() {
return SHA256Node.class;
}
@Override
public List getExecutionSignature() {
return Arrays.asList();
}
@Override
public List getNodeSignatures() {
return Arrays.asList(Arrays.asList(RubyNode[].class));
}
@Override
public SHA256Node 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() {
if (sHA256NodeFactoryInstance == null) {
sHA256NodeFactoryInstance = new SHA256NodeFactory();
}
return sHA256NodeFactoryInstance;
}
public static SHA256Node create(RubyNode[] arguments) {
return new SHA256NodeGen(arguments);
}
@GeneratedBy(SHA256Node.class)
public static final class SHA256NodeGen extends SHA256Node {
@SuppressWarnings("unused")
private SHA256NodeGen(RubyNode[] arguments) {
}
@Override
public NodeCost getCost() {
return NodeCost.MONOMORPHIC;
}
@Override
public Object execute(VirtualFrame frameValue) {
return this.sha256();
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
}
}
@GeneratedBy(SHA384Node.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public static final class SHA384NodeFactory implements NodeFactory {
private static SHA384NodeFactory sHA384NodeFactoryInstance;
private SHA384NodeFactory() {
}
@Override
public Class getNodeClass() {
return SHA384Node.class;
}
@Override
public List getExecutionSignature() {
return Arrays.asList();
}
@Override
public List getNodeSignatures() {
return Arrays.asList(Arrays.asList(RubyNode[].class));
}
@Override
public SHA384Node 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() {
if (sHA384NodeFactoryInstance == null) {
sHA384NodeFactoryInstance = new SHA384NodeFactory();
}
return sHA384NodeFactoryInstance;
}
public static SHA384Node create(RubyNode[] arguments) {
return new SHA384NodeGen(arguments);
}
@GeneratedBy(SHA384Node.class)
public static final class SHA384NodeGen extends SHA384Node {
@SuppressWarnings("unused")
private SHA384NodeGen(RubyNode[] arguments) {
}
@Override
public NodeCost getCost() {
return NodeCost.MONOMORPHIC;
}
@Override
public Object execute(VirtualFrame frameValue) {
return this.sha384();
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
}
}
@GeneratedBy(SHA512Node.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public static final class SHA512NodeFactory implements NodeFactory {
private static SHA512NodeFactory sHA512NodeFactoryInstance;
private SHA512NodeFactory() {
}
@Override
public Class getNodeClass() {
return SHA512Node.class;
}
@Override
public List getExecutionSignature() {
return Arrays.asList();
}
@Override
public List getNodeSignatures() {
return Arrays.asList(Arrays.asList(RubyNode[].class));
}
@Override
public SHA512Node 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() {
if (sHA512NodeFactoryInstance == null) {
sHA512NodeFactoryInstance = new SHA512NodeFactory();
}
return sHA512NodeFactoryInstance;
}
public static SHA512Node create(RubyNode[] arguments) {
return new SHA512NodeGen(arguments);
}
@GeneratedBy(SHA512Node.class)
public static final class SHA512NodeGen extends SHA512Node {
@SuppressWarnings("unused")
private SHA512NodeGen(RubyNode[] arguments) {
}
@Override
public NodeCost getCost() {
return NodeCost.MONOMORPHIC;
}
@Override
public Object execute(VirtualFrame frameValue) {
return this.sha512();
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
}
}
@GeneratedBy(UpdateNode.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public static final class UpdateNodeFactory implements NodeFactory {
private static UpdateNodeFactory updateNodeFactoryInstance;
private UpdateNodeFactory() {
}
@Override
public Class getNodeClass() {
return UpdateNode.class;
}
@Override
public List getExecutionSignature() {
return Arrays.asList(RubyNode.class, RubyNode.class);
}
@Override
public List getNodeSignatures() {
return Arrays.asList(Arrays.asList(RubyNode[].class));
}
@Override
public UpdateNode 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() {
if (updateNodeFactoryInstance == null) {
updateNodeFactoryInstance = new UpdateNodeFactory();
}
return updateNodeFactoryInstance;
}
public static UpdateNode create(RubyNode[] arguments) {
return new UpdateNodeGen(arguments);
}
@GeneratedBy(UpdateNode.class)
public static final class UpdateNodeGen extends UpdateNode {
@Child private RubyNode arguments0_;
@Child private RubyNode arguments1_;
@CompilationFinal private boolean seenUnsupported0;
private UpdateNodeGen(RubyNode[] arguments) {
this.arguments0_ = arguments != null && 0 < arguments.length ? arguments[0] : null;
this.arguments1_ = arguments != null && 1 < arguments.length ? arguments[1] : null;
}
@Override
public NodeCost getCost() {
return NodeCost.MONOMORPHIC;
}
@Override
public Object execute(VirtualFrame frameValue) {
DynamicObject arguments0Value_;
try {
arguments0Value_ = arguments0_.executeDynamicObject(frameValue);
} catch (UnexpectedResultException ex) {
Object arguments1Value = arguments1_.execute(frameValue);
throw unsupported(ex.getResult(), arguments1Value);
}
DynamicObject arguments1Value_;
try {
arguments1Value_ = arguments1_.executeDynamicObject(frameValue);
} catch (UnexpectedResultException ex) {
throw unsupported(arguments0Value_, ex.getResult());
}
if ((RubyGuards.isRubyString(arguments1Value_))) {
return this.update(arguments0Value_, arguments1Value_);
}
throw unsupported(arguments0Value_, arguments1Value_);
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
private UnsupportedSpecializationException unsupported(Object arguments0Value, Object arguments1Value) {
if (!seenUnsupported0) {
CompilerDirectives.transferToInterpreterAndInvalidate();
seenUnsupported0 = true;
}
return new UnsupportedSpecializationException(this, new Node[] {arguments0_, arguments1_}, arguments0Value, arguments1Value);
}
}
}
@GeneratedBy(ResetNode.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public static final class ResetNodeFactory implements NodeFactory {
private static ResetNodeFactory resetNodeFactoryInstance;
private ResetNodeFactory() {
}
@Override
public Class getNodeClass() {
return ResetNode.class;
}
@Override
public List getExecutionSignature() {
return Arrays.asList(RubyNode.class);
}
@Override
public List getNodeSignatures() {
return Arrays.asList(Arrays.asList(RubyNode[].class));
}
@Override
public ResetNode 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() {
if (resetNodeFactoryInstance == null) {
resetNodeFactoryInstance = new ResetNodeFactory();
}
return resetNodeFactoryInstance;
}
public static ResetNode create(RubyNode[] arguments) {
return new ResetNodeGen(arguments);
}
@GeneratedBy(ResetNode.class)
public static final class ResetNodeGen extends ResetNode {
@Child private RubyNode arguments0_;
@CompilationFinal private boolean seenUnsupported0;
private ResetNodeGen(RubyNode[] arguments) {
this.arguments0_ = arguments != null && 0 < arguments.length ? arguments[0] : null;
}
@Override
public NodeCost getCost() {
return NodeCost.MONOMORPHIC;
}
@Override
public Object execute(VirtualFrame frameValue) {
DynamicObject arguments0Value_;
try {
arguments0Value_ = arguments0_.executeDynamicObject(frameValue);
} catch (UnexpectedResultException ex) {
throw unsupported(ex.getResult());
}
return this.reset(arguments0Value_);
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
private UnsupportedSpecializationException unsupported(Object arguments0Value) {
if (!seenUnsupported0) {
CompilerDirectives.transferToInterpreterAndInvalidate();
seenUnsupported0 = true;
}
return new UnsupportedSpecializationException(this, new Node[] {arguments0_}, arguments0Value);
}
}
}
@GeneratedBy(DigestNode.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public static final class DigestNodeFactory implements NodeFactory {
private static DigestNodeFactory digestNodeFactoryInstance;
private DigestNodeFactory() {
}
@Override
public Class getNodeClass() {
return DigestNode.class;
}
@Override
public List getExecutionSignature() {
return Arrays.asList(RubyNode.class);
}
@Override
public List getNodeSignatures() {
return Arrays.asList(Arrays.asList(RubyNode[].class));
}
@Override
public DigestNode 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() {
if (digestNodeFactoryInstance == null) {
digestNodeFactoryInstance = new DigestNodeFactory();
}
return digestNodeFactoryInstance;
}
public static DigestNode create(RubyNode[] arguments) {
return new DigestNodeGen(arguments);
}
@GeneratedBy(DigestNode.class)
public static final class DigestNodeGen extends DigestNode {
@Child private RubyNode arguments0_;
@CompilationFinal private boolean seenUnsupported0;
private DigestNodeGen(RubyNode[] arguments) {
this.arguments0_ = arguments != null && 0 < arguments.length ? arguments[0] : null;
}
@Override
public NodeCost getCost() {
return NodeCost.MONOMORPHIC;
}
@Override
public Object execute(VirtualFrame frameValue) {
DynamicObject arguments0Value_;
try {
arguments0Value_ = arguments0_.executeDynamicObject(frameValue);
} catch (UnexpectedResultException ex) {
throw unsupported(ex.getResult());
}
return this.digest(arguments0Value_);
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
private UnsupportedSpecializationException unsupported(Object arguments0Value) {
if (!seenUnsupported0) {
CompilerDirectives.transferToInterpreterAndInvalidate();
seenUnsupported0 = true;
}
return new UnsupportedSpecializationException(this, new Node[] {arguments0_}, arguments0Value);
}
}
}
@GeneratedBy(DigestLengthNode.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public static final class DigestLengthNodeFactory implements NodeFactory {
private static DigestLengthNodeFactory digestLengthNodeFactoryInstance;
private DigestLengthNodeFactory() {
}
@Override
public Class getNodeClass() {
return DigestLengthNode.class;
}
@Override
public List getExecutionSignature() {
return Arrays.asList(RubyNode.class);
}
@Override
public List getNodeSignatures() {
return Arrays.asList(Arrays.asList(RubyNode[].class));
}
@Override
public DigestLengthNode 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() {
if (digestLengthNodeFactoryInstance == null) {
digestLengthNodeFactoryInstance = new DigestLengthNodeFactory();
}
return digestLengthNodeFactoryInstance;
}
public static DigestLengthNode create(RubyNode[] arguments) {
return new DigestLengthNodeGen(arguments);
}
@GeneratedBy(DigestLengthNode.class)
public static final class DigestLengthNodeGen extends DigestLengthNode {
@Child private RubyNode arguments0_;
@CompilationFinal private boolean seenUnsupported0;
private DigestLengthNodeGen(RubyNode[] arguments) {
this.arguments0_ = arguments != null && 0 < arguments.length ? arguments[0] : null;
}
@Override
public NodeCost getCost() {
return NodeCost.MONOMORPHIC;
}
@Override
public Object execute(VirtualFrame frameValue) {
return executeInteger(frameValue);
}
@Override
public void executeVoid(VirtualFrame frameValue) {
executeInteger(frameValue);
return;
}
@Override
public int executeInteger(VirtualFrame frameValue) {
DynamicObject arguments0Value_;
try {
arguments0Value_ = arguments0_.executeDynamicObject(frameValue);
} catch (UnexpectedResultException ex) {
throw unsupported(ex.getResult());
}
return this.digestLength(arguments0Value_);
}
private UnsupportedSpecializationException unsupported(Object arguments0Value) {
if (!seenUnsupported0) {
CompilerDirectives.transferToInterpreterAndInvalidate();
seenUnsupported0 = true;
}
return new UnsupportedSpecializationException(this, new Node[] {arguments0_}, arguments0Value);
}
}
}
@GeneratedBy(BubbleBabbleNode.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public static final class BubbleBabbleNodeFactory implements NodeFactory {
private static BubbleBabbleNodeFactory bubbleBabbleNodeFactoryInstance;
private BubbleBabbleNodeFactory() {
}
@Override
public Class getNodeClass() {
return BubbleBabbleNode.class;
}
@Override
public List getExecutionSignature() {
return Arrays.asList(RubyNode.class);
}
@Override
public List getNodeSignatures() {
return Arrays.asList(Arrays.asList(RubyNode[].class));
}
@Override
public BubbleBabbleNode 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() {
if (bubbleBabbleNodeFactoryInstance == null) {
bubbleBabbleNodeFactoryInstance = new BubbleBabbleNodeFactory();
}
return bubbleBabbleNodeFactoryInstance;
}
public static BubbleBabbleNode create(RubyNode[] arguments) {
return new BubbleBabbleNodeGen(arguments);
}
@GeneratedBy(BubbleBabbleNode.class)
public static final class BubbleBabbleNodeGen extends BubbleBabbleNode {
@Child private RubyNode arguments0_;
@CompilationFinal private boolean seenUnsupported0;
private BubbleBabbleNodeGen(RubyNode[] arguments) {
this.arguments0_ = arguments != null && 0 < arguments.length ? arguments[0] : null;
}
@Override
public NodeCost getCost() {
return NodeCost.MONOMORPHIC;
}
@Override
public Object execute(VirtualFrame frameValue) {
DynamicObject arguments0Value_;
try {
arguments0Value_ = arguments0_.executeDynamicObject(frameValue);
} catch (UnexpectedResultException ex) {
throw unsupported(ex.getResult());
}
if ((RubyGuards.isRubyString(arguments0Value_))) {
return this.bubblebabble(arguments0Value_);
}
throw unsupported(arguments0Value_);
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
private UnsupportedSpecializationException unsupported(Object arguments0Value) {
if (!seenUnsupported0) {
CompilerDirectives.transferToInterpreterAndInvalidate();
seenUnsupported0 = true;
}
return new UnsupportedSpecializationException(this, new Node[] {arguments0_}, arguments0Value);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy