}
return emptyReadSet;
}
ArrayList<EnclosingSlot> rsl = new ArrayList<>();
for (RSymbol s : origRSet) {
RFunction p = parent;
int hops = 1;
while (p != null) {
int slot = p.localSlot(s);
if (slot != -1) {
rsl.add(new EnclosingSlot(s, hops, slot));
break;
}
p = p.enclosingFunction();
hops++;
}
}
return rsl.toArray(new EnclosingSlot[0]); // FIXME: rewrite this to get rid of allocation/copying
}