Examples of TableSwitchInsnNode


Examples of org.objectweb.asm.tree.TableSwitchInsnNode

        LabelNode restoreLabel = new LabelNode();
        LabelNode saveLabel = new LabelNode();
        LabelNode unwindLabel = new LabelNode();
        LabelNode[] labels = new LabelNode[] { resumeLabel, restoreLabel, saveLabel,
                unwindLabel };
        new TableSwitchInsnNode(0, 3, resumeLabel, labels).accept(mv);
        genSave(mv, saveLabel);
        genUnwind(mv, unwindLabel);
        genRestore(mv, restoreLabel);
        resumeLabel.accept(mv);
    }
View Full Code Here

Examples of org.objectweb.asm.tree.TableSwitchInsnNode

        LabelNode[] labels = new LabelNode[callWeavers.size() + 1];
        labels[0] = startLabel;
        for (int i = 0; i < callWeavers.size(); i++) {
            labels[i + 1] = new LabelNode();
        }
        new TableSwitchInsnNode(0, callWeavers.size(), errLabel, labels).accept(mv);
       
        errLabel.accept(mv);
        mv.visitVarInsn(ALOAD, getFiberVar());
        mv.visitMethodInsn(INVOKEVIRTUAL, FIBER_CLASS, "wrongPC", "()V");
        // Generate pass through down code, one for each pausable method
View Full Code Here

Examples of org.objectweb.asm.tree.TableSwitchInsnNode

  @SuppressWarnings("unchecked")
  private static boolean sameTableSwitchInsn(AbstractInsnNode o, AbstractInsnNode n) {
    if (!(n instanceof TableSwitchInsnNode)) {
      return false;
    }
    TableSwitchInsnNode tsio = (TableSwitchInsnNode) o;
    TableSwitchInsnNode tsin = (TableSwitchInsnNode) n;
    if (sameLabels(tsio.dflt, tsin.dflt)) {
      return false;
    }
    if (tsio.min != tsin.min) {
      return false;
View Full Code Here

Examples of org.objectweb.asm.tree.TableSwitchInsnNode

                JumpInsnNode jnode = (JumpInsnNode) node;
                int destidx = instructions.indexOf(jnode.label);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
            }
            if (node.getType() == AbstractInsnNode.TABLESWITCH_INSN) {
                TableSwitchInsnNode tsnode = (TableSwitchInsnNode) node;
                int destidx = instructions.indexOf(tsnode.dflt);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
                for (int i = tsnode.labels.size() - 1; i >= 0; --i) {
                    LabelNode l = tsnode.labels.get(i);
                    destidx = instructions.indexOf(l);
View Full Code Here

Examples of org.objectweb.asm.tree.TableSwitchInsnNode

                    }
                    break;

                case AbstractInsnNode.TABLESWITCH_INSN:
                    {
                        TableSwitchInsnNode lsi = (TableSwitchInsnNode) ptr;
                        if (lsi.labels.size() <= MAX_SWITCH) break;
                        cutoff = (lsi.min + lsi.max) / 2;
                        TableSwitchInsnNode lsl = new TableSwitchInsnNode(lsi.min, cutoff-1, lsi.dflt);
                        TableSwitchInsnNode lsr = new TableSwitchInsnNode(cutoff, lsi.max, lsi.dflt);

                        lsl.labels.addAll(lsi.labels.subList(0, cutoff - lsi.min));
                        lsr.labels.addAll(lsi.labels.subList(cutoff - lsi.min, lsi.max + 1 - lsi.min));
                        left = lsl;
                        right = lsr;
View Full Code Here

Examples of org.objectweb.asm.tree.TableSwitchInsnNode

                    if (node.getOpcode() != Opcodes.GOTO)
                        succTemp.add(new ControlEdge(insnNo, insnNo+1, null));
                    break;

                case AbstractInsnNode.TABLESWITCH_INSN:
                    TableSwitchInsnNode tsi = (TableSwitchInsnNode) node;
                    succTemp.add(new ControlEdge(insnNo, insnMap.get(tsi.dflt), null));
                    for (int i = 0; i  < tsi.labels.size(); i++)
                        succTemp.add(new ControlEdge(insnNo, insnMap.get(tsi.labels.get(i)), null));
                    break;
View Full Code Here

Examples of org.objectweb.asm.tree.TableSwitchInsnNode

                    IincInsnNode ii = (IincInsnNode) ai;
                    return (ii.var >= 256 || ii.incr > 127 || ii.incr < -128) ? 6 : 3;
                }
            case AbstractInsnNode.TABLESWITCH_INSN:
                {
                    TableSwitchInsnNode si = (TableSwitchInsnNode) ai;
                    return 16 + si.labels.size() * 4;
                }
            case AbstractInsnNode.LOOKUPSWITCH_INSN:
                {
                    LookupSwitchInsnNode si = (LookupSwitchInsnNode) ai;
View Full Code Here

Examples of org.objectweb.asm.tree.TableSwitchInsnNode

                    v.visitJumpInsn(opc, mapLabel(ji.label, begin, insnLabels, exitTrampolineLabels));
                    break;
                }
            case AbstractInsnNode.TABLESWITCH_INSN:
                {
                    TableSwitchInsnNode si = (TableSwitchInsnNode)ai;
                    Label[] mapped = new Label[si.labels.size()];
                    for (int i = 0; i < mapped.length; i++)
                        mapped[i] = mapLabel((LabelNode)si.labels.get(i), begin, insnLabels, exitTrampolineLabels);
                    v.visitTableSwitchInsn(si.min, si.max, mapLabel(si.dflt, begin, insnLabels, exitTrampolineLabels), mapped);
                    break;
View Full Code Here

Examples of org.objectweb.asm.tree.TableSwitchInsnNode

                JumpInsnNode jnode = (JumpInsnNode) node;
                int destidx = instructions.indexOf(jnode.label);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
            }
            if (node.getType() == AbstractInsnNode.TABLESWITCH_INSN) {
                TableSwitchInsnNode tsnode = (TableSwitchInsnNode) node;
                int destidx = instructions.indexOf(tsnode.dflt);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
                for (int i = tsnode.labels.size() - 1; i >= 0; --i) {
                    LabelNode l = tsnode.labels.get(i);
                    destidx = instructions.indexOf(l);
View Full Code Here

Examples of org.objectweb.asm.tree.TableSwitchInsnNode

      case 10:
        IincInsnNode iiinsn = (IincInsnNode) insn;
        visitIincInsn(iiinsn.var, iiinsn.incr);
        break;
      case 11:
        TableSwitchInsnNode tsinsn = (TableSwitchInsnNode) insn;
        Label[] tslables = new Label[tsinsn.labels.size()];
        for (int i = 0; i < tslables.length; i++)
          tslables[i] = tsinsn.labels.get(i).getLabel();
        visitTableSwitchInsn(tsinsn.min, tsinsn.max, tsinsn.dflt.getLabel(), tslables);
        break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.