com.oracle.truffle.js.runtime.builtins.JSAdapterObjectGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.runtime.builtins;
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.LibraryExport;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.js.runtime.objects.JSObjectGen;
@GeneratedBy(JSAdapterObject.class)
final class JSAdapterObjectGen {
static {
LibraryExport.register(JSAdapterObject.class, new InteropLibraryExports());
}
private JSAdapterObjectGen() {
}
@GeneratedBy(JSAdapterObject.class)
private static final class InteropLibraryExports extends LibraryExport {
private InteropLibraryExports() {
super(InteropLibrary.class, JSAdapterObject.class, false, false, 0);
}
@Override
protected InteropLibrary createUncached(Object receiver) {
assert receiver instanceof JSAdapterObject;
InteropLibrary uncached = new Uncached(receiver);
return uncached;
}
@Override
protected InteropLibrary createCached(Object receiver) {
assert receiver instanceof JSAdapterObject;
return new Cached(receiver);
}
@GeneratedBy(JSAdapterObject.class)
private static final class Cached extends JSObjectGen.InteropLibraryExports.Cached {
protected Cached(Object receiver) {
super(receiver);
}
@Override
public boolean hasMetaObject(Object receiver) {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
assert assertAdopted();
return (((JSAdapterObject) receiver)).hasMetaObject();
}
@Override
public Object getMetaObject(Object receiver) throws UnsupportedMessageException {
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
assert assertAdopted();
return (((JSAdapterObject) receiver)).getMetaObject();
}
}
@GeneratedBy(JSAdapterObject.class)
@DenyReplace
private static final class Uncached extends JSObjectGen.InteropLibraryExports.Uncached {
protected Uncached(Object receiver) {
super(receiver);
}
@Override
@TruffleBoundary
public boolean accepts(Object receiver) {
return super.accepts(receiver);
}
@TruffleBoundary
@Override
public boolean hasMetaObject(Object receiver) {
// declared: true
assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
return ((JSAdapterObject) 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 ((JSAdapterObject) receiver) .getMetaObject();
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy