public class org.jruby.ir.passes.OptimizeDelegationPass extends org.jruby.ir.passes.CompilerPass
  minor version: 0
  major version: 59
  flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
  this_class: org.jruby.ir.passes.OptimizeDelegationPass
  super_class: org.jruby.ir.passes.CompilerPass
{
  public void <init>();
    descriptor: ()V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=1, locals=1, args_size=1
        start local 0 // org.jruby.ir.passes.OptimizeDelegationPass this
         0: .line 16
            aload 0 /* this */
            invokespecial org.jruby.ir.passes.CompilerPass.<init>:()V
            return
        end local 0 // org.jruby.ir.passes.OptimizeDelegationPass this
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0    1     0  this  Lorg/jruby/ir/passes/OptimizeDelegationPass;

  public java.lang.String getLabel();
    descriptor: ()Ljava/lang/String;
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=1, locals=1, args_size=1
        start local 0 // org.jruby.ir.passes.OptimizeDelegationPass this
         0: .line 19
            ldc "Delegated Variable Removal"
            areturn
        end local 0 // org.jruby.ir.passes.OptimizeDelegationPass this
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0    1     0  this  Lorg/jruby/ir/passes/OptimizeDelegationPass;

  public java.lang.String getShortLabel();
    descriptor: ()Ljava/lang/String;
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=1, locals=1, args_size=1
        start local 0 // org.jruby.ir.passes.OptimizeDelegationPass this
         0: .line 24
            ldc "Opt Delegation"
            areturn
        end local 0 // org.jruby.ir.passes.OptimizeDelegationPass this
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0    1     0  this  Lorg/jruby/ir/passes/OptimizeDelegationPass;

  public java.lang.Object execute(org.jruby.ir.IRScope, java.lang.Object[]);
    descriptor: (Lorg/jruby/ir/IRScope;[Ljava/lang/Object;)Ljava/lang/Object;
    flags: (0x0081) ACC_PUBLIC, ACC_VARARGS
    Code:
      stack=2, locals=4, args_size=3
        start local 0 // org.jruby.ir.passes.OptimizeDelegationPass this
        start local 1 // org.jruby.ir.IRScope s
        start local 2 // java.lang.Object[] data
         0: .line 29
            aload 1 /* s */
            invokevirtual org.jruby.ir.IRScope.getExecutionContext:()Lorg/jruby/ir/interpreter/FullInterpreterContext;
            invokevirtual org.jruby.ir.interpreter.FullInterpreterContext.getFlags:()Ljava/util/EnumSet;
            astore 3 /* flags */
        start local 3 // java.util.EnumSet flags
         1: .line 31
            aload 3 /* flags */
            getstatic org.jruby.ir.IRFlags.BINDING_HAS_ESCAPED:Lorg/jruby/ir/IRFlags;
            invokevirtual java.util.EnumSet.contains:(Ljava/lang/Object;)Z
            ifeq 2
            aconst_null
            areturn
         2: .line 32
      StackMap locals: java.util.EnumSet
      StackMap stack:
            aload 3 /* flags */
            getstatic org.jruby.ir.IRFlags.RECEIVES_CLOSURE_ARG:Lorg/jruby/ir/IRFlags;
            invokevirtual java.util.EnumSet.contains:(Ljava/lang/Object;)Z
            ifne 3
            aconst_null
            areturn
         3: .line 34
      StackMap locals:
      StackMap stack:
            aload 1 /* s */
            invokestatic org.jruby.ir.passes.OptimizeDelegationPass.optimizeDelegatedVars:(Lorg/jruby/ir/IRScope;)V
         4: .line 36
            iconst_1
            invokestatic java.lang.Boolean.valueOf:(Z)Ljava/lang/Boolean;
            areturn
        end local 3 // java.util.EnumSet flags
        end local 2 // java.lang.Object[] data
        end local 1 // org.jruby.ir.IRScope s
        end local 0 // org.jruby.ir.passes.OptimizeDelegationPass this
      LocalVariableTable:
        Start  End  Slot   Name  Signature
            0    5     0   this  Lorg/jruby/ir/passes/OptimizeDelegationPass;
            0    5     1      s  Lorg/jruby/ir/IRScope;
            0    5     2   data  [Ljava/lang/Object;
            1    5     3  flags  Ljava/util/EnumSet<Lorg/jruby/ir/IRFlags;>;
    MethodParameters:
      Name  Flags
      s     
      data  

  public boolean invalidate(org.jruby.ir.IRScope);
    descriptor: (Lorg/jruby/ir/IRScope;)Z
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=1, locals=2, args_size=2
        start local 0 // org.jruby.ir.passes.OptimizeDelegationPass this
        start local 1 // org.jruby.ir.IRScope s
         0: .line 42
            iconst_0
            ireturn
        end local 1 // org.jruby.ir.IRScope s
        end local 0 // org.jruby.ir.passes.OptimizeDelegationPass this
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0    1     0  this  Lorg/jruby/ir/passes/OptimizeDelegationPass;
            0    1     1     s  Lorg/jruby/ir/IRScope;
    MethodParameters:
      Name  Flags
      s     

  private static void optimizeDelegatedVars(org.jruby.ir.IRScope);
    descriptor: (Lorg/jruby/ir/IRScope;)V
    flags: (0x000a) ACC_PRIVATE, ACC_STATIC
    Code:
      stack=5, locals=9, args_size=1
        start local 0 // org.jruby.ir.IRScope s
         0: .line 46
            new java.util.HashMap
            dup
            invokespecial java.util.HashMap.<init>:()V
            astore 1 /* unusedExplicitBlocks */
        start local 1 // java.util.Map unusedExplicitBlocks
         1: .line 48
            aload 0 /* s */
            invokevirtual org.jruby.ir.IRScope.getCFG:()Lorg/jruby/ir/representations/CFG;
            invokevirtual org.jruby.ir.representations.CFG.getBasicBlocks:()Ljava/util/Collection;
            invokeinterface java.util.Collection.iterator:()Ljava/util/Iterator;
            astore 3
            goto 17
      StackMap locals: org.jruby.ir.IRScope java.util.Map top java.util.Iterator
      StackMap stack:
         2: aload 3
            invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
            checkcast org.jruby.ir.representations.BasicBlock
            astore 2 /* bb */
        start local 2 // org.jruby.ir.representations.BasicBlock bb
         3: .line 49
            aload 2 /* bb */
            invokevirtual org.jruby.ir.representations.BasicBlock.getInstrs:()Ljava/util/List;
            invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
            astore 5
            goto 16
      StackMap locals: org.jruby.ir.IRScope java.util.Map org.jruby.ir.representations.BasicBlock java.util.Iterator top java.util.Iterator
      StackMap stack:
         4: aload 5
            invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
            checkcast org.jruby.ir.instructions.Instr
            astore 4 /* i */
        start local 4 // org.jruby.ir.instructions.Instr i
         5: .line 50
            aload 4 /* i */
            instanceof org.jruby.ir.instructions.ReifyClosureInstr
            ifeq 10
         6: .line 51
            aload 4 /* i */
            checkcast org.jruby.ir.instructions.ReifyClosureInstr
            astore 6 /* ri */
        start local 6 // org.jruby.ir.instructions.ReifyClosureInstr ri
         7: .line 55
            aload 6 /* ri */
            invokevirtual org.jruby.ir.instructions.ReifyClosureInstr.getResult:()Lorg/jruby/ir/operands/Variable;
            instanceof org.jruby.ir.operands.LocalVariable
            ifeq 8
            goto 16
         8: .line 57
      StackMap locals: org.jruby.ir.IRScope java.util.Map org.jruby.ir.representations.BasicBlock java.util.Iterator org.jruby.ir.instructions.Instr java.util.Iterator org.jruby.ir.instructions.ReifyClosureInstr
      StackMap stack:
            aload 1 /* unusedExplicitBlocks */
            aload 6 /* ri */
            invokevirtual org.jruby.ir.instructions.ReifyClosureInstr.getResult:()Lorg/jruby/ir/operands/Variable;
            aload 6 /* ri */
            invokevirtual org.jruby.ir.instructions.ReifyClosureInstr.getSource:()Lorg/jruby/ir/operands/Variable;
            invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
            pop
        end local 6 // org.jruby.ir.instructions.ReifyClosureInstr ri
         9: .line 58
            goto 16
        10: .line 59
      StackMap locals:
      StackMap stack:
            aload 1 /* unusedExplicitBlocks */
            invokeinterface java.util.Map.keySet:()Ljava/util/Set;
            invokeinterface java.util.Set.iterator:()Ljava/util/Iterator;
            astore 6 /* it */
        start local 6 // java.util.Iterator it
        11: .line 60
            goto 15
        12: .line 61
      StackMap locals: java.util.Iterator
      StackMap stack:
            aload 6 /* it */
            invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
            checkcast org.jruby.ir.operands.Variable
            astore 7 /* explicitBlock */
        start local 7 // org.jruby.ir.operands.Variable explicitBlock
        13: .line 62
            aload 4 /* i */
            aload 7 /* explicitBlock */
            invokestatic org.jruby.ir.passes.OptimizeDelegationPass.usesVariableAsNonClosureArg:(Lorg/jruby/ir/instructions/Instr;Lorg/jruby/ir/operands/Variable;)Z
            ifeq 15
        14: .line 63
            aload 6 /* it */
            invokeinterface java.util.Iterator.remove:()V
        end local 7 // org.jruby.ir.operands.Variable explicitBlock
        15: .line 60
      StackMap locals:
      StackMap stack:
            aload 6 /* it */
            invokeinterface java.util.Iterator.hasNext:()Z
            ifne 12
        end local 6 // java.util.Iterator it
        end local 4 // org.jruby.ir.instructions.Instr i
        16: .line 49
      StackMap locals: org.jruby.ir.IRScope java.util.Map org.jruby.ir.representations.BasicBlock java.util.Iterator top java.util.Iterator
      StackMap stack:
            aload 5
            invokeinterface java.util.Iterator.hasNext:()Z
            ifne 4
        end local 2 // org.jruby.ir.representations.BasicBlock bb
        17: .line 48
      StackMap locals: org.jruby.ir.IRScope java.util.Map top java.util.Iterator
      StackMap stack:
            aload 3
            invokeinterface java.util.Iterator.hasNext:()Z
            ifne 2
        18: .line 70
            aload 0 /* s */
            invokevirtual org.jruby.ir.IRScope.getCFG:()Lorg/jruby/ir/representations/CFG;
            invokevirtual org.jruby.ir.representations.CFG.getBasicBlocks:()Ljava/util/Collection;
            invokeinterface java.util.Collection.iterator:()Ljava/util/Iterator;
            astore 3
            goto 31
      StackMap locals:
      StackMap stack:
        19: aload 3
            invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
            checkcast org.jruby.ir.representations.BasicBlock
            astore 2 /* bb */
        start local 2 // org.jruby.ir.representations.BasicBlock bb
        20: .line 71
            aload 2 /* bb */
            invokevirtual org.jruby.ir.representations.BasicBlock.getInstrs:()Ljava/util/List;
            invokeinterface java.util.List.listIterator:()Ljava/util/ListIterator;
            astore 4 /* instrs */
        start local 4 // java.util.ListIterator instrs
        21: .line 72
            goto 30
        22: .line 73
      StackMap locals: org.jruby.ir.IRScope java.util.Map org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator
      StackMap stack:
            aload 4 /* instrs */
            invokeinterface java.util.ListIterator.next:()Ljava/lang/Object;
            checkcast org.jruby.ir.instructions.Instr
            astore 5 /* i */
        start local 5 // org.jruby.ir.instructions.Instr i
        23: .line 74
            aload 5 /* i */
            instanceof org.jruby.ir.instructions.ReifyClosureInstr
            ifeq 30
        24: .line 75
            aload 5 /* i */
            checkcast org.jruby.ir.instructions.ReifyClosureInstr
            astore 6 /* ri */
        start local 6 // org.jruby.ir.instructions.ReifyClosureInstr ri
        25: .line 76
            aload 6 /* ri */
            invokevirtual org.jruby.ir.instructions.ReifyClosureInstr.getResult:()Lorg/jruby/ir/operands/Variable;
            astore 7 /* procVar */
        start local 7 // org.jruby.ir.operands.Variable procVar
        26: .line 77
            aload 1 /* unusedExplicitBlocks */
            aload 7 /* procVar */
            invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
            checkcast org.jruby.ir.operands.Operand
            astore 8 /* blockVar */
        start local 8 // org.jruby.ir.operands.Operand blockVar
        27: .line 79
            aload 8 /* blockVar */
            ifnull 30
        28: .line 80
            aload 6 /* ri */
            invokevirtual org.jruby.ir.instructions.ReifyClosureInstr.markDead:()V
        29: .line 81
            aload 4 /* instrs */
            new org.jruby.ir.instructions.CopyInstr
            dup
            aload 7 /* procVar */
            aload 8 /* blockVar */
            invokespecial org.jruby.ir.instructions.CopyInstr.<init>:(Lorg/jruby/ir/operands/Variable;Lorg/jruby/ir/operands/Operand;)V
            invokeinterface java.util.ListIterator.set:(Ljava/lang/Object;)V
        end local 8 // org.jruby.ir.operands.Operand blockVar
        end local 7 // org.jruby.ir.operands.Variable procVar
        end local 6 // org.jruby.ir.instructions.ReifyClosureInstr ri
        end local 5 // org.jruby.ir.instructions.Instr i
        30: .line 72
      StackMap locals:
      StackMap stack:
            aload 4 /* instrs */
            invokeinterface java.util.ListIterator.hasNext:()Z
            ifne 22
        end local 4 // java.util.ListIterator instrs
        end local 2 // org.jruby.ir.representations.BasicBlock bb
        31: .line 70
      StackMap locals: org.jruby.ir.IRScope java.util.Map top java.util.Iterator
      StackMap stack:
            aload 3
            invokeinterface java.util.Iterator.hasNext:()Z
            ifne 19
        32: .line 86
            return
        end local 1 // java.util.Map unusedExplicitBlocks
        end local 0 // org.jruby.ir.IRScope s
      LocalVariableTable:
        Start  End  Slot                  Name  Signature
            0   33     0                     s  Lorg/jruby/ir/IRScope;
            1   33     1  unusedExplicitBlocks  Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;
            3   17     2                    bb  Lorg/jruby/ir/representations/BasicBlock;
            5   16     4                     i  Lorg/jruby/ir/instructions/Instr;
            7    9     6                    ri  Lorg/jruby/ir/instructions/ReifyClosureInstr;
           11   16     6                    it  Ljava/util/Iterator<Lorg/jruby/ir/operands/Operand;>;
           13   15     7         explicitBlock  Lorg/jruby/ir/operands/Variable;
           20   31     2                    bb  Lorg/jruby/ir/representations/BasicBlock;
           21   31     4                instrs  Ljava/util/ListIterator<Lorg/jruby/ir/instructions/Instr;>;
           23   30     5                     i  Lorg/jruby/ir/instructions/Instr;
           25   30     6                    ri  Lorg/jruby/ir/instructions/ReifyClosureInstr;
           26   30     7               procVar  Lorg/jruby/ir/operands/Variable;
           27   30     8              blockVar  Lorg/jruby/ir/operands/Operand;
    MethodParameters:
      Name  Flags
      s     

  private static boolean usesVariableAsNonClosureArg(org.jruby.ir.instructions.Instr, org.jruby.ir.operands.Variable);
    descriptor: (Lorg/jruby/ir/instructions/Instr;Lorg/jruby/ir/operands/Variable;)Z
    flags: (0x000a) ACC_PRIVATE, ACC_STATIC
    Code:
      stack=3, locals=3, args_size=2
        start local 0 // org.jruby.ir.instructions.Instr i
        start local 1 // org.jruby.ir.operands.Variable v
         0: .line 89
            aload 0 /* i */
            invokevirtual org.jruby.ir.instructions.Instr.getUsedVariables:()Ljava/util/List;
            astore 2 /* usedVariables */
        start local 2 // java.util.List usedVariables
         1: .line 90
            aload 2 /* usedVariables */
            aload 1 /* v */
            invokeinterface java.util.List.contains:(Ljava/lang/Object;)Z
            ifeq 6
         2: .line 91
            aload 0 /* i */
            instanceof org.jruby.ir.instructions.ClosureAcceptingInstr
            ifeq 5
         3: .line 92
            aload 2 /* usedVariables */
            aload 1 /* v */
            invokeinterface java.util.List.indexOf:(Ljava/lang/Object;)I
            aload 2 /* usedVariables */
            aload 1 /* v */
            invokeinterface java.util.List.lastIndexOf:(Ljava/lang/Object;)I
            if_icmpne 5
         4: .line 93
            aload 1 /* v */
            aload 0 /* i */
            checkcast org.jruby.ir.instructions.ClosureAcceptingInstr
            invokeinterface org.jruby.ir.instructions.ClosureAcceptingInstr.getClosureArg:()Lorg/jruby/ir/operands/Operand;
            if_acmpeq 6
         5: .line 90
      StackMap locals: java.util.List
      StackMap stack:
            iconst_1
            ireturn
      StackMap locals:
      StackMap stack:
         6: iconst_0
            ireturn
        end local 2 // java.util.List usedVariables
        end local 1 // org.jruby.ir.operands.Variable v
        end local 0 // org.jruby.ir.instructions.Instr i
      LocalVariableTable:
        Start  End  Slot           Name  Signature
            0    7     0              i  Lorg/jruby/ir/instructions/Instr;
            0    7     1              v  Lorg/jruby/ir/operands/Variable;
            1    7     2  usedVariables  Ljava/util/List<Lorg/jruby/ir/operands/Variable;>;
    MethodParameters:
      Name  Flags
      i     
      v     
}
SourceFile: "OptimizeDelegationPass.java"