Set<LocalVariable> newDirtyVars = new HashSet<LocalVariable>(dirtyVars);
for (LocalVariable v : dirtyVars) {
// We have to spill the var that is defined in the closure as well because the load var pass
// will attempt to load the var always. So, if the call doesn't actually call the closure,
// we'll be in trouble in that scenario!
if (spillAllVars || cl.usesLocalVariable(v) || cl.definesLocalVariable(v)) {
addedStores = true;
instrs.add(new StoreLocalVarInstr(getLocalVarReplacement(v, scope, varRenameMap), scope, v));
newDirtyVars.remove(v);
}
}