(&mut self, builder: &mut FunctionBuilder)
| 1626 | } |
| 1627 | |
| 1628 | fn generate_stack_slots(&mut self, builder: &mut FunctionBuilder) -> Result<()> { |
| 1629 | for _ in 0..self.param(&self.config.static_stack_slots_per_function)? { |
| 1630 | let bytes = self.param(&self.config.static_stack_slot_size)? as u32; |
| 1631 | let alignment = self.param(&self.config.stack_slot_alignment_log2)? as u8; |
| 1632 | let alignment_bytes = 1 << alignment; |
| 1633 | |
| 1634 | let ss_data = StackSlotData::new(StackSlotKind::ExplicitSlot, bytes, alignment); |
| 1635 | let slot = builder.create_sized_stack_slot(ss_data); |
| 1636 | |
| 1637 | // Generate one Alias Analysis Category for each slot |
| 1638 | let category = *self.u.choose(AACategory::all())?; |
| 1639 | |
| 1640 | self.resources |
| 1641 | .stack_slots |
| 1642 | .push((slot, bytes, alignment_bytes, category)); |
| 1643 | } |
| 1644 | |
| 1645 | self.resources |
| 1646 | .stack_slots |
| 1647 | .sort_unstable_by_key(|&(_slot, bytes, _align, _category)| bytes); |
| 1648 | |
| 1649 | Ok(()) |
| 1650 | } |
| 1651 | |
| 1652 | /// Zero initializes the stack slot by inserting `stack_store`'s. |
| 1653 | fn initialize_stack_slots(&mut self, builder: &mut FunctionBuilder) -> Result<()> { |
no test coverage detected