336969538c
* Type arguments are moved to global object table (and de-duplicated). * Finalize non-recursive generic types at bytecode generation time. * Constants are moved to global object table (and de-duplicated). * ICData creation is avoided for direct calls. * Interface calls reference target member instead of selector name. Size of a dilp files: 17868K => 15896K (-11%). Change-Id: I0c9bf338137a0fae6ed90ab6b125ed2b24a1a8ad Reviewed-on: https://dart-review.googlesource.com/c/91108 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Zach Anderson <zra@google.com> Reviewed-by: Régis Crelier <regis@google.com>
240 lines
4.5 KiB
Plaintext
240 lines
4.5 KiB
Plaintext
library #lib;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 2
|
|
CheckStack 0
|
|
PushNull
|
|
PopLocal r0
|
|
Push FP[-5]
|
|
PopLocal r1
|
|
Push r1
|
|
PushInt 1
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L1
|
|
Push r1
|
|
PushInt 2
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L2
|
|
Push r1
|
|
PushInt 3
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L3
|
|
Jump L4
|
|
L1:
|
|
PushInt 11
|
|
PopLocal r0
|
|
Jump L4
|
|
L2:
|
|
PushInt 22
|
|
PopLocal r0
|
|
Jump L4
|
|
L3:
|
|
PushInt 33
|
|
PopLocal r0
|
|
Jump L4
|
|
L4:
|
|
Push r0
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = InterfaceCall 'dart:core::Object::==', ArgDesc num-args 2, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
]static method foo1(core::int x) → core::int {
|
|
core::int y;
|
|
#L1:
|
|
switch(x) {
|
|
#L2:
|
|
case 1:
|
|
{
|
|
y = 11;
|
|
break #L1;
|
|
}
|
|
#L3:
|
|
case 2:
|
|
{
|
|
y = 22;
|
|
break #L1;
|
|
}
|
|
#L4:
|
|
case 3:
|
|
{
|
|
y = 33;
|
|
break #L1;
|
|
}
|
|
}
|
|
return y;
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 2
|
|
CheckStack 0
|
|
PushNull
|
|
PopLocal r0
|
|
Push FP[-5]
|
|
PopLocal r1
|
|
Push r1
|
|
PushInt 1
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L1
|
|
Push r1
|
|
PushInt 2
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L1
|
|
Push r1
|
|
PushInt 3
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L1
|
|
Push r1
|
|
PushInt 4
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L2
|
|
Push r1
|
|
PushInt 5
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L2
|
|
Push r1
|
|
PushInt 6
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L2
|
|
Jump L3
|
|
L1:
|
|
PushInt 11
|
|
PopLocal r0
|
|
Jump L4
|
|
L2:
|
|
PushInt 22
|
|
PopLocal r0
|
|
Jump L4
|
|
L3:
|
|
PushInt 33
|
|
PopLocal r0
|
|
L4:
|
|
Push r0
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = InterfaceCall 'dart:core::Object::==', ArgDesc num-args 2, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
]static method foo2(core::int x) → core::int {
|
|
core::int y;
|
|
#L5:
|
|
switch(x) {
|
|
#L6:
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
{
|
|
y = 11;
|
|
break #L5;
|
|
}
|
|
#L7:
|
|
case 4:
|
|
case 5:
|
|
case 6:
|
|
{
|
|
y = 22;
|
|
break #L5;
|
|
}
|
|
#L8:
|
|
default:
|
|
{
|
|
y = 33;
|
|
}
|
|
}
|
|
return y;
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 2
|
|
CheckStack 0
|
|
PushNull
|
|
PopLocal r0
|
|
Push FP[-5]
|
|
PopLocal r1
|
|
Push r1
|
|
PushInt 1
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L1
|
|
Push r1
|
|
PushInt 2
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L1
|
|
Push r1
|
|
PushInt 3
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L1
|
|
Push r1
|
|
PushInt 4
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L2
|
|
Push r1
|
|
PushInt 5
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L2
|
|
Push r1
|
|
PushInt 6
|
|
InterfaceCall 2, CP#0
|
|
JumpIfTrue L2
|
|
Jump L3
|
|
L1:
|
|
PushInt 11
|
|
PopLocal r0
|
|
Jump L2
|
|
L2:
|
|
PushInt 22
|
|
PopLocal r0
|
|
PushInt 42
|
|
ReturnTOS
|
|
L3:
|
|
PushInt 33
|
|
PopLocal r0
|
|
Push r0
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = InterfaceCall 'dart:core::Object::==', ArgDesc num-args 2, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
]static method foo3(core::int x) → core::int {
|
|
core::int y;
|
|
switch(x) {
|
|
#L9:
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
{
|
|
y = 11;
|
|
continue #L10;
|
|
}
|
|
#L10:
|
|
case 4:
|
|
case 5:
|
|
case 6:
|
|
{
|
|
y = 22;
|
|
return 42;
|
|
}
|
|
#L11:
|
|
default:
|
|
{
|
|
y = 33;
|
|
}
|
|
}
|
|
return y;
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
}
|
|
]static method main() → dynamic {}
|