Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.JumpInsnNode


        return this;
    }

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


          labelz.put(lnn.start.getLabel().getOffset(), lnn.start);
        } else {
          lnn.start = cl;
        }
      } else if (ain instanceof JumpInsnNode) {
        JumpInsnNode jin = (JumpInsnNode) ain;
        LabelNode cl = labelz.get(jin.label.getLabel().getOffset());
        if (cl == null) {
          labelz.put(jin.label.getLabel().getOffset(), jin.label);
        } else {
          jin.label = cl;
View Full Code Here

      case IF_ACMPNE:
      case GOTO:
      case JSR:
      case IFNULL:
      case IFNONNULL:
        return new JumpInsnNode(opcode, getLabelNode(toint(args[1]))); // this was annoying to do.

      case BIPUSH:
      case SIPUSH:
        return new IntInsnNode(opcode, toint(args[1]));
      case NEWARRAY:
View Full Code Here

          fullInsn += ' ' + fin.owner;
          fullInsn += ' ' + fin.name;
          fullInsn += ' ' + fin.desc;
          break;
        case AbstractInsnNode.JUMP_INSN:
          JumpInsnNode jin = (JumpInsnNode) ain;
          try {
            int offset = getLabelOffset(jin.label.getLabel(), instructions); // YAY FIXED
            fullInsn += " " + offset;
          } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

  @Override
    public JumpInsnNode deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
        JsonObject jsonObject = (JsonObject) json;
        int opcode = jsonObject.get("opcode").getAsInt();
        LabelNode labelNode = context.deserialize(jsonObject.get("local"), List.class);
        return new JumpInsnNode(opcode, labelNode);
    }
View Full Code Here

                    current.init(f).execute(insnNode, interpreter);
                    subroutine = subroutine == null ? null : subroutine.copy();

                    if (insnNode instanceof JumpInsnNode) {
                        JumpInsnNode j = (JumpInsnNode) insnNode;
                        if (insnOpcode != GOTO && insnOpcode != JSR) {
                            merge(insn + 1, current, subroutine);
                        }
                        if (insnOpcode == JSR) {
                            jsr = true;
View Full Code Here

        method = new MethodNode(ASM4, ACC_PROTECTED, "setup", getMethodDescriptor(VOID_TYPE), null, null);
        method.instructions.add(new VarInsnNode(ALOAD, 0));
        method.instructions.add(new MethodInsnNode(INVOKESPECIAL, tSuper.getInternalName(), "setup", getMethodDescriptor(VOID_TYPE), false));
        method.instructions.add(new FieldInsnNode(GETSTATIC, classNode.name, "LISTENER_LIST", tList.getDescriptor()));
        LabelNode initLisitener = new LabelNode();
        method.instructions.add(new JumpInsnNode(IFNULL, initLisitener));
        method.instructions.add(new InsnNode(RETURN));
        method.instructions.add(initLisitener);
        method.instructions.add(new FrameNode(F_SAME, 0, null, 0, null));
        method.instructions.add(new TypeInsnNode(NEW, tList.getInternalName()));
        method.instructions.add(new InsnNode(DUP));
View Full Code Here

                        toInject.add(new VarInsnNode(ILOAD, mdIndex));
                        toInject.add(new VarInsnNode(ALOAD, 0));
                        toInject.add(new FieldInsnNode(GETFIELD, (String) hm.get("javaClassName"), (String) hm.get("entityPlayerFieldName"), "L" + (String) hm.get("entityPlayerMPJavaClassName") + ";"));
                        toInject.add(new MethodInsnNode(INVOKESTATIC, "keepcalm/mods/events/EventFactory", "onBlockHarvested", "(L" + (String) hm.get("worldJavaClassName") + ";IIIL" + (String) hm.get("blockJavaClassName") + ";IL" + (String) hm.get("entityPlayerJavaClassName") + ";)Z"));
                        LabelNode endIf = new LabelNode(new Label());
                        toInject.add(new JumpInsnNode(Opcodes.IFEQ, endIf));
                        toInject.add(new InsnNode(Opcodes.ICONST_0));
                        toInject.add(new InsnNode(Opcodes.IRETURN));
                        toInject.add(endIf);
                        toInject.add(lmm1Node);
                       
View Full Code Here

        insns.add(new VarInsnNode(Opcodes.ALOAD, 1));
        insns.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "keepcalm/mods/events/ForgeEventHelper", "onSignChange", "(L" + names.get("netServerHandler_javaName") + ";L" + names.get("packet130UpdateSign_javaName") + ";)L" + names.get("packet130UpdateSign_javaName") + ";" ));
        LabelNode endIf = new LabelNode(new Label());
        insns.add(new VarInsnNode(Opcodes.ASTORE, 1));
        insns.add(new VarInsnNode(Opcodes.ALOAD, 1));
        insns.add(new JumpInsnNode(Opcodes.IFNONNULL, endIf));
        insns.add(new InsnNode(Opcodes.RETURN));
        insns.add(endIf);
       
        m.instructions.insert(insns);
      }
View Full Code Here

              insns.add(new VarInsnNode(Opcodes.ILOAD, 3));
              insns.add(new VarInsnNode(Opcodes.ILOAD, 4));
              insns.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "keepcalm/mods/events/ForgeEventHelper",
                  "onPressurePlateInteract", "(L" + names.get("blockPressurePlate_javaName") + ";L" + names.get("world_javaName") + ";III)Z"));
              LabelNode endIf = new LabelNode(new Label());
              insns.add(new JumpInsnNode(Opcodes.IFEQ, endIf));
              insns.add(new InsnNode(Opcodes.RETURN));
              insns.add(endIf);
              insns.add(new LabelNode(new Label()));
             
              m.instructions.insertBefore(m.instructions.get(i), insns);
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.