Ejemplo n.º 1
0
 public void visitAnyInstruction(
     Clazz clazz,
     Method method,
     CodeAttribute codeAttribute,
     int offset,
     Instruction instruction) {
   // Add the instruction.
   codeAttributeComposer.appendInstruction(offset, instruction);
 }
Ejemplo n.º 2
0
  public void visitConstantInstruction(
      Clazz clazz,
      Method method,
      CodeAttribute codeAttribute,
      int offset,
      ConstantInstruction constantInstruction) {
    // Create a copy of the instruction.
    Instruction newConstantInstruction =
        new ConstantInstruction(
                constantInstruction.opcode,
                constantAdder.addConstant(clazz, constantInstruction.constantIndex),
                constantInstruction.constant)
            .shrink();

    // Add the instruction.
    codeAttributeComposer.appendInstruction(offset, newConstantInstruction);
  }