Instr i = instrs.next();
if (i instanceof ResultInstr) {
Variable v = ((ResultInstr) i).getResult();
// %self is local to every scope and never crosses scope boundaries and need not be spilled/refilled
if (v instanceof LocalVariable && !v.isSelf()) {
LocalVariable lv = (LocalVariable)v;
if (lv.getScopeDepth() == 0) {
// Make sure there is a replacement tmp-var allocated for lv
setupLocalVarReplacement(lv, s, varRenameMap);
} else {
parentScopeNeeded = true;
decrementScopeDepth(lv, s, varRenameMap);
}
}
}
for (Variable v : i.getUsedVariables()) {
if (v instanceof LocalVariable && !v.isSelf()) {
LocalVariable lv = (LocalVariable)v;
if (lv.getScopeDepth() == 0) {
// SSS FIXME: Ugly/Dirty! Some abstraction is broken.
// If we hit a load/store instr for a local-var and we
// eliminated the dynscope for it, we no longer need the
// load/store instr for it.
if (i instanceof LoadLocalVarInstr) {