Package org.apache.bcel.util

Examples of org.apache.bcel.util.InstructionFinder.search()


    InstructionFinder finder =
      new InstructionFinder( iList );
   
    // do the search
    Iterator iter
      = finder.search(
        Constants.OPCODE_NAMES[Constants.INVOKESPECIAL] );
 
    if( iter.hasNext() ) {
      InstructionHandle[] ih
        = (InstructionHandle[])iter.next();
View Full Code Here


    InstructionFinder finder =
      new InstructionFinder( iList );
   
    // search all invokes
    Iterator iter
      = finder.search(
        Constants.OPCODE_NAMES[Constants.INVOKEINTERFACE]
        + "|"
        + Constants.OPCODE_NAMES[Constants.INVOKESPECIAL]
        + "|"
        + Constants.OPCODE_NAMES[Constants.INVOKESTATIC]
View Full Code Here

    InstructionFinder finder =
      new InstructionFinder( iList );
   
    // do the search
    Iterator iter
      = finder.search(
        Constants.OPCODE_NAMES[Constants.INVOKEVIRTUAL],
        new MethodCallConstraint( idx ) );
   
    // the return list
    List<InstructionHandle> rc = new ArrayList<InstructionHandle>();
View Full Code Here

    InstructionFinder finder =
      new InstructionFinder( iList );
   
    // do the search
    Iterator iter
      = finder.search( "IRETURN|LRETURN|FRETURN|DRETURN|ARETURN|RETURN" );
   
    List<InstructionHandle> rc = new ArrayList<InstructionHandle>();
   
    while( iter.hasNext() ) {
      InstructionHandle[] ih
View Full Code Here

    InstructionFinder finder =
      new InstructionFinder( iList );
 
    if( varIdx > 3 ) { // a constraint checks the variable index
      return finder.search(
        prefix + " " +
        "ALOAD " + postfix,
        new LoadStoreConstraint( varIdx, instructionIdx ) );
    }
    else { // the variable index is included in the instruction
View Full Code Here

        prefix + " " +
        "ALOAD " + postfix,
        new LoadStoreConstraint( varIdx, instructionIdx ) );
    }
    else { // the variable index is included in the instruction
      return finder.search(
        prefix + " " 
        + new ALOAD( varIdx ).toString( false )
        + " " + postfix );
    }
  }
View Full Code Here

    InstructionFinder finder =
      new InstructionFinder( iList );
 
    if( varIdx > 3 ) {  // a constraint checks the variable index
      return finder.search(
        prefix + " " +
        "ASTORE " + postfix,
        new LoadStoreConstraint( varIdx, instructionIdx ) );
    }
    else { // the variable index is included in the instruction
View Full Code Here

        prefix + " " +
        "ASTORE " + postfix,
        new LoadStoreConstraint( varIdx, instructionIdx ) );
    }
    else { // the variable index is included in the instruction
      return finder.search(
        prefix + " " 
        + new ASTORE( varIdx ).toString( false )
        + " " + postfix );
    }
  }
View Full Code Here

    AccessMethodConstraint constraint = new AccessMethodConstraint(cpoolgen, verbose);
    String pattern = "ALOAD GETFIELD INVOKESTATIC+";
   
    InstructionList list = gmethod.getInstructionList();
    InstructionFinder finder = new InstructionFinder(list);
    for (Iterator i = finder.search(pattern, constraint); i.hasNext(); ) {
      InstructionHandle[] match = (InstructionHandle[])i.next();
      if (match.length > 3) throw new CantInstrumentException(
          "Can't instrument multiply nested triggers.");
      INVOKESTATIC is = (INVOKESTATIC)(match[match.length-1].getInstruction());
      String accessMethodName = is.getMethodName(cpoolgen);
View Full Code Here

  InstructionHandle ih;
  String pattern;

  // Remove seqences of ALOAD, POP (GTM)
  pattern = "`ALOAD'`POP'`Instruction'";
  for(Iterator iter=find.search(pattern); iter.hasNext();){
      InstructionHandle[] match = (InstructionHandle[])iter.next();
      try {
    if ((!match[0].hasTargeters()) && (!match[1].hasTargeters())) {
                    il.delete(match[0], match[1]);
                }
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.