Appends `delta` to the image, replacing the current trailing EOF terminator.
(&mut self, delta: ImageDelta)
| 235 | |
| 236 | /// Appends `delta` to the image, replacing the current trailing EOF terminator. |
| 237 | pub(crate) fn append(&mut self, delta: ImageDelta) { |
| 238 | debug_assert_eq!(self.code.last().copied(), Some(bytecode::make_eof())); |
| 239 | debug_assert_eq!(self.debug_info.instrs.len(), self.code.len()); |
| 240 | debug_assert_eq!(delta.code.len(), delta.instrs.len()); |
| 241 | debug_assert_eq!(delta.code.last().copied(), Some(bytecode::make_eof())); |
| 242 | |
| 243 | self.code.pop(); |
| 244 | self.debug_info.instrs.pop(); |
| 245 | |
| 246 | self.code.extend(delta.code); |
| 247 | self.upcalls.extend(delta.upcalls); |
| 248 | self.constants.extend(delta.constants); |
| 249 | self.data.extend(delta.data); |
| 250 | self.debug_info.instrs.extend(delta.instrs); |
| 251 | self.debug_info.callables = delta.callables; |
| 252 | self.debug_info.global_vars = delta.global_vars; |
| 253 | self.debug_info.program_vars = delta.program_vars; |
| 254 | } |
| 255 | |
| 256 | /// Disassembles the image into a textual representation for debugging. |
| 257 | pub fn disasm(&self) -> Vec<String> { |
no outgoing calls