Add support for emergency spill slots.

- Create a new kind of stack slot: emergency_slot.
- Add a get_emergency_slot() method which finds a suitable emergency
  slot given a list of slots already in use.
- Use emergency spill slots when schedule_moves needs them.
This commit is contained in:
Jakob Stoklund Olesen
2017-10-06 09:11:51 -07:00
parent d0b4c76262
commit b3fa47cacc
7 changed files with 154 additions and 10 deletions

View File

@@ -56,7 +56,9 @@ pub fn layout_stack(frame: &mut StackSlots, alignment: StackSize) -> Result<Stac
)?;
outgoing_max = max(outgoing_max, offset);
}
StackSlotKind::SpillSlot | StackSlotKind::Local => {
StackSlotKind::SpillSlot |
StackSlotKind::Local |
StackSlotKind::EmergencySlot => {
// Determine the smallest alignment of any local or spill slot.
min_align = slot.alignment(min_align);
}