com.oracle.graal.python.runtime.EmulatedAddrInfoCursorImplGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.runtime;
import com.oracle.graal.python.runtime.EmulatedPosixSupport.EmulatedAddrInfoCursorImpl;
import com.oracle.graal.python.runtime.PosixSupportLibrary.AddrInfoCursor;
import com.oracle.graal.python.runtime.PosixSupportLibrary.AddrInfoCursorLibrary;
import com.oracle.graal.python.runtime.PosixSupportLibrary.UniversalSockAddr;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.GeneratedBy;
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.NodeCost;
@GeneratedBy(EmulatedAddrInfoCursorImpl.class)
final class EmulatedAddrInfoCursorImplGen {
private static final LibraryFactory DYNAMIC_DISPATCH_LIBRARY_ = LibraryFactory.resolve(DynamicDispatchLibrary.class);
static {
LibraryExport.register(EmulatedAddrInfoCursorImpl.class, new AddrInfoCursorLibraryExports());
}
private EmulatedAddrInfoCursorImplGen() {
}
@GeneratedBy(EmulatedAddrInfoCursorImpl.class)
protected static class AddrInfoCursorLibraryExports extends LibraryExport {
private AddrInfoCursorLibraryExports() {
super(AddrInfoCursorLibrary.class, EmulatedAddrInfoCursorImpl.class, false, false, 0);
}
@Override
protected AddrInfoCursorLibrary createUncached(Object receiver) {
assert receiver instanceof EmulatedAddrInfoCursorImpl;
AddrInfoCursorLibrary uncached = new Uncached(receiver);
return uncached;
}
@Override
protected AddrInfoCursorLibrary createCached(Object receiver) {
assert receiver instanceof EmulatedAddrInfoCursorImpl;
return new Cached(receiver);
}
@GeneratedBy(EmulatedAddrInfoCursorImpl.class)
protected static class Cached extends AddrInfoCursorLibrary {
private final Class extends EmulatedAddrInfoCursorImpl> receiverClass_;
protected Cached(Object receiver) {
EmulatedAddrInfoCursorImpl castReceiver = ((EmulatedAddrInfoCursorImpl) receiver) ;
this.receiverClass_ = castReceiver.getClass();
}
@Override
public boolean accepts(Object receiver) {
assert receiver.getClass() != this.receiverClass_ || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected.";
return CompilerDirectives.isExact(receiver, this.receiverClass_);
}
@Override
public void release(AddrInfoCursor receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
(CompilerDirectives.castExact(receiver, receiverClass_)).release();
return;
}
@Override
public boolean next(AddrInfoCursor receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (CompilerDirectives.castExact(receiver, receiverClass_)).next();
}
@Override
public int getFlags(AddrInfoCursor receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (CompilerDirectives.castExact(receiver, receiverClass_)).getFlags();
}
@Override
public int getFamily(AddrInfoCursor receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (CompilerDirectives.castExact(receiver, receiverClass_)).getFamily();
}
@Override
public int getSockType(AddrInfoCursor receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (CompilerDirectives.castExact(receiver, receiverClass_)).getSockType();
}
@Override
public int getProtocol(AddrInfoCursor receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (CompilerDirectives.castExact(receiver, receiverClass_)).getProtocol();
}
@Override
public Object getCanonName(AddrInfoCursor receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (CompilerDirectives.castExact(receiver, receiverClass_)).getCanonName();
}
@Override
public UniversalSockAddr getSockAddr(AddrInfoCursor receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (CompilerDirectives.castExact(receiver, receiverClass_)).getSockAddr();
}
}
@GeneratedBy(EmulatedAddrInfoCursorImpl.class)
protected static class Uncached extends AddrInfoCursorLibrary {
private final Class extends EmulatedAddrInfoCursorImpl> receiverClass_;
protected Uncached(Object receiver) {
this.receiverClass_ = ((EmulatedAddrInfoCursorImpl) receiver).getClass();
}
@Override
@TruffleBoundary
public boolean accepts(Object receiver) {
assert receiver.getClass() != this.receiverClass_ || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected.";
return CompilerDirectives.isExact(receiver, this.receiverClass_);
}
@Override
public final boolean isAdoptable() {
return false;
}
@Override
public final NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@TruffleBoundary
@Override
public void release(AddrInfoCursor receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
((EmulatedAddrInfoCursorImpl) receiver) .release();
return;
}
@TruffleBoundary
@Override
public boolean next(AddrInfoCursor receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((EmulatedAddrInfoCursorImpl) receiver) .next();
}
@TruffleBoundary
@Override
public int getFlags(AddrInfoCursor receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((EmulatedAddrInfoCursorImpl) receiver) .getFlags();
}
@TruffleBoundary
@Override
public int getFamily(AddrInfoCursor receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((EmulatedAddrInfoCursorImpl) receiver) .getFamily();
}
@TruffleBoundary
@Override
public int getSockType(AddrInfoCursor receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((EmulatedAddrInfoCursorImpl) receiver) .getSockType();
}
@TruffleBoundary
@Override
public int getProtocol(AddrInfoCursor receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((EmulatedAddrInfoCursorImpl) receiver) .getProtocol();
}
@TruffleBoundary
@Override
public Object getCanonName(AddrInfoCursor receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((EmulatedAddrInfoCursorImpl) receiver) .getCanonName();
}
@TruffleBoundary
@Override
public UniversalSockAddr getSockAddr(AddrInfoCursor receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((EmulatedAddrInfoCursorImpl) receiver) .getSockAddr();
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy