/** * creates a new scope block for each case statement * * @param pc * the current program counter */ private void sawSwitch(int pc) { int[] offsets = getSwitchOffsets(); List<Integer> targets = new ArrayList<>(offsets.length); for (int offset : offsets) { targets.add(Integer.valueOf(offset + pc)); } Integer defOffset = Integer.valueOf(getDefaultSwitchOffset() + pc); if (!targets.contains(defOffset)) { targets.add(defOffset); } Collections.sort(targets); Integer lastTarget = targets.get(0); for (int i = 1; i < targets.size(); i++) { Integer nextTarget = targets.get(i); ScopeBlock sb = new ScopeBlock(lastTarget.intValue(), nextTarget.intValue()); sb.setCase(); rootScopeBlock.addChild(sb); lastTarget = nextTarget; } for (Integer target : targets) { switchTargets.set(target.intValue()); } }
/** * creates a new scope block for each case statement * * @param pc * the current program counter */ private void sawSwitch(int pc) { int[] offsets = getSwitchOffsets(); List<Integer> targets = new ArrayList<>(offsets.length); for (int offset : offsets) { targets.add(Integer.valueOf(offset + pc)); } Integer defOffset = Integer.valueOf(getDefaultSwitchOffset() + pc); if (!targets.contains(defOffset)) { targets.add(defOffset); } Collections.sort(targets); Integer lastTarget = targets.get(0); for (int i = 1; i < targets.size(); i++) { Integer nextTarget = targets.get(i); ScopeBlock sb = new ScopeBlock(lastTarget.intValue(), nextTarget.intValue()); sb.setCase(); rootScopeBlock.addChild(sb); lastTarget = nextTarget; } for (Integer target : targets) { switchTargets.set(target.intValue()); } }
/** * processes a monitor enter call to create a scope block * * @param pc * the current program counter */ private void sawMonitorEnter(int pc) { monitorSyncPCs.add(Integer.valueOf(pc)); ScopeBlock sb = new ScopeBlock(pc, Integer.MAX_VALUE); sb.setSync(); rootScopeBlock.addChild(sb); }
ScopeBlock sb = findScopeBlockWithTarget(rootScopeBlock, pc, nextPC); if (sb == null) { sb = new ScopeBlock(pc, target); sb.setLoop(); sb.setGoto(); rootScopeBlock.addChild(sb); } else { sb = new ScopeBlock(nextPC, target); sb.setGoto(); rootScopeBlock.addChild(sb); parent.removeChild(sb); sb = new ScopeBlock(pc, target); rootScopeBlock.addChild(sb); } else { sb = new ScopeBlock(pc, target); rootScopeBlock.addChild(sb);
ScopeBlock sb = findScopeBlockWithTarget(rootScopeBlock, pc, nextPC); if (sb == null) { sb = new ScopeBlock(pc, target); sb.setLoop(); sb.setGoto(); rootScopeBlock.addChild(sb); } else { sb = new ScopeBlock(nextPC, target); sb.setGoto(); rootScopeBlock.addChild(sb); parent.removeChild(sb); sb = new ScopeBlock(pc, target); rootScopeBlock.addChild(sb); } else { sb = new ScopeBlock(pc, target); rootScopeBlock.addChild(sb);
ScopeBlock catchSB = findScopeBlock(rootScopeBlock, pc + 1); if ((catchSB != null) && (catchSB.getStart() < pc)) { ScopeBlock sb = new ScopeBlock(pc, catchSB.getFinish()); catchSB.setFinish(getPC() - 1); rootScopeBlock.addChild(sb);
ScopeBlock catchSB = findScopeBlock(rootScopeBlock, pc + 1); if ((catchSB != null) && (catchSB.getStart() < pc)) { ScopeBlock sb = new ScopeBlock(pc, catchSB.getFinish()); catchSB.setFinish(getPC() - 1); rootScopeBlock.addChild(sb);
ScopeBlock sb = new ScopeBlock(pc, findCatchHandlerFor(pc)); sb.setTry(); rootScopeBlock.addChild(sb);
ScopeBlock sb = new ScopeBlock(pc, findCatchHandlerFor(pc)); sb.setTry(); rootScopeBlock.addChild(sb);
rootScopeBlock = new ScopeBlock(0, obj.getLength()); tryBlocks.clear(); catchHandlers.clear();
rootScopeBlock = new ScopeBlock(0, obj.getLength()); tryBlocks.clear(); catchHandlers.clear();
/** * processes a monitor enter call to create a scope block * * @param pc * the current program counter */ private void sawMonitorEnter(int pc) { monitorSyncPCs.add(Integer.valueOf(pc)); ScopeBlock sb = new ScopeBlock(pc, Integer.MAX_VALUE); sb.setSync(); rootScopeBlock.addChild(sb); }