Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.TypeInsnNode


    il.add(new FieldInsnNode(PUTFIELD, "pkg/Bean", "f", "I"));
    LabelNode end = new LabelNode();
    il.add(new JumpInsnNode(GOTO, end));
    il.add(label);
    il.add(new FrameNode(F_SAME, 0, null, 0, null));
    il.add(new TypeInsnNode(NEW, "java/lang/IllegalArgumentException"));
    il.add(new InsnNode(DUP));
    il.add(new MethodInsnNode(INVOKESPECIAL,
        "java/lang/IllegalArgumentException", "<init>", "()V"));
    il.add(new InsnNode(ATHROW));
    il.add(end);
View Full Code Here


    il.add(new FieldInsnNode(PUTFIELD, "pkg/Bean", "f", "I"));
    LabelNode end = new LabelNode();
    il.add(new JumpInsnNode(GOTO, end));
    il.add(label);
    il.add(new FrameNode(F_SAME, 0, null, 0, null));
    il.add(new TypeInsnNode(NEW, "java/lang/IllegalArgumentException"));
    il.add(new InsnNode(DUP));
    il.add(new MethodInsnNode(INVOKESPECIAL,
        "java/lang/IllegalArgumentException", "<init>", "()V"));
    il.add(new InsnNode(ATHROW));
    il.add(end);
View Full Code Here

          il.add(new TableSwitchInsnNode(((IInteger)((IConstructor)v).get(0)).intValue(),
                           ((IInteger)((IConstructor)v).get(1)).intValue(),
                           getLabel(((IInteger)((IConstructor)v).get(2)).intValue()),
                           la));
        } else if (((IConstructor)v).getName().equals("type")) {
          il.add(new TypeInsnNode(((IInteger)((IConstructor)v).get(0)).intValue(),
                          ((IString)((IConstructor)v).get(1)).getValue()));
        }
      }
      return il;
    }
View Full Code Here

          if (firstCase) { firstCase = false; } else { writer.write(", "); }
          writer.write("" + getLabelIndex(l));
        }
        writer.write("])");
      } else if (ai instanceof TypeInsnNode) {
        TypeInsnNode n = ((TypeInsnNode)ai);
        writer.write("\n\t\t\t\t\\type(" + n.getOpcode() + ", \"" + escape(n.desc) + "\")");
      } else {
        if (!(ai instanceof FrameNode)) {
          throw new RuntimeException("Error: Unsupported instruction encountered (" + ai.getClass() + ").");
        }
        first = true;
View Full Code Here

        }
       
        LabelNode labelNode4ifeg = new LabelNode();
        InsnList newCode = new InsnList();
        newCode.add(new VarInsnNode(Opcodes.ALOAD, varInsnNode.var));
        newCode.add(new TypeInsnNode(Opcodes.INSTANCEOF, INTERRUPT_EXCEPTION_NAME));
        newCode.add(new JumpInsnNode(Opcodes.IFEQ, labelNode4ifeg));
        newCode.add(new VarInsnNode(Opcodes.ALOAD, varInsnNode.var));
        newCode.add(new TypeInsnNode(Opcodes.CHECKCAST, INTERRUPT_EXCEPTION_NAME));
        newCode.add(new InsnNode(Opcodes.ATHROW));
        newCode.add(labelNode4ifeg);
        m.instructions.insert(insertPoint, newCode);
      }
    }
View Full Code Here

    testInstructionBetweenFrames(new VarInsnNode(Opcodes.ILOAD, 0));
  }

  @Test
  public void testTypeInsn() {
    testInstructionBetweenFrames(new TypeInsnNode(Opcodes.NEW,
        "java/lang/Object"));
  }
View Full Code Here

        case GETSTATIC: {
            final FieldInsnNode f = (FieldInsnNode) insn;
            return new StaticField(f.owner, f.name, f.desc);
        }
        case NEW: {
            final TypeInsnNode type = (TypeInsnNode) insn;
            return new ObjectRef(Type.getObjectType(type.desc));
        }
        default:
            throw new IllegalArgumentException("Invalid instruction opcode.");
        }
View Full Code Here

            default:
                throw new IllegalArgumentException("Invalid array type");
            }
        }
        case ANEWARRAY: {
            final TypeInsnNode tinsn = (TypeInsnNode) insn;
            return new ArrayRef(Type.getType("[" + Type.getObjectType(tinsn.desc)), value);
        }
        case ARRAYLENGTH:
            return new ValueHolder(Type.INT_TYPE, value);
        case ATHROW:
            return null;
        case CHECKCAST: {
            final TypeInsnNode tinsn = (TypeInsnNode) insn;
            return new ValueHolder(Type.getObjectType(tinsn.desc), value);
        }
        case INSTANCEOF:
            return new ValueHolder(Type.INT_TYPE, value);
        case MONITORENTER:
View Full Code Here

      case INVOKE_DYNAMIC:
        throw new UnsupportedOperationException("Not yet implemented.");
   
      /** Create new object */
      case NEW: {
        final TypeInsnNode type = (TypeInsnNode) instruction.getInstruction();
        stack.push(new ObjectRef(type.desc));
        break;
      }
     
      /** Create new array. pops one operand (..., count) and
View Full Code Here

    IincInsnNode ni = (IincInsnNode) n;
    return oi.var == ni.var && oi.incr == ni.incr;
  }

  private static boolean sameTypeInsn(AbstractInsnNode o, AbstractInsnNode n) {
    TypeInsnNode oi = (TypeInsnNode) o;
    if (!(n instanceof TypeInsnNode)) {
      return false;
    }
    TypeInsnNode ni = (TypeInsnNode) n;
    return oi.desc.equals(ni.desc);
  }
View Full Code Here

TOP

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

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.