158159160161162163164165166167168
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 }