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.interpreter.FullInterpreterContext, java.util.Map<org.jruby.ir.operands.Operand, org.jruby.ir.operands.Operand>);
descriptor: (Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/interpreter/FullInterpreterContext;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.interpreter.FullInterpreterContext.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 fic Lorg/jruby/ir/interpreter/FullInterpreterContext;
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/interpreter/FullInterpreterContext;Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;)V
MethodParameters:
Name Flags
v
fic
varRenameMap
private void decrementScopeDepth(org.jruby.ir.operands.LocalVariable, java.util.Map<org.jruby.ir.operands.Operand, org.jruby.ir.operands.Operand>);
descriptor: (Lorg/jruby/ir/operands/LocalVariable;Ljava/util/Map;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=5, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 2
aload 1
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
ifnonnull 1
aload 2
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 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 varRenameMap Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;
Signature: (Lorg/jruby/ir/operands/LocalVariable;Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;)V
MethodParameters:
Name Flags
v
varRenameMap
public void eliminateLocalVars(org.jruby.ir.interpreter.FullInterpreterContext);
descriptor: (Lorg/jruby/ir/interpreter/FullInterpreterContext;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=12, 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.interpreter.FullInterpreterContext.getScope:()Lorg/jruby/ir/IRScope;
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
iconst_1
invokevirtual org.jruby.ir.interpreter.FullInterpreterContext.setDynamicScopeEliminated:(Z)V
3: iconst_0
istore 3
start local 3 4: aload 1
invokevirtual org.jruby.ir.interpreter.FullInterpreterContext.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 5
goto 47
StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map int top java.util.Iterator
StackMap stack:
5: aload 5
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.representations.BasicBlock
astore 4
start local 4 6: aload 4
invokevirtual org.jruby.ir.representations.BasicBlock.getInstrs:()Ljava/util/List;
invokeinterface java.util.List.listIterator:()Ljava/util/ListIterator;
astore 6
start local 6 7: goto 46
8: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map int org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator
StackMap stack:
aload 6
invokeinterface java.util.ListIterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.instructions.Instr
astore 7
start local 7 9: aload 7
instanceof org.jruby.ir.instructions.ResultInstr
ifeq 18
10: aload 7
checkcast org.jruby.ir.instructions.ResultInstr
invokeinterface org.jruby.ir.instructions.ResultInstr.getResult:()Lorg/jruby/ir/operands/Variable;
astore 8
start local 8 11: aload 8
instanceof org.jruby.ir.operands.LocalVariable
ifeq 18
aload 8
invokevirtual org.jruby.ir.operands.Variable.isSelf:()Z
ifne 18
12: aload 8
checkcast org.jruby.ir.operands.LocalVariable
astore 9
start local 9 13: aload 9
invokevirtual org.jruby.ir.operands.LocalVariable.getScopeDepth:()I
ifne 16
14: aload 0
aload 9
aload 1
aload 2
invokevirtual org.jruby.ir.passes.OptimizeDynScopesPass.setupLocalVarReplacement:(Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/interpreter/FullInterpreterContext;Ljava/util/Map;)V
15: goto 18
16: StackMap locals: org.jruby.ir.instructions.Instr org.jruby.ir.operands.Variable org.jruby.ir.operands.LocalVariable
StackMap stack:
iconst_1
istore 3
17: aload 0
aload 9
aload 2
invokevirtual org.jruby.ir.passes.OptimizeDynScopesPass.decrementScopeDepth:(Lorg/jruby/ir/operands/LocalVariable;Ljava/util/Map;)V
end local 9 end local 8 18: StackMap locals:
StackMap stack:
aload 7
invokevirtual org.jruby.ir.instructions.Instr.getUsedVariables:()Ljava/util/List;
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 9
goto 45
StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map int org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator org.jruby.ir.instructions.Instr top java.util.Iterator
StackMap stack:
19: aload 9
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.operands.Variable
astore 8
start local 8 20: aload 8
instanceof org.jruby.ir.operands.LocalVariable
ifeq 45
aload 8
invokevirtual org.jruby.ir.operands.Variable.isSelf:()Z
ifne 45
21: aload 8
checkcast org.jruby.ir.operands.LocalVariable
astore 10
start local 10 22: aload 10
invokevirtual org.jruby.ir.operands.LocalVariable.getScopeDepth:()I
ifne 34
23: aload 7
instanceof org.jruby.ir.instructions.LoadLocalVarInstr
ifeq 28
24: aload 7
checkcast org.jruby.ir.instructions.LoadLocalVarInstr
astore 11
start local 11 25: aload 11
invokevirtual org.jruby.ir.instructions.LoadLocalVarInstr.getLocalVar:()Lorg/jruby/ir/operands/LocalVariable;
aload 10
if_acmpne 32
26: aload 6
invokeinterface java.util.ListIterator.remove:()V
end local 11 27: goto 32
StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map 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:
28: aload 7
instanceof org.jruby.ir.instructions.StoreLocalVarInstr
ifeq 32
29: aload 7
checkcast org.jruby.ir.instructions.StoreLocalVarInstr
astore 11
start local 11 30: aload 11
invokevirtual org.jruby.ir.instructions.StoreLocalVarInstr.getLocalVar:()Lorg/jruby/ir/operands/LocalVariable;
aload 10
if_acmpne 32
31: aload 6
invokeinterface java.util.ListIterator.remove:()V
end local 11 32: StackMap locals:
StackMap stack:
aload 0
aload 10
aload 1
aload 2
invokevirtual org.jruby.ir.passes.OptimizeDynScopesPass.setupLocalVarReplacement:(Lorg/jruby/ir/operands/LocalVariable;Lorg/jruby/ir/interpreter/FullInterpreterContext;Ljava/util/Map;)V
33: goto 45
34: StackMap locals:
StackMap stack:
aload 7
instanceof org.jruby.ir.instructions.LoadLocalVarInstr
ifeq 39
35: aload 7
checkcast org.jruby.ir.instructions.LoadLocalVarInstr
astore 11
start local 11 36: aload 11
invokevirtual org.jruby.ir.instructions.LoadLocalVarInstr.getLocalVar:()Lorg/jruby/ir/operands/LocalVariable;
aload 10
if_acmpne 43
37: aload 11
invokevirtual org.jruby.ir.instructions.LoadLocalVarInstr.decrementLVarScopeDepth:()V
end local 11 38: goto 43
StackMap locals:
StackMap stack:
39: aload 7
instanceof org.jruby.ir.instructions.StoreLocalVarInstr
ifeq 43
40: aload 7
checkcast org.jruby.ir.instructions.StoreLocalVarInstr
astore 11
start local 11 41: aload 11
invokevirtual org.jruby.ir.instructions.StoreLocalVarInstr.getLocalVar:()Lorg/jruby/ir/operands/LocalVariable;
aload 10
if_acmpne 43
42: aload 11
invokevirtual org.jruby.ir.instructions.StoreLocalVarInstr.decrementLVarScopeDepth:()V
end local 11 43: StackMap locals:
StackMap stack:
iconst_1
istore 3
44: aload 0
aload 10
aload 2
invokevirtual org.jruby.ir.passes.OptimizeDynScopesPass.decrementScopeDepth:(Lorg/jruby/ir/operands/LocalVariable;Ljava/util/Map;)V
end local 10 end local 8 45: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map int org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator org.jruby.ir.instructions.Instr top java.util.Iterator
StackMap stack:
aload 9
invokeinterface java.util.Iterator.hasNext:()Z
ifne 19
end local 7 46: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map int org.jruby.ir.representations.BasicBlock java.util.Iterator java.util.ListIterator
StackMap stack:
aload 6
invokeinterface java.util.ListIterator.hasNext:()Z
ifne 8
end local 6 end local 4 47: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map int top java.util.Iterator
StackMap stack:
aload 5
invokeinterface java.util.Iterator.hasNext:()Z
ifne 5
48: iload 3
ifeq 49
aload 1
iconst_1
invokevirtual org.jruby.ir.interpreter.FullInterpreterContext.setReuseParentDynScope:(Z)V
49: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map int
StackMap stack:
aload 1
invokevirtual org.jruby.ir.interpreter.FullInterpreterContext.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 5
goto 55
StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map int top java.util.Iterator
StackMap stack:
50: aload 5
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.representations.BasicBlock
astore 4
start local 4 51: aload 4
invokevirtual org.jruby.ir.representations.BasicBlock.getInstrs:()Ljava/util/List;
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 7
goto 54
StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map int org.jruby.ir.representations.BasicBlock java.util.Iterator top java.util.Iterator
StackMap stack:
52: aload 7
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.instructions.Instr
astore 6
start local 6 53: aload 6
aload 2
invokevirtual org.jruby.ir.instructions.Instr.renameVars:(Ljava/util/Map;)V
end local 6 StackMap locals:
StackMap stack:
54: aload 7
invokeinterface java.util.Iterator.hasNext:()Z
ifne 52
end local 4 55: StackMap locals: org.jruby.ir.passes.OptimizeDynScopesPass org.jruby.ir.interpreter.FullInterpreterContext java.util.Map int top java.util.Iterator
StackMap stack:
aload 5
invokeinterface java.util.Iterator.hasNext:()Z
ifne 50
56: 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/interpreter/FullInterpreterContext;)Z
pop
57: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 58 0 this Lorg/jruby/ir/passes/OptimizeDynScopesPass;
0 58 1 fic Lorg/jruby/ir/interpreter/FullInterpreterContext;
2 58 2 varRenameMap Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;
4 58 3 parentScopeNeeded Z
6 47 4 b Lorg/jruby/ir/representations/BasicBlock;
7 47 6 instrs Ljava/util/ListIterator<Lorg/jruby/ir/instructions/Instr;>;
9 46 7 i Lorg/jruby/ir/instructions/Instr;
11 18 8 v Lorg/jruby/ir/operands/Variable;
13 18 9 lv Lorg/jruby/ir/operands/LocalVariable;
20 45 8 v Lorg/jruby/ir/operands/Variable;
22 45 10 lv Lorg/jruby/ir/operands/LocalVariable;
25 27 11 llvi Lorg/jruby/ir/instructions/LoadLocalVarInstr;
30 32 11 slvi Lorg/jruby/ir/instructions/StoreLocalVarInstr;
36 38 11 llvi Lorg/jruby/ir/instructions/LoadLocalVarInstr;
41 43 11 slvi Lorg/jruby/ir/instructions/StoreLocalVarInstr;
51 55 4 b Lorg/jruby/ir/representations/BasicBlock;
53 54 6 i Lorg/jruby/ir/instructions/Instr;
MethodParameters:
Name Flags
fic
public java.lang.Object execute(org.jruby.ir.interpreter.FullInterpreterContext, java.lang.Object[]);
descriptor: (Lorg/jruby/ir/interpreter/FullInterpreterContext;[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.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 1
aconst_null
areturn
1: StackMap locals:
StackMap stack:
aload 0
aload 1
invokevirtual org.jruby.ir.passes.OptimizeDynScopesPass.eliminateLocalVars:(Lorg/jruby/ir/interpreter/FullInterpreterContext;)V
2: aconst_null
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/jruby/ir/passes/OptimizeDynScopesPass;
0 3 1 fic Lorg/jruby/ir/interpreter/FullInterpreterContext;
0 3 2 data [Ljava/lang/Object;
MethodParameters:
Name Flags
fic
data
public boolean invalidate(org.jruby.ir.interpreter.FullInterpreterContext);
descriptor: (Lorg/jruby/ir/interpreter/FullInterpreterContext;)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 fic Lorg/jruby/ir/interpreter/FullInterpreterContext;
MethodParameters:
Name Flags
fic
}
SourceFile: "OptimizeDynScopesPass.java"