示例#1
0
  @Specialization
  protected Object doInternal(VirtualFrame frame, RPromise x) {
    if (builtinCallNode == null) {
      RNode call = (RNode) x.getRep();
      RNode operand = (RNode) RASTUtils.unwrap(call);

      if (!(operand instanceof RCallNode)) {
        errorProfile.enter();
        throw RError.error(this, RError.Message.INVALID_INTERNAL);
      }

      RCallNode callNode = (RCallNode) operand;
      RNode func = callNode.getFunctionNode();
      String name = ((ReadVariableNode) func).getIdentifier();
      RFunction function = RContext.lookupBuiltin(name);
      if (function == null
          || function.isBuiltin() && function.getRBuiltin().getKind() != RBuiltinKind.INTERNAL) {
        errorProfile.enter();
        if (function == null && notImplemented(name)) {
          throw RInternalError.unimplemented(".Internal " + name);
        }
        throw RError.error(this, RError.Message.NO_SUCH_INTERNAL, name);
      }

      // .Internal function is validated
      CompilerDirectives.transferToInterpreterAndInvalidate();
      builtinCallNode = insert(RCallNode.createInternalCall(callNode, function));
    }
    return builtinCallNode.execute(frame);
  }
示例#2
0
 @Override
 public Object getRelementImpl(int index) {
   if (index == 0) {
     String name = getBuiltin().getName();
     assert name == name.intern();
     return RDataFactory.createSymbol(name);
   } else {
     throw RInternalError.unimplemented();
   }
 }
示例#3
0
 @Override
 public long seek(long offset, SeekMode seekMode, SeekRWMode seekRWMode) throws IOException {
   long position = inputStream.getChannel().position();
   switch (seekMode) {
     case ENQUIRE:
       break;
     case CURRENT:
       if (offset != 0) {
         inputStream.getChannel().position(position + offset);
       }
       break;
     case START:
       inputStream.getChannel().position(offset);
       break;
     case END:
       throw RInternalError.unimplemented();
   }
   return position;
 }
示例#4
0
 @SuppressWarnings("unused")
 @Specialization
 protected RNull resetCondHands(Object stack) {
   // TODO
   throw RInternalError.unimplemented();
 }
示例#5
0
 @Override
 public final Object call(RArgsValuesAndNames args) {
   throw RInternalError.unimplemented("unimplemented external builtin: " + name);
 }
示例#6
0
 @Override
 public byte[] readBinChars() throws IOException {
   throw RInternalError.unimplemented();
 }
示例#7
0
 @Override
 public int readBin(ByteBuffer buffer) throws IOException {
   throw RInternalError.unimplemented();
 }
示例#8
0
 @Override
 public String readChar(int nchars, boolean useBytes) throws IOException {
   throw RInternalError.unimplemented();
 }
示例#9
0
 @Override
 public void writeChar(String s, int pad, String eos, boolean useBytes) throws IOException {
   throw RInternalError.unimplemented();
 }
示例#10
0
 @Override
 public void writeString(String s, boolean nl) throws IOException {
   throw RInternalError.unimplemented();
 }
示例#11
0
 @Override
 public OutputStream getOutputStream() throws IOException {
   throw RInternalError.unimplemented();
 }