@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(); } }
public byte[] getData(String dbPath) { byte[] dbData = dbCache.get(dbPath); if (dbData == null) { try { dbData = Files.readAllBytes(FileSystems.getDefault().getPath(dbPath)); } catch (IOException ex) { // unexpected throw RInternalError.shouldNotReachHere(ex); } dbCache.put(dbPath, dbData); } return dbData; }
protected RuntimeException fallback(Object fobj) { String name = null; if (fobj instanceof RList) { name = lookupName((RList) fobj); name = name == UNKNOWN_EXTERNAL_BUILTIN ? null : name; if (name != null && lookupBuiltin((RList) fobj) != null) { /* * if we reach this point, then the cache saw a different value for f. the lists * that contain the information about native calls are never expected to change. */ throw RInternalError.shouldNotReachHere( "fallback reached for " + getRBuiltin().name() + " " + name); } } throw RError.nyi( this, getRBuiltin().name() + " specialization failure: " + (name == null ? "<unknown>" : name)); }
@Override public final Object call(RArgsValuesAndNames args) { throw RInternalError.unimplemented("unimplemented external builtin: " + name); }
/** TODO the string is not really needed as all output is performed prior to the throw. */ RError(String msg) { super(msg); verboseStackTrace = RInternalError.createVerboseStackTrace(); }