com.oracle.svm.truffle.nfi.ErrnoMirrorGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.svm.truffle.nfi;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.interop.ArityException;
import com.oracle.truffle.api.interop.InteropLibrary;
import com.oracle.truffle.api.interop.UnknownIdentifierException;
import com.oracle.truffle.api.interop.UnsupportedMessageException;
import com.oracle.truffle.api.interop.UnsupportedTypeException;
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;
@GeneratedBy(ErrnoMirror.class)
final class ErrnoMirrorGen {
private static final LibraryFactory DYNAMIC_DISPATCH_LIBRARY_ = LibraryFactory.resolve(DynamicDispatchLibrary.class);
static {
LibraryExport.register(ErrnoMirror.class, new InteropLibraryExports());
}
private ErrnoMirrorGen() {
}
@GeneratedBy(ErrnoMirror.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, ErrnoMirror.class, false, false, 0);
}
@Override
protected InteropLibrary createUncached(Object receiver) {
assert receiver instanceof ErrnoMirror;
InteropLibrary uncached = InteropLibraryExports.UNCACHED;
return uncached;
}
@Override
protected InteropLibrary createCached(Object receiver) {
assert receiver instanceof ErrnoMirror;
return InteropLibraryExports.CACHE;
}
@GeneratedBy(ErrnoMirror.class)
private static final class Cached extends InteropLibrary implements UnadoptableNode {
protected Cached() {
}
@Override
public boolean accepts(Object receiver) {
assert !(receiver instanceof ErrnoMirror) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected.";
return receiver instanceof ErrnoMirror;
}
@Override
public Object execute(Object receiver, Object... arguments) throws UnsupportedTypeException, ArityException, UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((ErrnoMirror) receiver)).execute(arguments);
}
@Override
public boolean hasMembers(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((ErrnoMirror) receiver)).hasMembers();
}
@Override
public boolean isMemberInvocable(Object receiver, String member) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((ErrnoMirror) receiver)).isMemberInvocable(member);
}
@Override
public Object getMembers(Object receiver, boolean includeInternal) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((ErrnoMirror) receiver)).getMembers(includeInternal);
}
@Override
public Object invokeMember(Object receiver, String member, Object... arguments) throws UnsupportedMessageException, ArityException, UnknownIdentifierException, UnsupportedTypeException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((ErrnoMirror) receiver)).invokeMember(member, arguments);
}
@Override
public boolean isExecutable(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return (((ErrnoMirror) receiver)).isExecutable();
}
}
@GeneratedBy(ErrnoMirror.class)
@DenyReplace
private static final class Uncached extends InteropLibrary implements UnadoptableNode {
protected Uncached() {
}
@Override
@TruffleBoundary
public boolean accepts(Object receiver) {
assert !(receiver instanceof ErrnoMirror) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected.";
return receiver instanceof ErrnoMirror;
}
@TruffleBoundary
@Override
public Object execute(Object receiver, Object... arguments) throws UnsupportedTypeException, ArityException, UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((ErrnoMirror) receiver) .execute(arguments);
}
@TruffleBoundary
@Override
public boolean hasMembers(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((ErrnoMirror) receiver) .hasMembers();
}
@TruffleBoundary
@Override
public boolean isMemberInvocable(Object receiver, String member) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((ErrnoMirror) receiver) .isMemberInvocable(member);
}
@TruffleBoundary
@Override
public Object getMembers(Object receiver, boolean includeInternal) throws UnsupportedMessageException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((ErrnoMirror) receiver) .getMembers(includeInternal);
}
@TruffleBoundary
@Override
public Object invokeMember(Object receiver, String member, Object... arguments) throws UnsupportedMessageException, ArityException, UnknownIdentifierException, UnsupportedTypeException {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((ErrnoMirror) receiver) .invokeMember(member, arguments);
}
@TruffleBoundary
@Override
public boolean isExecutable(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((ErrnoMirror) receiver) .isExecutable();
}
}
}
}