All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.truffle.sl.runtime.SLObjectMessageResolutionForeign Maven / Gradle / Ivy

There is a newer version: 1.0.0-rc7
Show newest version
package com.oracle.truffle.sl.runtime;
import com.oracle.truffle.api.interop.UnsupportedMessageException;
import com.oracle.truffle.api.interop.ForeignAccess.Factory10;
import com.oracle.truffle.api.interop.ForeignAccess.Factory;
import com.oracle.truffle.api.interop.Message;
import com.oracle.truffle.api.interop.ForeignAccess;
import com.oracle.truffle.api.interop.TruffleObject;
import com.oracle.truffle.api.CallTarget;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.nodes.RootNode;
final class SLObjectMessageResolutionForeign implements Factory10, Factory {
  public static final ForeignAccess ACCESS = ForeignAccess.create(null, new SLObjectMessageResolutionForeign());
  public static ForeignAccess createAccess() { return ForeignAccess.create(null, new SLObjectMessageResolutionForeign());}

  private SLObjectMessageResolutionForeign(){}

  public boolean canHandle(TruffleObject obj) {
    return com.oracle.truffle.sl.runtime.SLObjectType.isInstance(obj);
  }

    public CallTarget accessIsNull() {
      return Truffle.getRuntime().createCallTarget(RootNode.createConstantNode(false));
    }
    public CallTarget accessIsExecutable() {
      return Truffle.getRuntime().createCallTarget(RootNode.createConstantNode(false));
    }
    public CallTarget accessIsBoxed() {
      return Truffle.getRuntime().createCallTarget(RootNode.createConstantNode(false));
    }
    public CallTarget accessHasSize() {
      return Truffle.getRuntime().createCallTarget(RootNode.createConstantNode(false));
    }
    public CallTarget accessGetSize() {
      throw UnsupportedMessageException.raise(Message.GET_SIZE);
    }
    public CallTarget accessUnbox() {
      throw UnsupportedMessageException.raise(Message.UNBOX);
    }
    public CallTarget accessRead() {
      return com.oracle.truffle.api.Truffle.getRuntime().createCallTarget(com.oracle.truffle.sl.runtime.SLForeignReadNodeSub.createRoot(com.oracle.truffle.sl.SLLanguage.class));
    }
    public CallTarget accessWrite() {
      return com.oracle.truffle.api.Truffle.getRuntime().createCallTarget(com.oracle.truffle.sl.runtime.SLForeignWriteNodeSub.createRoot(com.oracle.truffle.sl.SLLanguage.class));
    }
    public CallTarget accessExecute(int argumentsLength) {
      throw UnsupportedMessageException.raise(Message.createExecute(argumentsLength));
    }
    public CallTarget accessInvoke(int argumentsLength) {
      return com.oracle.truffle.api.Truffle.getRuntime().createCallTarget(com.oracle.truffle.sl.runtime.SLForeignInvokeNodeSub.createRoot(com.oracle.truffle.sl.SLLanguage.class));
    }
    public CallTarget accessNew(int argumentsLength) {
      throw UnsupportedMessageException.raise(Message.createNew(argumentsLength));
    }
    public CallTarget accessMessage(Message unknown) {
      throw UnsupportedMessageException.raise(unknown);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy