// Process closure accepting instrs specially -- these are the sites of binding loads!
if (i instanceof ClosureAcceptingInstr) {
Operand o = ((ClosureAcceptingInstr)i).getClosureArg();
if (o != null && o instanceof WrappedIRClosure) {
IRClosure cl = ((WrappedIRClosure) o).getClosure();
// Variables defined in the closure do not need to be loaded anymore at
// program points before the call, because they will be loaded after the
// call completes to fetch the latest value.
//
// Allocate a new hash-set and modify it to get around ConcurrentModificationException on reqdLoads
Set<LocalVariable> newReqdLoads = new HashSet<LocalVariable>(reqdLoads);
for (LocalVariable v: reqdLoads) {
if (cl.definesLocalVariable(v)) newReqdLoads.remove(v);
}
reqdLoads = newReqdLoads;
}
// In this case, we are going to blindly load everything -- so, at the call site, pending loads dont carry over!