private ExceptionHandlerMapper(final InstructionCollection instructions, final List<ExceptionTableEntry> tableEntries) { _instructions = VerifyArgument.notNull(instructions, "instructions"); _tableEntries = VerifyArgument.notNull(tableEntries, "tableEntries"); _handlerPlaceholders = createHandlerPlaceholders(); _offsets = new int[instructions.size()]; _hasIncomingJumps = new boolean[instructions.size()]; for (int i = 0; i < instructions.size(); i++) { _offsets[i] = instructions.get(i).getOffset(); } _entryPoint = new ControlFlowNode(_nextBlockId++, 0, ControlFlowNodeType.EntryPoint); _regularExit = new ControlFlowNode(_nextBlockId++, -1, ControlFlowNodeType.RegularExit); _exceptionalExit = new ControlFlowNode(_nextBlockId++, -2, ControlFlowNodeType.ExceptionalExit); _nodes.add(_entryPoint); _nodes.add(_regularExit); _nodes.add(_exceptionalExit); }
private ExceptionHandlerMapper(final InstructionCollection instructions, final List<ExceptionTableEntry> tableEntries) { _instructions = VerifyArgument.notNull(instructions, "instructions"); _tableEntries = VerifyArgument.notNull(tableEntries, "tableEntries"); _handlerPlaceholders = createHandlerPlaceholders(); _offsets = new int[instructions.size()]; _hasIncomingJumps = new boolean[instructions.size()]; for (int i = 0; i < instructions.size(); i++) { _offsets[i] = instructions.get(i).getOffset(); } _entryPoint = new ControlFlowNode(_nextBlockId++, 0, ControlFlowNodeType.EntryPoint); _regularExit = new ControlFlowNode(_nextBlockId++, -1, ControlFlowNodeType.RegularExit); _exceptionalExit = new ControlFlowNode(_nextBlockId++, -2, ControlFlowNodeType.ExceptionalExit); _nodes.add(_entryPoint); _nodes.add(_regularExit); _nodes.add(_exceptionalExit); }
private ExceptionHandlerMapper(final InstructionCollection instructions, final List<ExceptionTableEntry> tableEntries) { _instructions = VerifyArgument.notNull(instructions, "instructions"); _tableEntries = VerifyArgument.notNull(tableEntries, "tableEntries"); _handlerPlaceholders = createHandlerPlaceholders(); _offsets = new int[instructions.size()]; _hasIncomingJumps = new boolean[instructions.size()]; for (int i = 0; i < instructions.size(); i++) { _offsets[i] = instructions.get(i).getOffset(); } _entryPoint = new ControlFlowNode(_nextBlockId++, 0, ControlFlowNodeType.EntryPoint); _regularExit = new ControlFlowNode(_nextBlockId++, -1, ControlFlowNodeType.RegularExit); _exceptionalExit = new ControlFlowNode(_nextBlockId++, -2, ControlFlowNodeType.ExceptionalExit); _nodes.add(_entryPoint); _nodes.add(_regularExit); _nodes.add(_exceptionalExit); }
@Override protected void beforeClear() { for (int i = 0; i < size(); i++) { get(i).setNext(null); get(i).setPrevious(null); } }
@Override protected void beforeClear() { for (int i = 0; i < size(); i++) { get(i).setNext(null); get(i).setPrevious(null); } }
@Override protected void beforeClear() { for (int i = 0; i < size(); i++) { get(i).setNext(null); get(i).setPrevious(null); } }
@Override protected void afterAdd(final int index, final Instruction item, final boolean appended) { final Instruction next = index < size() - 1 ? get(index + 1) : null; final Instruction previous = index > 0 ? get(index - 1) : null; if (previous != null) { previous.setNext(item); } if (next != null) { next.setPrevious(item); } item.setPrevious(previous); item.setNext(next); }
@Override protected void afterAdd(final int index, final Instruction item, final boolean appended) { final Instruction next = index < size() - 1 ? get(index + 1) : null; final Instruction previous = index > 0 ? get(index - 1) : null; if (previous != null) { previous.setNext(item); } if (next != null) { next.setPrevious(item); } item.setPrevious(previous); item.setNext(next); }
@Override protected void afterAdd(final int index, final Instruction item, final boolean appended) { final Instruction next = index < size() - 1 ? get(index + 1) : null; final Instruction previous = index > 0 ? get(index - 1) : null; if (previous != null) { previous.setNext(item); } if (next != null) { next.setPrevious(item); } item.setPrevious(previous); item.setNext(next); }
public void recomputeOffsets() { if (isEmpty()) { return; } Instruction previous = get(0); previous.setOffset(0); for (int i = 1; i < size(); i++) { final Instruction current = get(i); current.setOffset(previous.getOffset() + previous.getSize()); previous = current; } } }
public void recomputeOffsets() { if (isEmpty()) { return; } Instruction previous = get(0); previous.setOffset(0); for (int i = 1; i < size(); i++) { final Instruction current = get(i); current.setOffset(previous.getOffset() + previous.getSize()); previous = current; } } }
public void recomputeOffsets() { if (isEmpty()) { return; } Instruction previous = get(0); previous.setOffset(0); for (int i = 1; i < size(); i++) { final Instruction current = get(i); current.setOffset(previous.getOffset() + previous.getSize()); previous = current; } } }
for (int i = 0; i < newInstructions.size(); i++) { builder._originalInstructionMap.put(newInstructions.get(i), oldInstructions.get(i));
for (int i = 0; i < newInstructions.size(); i++) { builder._originalInstructionMap.put(newInstructions.get(i), oldInstructions.get(i));
for (int i = 0; i < newInstructions.size(); i++) { builder._originalInstructionMap.put(newInstructions.get(i), oldInstructions.get(i));
for (int i = 0, n = instructions.size(); i < n; i++) { final Instruction blockStart = instructions.get(i); final ExceptionHandler blockStartExceptionHandler = findInnermostExceptionHandler(blockStart.getOffset());
for (int i = 0, n = instructions.size(); i < n; i++) { final Instruction blockStart = instructions.get(i); final ExceptionHandler blockStartExceptionHandler = findInnermostExceptionHandler(blockStart.getOffset());
for (int i = 0, n = instructions.size(); i < n; i++) { final Instruction blockStart = instructions.get(i); final ExceptionHandler blockStartExceptionHandler = findInnermostExceptionHandler(blockStart.getOffset());
final Instruction end = node.getEnd(); if (end == null || end.getOffset() >= _instructions.get(_instructions.size() - 1).getEndOffset()) { continue;
final Instruction end = node.getEnd(); if (end == null || end.getOffset() >= _instructions.get(_instructions.size() - 1).getEndOffset()) { continue;