@Override public final Instruction next() { final Instruction next = _next; if (next == null || next.getOffset() > _end.getOffset()) { throw new NoSuchElementException(); } _next = next.getNext(); return next; }
@Override public final Instruction next() { final Instruction next = _next; if (next == null || next.getOffset() > _end.getOffset()) { throw new NoSuchElementException(); } _next = next.getNext(); return next; }
@Override public final Instruction next() { final Instruction next = _next; if (next == null || next.getOffset() > _end.getOffset()) { throw new NoSuchElementException(); } _next = next.getNext(); return next; }
public Instruction tryGetAtOffset(final int offset) { final int index = Collections.binarySearch( this, new Instruction(offset, OpCode.NOP), new Comparator<Instruction>() { @Override public int compare(@NotNull final Instruction o1, @NotNull final Instruction o2) { return Integer.compare(o1.getOffset(), o2.getOffset()); } } ); if (index < 0) { final Instruction last = lastOrDefault(this); if (last != null && last.getNext() != null && last.getNext().getOffset() == offset) { return last.getNext(); } return null; } return get(index); }
public Instruction tryGetAtOffset(final int offset) { final int index = Collections.binarySearch( this, new Instruction(offset, OpCode.NOP), new Comparator<Instruction>() { @Override public int compare(@NotNull final Instruction o1, @NotNull final Instruction o2) { return Integer.compare(o1.getOffset(), o2.getOffset()); } } ); if (index < 0) { final Instruction last = lastOrDefault(this); if (last != null && last.getNext() != null && last.getNext().getOffset() == offset) { return last.getNext(); } return null; } return get(index); }
public Instruction tryGetAtOffset(final int offset) { final int index = Collections.binarySearch( this, new Instruction(offset, OpCode.NOP), new Comparator<Instruction>() { @Override public int compare(@NotNull final Instruction o1, @NotNull final Instruction o2) { return Integer.compare(o1.getOffset(), o2.getOffset()); } } ); if (index < 0) { final Instruction last = lastOrDefault(this); if (last != null && last.getNext() != null && last.getNext().getOffset() == offset) { return last.getNext(); } return null; } return get(index); }
private static Map<Instruction, ControlFlowNode> createNodeMap(final ControlFlowGraph cfg) { final Map<Instruction, ControlFlowNode> nodeMap = new IdentityHashMap<>(); for (final ControlFlowNode node : cfg.getNodes()) { if (node.getNodeType() != ControlFlowNodeType.Normal) { continue; } for (Instruction p = node.getStart(); p != null && p.getOffset() < node.getEnd().getEndOffset(); p = p.getNext()) { nodeMap.put(p, node); } } return nodeMap; }
private static Map<Instruction, ControlFlowNode> createNodeMap(final ControlFlowGraph cfg) { final Map<Instruction, ControlFlowNode> nodeMap = new IdentityHashMap<>(); for (final ControlFlowNode node : cfg.getNodes()) { if (node.getNodeType() != ControlFlowNodeType.Normal) { continue; } for (Instruction p = node.getStart(); p != null && p.getOffset() < node.getEnd().getEndOffset(); p = p.getNext()) { nodeMap.put(p, node); } } return nodeMap; }
private static Map<Instruction, ControlFlowNode> createNodeMap(final ControlFlowGraph cfg) { final Map<Instruction, ControlFlowNode> nodeMap = new IdentityHashMap<>(); for (final ControlFlowNode node : cfg.getNodes()) { if (node.getNodeType() != ControlFlowNodeType.Normal) { continue; } for (Instruction p = node.getStart(); p != null && p.getOffset() < node.getEnd().getEndOffset(); p = p.getNext()) { nodeMap.put(p, node); } } return nodeMap; }
@Override protected void afterRemove(final int index, final Instruction item) { final Instruction current = item.getNext(); final Instruction previous = item.getPrevious(); if (previous != null) { previous.setNext(current); } if (current != null) { current.setPrevious(previous); } item.setPrevious(null); item.setNext(null); }
@Override protected void afterRemove(final int index, final Instruction item) { final Instruction current = item.getNext(); final Instruction previous = item.getPrevious(); if (previous != null) { previous.setNext(current); } if (current != null) { current.setPrevious(previous); } item.setPrevious(null); item.setNext(null); }
@Override protected void afterRemove(final int index, final Instruction item) { final Instruction current = item.getNext(); final Instruction previous = item.getPrevious(); if (previous != null) { previous.setNext(current); } if (current != null) { current.setPrevious(previous); } item.setPrevious(null); item.setNext(null); }
@Override protected void beforeSet(final int index, final Instruction item) { final Instruction current = get(index); item.setPrevious(current.getPrevious()); item.setNext(current.getNext()); current.setPrevious(null); current.setNext(null); }
@Override protected void beforeSet(final int index, final Instruction item) { final Instruction current = get(index); item.setPrevious(current.getPrevious()); item.setNext(current.getNext()); current.setPrevious(null); current.setNext(null); }
@Override protected void beforeSet(final int index, final Instruction item) { final Instruction current = get(index); item.setPrevious(current.getPrevious()); item.setNext(current.getNext()); current.setPrevious(null); current.setNext(null); }
private static boolean shouldIncludeExceptionalExit(final ControlFlowGraph cfg, final ControlFlowNode head, final ControlFlowNode node) { if (node.getNodeType() != ControlFlowNodeType.Normal) { return false; } if (!node.getDominanceFrontier().contains(cfg.getExceptionalExit()) && !node.dominates(cfg.getExceptionalExit())) { final ControlFlowNode innermostHandlerNode = findInnermostExceptionHandlerNode(cfg, node.getStart().getOffset()); if (innermostHandlerNode == null || !node.getDominanceFrontier().contains(innermostHandlerNode)) { return false; } } if (node.getStart().getNext() != node.getEnd()) { return false; } if (head.getStart().getOpCode().isStore() && node.getStart().getOpCode().isLoad() && node.getEnd().getOpCode() == OpCode.ATHROW) { return InstructionHelper.getLoadOrStoreSlot(head.getStart()) == InstructionHelper.getLoadOrStoreSlot(node.getStart()); } return false; }
private static boolean shouldIncludeExceptionalExit(final ControlFlowGraph cfg, final ControlFlowNode head, final ControlFlowNode node) { if (node.getNodeType() != ControlFlowNodeType.Normal) { return false; } if (!node.getDominanceFrontier().contains(cfg.getExceptionalExit()) && !node.dominates(cfg.getExceptionalExit())) { final ControlFlowNode innermostHandlerNode = findInnermostExceptionHandlerNode(cfg, node.getStart().getOffset()); if (innermostHandlerNode == null || !node.getDominanceFrontier().contains(innermostHandlerNode)) { return false; } } if (node.getStart().getNext() != node.getEnd()) { return false; } if (head.getStart().getOpCode().isStore() && node.getStart().getOpCode().isLoad() && node.getEnd().getOpCode() == OpCode.ATHROW) { return InstructionHelper.getLoadOrStoreSlot(head.getStart()) == InstructionHelper.getLoadOrStoreSlot(node.getStart()); } return false; }
private static boolean shouldIncludeExceptionalExit(final ControlFlowGraph cfg, final ControlFlowNode head, final ControlFlowNode node) { if (node.getNodeType() != ControlFlowNodeType.Normal) { return false; } if (!node.getDominanceFrontier().contains(cfg.getExceptionalExit()) && !node.dominates(cfg.getExceptionalExit())) { final ControlFlowNode innermostHandlerNode = findInnermostExceptionHandlerNode(cfg, node.getStart().getOffset()); if (innermostHandlerNode == null || !node.getDominanceFrontier().contains(innermostHandlerNode)) { return false; } } if (node.getStart().getNext() != node.getEnd()) { return false; } if (head.getStart().getOpCode().isStore() && node.getStart().getOpCode().isLoad() && node.getEnd().getOpCode() == OpCode.ATHROW) { return InstructionHelper.getLoadOrStoreSlot(head.getStart()) == InstructionHelper.getLoadOrStoreSlot(node.getStart()); } return false; }
private static boolean shouldIncludeExceptionalExit( final ControlFlowGraph cfg, final ControlFlowNode head, final ControlFlowNode node) { if (node.getNodeType() != ControlFlowNodeType.Normal) { return false; } if (!node.getDominanceFrontier().contains(cfg.getExceptionalExit()) && !node.dominates(cfg.getExceptionalExit())) { final ControlFlowNode innermostHandlerNode = findInnermostExceptionHandlerNode(cfg, node.getEnd().getOffset(), false); if (innermostHandlerNode == null || !node.getDominanceFrontier().contains(innermostHandlerNode)) { return false; } } return head.getNodeType() == ControlFlowNodeType.Normal && node.getNodeType() == ControlFlowNodeType.Normal && node.getStart().getNext() == node.getEnd() && head.getStart().getOpCode().isStore() && node.getStart().getOpCode().isLoad() && node.getEnd().getOpCode() == OpCode.ATHROW && InstructionHelper.getLoadOrStoreSlot(head.getStart()) == InstructionHelper.getLoadOrStoreSlot(node.getStart()); }
private static boolean shouldIncludeExceptionalExit( final ControlFlowGraph cfg, final ControlFlowNode head, final ControlFlowNode node) { if (node.getNodeType() != ControlFlowNodeType.Normal) { return false; } if (!node.getDominanceFrontier().contains(cfg.getExceptionalExit()) && !node.dominates(cfg.getExceptionalExit())) { final ControlFlowNode innermostHandlerNode = findInnermostExceptionHandlerNode(cfg, node.getEnd().getOffset(), false); if (innermostHandlerNode == null || !node.getDominanceFrontier().contains(innermostHandlerNode)) { return false; } } return head.getNodeType() == ControlFlowNodeType.Normal && node.getNodeType() == ControlFlowNodeType.Normal && node.getStart().getNext() == node.getEnd() && head.getStart().getOpCode().isStore() && node.getStart().getOpCode().isLoad() && node.getEnd().getOpCode() == OpCode.ATHROW && InstructionHelper.getLoadOrStoreSlot(head.getStart()) == InstructionHelper.getLoadOrStoreSlot(node.getStart()); }