| 309 | } |
| 310 | |
| 311 | fn parse_code(len: usize, reader: &mut BlockReader) -> Vec<Instruction> { |
| 312 | /* |
| 313 | let read_bytes: Cell<usize> = Cell::new(0); |
| 314 | |
| 315 | (0..len).take_while(|_| read_bytes.get() < len).map(|_| { |
| 316 | let instruction = ClassReader::parse_instruction(reader, read_bytes.get()); |
| 317 | |
| 318 | read_bytes.set(read_bytes.get() + instruction.len()); |
| 319 | instruction |
| 320 | }).collect()*/ |
| 321 | let read_bytes: Cell<usize> = Cell::new(0); |
| 322 | |
| 323 | (0..len).take_while(|_| read_bytes.get() < len).map(|_| { |
| 324 | let instruction = ClassReader::parse_instruction(reader, read_bytes.get()); |
| 325 | |
| 326 | read_bytes.set(reader.position()); |
| 327 | instruction |
| 328 | }).collect() |
| 329 | } |
| 330 | |
| 331 | fn parse_instruction(reader: &mut BlockReader, current_offset: usize) -> Instruction { |
| 332 | let opcode = reader.get_u8(); |