···600600 num_locals = len(self.varnames)
601601 Top = 2**num_locals - 1
602602 # map of block id -> assignment state in lattice
603603- live_out = [Top] * self.block_count
603603+ assigned_out = [Top] * self.block_count
604604 conditionally_assigned = set()
605605 argcount = (
606606 len(self.args)
···623623 def process_one_block(block, modify=False):
624624 bid = block.bid
625625 if len(preds[bid]) == 0:
626626- # No preds; all parameters are live-in
627627- currently_alive = ArgsAssigned
626626+ # No preds; all parameters are assigned
627627+ assigned = ArgsAssigned
628628 else:
629629- # Meet the live-out sets of all predecessors
630630- currently_alive = meet(live_out[pred] for pred in preds[bid])
629629+ # Meet the assigned sets of all predecessors
630630+ assigned = meet(assigned_out[pred] for pred in preds[bid])
631631 for instr in block.getInstructions():
632632 if modify and instr.opname == "LOAD_FAST":
633633- if currently_alive & (1 << instr.ioparg):
633633+ if assigned & (1 << instr.ioparg):
634634 instr.opname = "LOAD_FAST_REVERSE_UNCHECKED"
635635 instr.ioparg = reverse_local_idx(instr.ioparg)
636636 elif instr.ioparg >= argcount:
637637 # Exclude arguments because they come into the function
638638- # body live. Anything that makes them no longer live
639639- # will have to be DELETE_FAST.
638638+ # body assigned. The only thing that can undefine them
639639+ # is DELETE_FAST.
640640 conditionally_assigned.add(instr.oparg)
641641 elif instr.opname == "STORE_FAST":
642642- currently_alive |= 1 << instr.ioparg
642642+ assigned |= 1 << instr.ioparg
643643 if modify:
644644 instr.opname = "STORE_FAST_REVERSE"
645645 instr.ioparg = reverse_local_idx(instr.ioparg)
646646 elif instr.opname == "DELETE_FAST":
647647- currently_alive &= ~(1 << instr.ioparg)
648648- if currently_alive == live_out[block.bid]:
647647+ assigned &= ~(1 << instr.ioparg)
648648+ if assigned == assigned_out[bid]:
649649 return False
650650- live_out[block.bid] = currently_alive
650650+ assigned_out[bid] = assigned
651651 return True
652652653653 changed = True