Move the stack either up or down N slots. -1 becomes a -4 or -8
(&mut self, slots: isize)
| 750 | |
| 751 | /// Move the stack either up or down N slots. -1 becomes a -4 or -8 |
| 752 | pub fn shift_stack(&mut self, slots: isize) { |
| 753 | let stack = self.context.stack(); |
| 754 | if slots < 0 { |
| 755 | // we are potentially creating stack slots |
| 756 | for slot in 0..(slots*-1) { |
| 757 | let slot = (STACK_TOP - (slot as usize*HOST_WIDTH as usize)); |
| 758 | self.context.bound.entry(Location::Stack(slot)).or_insert_with(|| { |
| 759 | println!("creating stack slot {:x}", slot); |
| 760 | // bind the state variable port |
| 761 | JitVariable::Variable(self.f.add_stack_slot(&mut self.ir)) |
| 762 | }); |
| 763 | } |
| 764 | } |
| 765 | self.context.bound.insert(Location::Reg(RegSpec::rsp()), |
| 766 | JitVariable::Known(JitValue::Const(Wrapping( |
| 767 | (self.context.stack() as isize + (slots*HOST_WIDTH as isize)) as usize)))); |
| 768 | } |
| 769 | |
| 770 | fn constant(&mut self, c: isize) -> PortIdx { |
| 771 | // TODO: constant pooling? idk |
no test coverage detected