public class org.jruby.ir.passes.LocalOptimizationPass 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.LocalOptimizationPass
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/LocalOptimizationPass;
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 "Local Optimizations"
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/ir/passes/LocalOptimizationPass;
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 "Local Opts"
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/ir/passes/LocalOptimizationPass;
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=5, args_size=3
start local 0 start local 1 start local 2 0: 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 4
goto 3
StackMap locals: org.jruby.ir.passes.LocalOptimizationPass org.jruby.ir.IRScope java.lang.Object[] top java.util.Iterator
StackMap stack:
1: aload 4
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.representations.BasicBlock
astore 3
start local 3 2: aload 1
aload 3
invokestatic org.jruby.ir.passes.LocalOptimizationPass.runLocalOptsOnBasicBlock:(Lorg/jruby/ir/IRScope;Lorg/jruby/ir/representations/BasicBlock;)V
end local 3 3: StackMap locals:
StackMap stack:
aload 4
invokeinterface java.util.Iterator.hasNext:()Z
ifne 1
4: aload 1
invokevirtual org.jruby.ir.IRScope.computeScopeFlags:()V
5: 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
6: aconst_null
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lorg/jruby/ir/passes/LocalOptimizationPass;
0 7 1 s Lorg/jruby/ir/IRScope;
0 7 2 data [Ljava/lang/Object;
2 3 3 b Lorg/jruby/ir/representations/BasicBlock;
MethodParameters:
Name Flags
s
data
private static void recordSimplification(org.jruby.ir.operands.Variable, org.jruby.ir.operands.Operand, java.util.Map<org.jruby.ir.operands.Operand, org.jruby.ir.operands.Operand>, java.util.Map<org.jruby.ir.operands.Variable, java.util.List<org.jruby.ir.operands.Variable>>);
descriptor: (Lorg/jruby/ir/operands/Variable;Lorg/jruby/ir/operands/Operand;Ljava/util/Map;Ljava/util/Map;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=8, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 2
aload 0
aload 1
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
1: new java.util.ArrayList
dup
invokespecial java.util.ArrayList.<init>:()V
astore 4
start local 4 2: aload 1
aload 4
invokevirtual org.jruby.ir.operands.Operand.addUsedVariables:(Ljava/util/List;)V
3: aload 4
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 6
goto 10
StackMap locals: org.jruby.ir.operands.Variable org.jruby.ir.operands.Operand java.util.Map java.util.Map java.util.List top java.util.Iterator
StackMap stack:
4: aload 6
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.operands.Variable
astore 5
start local 5 5: aload 3
aload 5
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.util.List
astore 7
start local 7 6: aload 7
ifnonnull 9
7: new java.util.ArrayList
dup
invokespecial java.util.ArrayList.<init>:()V
astore 7
8: aload 3
aload 5
aload 7
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
9: StackMap locals: org.jruby.ir.operands.Variable org.jruby.ir.operands.Operand java.util.Map java.util.Map java.util.List org.jruby.ir.operands.Variable java.util.Iterator java.util.List
StackMap stack:
aload 7
aload 0
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
end local 7 end local 5 10: StackMap locals: org.jruby.ir.operands.Variable org.jruby.ir.operands.Operand java.util.Map java.util.Map java.util.List top java.util.Iterator
StackMap stack:
aload 6
invokeinterface java.util.Iterator.hasNext:()Z
ifne 4
11: return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 res Lorg/jruby/ir/operands/Variable;
0 12 1 val Lorg/jruby/ir/operands/Operand;
0 12 2 valueMap Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;
0 12 3 simplificationMap Ljava/util/Map<Lorg/jruby/ir/operands/Variable;Ljava/util/List<Lorg/jruby/ir/operands/Variable;>;>;
2 12 4 valVars Ljava/util/List<Lorg/jruby/ir/operands/Variable;>;
5 10 5 v Lorg/jruby/ir/operands/Variable;
6 10 7 x Ljava/util/List<Lorg/jruby/ir/operands/Variable;>;
Signature: (Lorg/jruby/ir/operands/Variable;Lorg/jruby/ir/operands/Operand;Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;Ljava/util/Map<Lorg/jruby/ir/operands/Variable;Ljava/util/List<Lorg/jruby/ir/operands/Variable;>;>;)V
MethodParameters:
Name Flags
res
val
valueMap
simplificationMap
public static org.jruby.ir.instructions.Instr optInstr(org.jruby.ir.IRScope, org.jruby.ir.instructions.Instr, java.util.Map<org.jruby.ir.operands.Operand, org.jruby.ir.operands.Operand>, java.util.Map<org.jruby.ir.operands.Variable, java.util.List<org.jruby.ir.operands.Variable>>);
descriptor: (Lorg/jruby/ir/IRScope;Lorg/jruby/ir/instructions/Instr;Ljava/util/Map;Ljava/util/Map;)Lorg/jruby/ir/instructions/Instr;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=10, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 1
aload 0
aload 2
invokevirtual org.jruby.ir.instructions.Instr.simplifyAndGetResult:(Lorg/jruby/ir/IRScope;Ljava/util/Map;)Lorg/jruby/ir/operands/Operand;
astore 4
start local 4 1: aload 1
instanceof org.jruby.ir.instructions.ResultInstr
ifne 3
2: aload 1
areturn
3: StackMap locals: org.jruby.ir.operands.Operand
StackMap stack:
aload 1
astore 5
start local 5 4: aload 1
checkcast org.jruby.ir.instructions.ResultInstr
invokeinterface org.jruby.ir.instructions.ResultInstr.getResult:()Lorg/jruby/ir/operands/Variable;
astore 6
start local 6 5: aload 4
ifnonnull 8
6: aload 2
aload 6
invokeinterface java.util.Map.remove:(Ljava/lang/Object;)Ljava/lang/Object;
pop
7: goto 16
8: StackMap locals: org.jruby.ir.instructions.Instr org.jruby.ir.operands.Variable
StackMap stack:
aload 6
aload 4
invokevirtual java.lang.Object.equals:(Ljava/lang/Object;)Z
ifne 10
9: aload 6
aload 4
aload 2
aload 3
invokestatic org.jruby.ir.passes.LocalOptimizationPass.recordSimplification:(Lorg/jruby/ir/operands/Variable;Lorg/jruby/ir/operands/Operand;Ljava/util/Map;Ljava/util/Map;)V
10: StackMap locals:
StackMap stack:
aload 1
invokevirtual org.jruby.ir.instructions.Instr.hasSideEffects:()Z
ifne 16
11: aload 1
instanceof org.jruby.ir.instructions.CopyInstr
ifeq 15
12: aload 6
aload 4
invokevirtual java.lang.Object.equals:(Ljava/lang/Object;)Z
ifeq 16
aload 1
aload 0
invokevirtual org.jruby.ir.instructions.Instr.canBeDeletedFromScope:(Lorg/jruby/ir/IRScope;)Z
ifeq 16
13: aload 1
invokevirtual org.jruby.ir.instructions.Instr.markDead:()V
14: goto 16
15: StackMap locals:
StackMap stack:
new org.jruby.ir.instructions.CopyInstr
dup
aload 6
aload 4
invokespecial org.jruby.ir.instructions.CopyInstr.<init>:(Lorg/jruby/ir/operands/Variable;Lorg/jruby/ir/operands/Operand;)V
astore 5
16: StackMap locals:
StackMap stack:
aload 6
aload 4
invokevirtual java.lang.Object.equals:(Ljava/lang/Object;)Z
ifne 24
17: aload 3
aload 6
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.util.List
astore 7
start local 7 18: aload 7
ifnull 24
19: aload 7
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 9
goto 22
StackMap locals: org.jruby.ir.IRScope org.jruby.ir.instructions.Instr java.util.Map java.util.Map org.jruby.ir.operands.Operand org.jruby.ir.instructions.Instr org.jruby.ir.operands.Variable java.util.List top java.util.Iterator
StackMap stack:
20: aload 9
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.operands.Variable
astore 8
start local 8 21: aload 2
aload 8
invokeinterface java.util.Map.remove:(Ljava/lang/Object;)Ljava/lang/Object;
pop
end local 8 22: StackMap locals:
StackMap stack:
aload 9
invokeinterface java.util.Iterator.hasNext:()Z
ifne 20
23: aload 3
aload 6
invokeinterface java.util.Map.remove:(Ljava/lang/Object;)Ljava/lang/Object;
pop
end local 7 24: StackMap locals: org.jruby.ir.IRScope org.jruby.ir.instructions.Instr java.util.Map java.util.Map org.jruby.ir.operands.Operand org.jruby.ir.instructions.Instr org.jruby.ir.operands.Variable
StackMap stack:
aload 5
areturn
end local 6 end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 25 0 s Lorg/jruby/ir/IRScope;
0 25 1 instr Lorg/jruby/ir/instructions/Instr;
0 25 2 valueMap Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;
0 25 3 simplificationMap Ljava/util/Map<Lorg/jruby/ir/operands/Variable;Ljava/util/List<Lorg/jruby/ir/operands/Variable;>;>;
1 25 4 val Lorg/jruby/ir/operands/Operand;
4 25 5 newInstr Lorg/jruby/ir/instructions/Instr;
5 25 6 res Lorg/jruby/ir/operands/Variable;
18 24 7 simplifiedVars Ljava/util/List<Lorg/jruby/ir/operands/Variable;>;
21 22 8 v Lorg/jruby/ir/operands/Variable;
Signature: (Lorg/jruby/ir/IRScope;Lorg/jruby/ir/instructions/Instr;Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;Ljava/util/Map<Lorg/jruby/ir/operands/Variable;Ljava/util/List<Lorg/jruby/ir/operands/Variable;>;>;)Lorg/jruby/ir/instructions/Instr;
MethodParameters:
Name Flags
s
instr
valueMap
simplificationMap
public static void runLocalOptsOnInstrArray(org.jruby.ir.IRScope, org.jruby.ir.instructions.Instr[]);
descriptor: (Lorg/jruby/ir/IRScope;[Lorg/jruby/ir/instructions/Instr;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=8, args_size=2
start local 0 start local 1 0: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 2
start local 2 1: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 3
start local 3 2: iconst_0
istore 4
start local 4 3: goto 13
4: StackMap locals: java.util.Map java.util.Map int
StackMap stack:
aload 1
iload 4
aaload
astore 5
start local 5 5: aload 0
aload 5
aload 2
aload 3
invokestatic org.jruby.ir.passes.LocalOptimizationPass.optInstr:(Lorg/jruby/ir/IRScope;Lorg/jruby/ir/instructions/Instr;Ljava/util/Map;Ljava/util/Map;)Lorg/jruby/ir/instructions/Instr;
astore 6
start local 6 6: aload 6
aload 5
if_acmpeq 8
7: aload 1
iload 4
aload 6
aastore
8: StackMap locals: org.jruby.ir.instructions.Instr org.jruby.ir.instructions.Instr
StackMap stack:
aload 5
invokevirtual org.jruby.ir.instructions.Instr.getOperation:()Lorg/jruby/ir/Operation;
astore 7
start local 7 9: aload 7
invokevirtual org.jruby.ir.Operation.startsBasicBlock:()Z
ifne 10
aload 7
invokevirtual org.jruby.ir.Operation.endsBasicBlock:()Z
ifne 10
aload 7
invokevirtual org.jruby.ir.Operation.isCall:()Z
ifeq 12
aload 5
invokevirtual org.jruby.ir.instructions.Instr.isDead:()Z
ifne 12
10: StackMap locals: org.jruby.ir.Operation
StackMap stack:
new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 2
11: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 3
end local 7 end local 6 end local 5 12: StackMap locals:
StackMap stack:
iinc 4 1
StackMap locals:
StackMap stack:
13: iload 4
aload 1
arraylength
if_icmplt 4
end local 4 14: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 15 0 s Lorg/jruby/ir/IRScope;
0 15 1 instrs [Lorg/jruby/ir/instructions/Instr;
1 15 2 valueMap Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;
2 15 3 simplificationMap Ljava/util/Map<Lorg/jruby/ir/operands/Variable;Ljava/util/List<Lorg/jruby/ir/operands/Variable;>;>;
3 14 4 i I
5 12 5 instr Lorg/jruby/ir/instructions/Instr;
6 12 6 newInstr Lorg/jruby/ir/instructions/Instr;
9 12 7 iop Lorg/jruby/ir/Operation;
MethodParameters:
Name Flags
s
instrs
public static void runLocalOptsOnBasicBlock(org.jruby.ir.IRScope, org.jruby.ir.representations.BasicBlock);
descriptor: (Lorg/jruby/ir/IRScope;Lorg/jruby/ir/representations/BasicBlock;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=8, args_size=2
start local 0 start local 1 0: aload 1
invokevirtual org.jruby.ir.representations.BasicBlock.getInstrs:()Ljava/util/List;
invokeinterface java.util.List.listIterator:()Ljava/util/ListIterator;
astore 2
start local 2 1: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 3
start local 3 2: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 4
start local 4 3: goto 15
4: StackMap locals: java.util.ListIterator java.util.Map java.util.Map
StackMap stack:
aload 2
invokeinterface java.util.ListIterator.next:()Ljava/lang/Object;
checkcast org.jruby.ir.instructions.Instr
astore 5
start local 5 5: aload 0
aload 5
aload 3
aload 4
invokestatic org.jruby.ir.passes.LocalOptimizationPass.optInstr:(Lorg/jruby/ir/IRScope;Lorg/jruby/ir/instructions/Instr;Ljava/util/Map;Ljava/util/Map;)Lorg/jruby/ir/instructions/Instr;
astore 6
start local 6 6: aload 6
invokevirtual org.jruby.ir.instructions.Instr.isDead:()Z
ifeq 9
7: aload 2
invokeinterface java.util.ListIterator.remove:()V
8: goto 11
StackMap locals: org.jruby.ir.instructions.Instr org.jruby.ir.instructions.Instr
StackMap stack:
9: aload 6
aload 5
if_acmpeq 11
10: aload 2
aload 6
invokeinterface java.util.ListIterator.set:(Ljava/lang/Object;)V
11: StackMap locals:
StackMap stack:
aload 5
invokevirtual org.jruby.ir.instructions.Instr.getOperation:()Lorg/jruby/ir/Operation;
astore 7
start local 7 12: aload 7
invokevirtual org.jruby.ir.Operation.isCall:()Z
ifeq 15
aload 5
invokevirtual org.jruby.ir.instructions.Instr.isDead:()Z
ifne 15
13: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 3
14: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 4
end local 7 end local 6 end local 5 15: StackMap locals:
StackMap stack:
aload 2
invokeinterface java.util.ListIterator.hasNext:()Z
ifne 4
16: return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 17 0 s Lorg/jruby/ir/IRScope;
0 17 1 b Lorg/jruby/ir/representations/BasicBlock;
1 17 2 instrs Ljava/util/ListIterator<Lorg/jruby/ir/instructions/Instr;>;
2 17 3 valueMap Ljava/util/Map<Lorg/jruby/ir/operands/Operand;Lorg/jruby/ir/operands/Operand;>;
3 17 4 simplificationMap Ljava/util/Map<Lorg/jruby/ir/operands/Variable;Ljava/util/List<Lorg/jruby/ir/operands/Variable;>;>;
5 15 5 instr Lorg/jruby/ir/instructions/Instr;
6 15 6 newInstr Lorg/jruby/ir/instructions/Instr;
12 15 7 iop Lorg/jruby/ir/Operation;
MethodParameters:
Name Flags
s
b
}
SourceFile: "LocalOptimizationPass.java"