blob: c718bdb788fb616141a06b2091c8ff9e381f2284 [file] [log] [blame]
library #lib;
import self as self;
import "dart:core" as core;
class A<T extends core::Object = dynamic> extends core::Object {
[@vm.bytecode=
Bytecode (version: stable) {
Entry 0
CheckStack
Push FP[-5]
PushConstant CP#1
IndirectStaticCall 1, CP#0
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = ArgDesc num-args 1, num-type-args 0, names []
[1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
}
] synthetic constructor •() self::A<self::A::T>
: super core::Object::•()
;
}
class B extends self::A<core::String> {
[@vm.bytecode=
Bytecode (version: stable) {
Entry 0
CheckStack
Push FP[-5]
PushConstant CP#1
IndirectStaticCall 1, CP#0
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = ArgDesc num-args 1, num-type-args 0, names []
[1] = StaticICData target '#lib::A::', arg-desc CP#0
}
] synthetic constructor •() self::B
: super self::A::•()
;
}
class C<T1 extends core::Object = dynamic, T2 extends core::Object = dynamic, T3 extends core::Object = dynamic> extends self::B {
[@vm.bytecode=
Bytecode (version: stable) {
Entry 0
CheckStack
Push FP[-5]
PushConstant CP#1
IndirectStaticCall 1, CP#0
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = ArgDesc num-args 1, num-type-args 0, names []
[1] = StaticICData target '#lib::B::', arg-desc CP#0
}
] synthetic constructor •() self::C<self::C::T1, self::C::T2, self::C::T3>
: super self::B::•()
;
}
class D<P extends core::Object = dynamic, Q extends core::Object = dynamic> extends self::C<core::int, self::D::Q, self::D::P> {
generic-covariant-impl field core::Map<self::D::P, self::D::Q> foo;
[@vm.bytecode=
Bytecode (version: stable) {
Entry 0
CheckStack
Push FP[-6]
Push FP[-5]
PushConstant CP#0
Push FP[-6]
LoadTypeArgumentsField CP#1
PushNull
PushConstant CP#2
AssertAssignable 0, CP#3
StoreFieldTOS CP#4
Push FP[-6]
PushConstant CP#7
IndirectStaticCall 1, CP#6
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = Type dart.core::Map<#lib::D::P, #lib::D::Q>
[1] = TypeArgumentsField #lib::D
[2] = String ''
[3] = SubtypeTestCache
[4] = InstanceField #lib::D::foo
[5] = Reserved
[6] = ArgDesc num-args 1, num-type-args 0, names []
[7] = StaticICData target '#lib::C::', arg-desc CP#6
}
] constructor •(dynamic tt) self::D<self::D::P, self::D::Q>
: self::D::foo = tt as{TypeError} core::Map<self::D::P, self::D::Q>, super self::C::•()
;
[@vm.bytecode=
Bytecode (version: stable) {
Entry 1
CheckStack
Push FP[-5]
Push FP[-6]
LoadTypeArgumentsField CP#0
PushNull
PushConstant CP#1
InstanceCall 4, CP#3
AssertBoolean 0
JumpIfFalse L1
PushConstant CP#4
PushConstant CP#6
IndirectStaticCall 1, CP#5
Drop1
L1:
Push FP[-5]
Push FP[-6]
LoadTypeArgumentsField CP#0
PushNull
PushConstant CP#7
InstanceCall 4, CP#8
AssertBoolean 0
JumpIfFalse L2
PushConstant CP#9
PushConstant CP#10
IndirectStaticCall 1, CP#5
Drop1
L2:
Push FP[-6]
Push FP[-5]
PushConstant CP#11
Push FP[-6]
LoadTypeArgumentsField CP#0
PushNull
PushConstant CP#12
AssertAssignable 0, CP#13
InstanceCall 2, CP#15
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = TypeArgumentsField #lib::D
[1] = Type #lib::A<#lib::D::P>
[2] = ArgDesc num-args 4, num-type-args 0, names []
[3] = ICData target-name 'dart.core::_instanceOf', arg-desc CP#2
[4] = String '21'
[5] = ArgDesc num-args 1, num-type-args 0, names []
[6] = StaticICData target 'dart.core::print', arg-desc CP#5
[7] = Type #lib::C<dynamic, #lib::D::Q, dart.core::List<#lib::D::P>>
[8] = ICData target-name 'dart.core::_instanceOf', arg-desc CP#2
[9] = String '22'
[10] = StaticICData target 'dart.core::print', arg-desc CP#5
[11] = Type dart.core::Map<#lib::D::P, #lib::D::Q>
[12] = String ''
[13] = SubtypeTestCache
[14] = ArgDesc num-args 2, num-type-args 0, names []
[15] = ICData set target-name 'foo', arg-desc CP#14
}
] method foo2(dynamic y) dynamic {
if(y is self::A<self::D::P>) {
core::print("21");
}
if(y is self::C<dynamic, self::D::Q, core::List<self::D::P>>) {
core::print("22");
}
[@vm.call-site-attributes.metadata=receiverType:#lib::D<#lib::D::P, #lib::D::Q>] this.{self::D::foo} = y as{TypeError} core::Map<self::D::P, self::D::Q>;
}
[@vm.bytecode=
Bytecode (version: stable) {
Entry 1
CheckStack
CheckFunctionTypeArgs 2, 0
Push FP[-5]
PushNull
Push r0
PushConstant CP#0
InstanceCall 4, CP#2
AssertBoolean 0
JumpIfFalse L1
PushConstant CP#3
PushConstant CP#5
IndirectStaticCall 1, CP#4
Drop1
L1:
Push FP[-5]
Push FP[-6]
LoadTypeArgumentsField CP#6
Push r0
PushConstant CP#7
InstanceCall 4, CP#8
AssertBoolean 0
JumpIfFalse L2
PushConstant CP#9
PushConstant CP#10
IndirectStaticCall 1, CP#4
Drop1
L2:
Push FP[-5]
PushConstant CP#11
Push FP[-6]
LoadTypeArgumentsField CP#6
Push r0
PushConstant CP#12
AssertAssignable 0, CP#13
InstanceCall 1, CP#14
ReturnTOS
PushNull
ReturnTOS
}
ConstantPool {
[0] = Type #lib::A<#lib::D::foo3::T1>
[1] = ArgDesc num-args 4, num-type-args 0, names []
[2] = ICData target-name 'dart.core::_instanceOf', arg-desc CP#1
[3] = String '31'
[4] = ArgDesc num-args 1, num-type-args 0, names []
[5] = StaticICData target 'dart.core::print', arg-desc CP#4
[6] = TypeArgumentsField #lib::D
[7] = Type #lib::C<dart.core::Map<#lib::D::foo3::T1, #lib::D::P>, dart.core::List<#lib::D::foo3::T2>, #lib::D::Q>
[8] = ICData target-name 'dart.core::_instanceOf', arg-desc CP#1
[9] = String '32'
[10] = StaticICData target 'dart.core::print', arg-desc CP#4
[11] = Type dart.core::Map<#lib::D::foo3::T2, #lib::D::Q>
[12] = String ' in type cast'
[13] = SubtypeTestCache
[14] = ICData get target-name 'values', arg-desc CP#4
}
] method foo3<T1 extends core::Object = dynamic, T2 extends core::Object = dynamic>(dynamic z) dynamic {
if(z is self::A<self::D::foo3::T1>) {
core::print("31");
}
if(z is self::C<core::Map<self::D::foo3::T1, self::D::P>, core::List<self::D::foo3::T2>, self::D::Q>) {
core::print("32");
}
return (z as core::Map<self::D::foo3::T2, self::D::Q>).{core::Map::values};
}
[@vm.bytecode=
Bytecode (version: stable) {
Entry 2
CheckStack
Push FP[-6]
LoadTypeArgumentsField CP#0
PushNull
InstantiateTypeArgumentsTOS 0, CP#1
StoreLocal r1
Push r1
PushInt 1
CreateArrayTOS
StoreLocal r1
Push r1
PushInt 0
Push FP[-5]
PushConstant CP#2
Push FP[-6]
LoadTypeArgumentsField CP#0
PushNull
PushConstant CP#3
AssertAssignable 0, CP#4
StoreIndexedTOS
PushConstant CP#6
IndirectStaticCall 2, CP#5
PopLocal r0
Push FP[-5]
PushConstant CP#2
Push FP[-6]
LoadTypeArgumentsField CP#0
PushNull
PushConstant CP#3
AssertAssignable 0, CP#7
ReturnTOS
PushNull
ReturnTOS
}
ConstantPool {
[0] = TypeArgumentsField #lib::D
[1] = TypeArgs [dart.core::Map<#lib::D::P, #lib::D::Q>]
[2] = Type dart.core::Map<#lib::D::P, #lib::D::Q>
[3] = String ''
[4] = SubtypeTestCache
[5] = ArgDesc num-args 2, num-type-args 0, names []
[6] = StaticICData target 'dart.core::List::_fromLiteral', arg-desc CP#5
[7] = SubtypeTestCache
}
] method foo4(dynamic w) core::Map<self::D::P, self::D::Q> {
core::List<core::Map<self::D::P, self::D::Q>> list = <core::Map<self::D::P, self::D::Q>>[w as{TypeError} core::Map<self::D::P, self::D::Q>];
return w as{TypeError} core::Map<self::D::P, self::D::Q>;
}
}
class E<P extends core::String = core::String> extends core::Object {
[@vm.bytecode=
Bytecode (version: stable) {
Entry 0
CheckStack
PushNull
ReturnTOS
PushNull
ReturnTOS
}
ConstantPool {
}
] static factory •<P extends core::String = dynamic>() self::E<self::E::•::P>
return null;
[@vm.bytecode=
Bytecode (version: stable) {
Entry 1
CheckStack
CheckFunctionTypeArgs 2, 0
JumpIfNotZeroTypeArgs L1
Push FP[-6]
LoadTypeArgumentsField CP#0
PushNull
InstantiateTypeArgumentsTOS 0, CP#1
PopLocal r0
L1:
Push FP[-6]
LoadTypeArgumentsField CP#0
Push r0
PushConstant CP#2
PushConstant CP#3
PushConstant CP#4
AssertSubtype
PushNull
ReturnTOS
}
ConstantPool {
[0] = TypeArgumentsField #lib::E
[1] = TypeArgs [#lib::E::P, dart.core::List<#lib::E::P>]
[2] = Type #lib::E::foo6::T
[3] = Type #lib::E::P
[4] = String 'T'
}
] method foo6<generic-covariant-impl T extends self::E::P = self::E::P, U extends core::List<self::E::foo6::T> = core::List<self::E::P>>(core::Map<self::E::foo6::T, self::E::foo6::U> map) void {}
}
static field core::List<core::Iterable<dynamic>> globalVar;
[@vm.bytecode=
Bytecode (version: stable) {
Entry 0
CheckStack
Push FP[-5]
PushConstant CP#0
InstanceCall 2, CP#2
AssertBoolean 0
JumpIfFalse L1
PushConstant CP#3
PushConstant CP#5
IndirectStaticCall 1, CP#4
Drop1
L1:
Push FP[-5]
PushNull
PushNull
PushConstant CP#6
InstanceCall 4, CP#8
AssertBoolean 0
JumpIfFalse L2
PushConstant CP#9
PushConstant CP#10
IndirectStaticCall 1, CP#4
Drop1
L2:
Push FP[-5]
PushConstant CP#11
PushNull
PushNull
PushConstant CP#12
AssertAssignable 0, CP#13
ReturnTOS
PushNull
ReturnTOS
}
ConstantPool {
[0] = Type #lib::B
[1] = ArgDesc num-args 2, num-type-args 0, names []
[2] = ICData target-name 'dart.core::_simpleInstanceOf', arg-desc CP#1
[3] = String '11'
[4] = ArgDesc num-args 1, num-type-args 0, names []
[5] = StaticICData target 'dart.core::print', arg-desc CP#4
[6] = Type #lib::C<dart.core::int, dart.core::Object, dynamic>
[7] = ArgDesc num-args 4, num-type-args 0, names []
[8] = ICData target-name 'dart.core::_instanceOf', arg-desc CP#7
[9] = String '12'
[10] = StaticICData target 'dart.core::print', arg-desc CP#4
[11] = Type #lib::A<dart.core::int>
[12] = String ' in type cast'
[13] = SubtypeTestCache
}
]static method foo1(dynamic x) dynamic {
if(x is self::B) {
core::print("11");
}
if(x is self::C<core::int, core::Object, dynamic>) {
core::print("12");
}
return x as self::A<core::int>;
}
[@vm.bytecode=
Bytecode (version: stable) {
Entry 1
CheckStack
Push FP[-5]
PushConstant CP#0
PushNull
PushNull
PushConstant CP#1
AssertAssignable 0, CP#2
StoreStaticTOS CP#3
PushNull
ReturnTOS
}
ConstantPool {
[0] = Type dart.core::List<dart.core::Iterable<dynamic>>
[1] = String ''
[2] = SubtypeTestCache
[3] = StaticField #lib::globalVar
}
]static method foo5(dynamic x) void {
self::globalVar = x as{TypeError} core::List<core::Iterable<dynamic>>;
}
[@vm.bytecode=
Bytecode (version: stable) {
Entry 0
CheckStack
PushNull
ReturnTOS
}
ConstantPool {
}
]static method main() dynamic {}