public class org.jruby.ir.passes.OptimizeDynScopesPass 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.OptimizeDynScopesPass
super_class: org.jruby.ir.passes.CompilerPass
{
static final boolean $assertionsDisabled;
descriptor: Z
flags: (0x1018) ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: ldc Lorg/jruby/ir/passes/OptimizeDynScopesPass;
invokevirtual java.lang.Class.desiredAssertionStatus:()Z
ifne 1
iconst_1
goto 2
StackMap locals:
StackMap stack:
1: iconst_0
StackMap locals:
StackMap stack: int
2: putstatic org.jruby.ir.passes.OptimizeDynScopesPass.$assertionsDisabled:Z
return
LocalVariableTable:
Start End Slot Name Signature
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/OptimizeDynScopesPass;
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 "Optimize Dynamic Scopes"
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/ir/passes/OptimizeDynScopesPass;
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 Dyn Scopes"
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/ir/passes/OptimizeDynScopesPass;
private void setupLocalVarReplacement(org.jruby.ir.operands.LocalVariable, org.jruby.ir.IRScope, java.util.Map<org.jruby.ir.operands.Operand, org.jruby.ir.operands.Operand>);
descriptor: (Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/IRScope;Ljava/util/Map;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 3
aload 1
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
ifnonnull 1
aload 3
aload 1
aload 2
aload 1
invokevirtual org.jruby.ir.IRScope.getNewTemporaryVariableFor:(Lorg/jruby/ir/operands/LocalVariable;)Lorg/jruby/ir/operands/TemporaryLocalVariable;
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
1: StackMap locals:
StackMap stack:
return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lorg/jruby/ir/passes/OptimizeDynScopesPass;
0 2 1 v Lorg/jruby/ir/operands/LocalVariable;
0 2 2 s Lorg/jruby/ir/IRScope;
0 2 3 varRenameMap Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;
Signature: (Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/IRScope;Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;)V
MethodParameters:
Name Flags
v
s
varRenameMap
private void decrementScopeDepth(org.jruby.ir.operands.LocalVariable, org.jruby.ir.IRScope, java.util.Map<org.jruby.ir.operands.Operand, org.jruby.ir.operands.Operand>);
descriptor: (Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/IRScope;Ljava/util/Map;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=5, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 3
aload 1
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
ifnonnull 1
aload 3
aload 1
aload 1
aload 1
invokevirtual org.jruby.ir.operands.LocalVariable.getScopeDepth:()I
iconst_1
isub
invokevirtual org.jruby.ir.operands.LocalVariable.cloneForDepth:(I)Lorg/jruby/ir/operands/LocalVariable;
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
1: StackMap locals:
StackMap stack:
return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lorg/jruby/ir/passes/OptimizeDynScopesPass;
0 2 1 v Lorg/jruby/ir/operands/LocalVariable;
0 2 2 s Lorg/jruby/ir/IRScope;
0 2 3 varRenameMap Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;
Signature: (Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/IRScope;Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;)V
MethodParameters:
Name Flags
v
s
varRenameMap
public void eliminateLocalVars(org.jruby.ir.IRScope);
descriptor: (Lorg/jruby/ir/IRScope;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=13, args_size=2
start local 0 start local 1 0: getstatic org.jruby.ir.passes.OptimizeDynScopesPass.$assertionsDisabled:Z
ifne 1
aload 1
invokevirtual org.jruby.ir.IRScope.getClosures:()Ljava/util/Collection;
invokeinterface java.util.Collection.isEmpty:()Z
ifne 1
new java.lang.AssertionError
dup
ldc "We assume that if a scope has nested closures, it uses a dynamic scoope."
invokespecial java.lang.AssertionError.<init>:(Ljava/lang/Object;)V
athrow
1: StackMap locals:
StackMap stack:
new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 2
start local 2 2: 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 3: aload 3
getstatic org.jruby.ir.IRFlags.DYNSCOPE_ELIMINATED:Lorg/jruby/ir/IRFlags;
invokevirtual java.util.EnumSet.add:(Ljava/lang/Object;)Z
pop
4: iconst_0
istore 4
start local 4 5: aload 1
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 6
goto 48
StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int top java.util.Iterator
StackMap stack:
6: aload 6
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.representations.BasicBlock
astore 5
start local 5 7: aload 5
invokevirtual org.jruby.ir.representations.BasicBlock.getInstrs:()Ljava/util/List;
invokeinterface java.util.List.listIterator:()Ljava/util/ListIterator;
astore 7
start local 7 8: goto 47
9: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator
StackMap stack:
aload 7
invokeinterface java.util.ListIterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.instructions.Instr
astore 8
start local 8 10: aload 8
instanceof org.jruby.ir.instructions.ResultInstr
ifeq 19
11: aload 8
checkcast org.jruby.ir.instructions.ResultInstr
invokeinterface org.jruby.ir.instructions.ResultInstr.getResult:()Lorg/jruby/ir/operands/Variable;
astore 9
start local 9 12: aload 9
instanceof org.jruby.ir.operands.LocalVariable
ifeq 19
aload 9
invokevirtual org.jruby.ir.operands.Variable.isSelf:()Z
ifne 19
13: aload 9
checkcast org.jruby.ir.operands.LocalVariable
astore 10
start local 10 14: aload 10
invokevirtual org.jruby.ir.operands.LocalVariable.getScopeDepth:()I
ifne 17
15: aload 0
aload 10
aload 1
aload 2
invokevirtual org.jruby.ir.passes.OptimizeDynScopesPass.setupLocalVarReplacement:(Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/IRScope;Ljava/util/Map;)V
16: goto 19
17: StackMap locals: org.jruby.ir.instructions.Instr org.jruby.ir.operands.Variable org.jruby.ir.operands.LocalVariable
StackMap stack:
iconst_1
istore 4
18: aload 0
aload 10
aload 1
aload 2
invokevirtual org.jruby.ir.passes.OptimizeDynScopesPass.decrementScopeDepth:(Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/IRScope;Ljava/util/Map;)V
end local 10 end local 9 19: StackMap locals:
StackMap stack:
aload 8
invokevirtual org.jruby.ir.instructions.Instr.getUsedVariables:()Ljava/util/List;
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 10
goto 46
StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator org.jruby.ir.instructions.Instr top java.util.Iterator
StackMap stack:
20: aload 10
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.operands.Variable
astore 9
start local 9 21: aload 9
instanceof org.jruby.ir.operands.LocalVariable
ifeq 46
aload 9
invokevirtual org.jruby.ir.operands.Variable.isSelf:()Z
ifne 46
22: aload 9
checkcast org.jruby.ir.operands.LocalVariable
astore 11
start local 11 23: aload 11
invokevirtual org.jruby.ir.operands.LocalVariable.getScopeDepth:()I
ifne 35
24: aload 8
instanceof org.jruby.ir.instructions.LoadLocalVarInstr
ifeq 29
25: aload 8
checkcast org.jruby.ir.instructions.LoadLocalVarInstr
astore 12
start local 12 26: aload 12
invokevirtual org.jruby.ir.instructions.LoadLocalVarInstr.getLocalVar:()Lorg/jruby/ir/operands/LocalVariable;
aload 11
if_acmpne 33
27: aload 7
invokeinterface java.util.ListIterator.remove:()V
end local 12 28: goto 33
StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator org.jruby.ir.instructions.Instr org.jruby.ir.operands.Variable java.util.Iterator org.jruby.ir.operands.LocalVariable
StackMap stack:
29: aload 8
instanceof org.jruby.ir.instructions.StoreLocalVarInstr
ifeq 33
30: aload 8
checkcast org.jruby.ir.instructions.StoreLocalVarInstr
astore 12
start local 12 31: aload 12
invokevirtual org.jruby.ir.instructions.StoreLocalVarInstr.getLocalVar:()Lorg/jruby/ir/operands/LocalVariable;
aload 11
if_acmpne 33
32: aload 7
invokeinterface java.util.ListIterator.remove:()V
end local 12 33: StackMap locals:
StackMap stack:
aload 0
aload 11
aload 1
aload 2
invokevirtual org.jruby.ir.passes.OptimizeDynScopesPass.setupLocalVarReplacement:(Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/IRScope;Ljava/util/Map;)V
34: goto 46
35: StackMap locals:
StackMap stack:
aload 8
instanceof org.jruby.ir.instructions.LoadLocalVarInstr
ifeq 40
36: aload 8
checkcast org.jruby.ir.instructions.LoadLocalVarInstr
astore 12
start local 12 37: aload 12
invokevirtual org.jruby.ir.instructions.LoadLocalVarInstr.getLocalVar:()Lorg/jruby/ir/operands/LocalVariable;
aload 11
if_acmpne 44
38: aload 12
invokevirtual org.jruby.ir.instructions.LoadLocalVarInstr.decrementLVarScopeDepth:()V
end local 12 39: goto 44
StackMap locals:
StackMap stack:
40: aload 8
instanceof org.jruby.ir.instructions.StoreLocalVarInstr
ifeq 44
41: aload 8
checkcast org.jruby.ir.instructions.StoreLocalVarInstr
astore 12
start local 12 42: aload 12
invokevirtual org.jruby.ir.instructions.StoreLocalVarInstr.getLocalVar:()Lorg/jruby/ir/operands/LocalVariable;
aload 11
if_acmpne 44
43: aload 12
invokevirtual org.jruby.ir.instructions.StoreLocalVarInstr.decrementLVarScopeDepth:()V
end local 12 44: StackMap locals:
StackMap stack:
iconst_1
istore 4
45: aload 0
aload 11
aload 1
aload 2
invokevirtual org.jruby.ir.passes.OptimizeDynScopesPass.decrementScopeDepth:(Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/IRScope;Ljava/util/Map;)V
end local 11 end local 9 46: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator org.jruby.ir.instructions.Instr top java.util.Iterator
StackMap stack:
aload 10
invokeinterface java.util.Iterator.hasNext:()Z
ifne 20
end local 8 47: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator
StackMap stack:
aload 7
invokeinterface java.util.ListIterator.hasNext:()Z
ifne 9
end local 7 end local 5 48: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int top java.util.Iterator
StackMap stack:
aload 6
invokeinterface java.util.Iterator.hasNext:()Z
ifne 6
49: iload 4
ifeq 50
aload 3
getstatic org.jruby.ir.IRFlags.REUSE_PARENT_DYNSCOPE:Lorg/jruby/ir/IRFlags;
invokevirtual java.util.EnumSet.add:(Ljava/lang/Object;)Z
pop
50: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int
StackMap stack:
aload 1
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 6
goto 56
StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int top java.util.Iterator
StackMap stack:
51: aload 6
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.representations.BasicBlock
astore 5
start local 5 52: aload 5
invokevirtual org.jruby.ir.representations.BasicBlock.getInstrs:()Ljava/util/List;
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 8
goto 55
StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int org.jruby.ir.representations.BasicBlock java.util.Iterator top java.util.Iterator
StackMap stack:
53: aload 8
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.instructions.Instr
astore 7
start local 7 54: aload 7
aload 2
invokevirtual org.jruby.ir.instructions.Instr.renameVars:(Ljava/util/Map;)V
end local 7 StackMap locals:
StackMap stack:
55: aload 8
invokeinterface java.util.Iterator.hasNext:()Z
ifne 53
end local 5 56: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.IRScope java.util.Map java.util.EnumSet int top java.util.Iterator
StackMap stack:
aload 6
invokeinterface java.util.Iterator.hasNext:()Z
ifne 51
57: new org.jruby.ir.passes.LiveVariableAnalysis
dup
invokespecial org.jruby.ir.passes.LiveVariableAnalysis.<init>:()V
aload 1
invokevirtual org.jruby.ir.passes.LiveVariableAnalysis.invalidate:(Lorg/jruby/ir/IRScope;)Z
pop
58: return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 59 0 this Lorg/jruby/ir/passes/OptimizeDynScopesPass;
0 59 1 s Lorg/jruby/ir/IRScope;
2 59 2 varRenameMap Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;
3 59 3 flags Ljava/util/EnumSet<Lorg/jruby/ir/IRFlags;>;
5 59 4 parentScopeNeeded Z
7 48 5 b Lorg/jruby/ir/representations/BasicBlock;
8 48 7 instrs Ljava/util/ListIterator<Lorg/jruby/ir/instructions/Instr;>;
10 47 8 i Lorg/jruby/ir/instructions/Instr;
12 19 9 v Lorg/jruby/ir/operands/Variable;
14 19 10 lv Lorg/jruby/ir/operands/LocalVariable;
21 46 9 v Lorg/jruby/ir/operands/Variable;
23 46 11 lv Lorg/jruby/ir/operands/LocalVariable;
26 28 12 llvi Lorg/jruby/ir/instructions/LoadLocalVarInstr;
31 33 12 slvi Lorg/jruby/ir/instructions/StoreLocalVarInstr;
37 39 12 llvi Lorg/jruby/ir/instructions/LoadLocalVarInstr;
42 44 12 slvi Lorg/jruby/ir/instructions/StoreLocalVarInstr;
52 56 5 b Lorg/jruby/ir/representations/BasicBlock;
54 55 7 i Lorg/jruby/ir/instructions/Instr;
MethodParameters:
Name Flags
s
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=3, args_size=3
start local 0 start local 1 start local 2 0: aload 1
invokevirtual org.jruby.ir.IRScope.computeScopeFlags:()V
1: aload 1
invokevirtual org.jruby.ir.IRScope.getExecutionContext:()Lorg/jruby/ir/interpreter/FullInterpreterContext;
invokevirtual org.jruby.ir.interpreter.FullInterpreterContext.getFlags:()Ljava/util/EnumSet;
getstatic org.jruby.ir.IRFlags.REQUIRES_DYNSCOPE:Lorg/jruby/ir/IRFlags;
invokevirtual java.util.EnumSet.contains:(Ljava/lang/Object;)Z
ifeq 2
aconst_null
areturn
2: StackMap locals:
StackMap stack:
aload 0
aload 1
invokevirtual org.jruby.ir.passes.OptimizeDynScopesPass.eliminateLocalVars:(Lorg/jruby/ir/IRScope;)V
3: aconst_null
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lorg/jruby/ir/passes/OptimizeDynScopesPass;
0 4 1 scope Lorg/jruby/ir/IRScope;
0 4 2 data [Ljava/lang/Object;
MethodParameters:
Name Flags
scope
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/OptimizeDynScopesPass;
0 1 1 scope Lorg/jruby/ir/IRScope;
MethodParameters:
Name Flags
scope
}
SourceFile: "OptimizeDynScopesPass.java"