0d1abc535b
As TypeArguments == null means 'vector of all dynamic', VM uses special object (Object::empty_type_arguments()) to indicate absence of _Closure._delayed_type_arguments. This CL corrects bytecode to use Object::empty_type_arguments() (via new constant pool entry EmptyTypeArguments) to initialize _Closure._delayed_type_arguments when allocating a closure. Change-Id: I9b00bc0606de85c02350c8eef08d8952c3e224ee Reviewed-on: https://dart-review.googlesource.com/69840 Reviewed-by: Régis Crelier <regis@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
1657 lines
44 KiB
Plaintext
1657 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
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C2 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C3 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C4 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C5 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C6 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C7 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C8 extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class A<T1 extends core::Object = dynamic, T2 extends core::Object = dynamic> extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 5
|
|
CheckStack
|
|
CheckFunctionTypeArgs 2, 0
|
|
AllocateContext 1
|
|
PopLocal r1
|
|
Push r1
|
|
Push FP[-5]
|
|
StoreContextVar 0
|
|
Allocate CP#38
|
|
StoreLocal r4
|
|
Push r4
|
|
Push r1
|
|
LoadContextVar 0
|
|
LoadTypeArgumentsField CP#17
|
|
StoreFieldTOS CP#39
|
|
Push r4
|
|
Push r0
|
|
StoreFieldTOS CP#3
|
|
Push r4
|
|
PushConstant CP#41
|
|
StoreFieldTOS CP#42
|
|
Push r4
|
|
PushConstant CP#0
|
|
StoreFieldTOS CP#44
|
|
Push r4
|
|
Push r1
|
|
StoreFieldTOS CP#1
|
|
PopLocal r3
|
|
PushConstant CP#54
|
|
Push r3
|
|
InstanceCall 2, CP#55
|
|
Drop1
|
|
PushConstant CP#56
|
|
Push r3
|
|
InstanceCall 2, CP#57
|
|
Drop1
|
|
PushConstant CP#18
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ClosureFunction nested1 <T5 extends dart.core::Object = dynamic, T6 extends dart.core::Object = dynamic>() → void;
|
|
[1] = InstanceField dart.core::_Closure::_context
|
|
[2] = Reserved
|
|
[3] = InstanceField dart.core::_Closure::_function_type_arguments
|
|
[4] = Reserved
|
|
[5] = Int 2
|
|
[6] = Int 4
|
|
[7] = ArgDesc num-args 4, num-type-args 0, names []
|
|
[8] = StaticICData target 'dart._internal::_prependTypeArguments', arg-desc CP#7
|
|
[9] = ClosureFunction nested2 <T7 extends dart.core::Object = dynamic, T8 extends dart.core::Object = dynamic>() → void;
|
|
[10] = Int 6
|
|
[11] = StaticICData target 'dart._internal::_prependTypeArguments', arg-desc CP#7
|
|
[12] = ClosureFunction <anonymous closure> () → dart.core::Null;
|
|
[13] = TypeArgs [dart.core::Type]
|
|
[14] = Int 8
|
|
[15] = Int 0
|
|
[16] = Type #lib::A::T1
|
|
[17] = TypeArgumentsField #lib::A
|
|
[18] = Null
|
|
[19] = Int 1
|
|
[20] = Type #lib::A::T2
|
|
[21] = Type #lib::A::foo::T3
|
|
[22] = Int 3
|
|
[23] = Type #lib::A::foo::T4
|
|
[24] = Type T5
|
|
[25] = Int 5
|
|
[26] = Type T6
|
|
[27] = Type T7
|
|
[28] = Int 7
|
|
[29] = Type T8
|
|
[30] = ArgDesc num-args 2, num-type-args 0, names []
|
|
[31] = StaticICData target 'dart.core::List::_fromLiteral', arg-desc CP#30
|
|
[32] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[33] = StaticICData target 'dart.core::print', arg-desc CP#32
|
|
[34] = TypeArgs [#lib::A::T1, #lib::A::T2, #lib::A::foo::T3, #lib::A::foo::T4, T5, T6, T7, T8]
|
|
[35] = ArgDesc num-args 0, num-type-args 8, names []
|
|
[36] = StaticICData target '#lib::callWithArgs', arg-desc CP#35
|
|
[37] = EndClosureFunctionScope
|
|
[38] = Class dart.core::_Closure
|
|
[39] = InstanceField dart.core::_Closure::_instantiator_type_arguments
|
|
[40] = Reserved
|
|
[41] = EmptyTypeArguments
|
|
[42] = InstanceField dart.core::_Closure::_delayed_type_arguments
|
|
[43] = Reserved
|
|
[44] = InstanceField dart.core::_Closure::_function
|
|
[45] = Reserved
|
|
[46] = ICData target-name 'call', arg-desc CP#32
|
|
[47] = EndClosureFunctionScope
|
|
[48] = TypeArgs [#lib::C7, #lib::C8]
|
|
[49] = ArgDesc num-args 1, num-type-args 2, names []
|
|
[50] = ICData target-name 'call', arg-desc CP#49
|
|
[51] = TypeArgs [dart.core::List<#lib::C7>, dart.core::List<#lib::C8>]
|
|
[52] = ICData target-name 'call', arg-desc CP#49
|
|
[53] = EndClosureFunctionScope
|
|
[54] = TypeArgs [#lib::C5, #lib::C6]
|
|
[55] = ICData target-name 'call', arg-desc CP#49
|
|
[56] = TypeArgs [dart.core::List<#lib::C5>, dart.core::List<#lib::C6>]
|
|
[57] = ICData target-name 'call', arg-desc CP#49
|
|
}
|
|
Closure CP#12 {
|
|
Entry 4
|
|
CheckStack
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r1
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#3
|
|
PopLocal r0
|
|
PushConstant CP#13
|
|
StoreLocal r3
|
|
Push r3
|
|
PushConstant CP#14
|
|
CreateArrayTOS
|
|
StoreLocal r3
|
|
Push r3
|
|
PushConstant CP#15
|
|
Push r1
|
|
LoadContextVar 0
|
|
LoadTypeArgumentsField CP#17
|
|
PushConstant CP#18
|
|
InstantiateType CP#16
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushConstant CP#19
|
|
Push r1
|
|
LoadContextVar 0
|
|
LoadTypeArgumentsField CP#17
|
|
PushConstant CP#18
|
|
InstantiateType CP#20
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushConstant CP#5
|
|
PushConstant CP#18
|
|
Push r0
|
|
InstantiateType CP#21
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushConstant CP#22
|
|
PushConstant CP#18
|
|
Push r0
|
|
InstantiateType CP#23
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushConstant CP#6
|
|
PushConstant CP#18
|
|
Push r0
|
|
InstantiateType CP#24
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushConstant CP#25
|
|
PushConstant CP#18
|
|
Push r0
|
|
InstantiateType CP#26
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushConstant CP#10
|
|
PushConstant CP#18
|
|
Push r0
|
|
InstantiateType CP#27
|
|
StoreIndexedTOS
|
|
Push r3
|
|
PushConstant CP#28
|
|
PushConstant CP#18
|
|
Push r0
|
|
InstantiateType CP#29
|
|
StoreIndexedTOS
|
|
PushConstant CP#31
|
|
IndirectStaticCall 2, CP#30
|
|
PushConstant CP#33
|
|
IndirectStaticCall 1, CP#32
|
|
Drop1
|
|
Push r1
|
|
LoadContextVar 0
|
|
LoadTypeArgumentsField CP#17
|
|
Push r0
|
|
InstantiateTypeArgumentsTOS 0, CP#34
|
|
PushConstant CP#36
|
|
IndirectStaticCall 1, CP#35
|
|
Drop1
|
|
PushConstant CP#18
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure CP#9 {
|
|
Entry 5
|
|
CheckStack
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r1
|
|
CheckFunctionTypeArgs 2, 0
|
|
Push r0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#3
|
|
PushConstant CP#6
|
|
PushConstant CP#10
|
|
PushConstant CP#11
|
|
IndirectStaticCall 4, CP#7
|
|
PopLocal r0
|
|
Allocate CP#38
|
|
StoreLocal r4
|
|
Push r4
|
|
Push r1
|
|
LoadContextVar 0
|
|
LoadTypeArgumentsField CP#17
|
|
StoreFieldTOS CP#39
|
|
Push r4
|
|
Push r0
|
|
StoreFieldTOS CP#3
|
|
Push r4
|
|
PushConstant CP#41
|
|
StoreFieldTOS CP#42
|
|
Push r4
|
|
PushConstant CP#12
|
|
StoreFieldTOS CP#44
|
|
Push r4
|
|
Push r1
|
|
StoreFieldTOS CP#1
|
|
PopLocal r3
|
|
Push r3
|
|
InstanceCall 1, CP#46
|
|
Drop1
|
|
PushConstant CP#18
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure CP#0 {
|
|
Entry 5
|
|
CheckStack
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r1
|
|
CheckFunctionTypeArgs 2, 0
|
|
Push r0
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#3
|
|
PushConstant CP#5
|
|
PushConstant CP#6
|
|
PushConstant CP#8
|
|
IndirectStaticCall 4, CP#7
|
|
PopLocal r0
|
|
Allocate CP#38
|
|
StoreLocal r4
|
|
Push r4
|
|
Push r1
|
|
LoadContextVar 0
|
|
LoadTypeArgumentsField CP#17
|
|
StoreFieldTOS CP#39
|
|
Push r4
|
|
Push r0
|
|
StoreFieldTOS CP#3
|
|
Push r4
|
|
PushConstant CP#41
|
|
StoreFieldTOS CP#42
|
|
Push r4
|
|
PushConstant CP#9
|
|
StoreFieldTOS CP#44
|
|
Push r4
|
|
Push r1
|
|
StoreFieldTOS CP#1
|
|
PopLocal r3
|
|
PushConstant CP#48
|
|
Push r3
|
|
InstanceCall 2, CP#50
|
|
Drop1
|
|
PushConstant CP#51
|
|
Push r3
|
|
InstanceCall 2, CP#52
|
|
Drop1
|
|
PushConstant CP#18
|
|
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>();
|
|
};
|
|
nested3.call();
|
|
}
|
|
nested2.call<self::C7, self::C8>();
|
|
nested2.call<core::List<self::C7>, core::List<self::C8>>();
|
|
}
|
|
nested1.call<self::C5, self::C6>();
|
|
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
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 5
|
|
CheckStack
|
|
AllocateContext 1
|
|
PopLocal r0
|
|
Push r0
|
|
Push FP[-5]
|
|
StoreContextVar 0
|
|
AllocateContext 1
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
PushConstant CP#0
|
|
StoreContextVar 0
|
|
AllocateContext 1
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
PushConstant CP#1
|
|
PopLocal r2
|
|
Push r0
|
|
PushConstant CP#2
|
|
StoreContextVar 0
|
|
Allocate CP#22
|
|
StoreLocal r4
|
|
Push r4
|
|
PushConstant CP#6
|
|
StoreFieldTOS CP#23
|
|
Push r4
|
|
PushConstant CP#6
|
|
StoreFieldTOS CP#25
|
|
Push r4
|
|
PushConstant CP#27
|
|
StoreFieldTOS CP#28
|
|
Push r4
|
|
PushConstant CP#3
|
|
StoreFieldTOS CP#30
|
|
Push r4
|
|
Push r0
|
|
StoreFieldTOS CP#4
|
|
PopLocal r3
|
|
Push r3
|
|
PushConstant CP#35
|
|
InstanceCall 2, CP#36
|
|
Drop1
|
|
Push r3
|
|
PushConstant CP#37
|
|
InstanceCall 2, CP#38
|
|
Drop1
|
|
Push r2
|
|
PushConstant CP#39
|
|
IndirectStaticCall 1, CP#18
|
|
Drop1
|
|
Push r0
|
|
LoadContextVar 0
|
|
PushConstant CP#40
|
|
IndirectStaticCall 1, CP#18
|
|
Drop1
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextVar 0
|
|
PushConstant CP#41
|
|
IndirectStaticCall 1, CP#18
|
|
Drop1
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
AllocateContext 1
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
PushConstant CP#42
|
|
StoreContextVar 0
|
|
Allocate CP#22
|
|
StoreLocal r3
|
|
Push r3
|
|
PushConstant CP#6
|
|
StoreFieldTOS CP#23
|
|
Push r3
|
|
PushConstant CP#6
|
|
StoreFieldTOS CP#25
|
|
Push r3
|
|
PushConstant CP#27
|
|
StoreFieldTOS CP#28
|
|
Push r3
|
|
PushConstant CP#43
|
|
StoreFieldTOS CP#30
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#4
|
|
PopLocal r2
|
|
Push r2
|
|
InstanceCall 1, CP#46
|
|
Drop1
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
PushConstant CP#6
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = Int 1
|
|
[1] = Int 2
|
|
[2] = Int 3
|
|
[3] = ClosureFunction <anonymous closure> (dart.core::int y) → dart.core::Null;
|
|
[4] = InstanceField dart.core::_Closure::_context
|
|
[5] = Reserved
|
|
[6] = Null
|
|
[7] = Type dart.core::int
|
|
[8] = String 'y'
|
|
[9] = SubtypeTestCache
|
|
[10] = ArgDesc num-args 2, num-type-args 0, names []
|
|
[11] = ICData target-name '+', arg-desc CP#10
|
|
[12] = Int 5
|
|
[13] = ICData target-name '>', arg-desc CP#10
|
|
[14] = Bool true
|
|
[15] = Int 4
|
|
[16] = ClosureFunction closure2 () → void;
|
|
[17] = ICData target-name '+', arg-desc CP#10
|
|
[18] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[19] = ICData get target-name 'foo', arg-desc CP#18
|
|
[20] = ICData target-name '+', arg-desc CP#10
|
|
[21] = EndClosureFunctionScope
|
|
[22] = Class dart.core::_Closure
|
|
[23] = InstanceField dart.core::_Closure::_instantiator_type_arguments
|
|
[24] = Reserved
|
|
[25] = InstanceField dart.core::_Closure::_function_type_arguments
|
|
[26] = Reserved
|
|
[27] = EmptyTypeArguments
|
|
[28] = InstanceField dart.core::_Closure::_delayed_type_arguments
|
|
[29] = Reserved
|
|
[30] = InstanceField dart.core::_Closure::_function
|
|
[31] = Reserved
|
|
[32] = ICData target-name 'call', arg-desc CP#18
|
|
[33] = StaticICData target 'dart.core::print', arg-desc CP#18
|
|
[34] = EndClosureFunctionScope
|
|
[35] = Int 10
|
|
[36] = ICData target-name 'call', arg-desc CP#10
|
|
[37] = Int 11
|
|
[38] = ICData target-name 'call', arg-desc CP#10
|
|
[39] = StaticICData target 'dart.core::print', arg-desc CP#18
|
|
[40] = StaticICData target 'dart.core::print', arg-desc CP#18
|
|
[41] = StaticICData target 'dart.core::print', arg-desc CP#18
|
|
[42] = Int 42
|
|
[43] = ClosureFunction <anonymous closure> () → dart.core::Null;
|
|
[44] = ICData set target-name 'foo', arg-desc CP#10
|
|
[45] = EndClosureFunctionScope
|
|
[46] = ICData target-name 'call', arg-desc CP#18
|
|
}
|
|
Closure CP#16 {
|
|
Entry 3
|
|
CheckStack
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#4
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextParent
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextParent
|
|
LoadContextParent
|
|
LoadContextVar 0
|
|
PushConstant CP#1
|
|
InstanceCall 2, CP#17
|
|
StoreContextVar 0
|
|
Push r0
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextParent
|
|
LoadContextParent
|
|
LoadContextParent
|
|
LoadContextVar 0
|
|
InstanceCall 1, CP#19
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextVar 0
|
|
InstanceCall 2, CP#20
|
|
StoreContextVar 0
|
|
PushConstant CP#6
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure CP#3 {
|
|
Entry 4
|
|
CheckStack
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#4
|
|
PopLocal r0
|
|
AllocateContext 1
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextParent
|
|
LoadContextParent
|
|
Push FP[-5]
|
|
StoreContextVar 0
|
|
Push r0
|
|
Push FP[-5]
|
|
StoreContextVar 0
|
|
Push FP[-5]
|
|
PushConstant CP#6
|
|
PushConstant CP#6
|
|
PushConstant CP#7
|
|
PushConstant CP#8
|
|
AssertAssignable 1, CP#9
|
|
Drop1
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextParent
|
|
Push r0
|
|
LoadContextVar 0
|
|
PushConstant CP#0
|
|
InstanceCall 2, CP#11
|
|
StoreContextVar 0
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextParent
|
|
LoadContextVar 0
|
|
PushConstant CP#12
|
|
InstanceCall 2, CP#13
|
|
AssertBoolean 0
|
|
PushConstant CP#14
|
|
IfNeStrictTOS
|
|
Jump L1
|
|
AllocateContext 1
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
PushConstant CP#15
|
|
StoreContextVar 0
|
|
Allocate CP#22
|
|
StoreLocal r2
|
|
Push r2
|
|
PushConstant CP#6
|
|
StoreFieldTOS CP#23
|
|
Push r2
|
|
PushConstant CP#6
|
|
StoreFieldTOS CP#25
|
|
Push r2
|
|
PushConstant CP#27
|
|
StoreFieldTOS CP#28
|
|
Push r2
|
|
PushConstant CP#16
|
|
StoreFieldTOS CP#30
|
|
Push r2
|
|
Push r0
|
|
StoreFieldTOS CP#4
|
|
PopLocal r3
|
|
Push r3
|
|
InstanceCall 1, CP#32
|
|
Drop1
|
|
Push r0
|
|
LoadContextVar 0
|
|
PushConstant CP#33
|
|
IndirectStaticCall 1, CP#18
|
|
Drop1
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
L1:
|
|
PushConstant CP#6
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure CP#43 {
|
|
Entry 3
|
|
CheckStack
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#4
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextVar 0
|
|
Push r0
|
|
LoadContextVar 0
|
|
InstanceCall 2, CP#44
|
|
Drop1
|
|
PushConstant CP#6
|
|
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);
|
|
}
|
|
closure2.call();
|
|
core::print(w);
|
|
}
|
|
};
|
|
closure1.call(10);
|
|
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;
|
|
};
|
|
closure3.call();
|
|
}
|
|
}
|
|
}
|
|
class C extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 5
|
|
CheckStack
|
|
AllocateContext 1
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
PushConstant CP#0
|
|
StoreContextVar 0
|
|
PushConstant CP#1
|
|
StoreLocal r3
|
|
Push r3
|
|
PushConstant CP#0
|
|
CreateArrayTOS
|
|
StoreLocal r3
|
|
PushConstant CP#3
|
|
IndirectStaticCall 2, CP#2
|
|
PopLocal r2
|
|
PushConstant CP#1
|
|
StoreLocal r3
|
|
Push r3
|
|
PushConstant CP#0
|
|
CreateArrayTOS
|
|
StoreLocal r3
|
|
PushConstant CP#4
|
|
IndirectStaticCall 2, CP#2
|
|
PopLocal r4
|
|
AllocateContext 1
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
PushConstant CP#0
|
|
StoreContextVar 0
|
|
L2:
|
|
CheckStack
|
|
Push r0
|
|
LoadContextVar 0
|
|
PushConstant CP#5
|
|
InstanceCall 2, CP#6
|
|
AssertBoolean 0
|
|
PushConstant CP#7
|
|
IfNeStrictTOS
|
|
Jump L1
|
|
Push r2
|
|
Allocate CP#14
|
|
StoreLocal r3
|
|
Push r3
|
|
PushConstant CP#12
|
|
StoreFieldTOS CP#15
|
|
Push r3
|
|
PushConstant CP#12
|
|
StoreFieldTOS CP#17
|
|
Push r3
|
|
PushConstant CP#19
|
|
StoreFieldTOS CP#20
|
|
Push r3
|
|
PushConstant CP#8
|
|
StoreFieldTOS CP#22
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#9
|
|
InstanceCall 2, CP#24
|
|
Drop1
|
|
Push r4
|
|
Allocate CP#14
|
|
StoreLocal r3
|
|
Push r3
|
|
PushConstant CP#12
|
|
StoreFieldTOS CP#15
|
|
Push r3
|
|
PushConstant CP#12
|
|
StoreFieldTOS CP#17
|
|
Push r3
|
|
PushConstant CP#19
|
|
StoreFieldTOS CP#20
|
|
Push r3
|
|
PushConstant CP#25
|
|
StoreFieldTOS CP#22
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#9
|
|
InstanceCall 2, CP#31
|
|
Drop1
|
|
Push r0
|
|
CloneContext
|
|
PopLocal r0
|
|
Push r0
|
|
Push r0
|
|
LoadContextVar 0
|
|
PushConstant CP#32
|
|
InstanceCall 2, CP#33
|
|
StoreLocal r3
|
|
StoreContextVar 0
|
|
Push r3
|
|
Drop1
|
|
Jump L2
|
|
L1:
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
PushConstant CP#12
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = Int 0
|
|
[1] = TypeArgs [dart.core::Function]
|
|
[2] = ArgDesc num-args 2, num-type-args 0, names []
|
|
[3] = StaticICData target 'dart.core::List::_fromLiteral', arg-desc CP#2
|
|
[4] = StaticICData target 'dart.core::List::_fromLiteral', arg-desc CP#2
|
|
[5] = Int 10
|
|
[6] = ICData target-name '<', arg-desc CP#2
|
|
[7] = Bool true
|
|
[8] = ClosureFunction <anonymous closure> () → dart.core::int;
|
|
[9] = InstanceField dart.core::_Closure::_context
|
|
[10] = Reserved
|
|
[11] = ICData target-name '+', arg-desc CP#2
|
|
[12] = Null
|
|
[13] = EndClosureFunctionScope
|
|
[14] = Class dart.core::_Closure
|
|
[15] = InstanceField dart.core::_Closure::_instantiator_type_arguments
|
|
[16] = Reserved
|
|
[17] = InstanceField dart.core::_Closure::_function_type_arguments
|
|
[18] = Reserved
|
|
[19] = EmptyTypeArguments
|
|
[20] = InstanceField dart.core::_Closure::_delayed_type_arguments
|
|
[21] = Reserved
|
|
[22] = InstanceField dart.core::_Closure::_function
|
|
[23] = Reserved
|
|
[24] = ICData target-name 'add', arg-desc CP#2
|
|
[25] = ClosureFunction <anonymous closure> (dart.core::int ii) → dart.core::Null;
|
|
[26] = Type dart.core::int
|
|
[27] = String 'ii'
|
|
[28] = SubtypeTestCache
|
|
[29] = ICData target-name '+', arg-desc CP#2
|
|
[30] = EndClosureFunctionScope
|
|
[31] = ICData target-name 'add', arg-desc CP#2
|
|
[32] = Int 1
|
|
[33] = ICData target-name '+', arg-desc CP#2
|
|
}
|
|
Closure CP#8 {
|
|
Entry 2
|
|
CheckStack
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#9
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextVar 0
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextVar 0
|
|
InstanceCall 2, CP#11
|
|
ReturnTOS
|
|
PushConstant CP#12
|
|
ReturnTOS
|
|
|
|
}
|
|
|
|
Closure CP#25 {
|
|
Entry 3
|
|
CheckStack
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#9
|
|
PopLocal r0
|
|
Push FP[-5]
|
|
PushConstant CP#12
|
|
PushConstant CP#12
|
|
PushConstant CP#26
|
|
PushConstant CP#27
|
|
AssertAssignable 1, CP#28
|
|
Drop1
|
|
Push r0
|
|
Push FP[-5]
|
|
Push r0
|
|
LoadContextParent
|
|
LoadContextVar 0
|
|
InstanceCall 2, CP#29
|
|
StoreContextVar 0
|
|
PushConstant CP#12
|
|
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)) {
|
|
getI.{core::List::add}(() → core::int => i.{core::num::+}(delta));
|
|
setI.{core::List::add}((core::int ii) → core::Null {
|
|
i = ii.{core::num::+}(delta);
|
|
});
|
|
}
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 5
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#0
|
|
PushConstant CP#0
|
|
PushConstant CP#1
|
|
PushConstant CP#2
|
|
AssertAssignable 0, CP#3
|
|
Drop1
|
|
Push FP[-5]
|
|
InstanceCall 1, CP#5
|
|
PopLocal r2
|
|
L2:
|
|
CheckStack
|
|
Push r2
|
|
InstanceCall 1, CP#6
|
|
PushConstant CP#7
|
|
IfNeStrictTOS
|
|
Jump L1
|
|
AllocateContext 1
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
Push r2
|
|
InstanceCall 1, CP#8
|
|
StoreContextVar 0
|
|
Allocate CP#16
|
|
StoreLocal r4
|
|
Push r4
|
|
PushConstant CP#0
|
|
StoreFieldTOS CP#17
|
|
Push r4
|
|
PushConstant CP#0
|
|
StoreFieldTOS CP#19
|
|
Push r4
|
|
PushConstant CP#21
|
|
StoreFieldTOS CP#22
|
|
Push r4
|
|
PushConstant CP#9
|
|
StoreFieldTOS CP#24
|
|
Push r4
|
|
Push r0
|
|
StoreFieldTOS CP#10
|
|
PopLocal r3
|
|
Push r3
|
|
InstanceCall 1, CP#26
|
|
Drop1
|
|
Push r0
|
|
LoadContextVar 0
|
|
PushConstant CP#27
|
|
IndirectStaticCall 1, CP#4
|
|
Drop1
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
Jump L2
|
|
L1:
|
|
PushConstant CP#0
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = Null
|
|
[1] = Type dart.core::List<dart.core::int>
|
|
[2] = String 'list'
|
|
[3] = SubtypeTestCache
|
|
[4] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[5] = ICData get target-name 'iterator', arg-desc CP#4
|
|
[6] = ICData target-name 'moveNext', arg-desc CP#4
|
|
[7] = Bool true
|
|
[8] = ICData get target-name 'current', arg-desc CP#4
|
|
[9] = ClosureFunction <anonymous closure> () → dart.core::Null;
|
|
[10] = InstanceField dart.core::_Closure::_context
|
|
[11] = Reserved
|
|
[12] = Int 1
|
|
[13] = ArgDesc num-args 2, num-type-args 0, names []
|
|
[14] = ICData target-name '+', arg-desc CP#13
|
|
[15] = EndClosureFunctionScope
|
|
[16] = Class dart.core::_Closure
|
|
[17] = InstanceField dart.core::_Closure::_instantiator_type_arguments
|
|
[18] = Reserved
|
|
[19] = InstanceField dart.core::_Closure::_function_type_arguments
|
|
[20] = Reserved
|
|
[21] = EmptyTypeArguments
|
|
[22] = InstanceField dart.core::_Closure::_delayed_type_arguments
|
|
[23] = Reserved
|
|
[24] = InstanceField dart.core::_Closure::_function
|
|
[25] = Reserved
|
|
[26] = ICData target-name 'call', arg-desc CP#4
|
|
[27] = StaticICData target 'dart.core::print', arg-desc CP#4
|
|
}
|
|
Closure CP#9 {
|
|
Entry 3
|
|
CheckStack
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#10
|
|
PopLocal r0
|
|
Push r0
|
|
Push r0
|
|
LoadContextVar 0
|
|
PushConstant CP#12
|
|
InstanceCall 2, CP#14
|
|
StoreContextVar 0
|
|
PushConstant CP#0
|
|
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);
|
|
};
|
|
inc.call();
|
|
core::print(i);
|
|
}
|
|
}
|
|
}
|
|
class D<T extends core::Object = dynamic> extends core::Object {
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack
|
|
Push FP[-5]
|
|
PushConstant CP#1
|
|
IndirectStaticCall 1, CP#0
|
|
Drop1
|
|
PushConstant CP#2
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
|
|
[2] = Null
|
|
}
|
|
] synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 3
|
|
CheckStack
|
|
AllocateContext 1
|
|
PopLocal r0
|
|
Push r0
|
|
Push FP[-5]
|
|
StoreContextVar 0
|
|
Push FP[-5]
|
|
Push FP[-6]
|
|
LoadTypeArgumentsField CP#0
|
|
PushConstant CP#1
|
|
PushConstant CP#2
|
|
PushConstant CP#3
|
|
AssertAssignable 0, CP#4
|
|
Drop1
|
|
Allocate CP#9
|
|
StoreLocal r2
|
|
Push r2
|
|
Push FP[-6]
|
|
LoadTypeArgumentsField CP#0
|
|
StoreFieldTOS CP#10
|
|
Push r2
|
|
PushConstant CP#1
|
|
StoreFieldTOS CP#12
|
|
Push r2
|
|
PushConstant CP#14
|
|
StoreFieldTOS CP#15
|
|
Push r2
|
|
PushConstant CP#5
|
|
StoreFieldTOS CP#17
|
|
Push r2
|
|
Push r0
|
|
StoreFieldTOS CP#6
|
|
ReturnTOS
|
|
PushConstant CP#1
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = TypeArgumentsField #lib::D
|
|
[1] = Null
|
|
[2] = Type #lib::D::T
|
|
[3] = String 't'
|
|
[4] = SubtypeTestCache
|
|
[5] = ClosureFunction <anonymous closure> () → #lib::D::T;
|
|
[6] = InstanceField dart.core::_Closure::_context
|
|
[7] = Reserved
|
|
[8] = EndClosureFunctionScope
|
|
[9] = Class dart.core::_Closure
|
|
[10] = InstanceField dart.core::_Closure::_instantiator_type_arguments
|
|
[11] = Reserved
|
|
[12] = InstanceField dart.core::_Closure::_function_type_arguments
|
|
[13] = Reserved
|
|
[14] = EmptyTypeArguments
|
|
[15] = InstanceField dart.core::_Closure::_delayed_type_arguments
|
|
[16] = Reserved
|
|
[17] = InstanceField dart.core::_Closure::_function
|
|
[18] = Reserved
|
|
}
|
|
Closure CP#5 {
|
|
Entry 2
|
|
CheckStack
|
|
Push FP[-5]
|
|
LoadFieldTOS CP#6
|
|
PopLocal r0
|
|
Push r0
|
|
LoadContextVar 0
|
|
ReturnTOS
|
|
PushConstant CP#1
|
|
ReturnTOS
|
|
|
|
}
|
|
] method foo(generic-covariant-impl self::D::T t) → dynamic {
|
|
return () → self::D::T => t;
|
|
}
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 4
|
|
CheckStack
|
|
AllocateContext 1
|
|
StoreLocal r1
|
|
Push r1
|
|
Push r0
|
|
StoreContextParent
|
|
PopLocal r0
|
|
Push r0
|
|
PushConstant CP#0
|
|
StoreContextVar 0
|
|
Allocate CP#11
|
|
StoreLocal r3
|
|
Push r3
|
|
PushConstant CP#4
|
|
StoreFieldTOS CP#12
|
|
Push r3
|
|
PushConstant CP#4
|
|
StoreFieldTOS CP#14
|
|
Push r3
|
|
PushConstant CP#16
|
|
StoreFieldTOS CP#17
|
|
Push r3
|
|
PushConstant CP#1
|
|
StoreFieldTOS CP#19
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#2
|
|
PopLocal r2
|
|
Push r2
|
|
PushConstant CP#21
|
|
InstanceCall 2, CP#22
|
|
Drop1
|
|
Push r0
|
|
LoadContextVar 0
|
|
ReturnTOS
|
|
Push r0
|
|
LoadContextParent
|
|
PopLocal r0
|
|
PushConstant CP#4
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = Int 5
|
|
[1] = ClosureFunction <anonymous closure> (dart.core::int y) → dart.core::Null;
|
|
[2] = InstanceField dart.core::_Closure::_context
|
|
[3] = Reserved
|
|
[4] = Null
|
|
[5] = Type dart.core::int
|
|
[6] = String 'y'
|
|
[7] = SubtypeTestCache
|
|
[8] = ArgDesc num-args 2, num-type-args 0, names []
|
|
[9] = ICData target-name '+', arg-desc CP#8
|
|
[10] = EndClosureFunctionScope
|
|
[11] = Class dart.core::_Closure
|
|
[12] = InstanceField dart.core::_Closure::_instantiator_type_arguments
|
|
[13] = Reserved
|
|
[14] = InstanceField dart.core::_Closure::_function_type_arguments
|
|
[15] = Reserved
|
|
[16] = EmptyTypeArguments
|
|
[17] = InstanceField dart.core::_Closure::_delayed_type_arguments
|
|
[18] = Reserved
|
|
[19] = InstanceField dart.core::_Closure::_function
|
|
[20] = Reserved
|
|
[21] = Int 3
|
|
[22] = ICData target-name 'call', arg-desc CP#8
|
|
}
|
|
Closure CP#1 {
|
|
Entry 3
|
|
CheckStack
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#2
|
|
PopLocal r0
|
|
Push FP[-5]
|
|
PushConstant CP#4
|
|
PushConstant CP#4
|
|
PushConstant CP#5
|
|
PushConstant CP#6
|
|
AssertAssignable 1, CP#7
|
|
Drop1
|
|
Push r0
|
|
Push r0
|
|
LoadContextVar 0
|
|
Push FP[-5]
|
|
InstanceCall 2, CP#9
|
|
StoreContextVar 0
|
|
PushConstant CP#4
|
|
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);
|
|
};
|
|
inc.call(3);
|
|
return x;
|
|
}
|
|
[@vm.bytecode=
|
|
Bytecode {
|
|
Entry 2
|
|
CheckStack
|
|
CheckFunctionTypeArgs 8, 0
|
|
PushConstant CP#0
|
|
StoreLocal r1
|
|
Push r1
|
|
PushConstant CP#1
|
|
CreateArrayTOS
|
|
StoreLocal r1
|
|
Push r1
|
|
PushConstant CP#2
|
|
PushConstant CP#4
|
|
Push r0
|
|
InstantiateType CP#3
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushConstant CP#5
|
|
PushConstant CP#4
|
|
Push r0
|
|
InstantiateType CP#6
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushConstant CP#7
|
|
PushConstant CP#4
|
|
Push r0
|
|
InstantiateType CP#8
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushConstant CP#9
|
|
PushConstant CP#4
|
|
Push r0
|
|
InstantiateType CP#10
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushConstant CP#11
|
|
PushConstant CP#4
|
|
Push r0
|
|
InstantiateType CP#12
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushConstant CP#13
|
|
PushConstant CP#4
|
|
Push r0
|
|
InstantiateType CP#14
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushConstant CP#15
|
|
PushConstant CP#4
|
|
Push r0
|
|
InstantiateType CP#16
|
|
StoreIndexedTOS
|
|
Push r1
|
|
PushConstant CP#17
|
|
PushConstant CP#4
|
|
Push r0
|
|
InstantiateType CP#18
|
|
StoreIndexedTOS
|
|
PushConstant CP#20
|
|
IndirectStaticCall 2, CP#19
|
|
PushConstant CP#22
|
|
IndirectStaticCall 1, CP#21
|
|
Drop1
|
|
PushConstant CP#4
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = TypeArgs [dart.core::Type]
|
|
[1] = Int 8
|
|
[2] = Int 0
|
|
[3] = Type #lib::callWithArgs::T1
|
|
[4] = Null
|
|
[5] = Int 1
|
|
[6] = Type #lib::callWithArgs::T2
|
|
[7] = Int 2
|
|
[8] = Type #lib::callWithArgs::T3
|
|
[9] = Int 3
|
|
[10] = Type #lib::callWithArgs::T4
|
|
[11] = Int 4
|
|
[12] = Type #lib::callWithArgs::T5
|
|
[13] = Int 5
|
|
[14] = Type #lib::callWithArgs::T6
|
|
[15] = Int 6
|
|
[16] = Type #lib::callWithArgs::T7
|
|
[17] = Int 7
|
|
[18] = Type #lib::callWithArgs::T8
|
|
[19] = ArgDesc num-args 2, num-type-args 0, names []
|
|
[20] = StaticICData target 'dart.core::List::_fromLiteral', arg-desc CP#19
|
|
[21] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[22] = StaticICData target 'dart.core::print', arg-desc CP#21
|
|
}
|
|
]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
|
|
PushConstant CP#0
|
|
PushConstant CP#2
|
|
PushConstant CP#1
|
|
AllocateT
|
|
StoreLocal r0
|
|
Push r0
|
|
PushConstant CP#4
|
|
IndirectStaticCall 1, CP#3
|
|
Drop1
|
|
InstanceCall 2, CP#6
|
|
Drop1
|
|
PushConstant CP#7
|
|
PushConstant CP#2
|
|
PushConstant CP#1
|
|
AllocateT
|
|
StoreLocal r0
|
|
Push r0
|
|
PushConstant CP#8
|
|
IndirectStaticCall 1, CP#3
|
|
Drop1
|
|
InstanceCall 2, CP#9
|
|
Drop1
|
|
PushConstant CP#7
|
|
PushConstant CP#10
|
|
PushConstant CP#1
|
|
AllocateT
|
|
StoreLocal r0
|
|
Push r0
|
|
PushConstant CP#11
|
|
IndirectStaticCall 1, CP#3
|
|
Drop1
|
|
InstanceCall 2, CP#12
|
|
Drop1
|
|
PushConstant CP#13
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = TypeArgs [#lib::C3, #lib::C4]
|
|
[1] = Class #lib::A
|
|
[2] = TypeArgumentsForInstanceAllocation #lib::A [#lib::C1, #lib::C2]
|
|
[3] = ArgDesc num-args 1, num-type-args 0, names []
|
|
[4] = StaticICData target '#lib::A::', arg-desc CP#3
|
|
[5] = ArgDesc num-args 1, num-type-args 2, names []
|
|
[6] = ICData target-name 'foo', arg-desc CP#5
|
|
[7] = TypeArgs [dart.core::List<#lib::C3>, dart.core::List<#lib::C4>]
|
|
[8] = StaticICData target '#lib::A::', arg-desc CP#3
|
|
[9] = ICData target-name 'foo', arg-desc CP#5
|
|
[10] = TypeArgumentsForInstanceAllocation #lib::A [dart.core::List<#lib::C1>, dart.core::List<#lib::C2>]
|
|
[11] = StaticICData target '#lib::A::', arg-desc CP#3
|
|
[12] = ICData target-name 'foo', arg-desc CP#5
|
|
[13] = Null
|
|
}
|
|
]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 6
|
|
CheckStack
|
|
Allocate CP#14
|
|
StoreLocal r3
|
|
Push r3
|
|
PushConstant CP#9
|
|
StoreFieldTOS CP#15
|
|
Push r3
|
|
PushConstant CP#9
|
|
StoreFieldTOS CP#3
|
|
Push r3
|
|
PushConstant CP#17
|
|
StoreFieldTOS CP#18
|
|
Push r3
|
|
PushConstant CP#0
|
|
StoreFieldTOS CP#20
|
|
Push r3
|
|
Push r0
|
|
StoreFieldTOS CP#1
|
|
PopLocal r2
|
|
Push r2
|
|
PopLocal r3
|
|
Allocate CP#14
|
|
StoreLocal r5
|
|
PushConstant CP#22
|
|
StoreFieldTOS CP#18
|
|
Push r5
|
|
Push r3
|
|
LoadFieldTOS CP#15
|
|
StoreFieldTOS CP#15
|
|
Push r5
|
|
Push r3
|
|
LoadFieldTOS CP#3
|
|
StoreFieldTOS CP#3
|
|
Push r5
|
|
Push r3
|
|
LoadFieldTOS CP#20
|
|
StoreFieldTOS CP#20
|
|
Push r5
|
|
Push r3
|
|
LoadFieldTOS CP#1
|
|
StoreFieldTOS CP#1
|
|
Push r5
|
|
PopLocal r4
|
|
Push r4
|
|
ReturnTOS
|
|
PushConstant CP#9
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ClosureFunction foo <T extends dart.core::Object = dynamic>(T t) → void;
|
|
[1] = InstanceField dart.core::_Closure::_context
|
|
[2] = Reserved
|
|
[3] = InstanceField dart.core::_Closure::_function_type_arguments
|
|
[4] = Reserved
|
|
[5] = Int 0
|
|
[6] = Int 1
|
|
[7] = ArgDesc num-args 4, num-type-args 0, names []
|
|
[8] = StaticICData target 'dart._internal::_prependTypeArguments', arg-desc CP#7
|
|
[9] = Null
|
|
[10] = Type T
|
|
[11] = String 't'
|
|
[12] = SubtypeTestCache
|
|
[13] = EndClosureFunctionScope
|
|
[14] = Class dart.core::_Closure
|
|
[15] = InstanceField dart.core::_Closure::_instantiator_type_arguments
|
|
[16] = Reserved
|
|
[17] = EmptyTypeArguments
|
|
[18] = InstanceField dart.core::_Closure::_delayed_type_arguments
|
|
[19] = Reserved
|
|
[20] = InstanceField dart.core::_Closure::_function
|
|
[21] = Reserved
|
|
[22] = TypeArgs [dart.core::int]
|
|
}
|
|
Closure CP#0 {
|
|
Entry 3
|
|
CheckStack
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#1
|
|
PopLocal r1
|
|
CheckFunctionTypeArgs 1, 0
|
|
Push r0
|
|
Push FP[-6]
|
|
LoadFieldTOS CP#3
|
|
PushConstant CP#5
|
|
PushConstant CP#6
|
|
PushConstant CP#8
|
|
IndirectStaticCall 4, CP#7
|
|
PopLocal r0
|
|
Push FP[-5]
|
|
PushConstant CP#9
|
|
Push r0
|
|
PushConstant CP#10
|
|
PushConstant CP#11
|
|
AssertAssignable 0, CP#12
|
|
Drop1
|
|
PushConstant CP#9
|
|
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
|
|
PushConstant CP#0
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = Null
|
|
}
|
|
]static method main() → dynamic {}
|