com.oracle.truffle.sl.runtime.SLBigIntegerGen Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truffle-sl Show documentation
Show all versions of truffle-sl Show documentation
Truffle SL is an example language implemented using the Truffle API.
The newest version!
// CheckStyle: start generated
package com.oracle.truffle.sl.runtime;
import com.oracle.truffle.api.TruffleLanguage;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.interop.InteropLibrary;
import com.oracle.truffle.api.interop.UnsupportedMessageException;
import com.oracle.truffle.api.library.DynamicDispatchLibrary;
import com.oracle.truffle.api.library.LibraryExport;
import com.oracle.truffle.api.library.LibraryFactory;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.UnadoptableNode;
import java.math.BigInteger;
@GeneratedBy(SLBigInteger.class)
final class SLBigIntegerGen {
private static final LibraryFactory DYNAMIC_DISPATCH_LIBRARY_ = LibraryFactory.resolve(DynamicDispatchLibrary.class);
static {
LibraryExport.register(SLBigInteger.class, new InteropLibraryExports());
}
private SLBigIntegerGen() {
}
@GeneratedBy(SLBigInteger.class)
private static final class InteropLibraryExports extends LibraryExport {
private static final Uncached UNCACHED = new Uncached();
private static final Cached CACHE = new Cached();
private InteropLibraryExports() {
super(InteropLibrary.class, SLBigInteger.class, false, false, 0);
}
@Override
protected InteropLibrary createUncached(Object receiver) {
assert receiver instanceof SLBigInteger;
InteropLibrary uncached = InteropLibraryExports.UNCACHED;
return uncached;
}
@Override
protected InteropLibrary createCached(Object receiver) {
assert receiver instanceof SLBigInteger;
return InteropLibraryExports.CACHE;
}
@GeneratedBy(SLBigInteger.class)
private static final class Cached extends InteropLibrary implements UnadoptableNode {
protected Cached() {
}
@Override
public boolean accepts(Object receiver) {
assert !(receiver instanceof SLBigInteger) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected.";
return receiver instanceof SLBigInteger;
}
@Override
public boolean isNumber(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).isNumber();
}
@TruffleBoundary
@Override
public boolean fitsInByte(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).fitsInByte();
}
@TruffleBoundary
@Override
public boolean fitsInShort(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).fitsInShort();
}
@TruffleBoundary
@Override
public boolean fitsInFloat(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).fitsInFloat();
}
@TruffleBoundary
@Override
public boolean fitsInLong(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).fitsInLong();
}
@TruffleBoundary
@Override
public boolean fitsInInt(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).fitsInInt();
}
@TruffleBoundary
@Override
public boolean fitsInDouble(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).fitsInDouble();
}
@Override
public boolean fitsInBigInteger(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).fitsInBigInteger();
}
@TruffleBoundary
@Override
public double asDouble(Object receiver) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).asDouble();
}
@TruffleBoundary
@Override
public long asLong(Object receiver) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).asLong();
}
@TruffleBoundary
@Override
public byte asByte(Object receiver) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).asByte();
}
@TruffleBoundary
@Override
public int asInt(Object receiver) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).asInt();
}
@TruffleBoundary
@Override
public float asFloat(Object receiver) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).asFloat();
}
@TruffleBoundary
@Override
public short asShort(Object receiver) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).asShort();
}
@Override
public BigInteger asBigInteger(Object receiver) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).asBigInteger();
}
@Override
public boolean hasLanguage(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).hasLanguage();
}
@Override
public Class extends TruffleLanguage>> getLanguage(Object receiver) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).getLanguage();
}
@Override
public boolean hasMetaObject(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).hasMetaObject();
}
@Override
public Object getMetaObject(Object receiver) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).getMetaObject();
}
@TruffleBoundary
@Override
public Object toDisplayString(Object receiver, boolean allowSideEffects) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((SLBigInteger) receiver)).toDisplayString(allowSideEffects);
}
}
@GeneratedBy(SLBigInteger.class)
@DenyReplace
private static final class Uncached extends InteropLibrary implements UnadoptableNode {
protected Uncached() {
}
@Override
@TruffleBoundary
public boolean accepts(Object receiver) {
assert !(receiver instanceof SLBigInteger) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected.";
return receiver instanceof SLBigInteger;
}
@TruffleBoundary
@Override
public boolean isNumber(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .isNumber();
}
@TruffleBoundary
@Override
public boolean fitsInByte(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .fitsInByte();
}
@TruffleBoundary
@Override
public boolean fitsInShort(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .fitsInShort();
}
@TruffleBoundary
@Override
public boolean fitsInFloat(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .fitsInFloat();
}
@TruffleBoundary
@Override
public boolean fitsInLong(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .fitsInLong();
}
@TruffleBoundary
@Override
public boolean fitsInInt(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .fitsInInt();
}
@TruffleBoundary
@Override
public boolean fitsInDouble(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .fitsInDouble();
}
@TruffleBoundary
@Override
public boolean fitsInBigInteger(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .fitsInBigInteger();
}
@TruffleBoundary
@Override
public double asDouble(Object receiver) throws UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .asDouble();
}
@TruffleBoundary
@Override
public long asLong(Object receiver) throws UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .asLong();
}
@TruffleBoundary
@Override
public byte asByte(Object receiver) throws UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .asByte();
}
@TruffleBoundary
@Override
public int asInt(Object receiver) throws UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .asInt();
}
@TruffleBoundary
@Override
public float asFloat(Object receiver) throws UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .asFloat();
}
@TruffleBoundary
@Override
public short asShort(Object receiver) throws UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .asShort();
}
@TruffleBoundary
@Override
public BigInteger asBigInteger(Object receiver) throws UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .asBigInteger();
}
@TruffleBoundary
@Override
public boolean hasLanguage(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .hasLanguage();
}
@TruffleBoundary
@Override
public Class extends TruffleLanguage>> getLanguage(Object receiver) throws UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .getLanguage();
}
@TruffleBoundary
@Override
public boolean hasMetaObject(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .hasMetaObject();
}
@TruffleBoundary
@Override
public Object getMetaObject(Object receiver) throws UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .getMetaObject();
}
@TruffleBoundary
@Override
public Object toDisplayString(Object receiver, boolean allowSideEffects) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((SLBigInteger) receiver) .toDisplayString(allowSideEffects);
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy