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 0: aload 0
invokespecial org.jruby.ir.passes.CompilerPass.<init>:()V
return
end local 0 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 0: ldc "Delegated Variable Removal"
areturn
end local 0 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 0: ldc "Opt Delegation"
areturn
end local 0 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 start local 1 start local 2 0: aload 1
invokevirtual org.jruby.ir.IRScope.getExecutionContext:()Lorg/jruby/ir/interpreter/FullInterpreterContext;
invokevirtual org.jruby.ir.interpreter.FullInterpreterContext.getFlags:()Ljava/util/EnumSet;
astore 3
start local 3 1: aload 3
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: StackMap locals: java.util.EnumSet
StackMap stack:
aload 3
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: StackMap locals:
StackMap stack:
aload 1
invokestatic org.jruby.ir.passes.OptimizeDelegationPass.optimizeDelegatedVars:(Lorg/jruby/ir/IRScope;)V
4: iconst_1
invokestatic java.lang.Boolean.valueOf:(Z)Ljava/lang/Boolean;
areturn
end local 3 end local 2 end local 1 end local 0 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 start local 1 0: iconst_0
ireturn
end local 1 end local 0 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 0: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 1
start local 1 1: aload 0
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
start local 2 3: aload 2
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
start local 4 5: aload 4
instanceof org.jruby.ir.instructions.ReifyClosureInstr
ifeq 10
6: aload 4
checkcast org.jruby.ir.instructions.ReifyClosureInstr
astore 6
start local 6 7: aload 6
invokevirtual org.jruby.ir.instructions.ReifyClosureInstr.getResult:()Lorg/jruby/ir/operands/Variable;
instanceof org.jruby.ir.operands.LocalVariable
ifeq 8
goto 16
8: 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
aload 6
invokevirtual org.jruby.ir.instructions.ReifyClosureInstr.getResult:()Lorg/jruby/ir/operands/Variable;
aload 6
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 9: goto 16
10: StackMap locals:
StackMap stack:
aload 1
invokeinterface java.util.Map.keySet:()Ljava/util/Set;
invokeinterface java.util.Set.iterator:()Ljava/util/Iterator;
astore 6
start local 6 11: goto 15
12: StackMap locals: java.util.Iterator
StackMap stack:
aload 6
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.operands.Variable
astore 7
start local 7 13: aload 4
aload 7
invokestatic org.jruby.ir.passes.OptimizeDelegationPass.usesVariableAsNonClosureArg:(Lorg/jruby/ir/instructions/Instr;Lorg/jruby/ir/operands/Variable;)Z
ifeq 15
14: aload 6
invokeinterface java.util.Iterator.remove:()V
end local 7 15: StackMap locals:
StackMap stack:
aload 6
invokeinterface java.util.Iterator.hasNext:()Z
ifne 12
end local 6 end local 4 16: 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 17: 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: aload 0
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
start local 2 20: aload 2
invokevirtual org.jruby.ir.representations.BasicBlock.getInstrs:()Ljava/util/List;
invokeinterface java.util.List.listIterator:()Ljava/util/ListIterator;
astore 4
start local 4 21: goto 30
22: StackMap locals: org.jruby.ir.IRScope java.util.Map org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator
StackMap stack:
aload 4
invokeinterface java.util.ListIterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.instructions.Instr
astore 5
start local 5 23: aload 5
instanceof org.jruby.ir.instructions.ReifyClosureInstr
ifeq 30
24: aload 5
checkcast org.jruby.ir.instructions.ReifyClosureInstr
astore 6
start local 6 25: aload 6
invokevirtual org.jruby.ir.instructions.ReifyClosureInstr.getResult:()Lorg/jruby/ir/operands/Variable;
astore 7
start local 7 26: aload 1
aload 7
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast org.jruby.ir.operands.Operand
astore 8
start local 8 27: aload 8
ifnull 30
28: aload 6
invokevirtual org.jruby.ir.instructions.ReifyClosureInstr.markDead:()V
29: aload 4
new org.jruby.ir.instructions.CopyInstr
dup
aload 7
aload 8
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 end local 7 end local 6 end local 5 30: StackMap locals:
StackMap stack:
aload 4
invokeinterface java.util.ListIterator.hasNext:()Z
ifne 22
end local 4 end local 2 31: 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: return
end local 1 end local 0 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 start local 1 0: aload 0
invokevirtual org.jruby.ir.instructions.Instr.getUsedVariables:()Ljava/util/List;
astore 2
start local 2 1: aload 2
aload 1
invokeinterface java.util.List.contains:(Ljava/lang/Object;)Z
ifeq 6
2: aload 0
instanceof org.jruby.ir.instructions.ClosureAcceptingInstr
ifeq 5
3: aload 2
aload 1
invokeinterface java.util.List.indexOf:(Ljava/lang/Object;)I
aload 2
aload 1
invokeinterface java.util.List.lastIndexOf:(Ljava/lang/Object;)I
if_icmpne 5
4: aload 1
aload 0
checkcast org.jruby.ir.instructions.ClosureAcceptingInstr
invokeinterface org.jruby.ir.instructions.ClosureAcceptingInstr.getClosureArg:()Lorg/jruby/ir/operands/Operand;
if_acmpeq 6
5: StackMap locals: java.util.List
StackMap stack:
iconst_1
ireturn
StackMap locals:
StackMap stack:
6: iconst_0
ireturn
end local 2 end local 1 end local 0 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"