Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.JumpInsnNode


        // all other instructions can be processed normally, perhaps with some control-flow fudging

        switch (ai.getType()) {
            case AbstractInsnNode.JUMP_INSN:
                {
                    JumpInsnNode ji = (JumpInsnNode)ai;
                    v.visitJumpInsn(opc, mapLabel(ji.label, begin, insnLabels, exitTrampolineLabels));
                    break;
                }
            case AbstractInsnNode.TABLESWITCH_INSN:
                {
View Full Code Here


        for (int i = firstJump.size() - 1; i >= 0; i--) {
            LabelNode not_my_problem = new LabelNode();
            instructions.add(new VarInsnNode(Opcodes.ILOAD, 1));
            instructions.add(intNode(firstJump.get(i)));
            instructions.add(new JumpInsnNode(Opcodes.IF_ICMPLT, not_my_problem));
            instructions.add(new VarInsnNode(Opcodes.ILOAD, 1));
            instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
            instructions.add(new MethodInsnNode(Opcodes.INVOKESTATIC, tgtype, name + "$f" + i, "(I[Ljava/lang/Object;)I"));
            instructions.add(new VarInsnNode(Opcodes.ISTORE, 1));
            instructions.add(new JumpInsnNode(Opcodes.GOTO, loop));
            instructions.add(not_my_problem);
        }

        // time for return
        String rty = null, unboxName = null, unboxDesc = null;
View Full Code Here

            if (node.getType() == AbstractInsnNode.JUMP_INSN
                    && node.getOpcode() != JSR) {
                // we do not follow recursively called subroutines here; but any
                // other sort of branch we do follow
                JumpInsnNode jnode = (JumpInsnNode) node;
                int destidx = instructions.indexOf(jnode.label);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
            }
            if (node.getType() == AbstractInsnNode.TABLESWITCH_INSN) {
                TableSwitchInsnNode tsnode = (TableSwitchInsnNode) node;
View Full Code Here

                    // instruction, which should never happen for verifiable
                    // code.
                    throw new RuntimeException("Instruction #" + i
                            + " is a RET not owned by any subroutine");
                }
                newInstructions.add(new JumpInsnNode(GOTO, retlabel));
            } else if (insn.getOpcode() == JSR) {
                LabelNode lbl = ((JumpInsnNode) insn).label;
                BitSet sub = subroutineHeads.get(lbl);
                Instantiation newinst = new Instantiation(instant, sub);
                LabelNode startlbl = newinst.gotoLabel(lbl);

                if (LOGGING) {
                    log(" Creating instantiation of subr " + sub);
                }

                // Rather than JSRing, we will jump to the inline version and
                // push NULL for what was once the return value. This hack
                // allows us to avoid doing any sort of data flow analysis to
                // figure out which instructions manipulate the old return value
                // pointer which is now known to be unneeded.
                newInstructions.add(new InsnNode(ACONST_NULL));
                newInstructions.add(new JumpInsnNode(GOTO, startlbl));
                newInstructions.add(newinst.returnLabel);

                // Insert this new instantiation into the queue to be emitted
                // later.
                worklist.add(newinst);
View Full Code Here

      case 6:
        InvokeDynamicInsnNode idinsn = (InvokeDynamicInsnNode) insn;
        visitInvokeDynamicInsn(idinsn.name, idinsn.desc, idinsn.bsm, idinsn.bsmArgs);
        break;
      case 7:
        JumpInsnNode jinsn = (JumpInsnNode) insn;
        visitJumpInsn(jinsn.getOpcode(), jinsn.label.getLabel());
        break;
      case 8:
        LabelNode linsn = (LabelNode) insn;
        visitLabel(linsn.getLabel());
        break;
View Full Code Here

      {
        case 8:
        case 15:
          break;
        case 7:
          JumpInsnNode jinsn = (JumpInsnNode) insn;
          controlFlowLabels.add(jinsn.label);
          break;
        case 11:
          TableSwitchInsnNode tsinsn = (TableSwitchInsnNode) insn;
          for (LabelNode label : tsinsn.labels)
View Full Code Here

                    ASMBlock needle = blocks.get("n_doFireTick");
                    ASMBlock inject = blocks.get("doFireTick");

                    ASMBlock key = needle.applyLabels(findOnce(mv.instructions, needle.list));
                    LabelNode jlabel = key.get("LRET");
                    mv.instructions.insertBefore(jlabel, new JumpInsnNode(GOTO, inject.get("LSKIP")));
                    mv.instructions.insert(jlabel, inject.list.list);
                }
            });
        }
View Full Code Here

        return this;
    }

    public MethodDefinition gotoLabel(String name)
    {
        instructionList.add(new JumpInsnNode(GOTO, getLabel(name)));
        return this;
    }
View Full Code Here

        return this;
    }

    public MethodDefinition ifZeroGoto(String name)
    {
        instructionList.add(new JumpInsnNode(IFEQ, getLabel(name)));
        return this;
    }
View Full Code Here

        return this;
    }

    public MethodDefinition ifNullGoto(String name)
    {
        instructionList.add(new JumpInsnNode(IFNULL, getLabel(name)));
        return this;
    }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.tree.JumpInsnNode

Copyright © 2018 www.massapicom. 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.