Examples of InstructionList


Examples of org.aspectj.apache.bcel.generic.InstructionList

    LazyMethodGen bridgeMethod = makeMethodGen(gen, bridgingSetter);
    bridgeMethod.setAccessFlags(bridgeMethod.getAccessFlags() | 0x00000040); // BRIDGE = 0x00000040
    Type[] paramTypes = BcelWorld.makeBcelTypes(bridgingSetter.getParameterTypes());
    Type[] bridgingToParms = BcelWorld.makeBcelTypes(itdfieldSetter.getParameterTypes());
    Type returnType = BcelWorld.makeBcelType(bridgingSetter.getReturnType());
    InstructionList body = bridgeMethod.getBody();
    fact = gen.getFactory();
    int pos = 0;

    if (!Modifier.isStatic(bridgingSetter.getModifiers())) {
      body.append(InstructionFactory.createThis());
      pos++;
    }
    for (int i = 0, len = paramTypes.length; i < len; i++) {
      Type paramType = paramTypes[i];
      body.append(InstructionFactory.createLoad(paramType, pos));
      if (!bridgingSetter.getParameterTypes()[i].getErasureSignature().equals(
          itdfieldSetter.getParameterTypes()[i].getErasureSignature())) {
        body.append(fact.createCast(paramType, bridgingToParms[i]));
      }
      pos += paramType.getSize();
    }

    body.append(Utility.createInvoke(fact, weaver.getWorld(), itdfieldSetter));
    body.append(InstructionFactory.createReturn(returnType));
    gen.addMethodGen(bridgeMethod);
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.InstructionList

  private BcelRenderer(InstructionFactory fact, BcelWorld world) {
    super();
    this.fact = fact;
    this.world = world;
    this.instructions = new InstructionList();
  }
View Full Code Here

Examples of org.jreversepro.reflect.instruction.InstructionList

      throws InstructionListParserException {
    bytecodes = _bytecodes;
    if (bytecodes == null) {
      throw new InstructionListParserException("bytecodes are null");
    }
    InstructionList il = new InstructionList();

    int maxCode = bytecodes.length;
    int currentPc = 0;
    int nextPc = -1;
    int startPc = -1;
    boolean bWide = false;
    while (currentPc < maxCode) {
      int curOpcode = Instruction.signedToUnsigned(bytecodes[currentPc]);
      startPc = currentPc + 1;
      if (curOpcode == Opcodes.OPCODE_TABLESWITCH) {
        startPc = currentPc + 4 - (currentPc % 4);
        nextPc = parseTableSwitchInstruction(startPc);
      } else if (curOpcode == Opcodes.OPCODE_LOOKUPSWITCH) {
        startPc = currentPc + 4 - (currentPc % 4);
        nextPc = parseLookupSwitchInstruction(startPc);
      } else {
        nextPc = currentPc
            + JVMInstructionSet.getOpcodeLength(curOpcode, bWide);
      }
      Instruction ins = new Instruction(currentPc, curOpcode, getArgArray(
          startPc, nextPc), nextPc, bWide);
      il.add(ins);
      bWide = (curOpcode == Opcodes.OPCODE_WIDE);
      currentPc = nextPc;
    }
    return il;
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.