예제 #1
0
 @TruffleBoundary
 protected static Object encodeArgumentPairList(RArgsValuesAndNames args, String symbolName) {
   Object list = RNull.instance;
   for (int i = args.getLength() - 1; i >= 0; i--) {
     String name = args.getSignature().getName(i);
     list =
         RDataFactory.createPairList(
             args.getArgument(i),
             list,
             name == null ? RNull.instance : RDataFactory.createSymbolInterned(name));
   }
   list = RDataFactory.createPairList(symbolName, list);
   return list;
 }
예제 #2
0
 @Specialization
 public Object callNamedFunctionWithPackage(
     String name, RArgsValuesAndNames args, String packageName) {
   controlVisibility();
   SymbolInfo symbolInfo = DLL.findSymbolInfo(name, packageName);
   if (symbolInfo == null) {
     errorProfile.enter();
     throw RError.error(this, Message.C_SYMBOL_NOT_IN_TABLE, name);
   }
   return RFFIFactory.getRFFI()
       .getCallRFFI()
       .invokeCall(symbolInfo.address, symbolInfo.symbol, args.getArguments());
 }
예제 #3
0
 @Specialization
 public Object callNamedFunction(
     VirtualFrame frame,
     RList symbol,
     RArgsValuesAndNames args,
     @SuppressWarnings("unused") Object packageName) {
   return RFFIFactory.getRFFI()
       .getCallRFFI()
       .invokeCall(
           getAddressFromSymbolInfo(frame, symbol),
           getNameFromSymbolInfo(frame, symbol),
           args.getArguments());
 }
예제 #4
0
 @Specialization
 protected RList c(
     String f,
     RArgsValuesAndNames args,
     byte naok,
     byte dup,
     @SuppressWarnings("unused") RMissing rPackage,
     @SuppressWarnings("unused") RMissing encoding, //
     @Cached("create()") BranchProfile errorProfile) {
   controlVisibility();
   SymbolInfo symbolInfo = DLL.findRegisteredSymbolinInDLL(f, null, "");
   if (symbolInfo == null) {
     errorProfile.enter();
     throw RError.error(this, RError.Message.C_SYMBOL_NOT_IN_TABLE, f);
   }
   return DotC.dispatch(
       this, symbolInfo.address, symbolInfo.symbol, naok, dup, args.getArguments());
 }
예제 #5
0
 @Specialization(guards = "lookupBuiltin(symbol) == null")
 protected RList c(
     VirtualFrame frame,
     RList symbol,
     RArgsValuesAndNames args,
     byte naok,
     byte dup,
     @SuppressWarnings("unused") RMissing rPackage,
     @SuppressWarnings("unused") RMissing encoding) {
   controlVisibility();
   return DotC.dispatch(
       this,
       getAddressFromSymbolInfo(frame, symbol),
       getNameFromSymbolInfo(frame, symbol),
       naok,
       dup,
       args.getArguments());
 }