Implements the `Alloc` opcode.
(&mut self, instr: u32, heap: &mut Heap)
| 605 | |
| 606 | /// Implements the `Alloc` opcode. |
| 607 | pub(super) fn do_alloc(&mut self, instr: u32, heap: &mut Heap) { |
| 608 | let (dest, etype) = bytecode::parse_alloc(instr); |
| 609 | debug_assert_eq!(ExprType::Text, etype, "Alloc is only emitted for strings right now"); |
| 610 | self.set_reg(dest, heap.empty_text_ptr()); |
| 611 | self.pc += 1; |
| 612 | } |
| 613 | |
| 614 | /// Implements the `AllocArray` opcode. |
| 615 | pub(super) fn do_alloc_array(&mut self, instr: u32, heap: &mut Heap) { |
no test coverage detected