Examples of InstructionHandle


Examples of org.apache.bcel.generic.InstructionHandle

      // this is not a correct methodname.
      return null;
    }
    logger.info("the level of enabling is: " + level);
    logger.info("Inserting GETSTATIC");
    InstructionHandle insertHandle =
      il.insert(getStaticHandle, getStaticHandle.getInstruction().copy());
    il.insert(
      getStaticHandle,
      instFact.createGetStatic(LEVEL, level, LevelType));
View Full Code Here

Examples of org.apache.bcel.generic.InstructionHandle

    MethodGen orig,
    InstructionList il,
    InstructionHandle firstInstructionHandle,
    ConstantPoolGen cp) {
      logger.info("Inserting Enter code.");
      InstructionHandle backup = il.insert(
        firstInstructionHandle,
        instFact.createGetStatic(
          clazz.getClassName(),
          loggerAttribute.getName(),
          loggerAttribute.getType()));
View Full Code Here

Examples of org.apache.bcel.generic.InstructionHandle

    MethodGen orig,
    InstructionList il,
    InstructionHandle returnInstructionHandle,
    ConstantPoolGen cp) {
      logger.info("Inserting Exit code.");
      InstructionHandle backup = il.insert(
      returnInstructionHandle,
        instFact.createGetStatic(
          clazz.getClassName(),
          loggerAttribute.getName(),
          loggerAttribute.getType()));
View Full Code Here

Examples of org.apache.bcel.generic.InstructionHandle

    InstructionList il,
    InstructionHandle getStaticHandle,
    InstructionHandle invokeInterfaceHandle,
    ConstantPoolGen cp) {
    logger.info("Inserting GETSTATIC");
    InstructionHandle insertHandle =
      il.insert(getStaticHandle, getStaticHandle.getInstruction().copy());
    String isEnabled =
      getIsEnabled(
        (
          (INVOKEINTERFACE) invokeInterfaceHandle
View Full Code Here

Examples of org.apache.bcel.generic.InstructionHandle

    MethodGen orig,
    InstructionList il,
    InstructionHandle firstInstructionHandle,
    ConstantPoolGen cp) {
    logger.info("Inserting Enter code.");
    InstructionHandle backup = il.insert(
      firstInstructionHandle,
      instFact.createGetStatic(
        clazz.getClassName(),
        loggerAttribute.getName(),
        loggerAttribute.getType()));
View Full Code Here

Examples of org.apache.bcel.generic.InstructionHandle

    MethodGen orig,
    InstructionList il,
    InstructionHandle returnInstructionHandle,
    ConstantPoolGen cp) {
      logger.info("Inserting Exit code.");
  InstructionHandle backup = il.insert(
  returnInstructionHandle,
    instFact.createGetStatic(
      clazz.getClassName(),
      loggerAttribute.getName(),
      loggerAttribute.getType()));
View Full Code Here

Examples of org.apache.bcel.generic.InstructionHandle

        InstructionHandle handle,
        ConstantPoolGen cp)
        throws NoMatchingInvokeInterfaceInstruction {

        logger.info("Found a logger instruction.");
        InstructionHandle lastLogHandle = handle;

        InvokeInstruction invokeInterface = null;
        Instruction inst = null;
        while (true) {
            handle = handle.getNext();
            if (handle == null) {
                logger.warn("No matching invokeInterface found.");
                throw new NoMatchingInvokeInterfaceInstruction("No matching invokeInterface found.");
            }
            inst = handle.getInstruction();
            if (inst instanceof InvokeInstruction) {
                invokeInterface = (InvokeInstruction) inst;
                if (invokeInterface.getClassType(cp).equals(getLogType())) {
                    logger.info("Found matching invokeInstruction.");
                    if (level_logs == FORKLOGS) {
                        InstructionHandle insertHandle =
                            insertFork(il, lastLogHandle, handle, cp);
                        if (insertHandle != null) {
                            il.redirectBranches(lastLogHandle, insertHandle);
                            il.redirectExceptionHandlers(
                                mg.getExceptionHandlers(),
View Full Code Here

Examples of org.apache.bcel.generic.InstructionHandle

                    + mg.getName()
                    + " is a special method and won't be modified.");
            return orig;
        }
        InstructionList il = null;
        InstructionHandle handle = null;
        Instruction inst = null;

        GETSTATIC getStatic = null;

        Method m = null;

        try {
            il = mg.getInstructionList();
            handle = il.getStart();
            if (level_enters == SIMPLEENTER) {

                insertEnter(mg, il, handle, cp);
                insertFork(il, il.getStart(), handle.getPrev(), cp);
            }

            for (; handle != null; handle = handle.getNext()) {
                inst = handle.getInstruction();
                logger.info("next instruction: " + inst);
                if (level_exits == SIMPLEEXIT
                    && inst instanceof ReturnInstruction) {
                    InstructionHandle lastLogHandle = handle;
                    logger.info(
                        "Found a ReturnInstruction of type: "
                            + inst.toString());
                    int stackSize =
                        inst.consumeStack(cp) - inst.produceStack(cp);
                    while (stackSize != 0) {
                        handle = handle.getPrev();
                        inst = handle.getInstruction();
                        logger.info("prev instruction: " + inst);
                        stackSize += inst.consumeStack(cp)
                            - inst.produceStack(cp);
                    }

                    InstructionHandle insertHandle =
                        insertExit(mg, il, handle, cp);
                    if (insertHandle != null) {
                      // We need to redirect branches etc.... twice
                      // so that the if fork doesn't get erroneous modified.
                        il.redirectBranches(handle, insertHandle);
View Full Code Here

Examples of org.apache.bcel.generic.InstructionHandle

      // this is not a correct methodname.
      return null;
    }
    logger.info("the level of enabling is: " + level);
    logger.info("Inserting GETSTATIC");
    InstructionHandle insertHandle =
      il.insert(getStaticHandle, getStaticHandle.getInstruction().copy());
    il.insert(
      getStaticHandle,
      instFact.createGetStatic(LEVEL, level, LevelType));
View Full Code Here

Examples of org.apache.bcel.generic.InstructionHandle

    MethodGen orig,
    InstructionList il,
    InstructionHandle firstInstructionHandle,
    ConstantPoolGen cp) {
      logger.info("Inserting Enter code.");
      InstructionHandle backup = il.insert(
        firstInstructionHandle,
        instFact.createGetStatic(
          clazz.getClassName(),
          loggerAttribute.getName(),
          loggerAttribute.getType()));
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.