blob: f53ec42914fb476d8dbc168fb593a14d1a82a6f6 [file] [log] [blame]
library #lib;
import self as self;
import "dart:core" as core;
class A<T extends core::Object> 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 B extends self::A<core::String> {
[@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 '#lib::A::', arg-desc CP#0
[2] = Null
}
] synthetic constructor •() void
: super self::A::•()
;
}
class C<T1 extends core::Object, T2 extends core::Object, T3 extends core::Object> extends self::B {
[@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 '#lib::B::', arg-desc CP#0
[2] = Null
}
] synthetic constructor •() void
: super self::B::•()
;
}
class D<P extends core::Object, Q extends core::Object> extends self::C<core::int, self::D::Q, self::D::P> {
generic-covariant-impl generic-covariant-interface field core::Map<self::D::P, self::D::Q> 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 '#lib::C::', arg-desc CP#0
[2] = Null
}
] synthetic constructor •() void
: super self::C::•()
;
[@vm.bytecode=
Bytecode {
Entry 1
CheckStack
Push FP[-5]
Push FP[-6]
LoadFieldTOS CP#0
PushConstant CP#1
PushConstant CP#2
InstanceCall1 4, CP#4
PushConstant CP#5
IfNeStrictTOS
Jump L1
PushConstant CP#6
PushConstant CP#8
IndirectStaticCall 1, CP#7
Drop1
L1:
Push FP[-5]
Push FP[-6]
LoadFieldTOS CP#0
PushConstant CP#1
PushConstant CP#9
InstanceCall1 4, CP#10
PushConstant CP#5
IfNeStrictTOS
Jump L2
PushConstant CP#11
PushConstant CP#12
IndirectStaticCall 1, CP#7
Drop1
L2:
Push FP[-6]
Push FP[-5]
StoreLocal r0
InstanceCall1 2, CP#14
Drop1
Push r0
Drop1
PushConstant CP#1
ReturnTOS
}
ConstantPool {
[0] = TypeArgumentsFieldOffset #lib::D
[1] = Null
[2] = Type #lib::A<#lib::D::P>
[3] = ArgDesc num-args 4, num-type-args 0, names []
[4] = ICData target-name '_instanceOf', arg-desc CP#3
[5] = Bool true
[6] = String '21'
[7] = ArgDesc num-args 1, num-type-args 0, names []
[8] = StaticICData target 'dart.core::print', arg-desc CP#7
[9] = Type #lib::C<dynamic, #lib::D::Q, dart.core::List<#lib::D::P>>
[10] = ICData target-name '_instanceOf', arg-desc CP#3
[11] = String '22'
[12] = StaticICData target 'dart.core::print', arg-desc CP#7
[13] = ArgDesc num-args 2, num-type-args 0, names []
[14] = ICData target-name 'set:foo', arg-desc CP#13
}
] 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");
}
this.{self::D::foo} = y as{TypeError} core::Map<self::D::P, self::D::Q>;
}
[@vm.bytecode=
Bytecode {
Entry 0
CheckStack
Push FP[-5]
Push FP[-6]
LoadFieldTOS CP#0
Push FP[-7]
PushConstant CP#1
InstanceCall1 4, CP#3
PushConstant CP#4
IfNeStrictTOS
Jump L1
PushConstant CP#5
PushConstant CP#7
IndirectStaticCall 1, CP#6
Drop1
L1:
Push FP[-5]
Push FP[-6]
LoadFieldTOS CP#0
Push FP[-7]
PushConstant CP#8
InstanceCall1 4, CP#9
PushConstant CP#4
IfNeStrictTOS
Jump L2
PushConstant CP#10
PushConstant CP#11
IndirectStaticCall 1, CP#6
Drop1
L2:
Push FP[-5]
Push FP[-6]
LoadFieldTOS CP#0
Push FP[-7]
PushConstant CP#12
InstanceCall1 4, CP#13
InstanceCall1 1, CP#14
ReturnTOS
PushConstant CP#15
ReturnTOS
}
ConstantPool {
[0] = TypeArgumentsFieldOffset #lib::D
[1] = Type #lib::A<#lib::D::foo3::T1>
[2] = ArgDesc num-args 4, num-type-args 0, names []
[3] = ICData target-name '_instanceOf', arg-desc CP#2
[4] = Bool true
[5] = String '31'
[6] = ArgDesc num-args 1, num-type-args 0, names []
[7] = StaticICData target 'dart.core::print', arg-desc CP#6
[8] = Type #lib::C<dart.core::Map<#lib::D::foo3::T1, #lib::D::P>, dart.core::List<#lib::D::foo3::T2>, #lib::D::Q>
[9] = ICData target-name '_instanceOf', arg-desc CP#2
[10] = String '32'
[11] = StaticICData target 'dart.core::print', arg-desc CP#6
[12] = Type dart.core::Map<#lib::D::foo3::T2, #lib::D::Q>
[13] = ICData target-name '_as', arg-desc CP#2
[14] = ICData target-name 'get:values', arg-desc CP#6
[15] = Null
}
] method foo3<T1 extends core::Object, T2 extends core::Object>(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 {
Entry 0
CheckStack
Push FP[-5]
PushConstant CP#0
PushConstant CP#0
PushConstant CP#1
InstanceCall1 4, CP#3
PushConstant CP#4
IfNeStrictTOS
Jump L1
PushConstant CP#5
PushConstant CP#7
IndirectStaticCall 1, CP#6
Drop1
L1:
Push FP[-5]
PushConstant CP#0
PushConstant CP#0
PushConstant CP#8
InstanceCall1 4, CP#9
PushConstant CP#4
IfNeStrictTOS
Jump L2
PushConstant CP#10
PushConstant CP#11
IndirectStaticCall 1, CP#6
Drop1
L2:
Push FP[-5]
PushConstant CP#0
PushConstant CP#0
PushConstant CP#12
InstanceCall1 4, CP#13
ReturnTOS
PushConstant CP#0
ReturnTOS
}
ConstantPool {
[0] = Null
[1] = Type #lib::B
[2] = ArgDesc num-args 4, num-type-args 0, names []
[3] = ICData target-name '_instanceOf', arg-desc CP#2
[4] = Bool true
[5] = String '11'
[6] = ArgDesc num-args 1, num-type-args 0, names []
[7] = StaticICData target 'dart.core::print', arg-desc CP#6
[8] = Type #lib::C<dart.core::int, dart.core::Object, dynamic>
[9] = ICData target-name '_instanceOf', arg-desc CP#2
[10] = String '12'
[11] = StaticICData target 'dart.core::print', arg-desc CP#6
[12] = Type #lib::A<dart.core::int>
[13] = ICData target-name '_as', arg-desc CP#2
}
]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 {
Entry 0
CheckStack
PushConstant CP#0
ReturnTOS
}
ConstantPool {
[0] = Null
}
]static method main() dynamic {}