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>
1608 lines
44 KiB
Plaintext
1608 lines
44 KiB
Plaintext
library #lib;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
typedef IntFunc = (core::int) → dynamic;
|
|
class C1 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::C1
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C2 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::C2
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C3 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::C3
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C4 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::C4
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C5 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::C5
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C6 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::C6
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C7 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::C7
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C8 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::C8
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class A<T1 extends core::Object = dynamic, T2 extends core::Object = dynamic> extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::A<self::A::T1, self::A::T2>
|
|
: super core::Object::•()
|
|
;
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 5
|
|
CheckStack 0
|
|
CheckFunctionTypeArgs 2, r0
|
|
AllocateContext 0, 1
|
|
PopLocal r1
|
|
Push r1
|
|
Push FP[-5]
|
|
StoreContextVar 0, 0
|
|
Allocate CP#30
|
|
StoreLocal r4
|
|
Push r4
|
|
Push FP[-5]
|
|
LoadTypeArgumentsField CP#14
|
|
StoreFieldTOS CP#31
|
|
Push r4
|
|
Push r0
|
|
StoreFieldTOS CP#6
|
|
Push r4
|
|
PushConstant CP#5
|
|
StoreFieldTOS CP#3
|
|
Push r4
|
|
PushConstant CP#0
|
|
StoreFieldTOS CP#33
|
|
Push r4
|
|
Push r1
|
|
StoreFieldTOS CP#1
|
|
PopLocal r3
|
|
PushConstant CP#44
|
|
Push r3
|
|
DynamicCall 2, CP#45
|
|
Drop1
|
|
PushConstant CP#46
|
|
Push r3
|
|
DynamicCall 2, CP#47
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ClosureFunction 0
|
|
[1] = InstanceField dart:core::_Closure::_context (field)
|
|
[2] = Reserved
|
|
[3] = InstanceField dart:core::_Closure::_delayed_type_arguments (field)
|
|
[4] = Reserved
|
|
[5] = EmptyTypeArguments
|
|
[6] = InstanceField dart:core::_Closure::_function_type_arguments (field)
|
|
[7] = Reserved
|
|
[8] = DirectCall 'dart:_internal::_prependTypeArguments', ArgDesc num-args 4, num-type-args 0, names []
|
|
[9] = Reserved
|
|
[10] = ClosureFunction 1
|
|
[11] = ClosureFunction 2
|
|
[12] = ObjectRef < dart:core::Type >
|
|
[13] = Type #lib::A::TypeParam/0
|
|
[14] = TypeArgumentsField #lib::A
|
|
[15] = Type #lib::A::TypeParam/1
|
|
[16] = Type #lib::A::foo::TypeParam/0
|
|
[17] = Type #lib::A::foo::TypeParam/1
|
|
[18] = Type #lib::A::foo::Closure/0::TypeParam/0
|
|
[19] = Type #lib::A::foo::Closure/0::TypeParam/1
|
|
[20] = Type #lib::A::foo::Closure/1::TypeParam/0
|
|
[21] = Type #lib::A::foo::Closure/1::TypeParam/1
|
|
[22] = DirectCall 'dart:core::List::_fromLiteral (constructor)', ArgDesc num-args 2, num-type-args 0, names []
|
|
[23] = Reserved
|
|
[24] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
|
|
[25] = Reserved
|
|
[26] = ObjectRef < #lib::A::TypeParam/0, #lib::A::TypeParam/1, #lib::A::foo::TypeParam/0, #lib::A::foo::TypeParam/1, #lib::A::foo::Closure/0::TypeParam/0, #lib::A::foo::Closure/0::TypeParam/1, #lib::A::foo::Closure/1::TypeParam/0, #lib::A::foo::Closure/1::TypeParam/1 >
|
|
[27] = DirectCall '#lib::callWithArgs', ArgDesc num-args 0, num-type-args 8, names []
|
|
[28] = Reserved
|
|
[29] = EndClosureFunctionScope
|
|
[30] = Class dart:core::_Closure
|
|
[31] = InstanceField dart:core::_Closure::_instantiator_type_arguments (field)
|
|
[32] = Reserved
|
|
[33] = InstanceField dart:core::_Closure::_function (field)
|
|
[34] = Reserved
|
|
[35] = ObjectRef ArgDesc num-args 1, num-type-args 0, names []
|
|
[36] = ICData dynamic target-name 'call', arg-desc CP#35
|
|
[37] = EndClosureFunctionScope
|
|
[38] = ObjectRef < #lib::C7, #lib::C8 >
|
|
[39] = ObjectRef ArgDesc num-args 1, num-type-args 2, names []
|
|
[40] = ICData dynamic target-name 'call', arg-desc CP#39
|
|
[41] = ObjectRef < dart:core::List < #lib::C7 >, dart:core::List < #lib::C8 > >
|
|
[42] = ICData dynamic target-name 'call', arg-desc CP#39
|
|
[43] = EndClosureFunctionScope
|
|
[44] = ObjectRef < #lib::C5, #lib::C6 >
|
|
[45] = ICData dynamic target-name 'call', arg-desc CP#39
|
|
[46] = ObjectRef < dart:core::List < #lib::C5 >, dart:core::List < #lib::C6 > >
|
|
[47] = ICData dynamic target-name 'call', arg-desc CP#39
|
|
}
|
|
Closure #lib::A::foo::'nested1' <dart:core::Object T5, dart:core::Object T6> () -> void
|
|
ClosureBytecode {
|
|
EntryFixed 1, 5
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r1
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#3
|
|
StoreLocal r0
|
|
PushConstant CP#5
|
|
JumpIfEqStrict L1
|
|
CheckFunctionTypeArgs 0, r2
|
|
Jump L2
|
|
L1:
|
|
CheckFunctionTypeArgs 2, r0
|
|
L2:
|
|
Push r0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#6
|
|
PushInt 2
|
|
PushInt 4
|
|
DirectCall 4, CP#8
|
|
PopLocal r0
|
|
Allocate CP#30
|
|
StoreLocal r4
|
|
Push r4
|
|
Push r1
|
|
LoadContextVar 0, 0
|
|
LoadTypeArgumentsField CP#14
|
|
StoreFieldTOS CP#31
|
|
Push r4
|
|
Push r0
|
|
StoreFieldTOS CP#6
|
|
Push r4
|
|
PushConstant CP#5
|
|
StoreFieldTOS CP#3
|
|
Push r4
|
|
PushConstant CP#10
|
|
StoreFieldTOS CP#33
|
|
Push r4
|
|
Push r1
|
|
StoreFieldTOS CP#1
|
|
PopLocal r3
|
|
PushConstant CP#38
|
|
Push r3
|
|
DynamicCall 2, CP#40
|
|
Drop1
|
|
PushConstant CP#41
|
|
Push r3
|
|
DynamicCall 2, CP#42
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure #lib::A::foo::Closure/0::'nested2' <dart:core::Object T7, dart:core::Object T8> () -> void
|
|
ClosureBytecode {
|
|
EntryFixed 1, 5
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r1
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#3
|
|
StoreLocal r0
|
|
PushConstant CP#5
|
|
JumpIfEqStrict L1
|
|
CheckFunctionTypeArgs 0, r2
|
|
Jump L2
|
|
L1:
|
|
CheckFunctionTypeArgs 2, r0
|
|
L2:
|
|
Push r0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#6
|
|
PushInt 4
|
|
PushInt 6
|
|
DirectCall 4, CP#8
|
|
PopLocal r0
|
|
Allocate CP#30
|
|
StoreLocal r4
|
|
Push r4
|
|
Push r1
|
|
LoadContextVar 0, 0
|
|
LoadTypeArgumentsField CP#14
|
|
StoreFieldTOS CP#31
|
|
Push r4
|
|
Push r0
|
|
StoreFieldTOS CP#6
|
|
Push r4
|
|
PushConstant CP#5
|
|
StoreFieldTOS CP#3
|
|
Push r4
|
|
PushConstant CP#11
|
|
StoreFieldTOS CP#33
|
|
Push r4
|
|
Push r1
|
|
StoreFieldTOS CP#1
|
|
PopLocal r3
|
|
Push r3
|
|
DynamicCall 1, CP#36
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure #lib::A::foo::Closure/1::'<anonymous closure>' () -> dart:core::Null
|
|
ClosureBytecode {
|
|
EntryFixed 1, 4
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r1
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#6
|
|
PopLocal r0
|
|
PushConstant CP#12
|
|
StoreLocal r3
|
|
Push r3
|
|
PushInt 8
|
|
CreateArrayTOS
|
|
StoreLocal r3
|
|
Push r3
|
|
PushInt 0
|
|
Push r1
|
|
LoadContextVar 0, 0
|
|
LoadTypeArgumentsField CP#14
|
|
PushNull
|
|
InstantiateType CP#13
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushInt 1
|
|
Push r1
|
|
LoadContextVar 0, 0
|
|
LoadTypeArgumentsField CP#14
|
|
PushNull
|
|
InstantiateType CP#15
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushInt 2
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#16
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushInt 3
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#17
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushInt 4
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#18
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushInt 5
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#19
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushInt 6
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#20
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushInt 7
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#21
|
|
StoreIndexedTOS
|
|
DirectCall 2, CP#22
|
|
DirectCall 1, CP#24
|
|
Drop1
|
|
Push r1
|
|
LoadContextVar 0, 0
|
|
LoadTypeArgumentsField CP#14
|
|
Push r0
|
|
InstantiateTypeArgumentsTOS 0, CP#26
|
|
DirectCall 1, CP#27
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
] method foo<T3 extends core::Object = dynamic, T4 extends core::Object = dynamic>() → void {
|
|
function nested1<T5 extends core::Object = dynamic, T6 extends core::Object = dynamic>() → void {
|
|
function nested2<T7 extends core::Object = dynamic, T8 extends core::Object = dynamic>() → void {
|
|
() → core::Null nested3 = () → core::Null {
|
|
core::print(<core::Type>[self::A::T1, self::A::T2, self::A::foo::T3, self::A::foo::T4, T5, T6, T7, T8]);
|
|
self::callWithArgs<self::A::T1, self::A::T2, self::A::foo::T3, self::A::foo::T4, T5, T6, T7, T8>();
|
|
};
|
|
[@vm.call-site-attributes.metadata=receiverType:() → dart.core::Null] nested3.call();
|
|
}
|
|
[@vm.call-site-attributes.metadata=receiverType:<T7 extends dart.core::Object = dynamic, T8 extends dart.core::Object = dynamic>() → void] nested2.call<self::C7, self::C8>();
|
|
[@vm.call-site-attributes.metadata=receiverType:<T7 extends dart.core::Object = dynamic, T8 extends dart.core::Object = dynamic>() → void] nested2.call<core::List<self::C7>, core::List<self::C8>>();
|
|
}
|
|
[@vm.call-site-attributes.metadata=receiverType:<T5 extends dart.core::Object = dynamic, T6 extends dart.core::Object = dynamic>() → void] nested1.call<self::C5, self::C6>();
|
|
[@vm.call-site-attributes.metadata=receiverType:<T5 extends dart.core::Object = dynamic, T6 extends dart.core::Object = dynamic>() → void] nested1.call<core::List<self::C5>, core::List<self::C6>>();
|
|
}
|
|
}
|
|
class B extends core::Object {
|
|
field core::int foo = null;
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
Nullable fields: [#lib::B::foo (field)]}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::B
|
|
: super core::Object::•()
|
|
;
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 5
|
|
CheckStack 0
|
|
AllocateContext 0, 4
|
|
PopLocal r0
|
|
Push r0
|
|
Push FP[-5]
|
|
StoreContextVar 0, 0
|
|
Push r0
|
|
PushInt 1
|
|
StoreContextVar 0, 1
|
|
PushInt 2
|
|
PopLocal r2
|
|
Push r0
|
|
PushInt 3
|
|
StoreContextVar 0, 2
|
|
Allocate CP#10
|
|
StoreLocal r4
|
|
Push r4
|
|
PushNull
|
|
StoreFieldTOS CP#11
|
|
Push r4
|
|
PushNull
|
|
StoreFieldTOS CP#13
|
|
Push r4
|
|
PushConstant CP#15
|
|
StoreFieldTOS CP#16
|
|
Push r4
|
|
PushConstant CP#0
|
|
StoreFieldTOS CP#18
|
|
Push r4
|
|
Push r0
|
|
StoreFieldTOS CP#1
|
|
PopLocal r3
|
|
Push r3
|
|
PushInt 10
|
|
DynamicCall 2, CP#26
|
|
Drop1
|
|
Push r3
|
|
PushInt 11
|
|
DynamicCall 2, CP#27
|
|
Drop1
|
|
Push r2
|
|
DirectCall 1, CP#22
|
|
Drop1
|
|
Push r0
|
|
LoadContextVar 0, 2
|
|
DirectCall 1, CP#22
|
|
Drop1
|
|
Push r0
|
|
LoadContextVar 0, 1
|
|
DirectCall 1, CP#22
|
|
Drop1
|
|
Push r0
|
|
PushInt 42
|
|
StoreContextVar 0, 3
|
|
Allocate CP#10
|
|
StoreLocal r3
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#11
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#13
|
|
Push r3
|
|
PushConstant CP#15
|
|
StoreFieldTOS CP#16
|
|
Push r3
|
|
PushConstant CP#28
|
|
StoreFieldTOS CP#18
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#1
|
|
PopLocal r2
|
|
Push r2
|
|
DynamicCall 1, CP#32
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ClosureFunction 0
|
|
[1] = InstanceField dart:core::_Closure::_context (field)
|
|
[2] = Reserved
|
|
[3] = Type dart:core::int
|
|
[4] = ObjectRef 'y'
|
|
[5] = SubtypeTestCache
|
|
[6] = ClosureFunction 1
|
|
[7] = InterfaceCall '#lib::B::get:foo', ArgDesc num-args 1, num-type-args 0, names []
|
|
[8] = Reserved
|
|
[9] = EndClosureFunctionScope
|
|
[10] = Class dart:core::_Closure
|
|
[11] = InstanceField dart:core::_Closure::_instantiator_type_arguments (field)
|
|
[12] = Reserved
|
|
[13] = InstanceField dart:core::_Closure::_function_type_arguments (field)
|
|
[14] = Reserved
|
|
[15] = EmptyTypeArguments
|
|
[16] = InstanceField dart:core::_Closure::_delayed_type_arguments (field)
|
|
[17] = Reserved
|
|
[18] = InstanceField dart:core::_Closure::_function (field)
|
|
[19] = Reserved
|
|
[20] = ObjectRef ArgDesc num-args 1, num-type-args 0, names []
|
|
[21] = ICData dynamic target-name 'call', arg-desc CP#20
|
|
[22] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
|
|
[23] = Reserved
|
|
[24] = EndClosureFunctionScope
|
|
[25] = ObjectRef ArgDesc num-args 2, num-type-args 0, names []
|
|
[26] = ICData dynamic target-name 'call', arg-desc CP#25
|
|
[27] = ICData dynamic target-name 'call', arg-desc CP#25
|
|
[28] = ClosureFunction 2
|
|
[29] = InterfaceCall '#lib::B::set:foo', ArgDesc num-args 2, num-type-args 0, names []
|
|
[30] = Reserved
|
|
[31] = EndClosureFunctionScope
|
|
[32] = ICData dynamic target-name 'call', arg-desc CP#20
|
|
}
|
|
Closure #lib::B::topLevel::'<anonymous closure>' (dart:core::int y) -> dart:core::Null
|
|
ClosureBytecode {
|
|
EntryFixed 2, 4
|
|
CheckStack 0
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r0
|
|
AllocateContext 1, 2
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
Push FP[-5]
|
|
StoreContextVar 1, 0
|
|
Push FP[-5]
|
|
PushConstant CP#3
|
|
PushNull
|
|
PushNull
|
|
PushConstant CP#4
|
|
AssertAssignable 1, CP#5
|
|
Drop1
|
|
Push r0
|
|
LoadContextParent
|
|
Push r0
|
|
LoadContextVar 1, 0
|
|
PushInt 1
|
|
AddInt
|
|
StoreContextVar 0, 1
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextVar 0, 1
|
|
PushInt 5
|
|
CompareIntGt
|
|
JumpIfFalse L1
|
|
Push r0
|
|
PushInt 4
|
|
StoreContextVar 1, 1
|
|
Allocate CP#10
|
|
StoreLocal r2
|
|
Push r2
|
|
PushNull
|
|
StoreFieldTOS CP#11
|
|
Push r2
|
|
PushNull
|
|
StoreFieldTOS CP#13
|
|
Push r2
|
|
PushConstant CP#15
|
|
StoreFieldTOS CP#16
|
|
Push r2
|
|
PushConstant CP#6
|
|
StoreFieldTOS CP#18
|
|
Push r2
|
|
Push r0
|
|
StoreFieldTOS CP#1
|
|
PopLocal r3
|
|
Push r3
|
|
DynamicCall 1, CP#21
|
|
Drop1
|
|
Push r0
|
|
LoadContextVar 1, 1
|
|
DirectCall 1, CP#22
|
|
Drop1
|
|
L1:
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure #lib::B::topLevel::Closure/0::'closure2' () -> void
|
|
ClosureBytecode {
|
|
EntryFixed 1, 3
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextParent
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextVar 0, 1
|
|
PushInt 2
|
|
AddInt
|
|
StoreContextVar 0, 2
|
|
Push r0
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextVar 0, 0
|
|
InterfaceCall 1, CP#7
|
|
Push r0
|
|
LoadContextVar 1, 0
|
|
AddInt
|
|
StoreContextVar 1, 1
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure #lib::B::topLevel::'<anonymous closure>' () -> dart:core::Null
|
|
ClosureBytecode {
|
|
EntryFixed 1, 3
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextVar 0, 0
|
|
Push r0
|
|
LoadContextVar 0, 3
|
|
InterfaceCall 2, CP#29
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
] method topLevel() → void {
|
|
{
|
|
core::int x = 1;
|
|
{
|
|
core::int y = 2;
|
|
core::int z = 3;
|
|
(core::int) → core::Null closure1 = (core::int y) → core::Null {
|
|
x = y.{core::num::+}(1);
|
|
if(x.{core::num::>}(5)) {
|
|
core::int w = 4;
|
|
function closure2() → void {
|
|
z = x.{core::num::+}(2);
|
|
w = this.{self::B::foo}.{core::num::+}(y);
|
|
}
|
|
[@vm.call-site-attributes.metadata=receiverType:() → void] closure2.call();
|
|
core::print(w);
|
|
}
|
|
};
|
|
[@vm.call-site-attributes.metadata=receiverType:(dart.core::int) → dart.core::Null] closure1.call(10);
|
|
[@vm.call-site-attributes.metadata=receiverType:(dart.core::int) → dart.core::Null] closure1.call(11);
|
|
core::print(y);
|
|
core::print(z);
|
|
}
|
|
core::print(x);
|
|
}
|
|
{
|
|
core::int x = 42;
|
|
() → core::Null closure3 = () → core::Null {
|
|
this.{self::B::foo} = x;
|
|
};
|
|
[@vm.call-site-attributes.metadata=receiverType:() → dart.core::Null] closure3.call();
|
|
}
|
|
}
|
|
}
|
|
class C extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::C
|
|
: super core::Object::•()
|
|
;
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 5
|
|
CheckStack 0
|
|
AllocateContext 0, 1
|
|
PopLocal r0
|
|
Push r0
|
|
PushInt 0
|
|
StoreContextVar 0, 0
|
|
PushConstant CP#0
|
|
StoreLocal r3
|
|
Push r3
|
|
PushInt 0
|
|
CreateArrayTOS
|
|
StoreLocal r3
|
|
DirectCall 2, CP#1
|
|
PopLocal r2
|
|
PushConstant CP#0
|
|
StoreLocal r3
|
|
Push r3
|
|
PushInt 0
|
|
CreateArrayTOS
|
|
StoreLocal r3
|
|
DirectCall 2, CP#1
|
|
PopLocal r4
|
|
AllocateContext 1, 1
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
PushInt 0
|
|
StoreContextVar 1, 0
|
|
L2:
|
|
CheckStack 1
|
|
Push r0
|
|
LoadContextVar 1, 0
|
|
PushInt 10
|
|
CompareIntLt
|
|
JumpIfFalse L1
|
|
Push r2
|
|
Allocate CP#7
|
|
StoreLocal r3
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#8
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#10
|
|
Push r3
|
|
PushConstant CP#12
|
|
StoreFieldTOS CP#13
|
|
Push r3
|
|
PushConstant CP#3
|
|
StoreFieldTOS CP#15
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#4
|
|
InterfaceCall 2, CP#17
|
|
Drop1
|
|
Push r4
|
|
Allocate CP#7
|
|
StoreLocal r3
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#8
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#10
|
|
Push r3
|
|
PushConstant CP#12
|
|
StoreFieldTOS CP#13
|
|
Push r3
|
|
PushConstant CP#19
|
|
StoreFieldTOS CP#15
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#4
|
|
InterfaceCall 2, CP#17
|
|
Drop1
|
|
Push r0
|
|
CloneContext 1, 1
|
|
PopLocal r0
|
|
Push r0
|
|
Push r0
|
|
LoadContextVar 1, 0
|
|
PushInt 1
|
|
AddInt
|
|
StoreLocal r3
|
|
StoreContextVar 1, 0
|
|
Push r3
|
|
Drop1
|
|
Jump L2
|
|
L1:
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ObjectRef < dart:core::Function >
|
|
[1] = DirectCall 'dart:core::List::_fromLiteral (constructor)', ArgDesc num-args 2, num-type-args 0, names []
|
|
[2] = Reserved
|
|
[3] = ClosureFunction 0
|
|
[4] = InstanceField dart:core::_Closure::_context (field)
|
|
[5] = Reserved
|
|
[6] = EndClosureFunctionScope
|
|
[7] = Class dart:core::_Closure
|
|
[8] = InstanceField dart:core::_Closure::_instantiator_type_arguments (field)
|
|
[9] = Reserved
|
|
[10] = InstanceField dart:core::_Closure::_function_type_arguments (field)
|
|
[11] = Reserved
|
|
[12] = EmptyTypeArguments
|
|
[13] = InstanceField dart:core::_Closure::_delayed_type_arguments (field)
|
|
[14] = Reserved
|
|
[15] = InstanceField dart:core::_Closure::_function (field)
|
|
[16] = Reserved
|
|
[17] = InterfaceCall 'dart:core::List::add', ArgDesc num-args 2, num-type-args 0, names []
|
|
[18] = Reserved
|
|
[19] = ClosureFunction 1
|
|
[20] = Type dart:core::int
|
|
[21] = ObjectRef 'ii'
|
|
[22] = SubtypeTestCache
|
|
[23] = EndClosureFunctionScope
|
|
}
|
|
Closure #lib::C::testForLoop::'<anonymous closure>' () -> dart:core::int
|
|
ClosureBytecode {
|
|
EntryFixed 1, 2
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#4
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextVar 1, 0
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextVar 0, 0
|
|
AddInt
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure #lib::C::testForLoop::'<anonymous closure>' (dart:core::int ii) -> dart:core::Null
|
|
ClosureBytecode {
|
|
EntryFixed 2, 3
|
|
CheckStack 0
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#4
|
|
PopLocal r0
|
|
Push FP[-5]
|
|
PushConstant CP#20
|
|
PushNull
|
|
PushNull
|
|
PushConstant CP#21
|
|
AssertAssignable 1, CP#22
|
|
Drop1
|
|
Push r0
|
|
Push FP[-5]
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextVar 0, 0
|
|
AddInt
|
|
StoreContextVar 1, 0
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
] method testForLoop() → void {
|
|
core::int delta = 0;
|
|
core::List<core::Function> getI = <core::Function>[];
|
|
core::List<core::Function> setI = <core::Function>[];
|
|
for (core::int i = 0; i.{core::num::<}(10); i = i.{core::num::+}(1)) {
|
|
[@vm.call-site-attributes.metadata=receiverType:dart.core::List<dart.core::Function>] getI.{core::List::add}(() → core::int => i.{core::num::+}(delta));
|
|
[@vm.call-site-attributes.metadata=receiverType:dart.core::List<dart.core::Function>] setI.{core::List::add}((core::int ii) → core::Null {
|
|
i = ii.{core::num::+}(delta);
|
|
});
|
|
}
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 5
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
InterfaceCall 1, CP#0
|
|
PopLocal r2
|
|
L2:
|
|
CheckStack 1
|
|
Push r2
|
|
InterfaceCall 1, CP#2
|
|
JumpIfFalse L1
|
|
AllocateContext 0, 1
|
|
PopLocal r0
|
|
Push r0
|
|
Push r2
|
|
InterfaceCall 1, CP#4
|
|
StoreContextVar 0, 0
|
|
Allocate CP#10
|
|
StoreLocal r4
|
|
Push r4
|
|
PushNull
|
|
StoreFieldTOS CP#11
|
|
Push r4
|
|
PushNull
|
|
StoreFieldTOS CP#13
|
|
Push r4
|
|
PushConstant CP#15
|
|
StoreFieldTOS CP#16
|
|
Push r4
|
|
PushConstant CP#6
|
|
StoreFieldTOS CP#18
|
|
Push r4
|
|
Push r0
|
|
StoreFieldTOS CP#7
|
|
PopLocal r3
|
|
Push r3
|
|
DynamicCall 1, CP#21
|
|
Drop1
|
|
Push r0
|
|
LoadContextVar 0, 0
|
|
DirectCall 1, CP#22
|
|
Drop1
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
Jump L2
|
|
L1:
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = InterfaceCall 'dart:core::Iterable::get:iterator', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
[2] = InterfaceCall 'dart:core::Iterator::moveNext', ArgDesc num-args 1, num-type-args 0, names []
|
|
[3] = Reserved
|
|
[4] = InterfaceCall 'dart:core::Iterator::get:current', ArgDesc num-args 1, num-type-args 0, names []
|
|
[5] = Reserved
|
|
[6] = ClosureFunction 0
|
|
[7] = InstanceField dart:core::_Closure::_context (field)
|
|
[8] = Reserved
|
|
[9] = EndClosureFunctionScope
|
|
[10] = Class dart:core::_Closure
|
|
[11] = InstanceField dart:core::_Closure::_instantiator_type_arguments (field)
|
|
[12] = Reserved
|
|
[13] = InstanceField dart:core::_Closure::_function_type_arguments (field)
|
|
[14] = Reserved
|
|
[15] = EmptyTypeArguments
|
|
[16] = InstanceField dart:core::_Closure::_delayed_type_arguments (field)
|
|
[17] = Reserved
|
|
[18] = InstanceField dart:core::_Closure::_function (field)
|
|
[19] = Reserved
|
|
[20] = ObjectRef ArgDesc num-args 1, num-type-args 0, names []
|
|
[21] = ICData dynamic target-name 'call', arg-desc CP#20
|
|
[22] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
|
|
[23] = Reserved
|
|
}
|
|
Closure #lib::C::testForInLoop::'<anonymous closure>' () -> dart:core::Null
|
|
ClosureBytecode {
|
|
EntryFixed 1, 3
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#7
|
|
PopLocal r0
|
|
Push r0
|
|
Push r0
|
|
LoadContextVar 0, 0
|
|
PushInt 1
|
|
AddInt
|
|
StoreContextVar 0, 0
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
] method testForInLoop(core::List<core::int> list) → void {
|
|
for (core::int i in list) {
|
|
() → core::Null inc = () → core::Null {
|
|
i = i.{core::num::+}(1);
|
|
};
|
|
[@vm.call-site-attributes.metadata=receiverType:() → dart.core::Null] inc.call();
|
|
core::print(i);
|
|
}
|
|
}
|
|
}
|
|
class D<T extends core::Object = dynamic> extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
DirectCall 1, CP#0
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
] synthetic constructor •() → self::D<self::D::T>
|
|
: super core::Object::•()
|
|
;
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 3
|
|
CheckStack 0
|
|
AllocateContext 0, 1
|
|
PopLocal r0
|
|
Push r0
|
|
Push FP[-5]
|
|
StoreContextVar 0, 0
|
|
Push FP[-5]
|
|
PushConstant CP#0
|
|
Push FP[-6]
|
|
LoadTypeArgumentsField CP#1
|
|
PushNull
|
|
PushConstant CP#2
|
|
AssertAssignable 0, CP#3
|
|
Drop1
|
|
Allocate CP#8
|
|
StoreLocal r2
|
|
Push r2
|
|
Push FP[-6]
|
|
LoadTypeArgumentsField CP#1
|
|
StoreFieldTOS CP#9
|
|
Push r2
|
|
PushNull
|
|
StoreFieldTOS CP#11
|
|
Push r2
|
|
PushConstant CP#13
|
|
StoreFieldTOS CP#14
|
|
Push r2
|
|
PushConstant CP#4
|
|
StoreFieldTOS CP#16
|
|
Push r2
|
|
Push r0
|
|
StoreFieldTOS CP#5
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = Type #lib::D::TypeParam/0
|
|
[1] = TypeArgumentsField #lib::D
|
|
[2] = ObjectRef 't'
|
|
[3] = SubtypeTestCache
|
|
[4] = ClosureFunction 0
|
|
[5] = InstanceField dart:core::_Closure::_context (field)
|
|
[6] = Reserved
|
|
[7] = EndClosureFunctionScope
|
|
[8] = Class dart:core::_Closure
|
|
[9] = InstanceField dart:core::_Closure::_instantiator_type_arguments (field)
|
|
[10] = Reserved
|
|
[11] = InstanceField dart:core::_Closure::_function_type_arguments (field)
|
|
[12] = Reserved
|
|
[13] = EmptyTypeArguments
|
|
[14] = InstanceField dart:core::_Closure::_delayed_type_arguments (field)
|
|
[15] = Reserved
|
|
[16] = InstanceField dart:core::_Closure::_function (field)
|
|
[17] = Reserved
|
|
}
|
|
Closure #lib::D::foo::'<anonymous closure>' () -> #lib::D::TypeParam/0
|
|
ClosureBytecode {
|
|
EntryFixed 1, 2
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#5
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextVar 0, 0
|
|
ReturnTOS
|
|
|
|
}
|
|
] method foo(generic-covariant-impl self::D::T t) → dynamic {
|
|
return () → self::D::T => t;
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 3
|
|
CheckStack 0
|
|
AllocateContext 0, 1
|
|
PopLocal r0
|
|
Push r0
|
|
Push FP[-5]
|
|
StoreContextVar 0, 0
|
|
Allocate CP#5
|
|
StoreLocal r2
|
|
Push r2
|
|
Push FP[-5]
|
|
LoadTypeArgumentsField CP#6
|
|
StoreFieldTOS CP#7
|
|
Push r2
|
|
PushNull
|
|
StoreFieldTOS CP#9
|
|
Push r2
|
|
PushConstant CP#11
|
|
StoreFieldTOS CP#12
|
|
Push r2
|
|
PushConstant CP#0
|
|
StoreFieldTOS CP#14
|
|
Push r2
|
|
Push r0
|
|
StoreFieldTOS CP#1
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ClosureFunction 0
|
|
[1] = InstanceField dart:core::_Closure::_context (field)
|
|
[2] = Reserved
|
|
[3] = ClosureFunction 1
|
|
[4] = EndClosureFunctionScope
|
|
[5] = Class dart:core::_Closure
|
|
[6] = TypeArgumentsField #lib::D
|
|
[7] = InstanceField dart:core::_Closure::_instantiator_type_arguments (field)
|
|
[8] = Reserved
|
|
[9] = InstanceField dart:core::_Closure::_function_type_arguments (field)
|
|
[10] = Reserved
|
|
[11] = EmptyTypeArguments
|
|
[12] = InstanceField dart:core::_Closure::_delayed_type_arguments (field)
|
|
[13] = Reserved
|
|
[14] = InstanceField dart:core::_Closure::_function (field)
|
|
[15] = Reserved
|
|
[16] = ObjectRef ArgDesc num-args 1, num-type-args 0, names []
|
|
[17] = ICData dynamic target-name 'call', arg-desc CP#16
|
|
[18] = EndClosureFunctionScope
|
|
}
|
|
Closure #lib::D::bar::'<anonymous closure>' () -> dart:core::Null
|
|
ClosureBytecode {
|
|
EntryFixed 1, 4
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r0
|
|
Allocate CP#5
|
|
StoreLocal r3
|
|
Push r3
|
|
Push r0
|
|
LoadContextVar 0, 0
|
|
LoadTypeArgumentsField CP#6
|
|
StoreFieldTOS CP#7
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#9
|
|
Push r3
|
|
PushConstant CP#11
|
|
StoreFieldTOS CP#12
|
|
Push r3
|
|
PushConstant CP#3
|
|
StoreFieldTOS CP#14
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#1
|
|
PopLocal r2
|
|
Push r2
|
|
DynamicCall 1, CP#17
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure #lib::D::bar::Closure/0::'inner' () -> dart:core::Null
|
|
ClosureBytecode {
|
|
EntryFixed 1, 2
|
|
CheckStack 0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r0
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
] method bar() → dynamic {
|
|
return () → core::Null {
|
|
function inner() → core::Null {}
|
|
[@vm.call-site-attributes.metadata=receiverType:() → dart.core::Null] inner.call();
|
|
};
|
|
}
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 4
|
|
CheckStack 0
|
|
AllocateContext 0, 1
|
|
PopLocal r0
|
|
Push r0
|
|
PushInt 5
|
|
StoreContextVar 0, 0
|
|
Allocate CP#7
|
|
StoreLocal r3
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#8
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#10
|
|
Push r3
|
|
PushConstant CP#12
|
|
StoreFieldTOS CP#13
|
|
Push r3
|
|
PushConstant CP#0
|
|
StoreFieldTOS CP#15
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#1
|
|
PopLocal r2
|
|
Push r2
|
|
PushInt 3
|
|
DynamicCall 2, CP#18
|
|
Drop1
|
|
Push r0
|
|
LoadContextVar 0, 0
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ClosureFunction 0
|
|
[1] = InstanceField dart:core::_Closure::_context (field)
|
|
[2] = Reserved
|
|
[3] = Type dart:core::int
|
|
[4] = ObjectRef 'y'
|
|
[5] = SubtypeTestCache
|
|
[6] = EndClosureFunctionScope
|
|
[7] = Class dart:core::_Closure
|
|
[8] = InstanceField dart:core::_Closure::_instantiator_type_arguments (field)
|
|
[9] = Reserved
|
|
[10] = InstanceField dart:core::_Closure::_function_type_arguments (field)
|
|
[11] = Reserved
|
|
[12] = EmptyTypeArguments
|
|
[13] = InstanceField dart:core::_Closure::_delayed_type_arguments (field)
|
|
[14] = Reserved
|
|
[15] = InstanceField dart:core::_Closure::_function (field)
|
|
[16] = Reserved
|
|
[17] = ObjectRef ArgDesc num-args 2, num-type-args 0, names []
|
|
[18] = ICData dynamic target-name 'call', arg-desc CP#17
|
|
}
|
|
Closure #lib::simpleClosure::'<anonymous closure>' (dart:core::int y) -> dart:core::Null
|
|
ClosureBytecode {
|
|
EntryFixed 2, 3
|
|
CheckStack 0
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r0
|
|
Push FP[-5]
|
|
PushConstant CP#3
|
|
PushNull
|
|
PushNull
|
|
PushConstant CP#4
|
|
AssertAssignable 1, CP#5
|
|
Drop1
|
|
Push r0
|
|
Push r0
|
|
LoadContextVar 0, 0
|
|
Push FP[-5]
|
|
AddInt
|
|
StoreContextVar 0, 0
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
]static method simpleClosure() → core::int {
|
|
core::int x = 5;
|
|
(core::int) → core::Null inc = (core::int y) → core::Null {
|
|
x = x.{core::num::+}(y);
|
|
};
|
|
[@vm.call-site-attributes.metadata=receiverType:(dart.core::int) → dart.core::Null] inc.call(3);
|
|
return x;
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 2
|
|
CheckStack 0
|
|
CheckFunctionTypeArgs 8, r0
|
|
PushConstant CP#0
|
|
StoreLocal r1
|
|
Push r1
|
|
PushInt 8
|
|
CreateArrayTOS
|
|
StoreLocal r1
|
|
Push r1
|
|
PushInt 0
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#1
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushInt 1
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#2
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushInt 2
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#3
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushInt 3
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#4
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushInt 4
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#5
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushInt 5
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#6
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushInt 6
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#7
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushInt 7
|
|
PushNull
|
|
Push r0
|
|
InstantiateType CP#8
|
|
StoreIndexedTOS
|
|
DirectCall 2, CP#9
|
|
DirectCall 1, CP#11
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ObjectRef < dart:core::Type >
|
|
[1] = Type #lib::callWithArgs::TypeParam/0
|
|
[2] = Type #lib::callWithArgs::TypeParam/1
|
|
[3] = Type #lib::callWithArgs::TypeParam/2
|
|
[4] = Type #lib::callWithArgs::TypeParam/3
|
|
[5] = Type #lib::callWithArgs::TypeParam/4
|
|
[6] = Type #lib::callWithArgs::TypeParam/5
|
|
[7] = Type #lib::callWithArgs::TypeParam/6
|
|
[8] = Type #lib::callWithArgs::TypeParam/7
|
|
[9] = DirectCall 'dart:core::List::_fromLiteral (constructor)', ArgDesc num-args 2, num-type-args 0, names []
|
|
[10] = Reserved
|
|
[11] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
|
|
[12] = Reserved
|
|
}
|
|
]static method callWithArgs<T1 extends core::Object = dynamic, T2 extends core::Object = dynamic, T3 extends core::Object = dynamic, T4 extends core::Object = dynamic, T5 extends core::Object = dynamic, T6 extends core::Object = dynamic, T7 extends core::Object = dynamic, T8 extends core::Object = dynamic>() → void {
|
|
core::print(<core::Type>[self::callWithArgs::T1, self::callWithArgs::T2, self::callWithArgs::T3, self::callWithArgs::T4, self::callWithArgs::T5, self::callWithArgs::T6, self::callWithArgs::T7, self::callWithArgs::T8]);
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 1
|
|
CheckStack 0
|
|
PushConstant CP#0
|
|
PushConstant CP#2
|
|
PushConstant CP#1
|
|
AllocateT
|
|
StoreLocal r0
|
|
Push r0
|
|
DirectCall 1, CP#3
|
|
Drop1
|
|
InterfaceCall 2, CP#5
|
|
Drop1
|
|
PushConstant CP#7
|
|
PushConstant CP#2
|
|
PushConstant CP#1
|
|
AllocateT
|
|
StoreLocal r0
|
|
Push r0
|
|
DirectCall 1, CP#3
|
|
Drop1
|
|
InterfaceCall 2, CP#5
|
|
Drop1
|
|
PushConstant CP#7
|
|
PushConstant CP#8
|
|
PushConstant CP#1
|
|
AllocateT
|
|
StoreLocal r0
|
|
Push r0
|
|
DirectCall 1, CP#3
|
|
Drop1
|
|
InterfaceCall 2, CP#5
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ObjectRef < #lib::C3, #lib::C4 >
|
|
[1] = Class #lib::A
|
|
[2] = ObjectRef < #lib::C1, #lib::C2 >
|
|
[3] = DirectCall '#lib::A:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
|
|
[4] = Reserved
|
|
[5] = InterfaceCall '#lib::A::foo', ArgDesc num-args 1, num-type-args 2, names []
|
|
[6] = Reserved
|
|
[7] = ObjectRef < dart:core::List < #lib::C3 >, dart:core::List < #lib::C4 > >
|
|
[8] = ObjectRef < dart:core::List < #lib::C1 >, dart:core::List < #lib::C2 > >
|
|
}
|
|
]static method callA() → void {
|
|
new self::A::•<self::C1, self::C2>().{self::A::foo}<self::C3, self::C4>();
|
|
new self::A::•<self::C1, self::C2>().{self::A::foo}<core::List<self::C3>, core::List<self::C4>>();
|
|
new self::A::•<core::List<self::C1>, core::List<self::C2>>().{self::A::foo}<core::List<self::C3>, core::List<self::C4>>();
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 7
|
|
CheckStack 0
|
|
Allocate CP#14
|
|
StoreLocal r3
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#15
|
|
Push r3
|
|
PushNull
|
|
StoreFieldTOS CP#6
|
|
Push r3
|
|
PushConstant CP#5
|
|
StoreFieldTOS CP#3
|
|
Push r3
|
|
PushConstant CP#0
|
|
StoreFieldTOS CP#17
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#1
|
|
PopLocal r2
|
|
Push r2
|
|
StoreLocal r3
|
|
PushConstant CP#19
|
|
StoreLocal r6
|
|
DirectCall 2, CP#20
|
|
Drop1
|
|
Allocate CP#14
|
|
StoreLocal r5
|
|
Push r6
|
|
StoreFieldTOS CP#3
|
|
Push r5
|
|
Push r3
|
|
LoadFieldTOS CP#15
|
|
StoreFieldTOS CP#15
|
|
Push r5
|
|
Push r3
|
|
LoadFieldTOS CP#6
|
|
StoreFieldTOS CP#6
|
|
Push r5
|
|
Push r3
|
|
LoadFieldTOS CP#17
|
|
StoreFieldTOS CP#17
|
|
Push r5
|
|
Push r3
|
|
LoadFieldTOS CP#1
|
|
StoreFieldTOS CP#1
|
|
Push r5
|
|
PopLocal r4
|
|
Push r4
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ClosureFunction 0
|
|
[1] = InstanceField dart:core::_Closure::_context (field)
|
|
[2] = Reserved
|
|
[3] = InstanceField dart:core::_Closure::_delayed_type_arguments (field)
|
|
[4] = Reserved
|
|
[5] = EmptyTypeArguments
|
|
[6] = InstanceField dart:core::_Closure::_function_type_arguments (field)
|
|
[7] = Reserved
|
|
[8] = DirectCall 'dart:_internal::_prependTypeArguments', ArgDesc num-args 4, num-type-args 0, names []
|
|
[9] = Reserved
|
|
[10] = Type #lib::testPartialInstantiation::Closure/0::TypeParam/0
|
|
[11] = ObjectRef 't'
|
|
[12] = SubtypeTestCache
|
|
[13] = EndClosureFunctionScope
|
|
[14] = Class dart:core::_Closure
|
|
[15] = InstanceField dart:core::_Closure::_instantiator_type_arguments (field)
|
|
[16] = Reserved
|
|
[17] = InstanceField dart:core::_Closure::_function (field)
|
|
[18] = Reserved
|
|
[19] = ObjectRef < dart:core::int >
|
|
[20] = DirectCall 'dart:_internal::_boundsCheckForPartialInstantiation', ArgDesc num-args 2, num-type-args 0, names []
|
|
[21] = Reserved
|
|
}
|
|
Closure #lib::testPartialInstantiation::'foo' <dart:core::Object T> (#lib::testPartialInstantiation::Closure/0::TypeParam/0 t) -> void
|
|
ClosureBytecode {
|
|
EntryFixed 2, 3
|
|
CheckStack 0
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r1
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#3
|
|
StoreLocal r0
|
|
PushConstant CP#5
|
|
JumpIfEqStrict L1
|
|
CheckFunctionTypeArgs 0, r2
|
|
Jump L2
|
|
L1:
|
|
CheckFunctionTypeArgs 1, r0
|
|
L2:
|
|
Push r0
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#6
|
|
PushInt 0
|
|
PushInt 1
|
|
DirectCall 4, CP#8
|
|
PopLocal r0
|
|
Push FP[-5]
|
|
PushConstant CP#10
|
|
PushNull
|
|
Push r0
|
|
PushConstant CP#11
|
|
AssertAssignable 0, CP#12
|
|
Drop1
|
|
PushNull
|
|
ReturnTOS
|
|
|
|
}
|
|
]static method testPartialInstantiation() → (core::int) → dynamic {
|
|
function foo<T extends core::Object = dynamic>(T t) → void {}
|
|
(core::int) → dynamic intFunc = foo<core::int>;
|
|
return intFunc;
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
}
|
|
]static method main() → dynamic {}
|