blob: 6da40f31bb4afdb9f937dee3cf79137c7e799923 [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 {
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::T>
: super core::Object::•()
;
}
class B extends self::A<core::String> {
[@vm.bytecode=
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall 1, CP#0
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall '#lib::A:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
] 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 {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall 1, CP#0
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall '#lib::B:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
] 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 {
Entry 0
CheckStack 0
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]
DirectCall 1, CP#6
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = Type dart:core::Map < #lib::D::TypeParam/0, #lib::D::TypeParam/1 >
[1] = TypeArgumentsField #lib::D
[2] = ObjectRef ''
[3] = SubtypeTestCache
[4] = InstanceField #lib::D::foo (field)
[5] = Reserved
[6] = DirectCall '#lib::C:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[7] = Reserved
}
] 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 {
Entry 1
CheckStack 0
Push FP[-5]
Push FP[-6]
LoadTypeArgumentsField CP#0
PushNull
PushConstant CP#1
InterfaceCall 4, CP#2
JumpIfFalse L1
PushConstant CP#4
DirectCall 1, CP#5
Drop1
L1:
Push FP[-5]
Push FP[-6]
LoadTypeArgumentsField CP#0
PushNull
PushConstant CP#7
InterfaceCall 4, CP#2
JumpIfFalse L2
PushConstant CP#8
DirectCall 1, CP#5
Drop1
L2:
Push FP[-6]
Push FP[-5]
PushConstant CP#9
Push FP[-6]
LoadTypeArgumentsField CP#0
PushNull
PushConstant CP#10
AssertAssignable 0, CP#11
InterfaceCall 2, CP#12
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = TypeArgumentsField #lib::D
[1] = Type #lib::A < #lib::D::TypeParam/0 >
[2] = InterfaceCall 'dart:core::Object::_instanceOf', ArgDesc num-args 4, num-type-args 0, names []
[3] = Reserved
[4] = ObjectRef '21'
[5] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
[6] = Reserved
[7] = Type #lib::C < dart:core::String, dynamic, #lib::D::TypeParam/1, dart:core::List < #lib::D::TypeParam/0 > >
[8] = ObjectRef '22'
[9] = Type dart:core::Map < #lib::D::TypeParam/0, #lib::D::TypeParam/1 >
[10] = ObjectRef ''
[11] = SubtypeTestCache
[12] = InterfaceCall '#lib::D::set:foo', ArgDesc num-args 2, num-type-args 0, names []
[13] = Reserved
}
] 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 {
Entry 1
CheckStack 0
CheckFunctionTypeArgs 2, r0
Push FP[-5]
PushNull
Push r0
PushConstant CP#0
InterfaceCall 4, CP#1
JumpIfFalse L1
PushConstant CP#3
DirectCall 1, CP#4
Drop1
L1:
Push FP[-5]
Push FP[-6]
LoadTypeArgumentsField CP#6
Push r0
PushConstant CP#7
InterfaceCall 4, CP#1
JumpIfFalse L2
PushConstant CP#8
DirectCall 1, CP#4
Drop1
L2:
Push FP[-5]
PushConstant CP#9
Push FP[-6]
LoadTypeArgumentsField CP#6
Push r0
PushConstant CP#10
AssertAssignable 0, CP#11
InterfaceCall 1, CP#12
ReturnTOS
}
ConstantPool {
[0] = Type #lib::A < #lib::D::foo3::TypeParam/0 >
[1] = InterfaceCall 'dart:core::Object::_instanceOf', ArgDesc num-args 4, num-type-args 0, names []
[2] = Reserved
[3] = ObjectRef '31'
[4] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
[5] = Reserved
[6] = TypeArgumentsField #lib::D
[7] = Type #lib::C < dart:core::String, dart:core::Map < #lib::D::foo3::TypeParam/0, #lib::D::TypeParam/0 >, dart:core::List < #lib::D::foo3::TypeParam/1 >, #lib::D::TypeParam/1 >
[8] = ObjectRef '32'
[9] = Type dart:core::Map < #lib::D::foo3::TypeParam/1, #lib::D::TypeParam/1 >
[10] = ObjectRef ' in type cast'
[11] = SubtypeTestCache
[12] = InterfaceCall 'dart:core::Map::get:values', ArgDesc num-args 1, num-type-args 0, names []
[13] = Reserved
}
] 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 {
Entry 2
CheckStack 0
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
DirectCall 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
}
ConstantPool {
[0] = TypeArgumentsField #lib::D
[1] = ObjectRef < dart:core::Map < #lib::D::TypeParam/0, #lib::D::TypeParam/1 > >
[2] = Type dart:core::Map < #lib::D::TypeParam/0, #lib::D::TypeParam/1 >
[3] = ObjectRef ''
[4] = SubtypeTestCache
[5] = DirectCall 'dart:core::List::_fromLiteral (constructor)', ArgDesc num-args 2, num-type-args 0, names []
[6] = Reserved
[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 {
Entry 0
CheckStack 0
PushNull
ReturnTOS
}
ConstantPool {
}
] static factory •<P extends core::String = dynamic>() self::E<self::E::•::P>
return null;
[@vm.bytecode=
Bytecode {
Entry 1
CheckStack 0
CheckFunctionTypeArgs 2, r0
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] = ObjectRef < #lib::E::TypeParam/0, dart:core::List < #lib::E::TypeParam/0 > >
[2] = Type #lib::E::foo6::TypeParam/0
[3] = Type #lib::E::TypeParam/0
[4] = ObjectRef '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 {
Entry 0
CheckStack 0
Push FP[-5]
PushConstant CP#0
InterfaceCall 2, CP#1
JumpIfFalse L1
PushConstant CP#3
DirectCall 1, CP#4
Drop1
L1:
Push FP[-5]
PushNull
PushNull
PushConstant CP#6
InterfaceCall 4, CP#7
JumpIfFalse L2
PushConstant CP#9
DirectCall 1, CP#4
Drop1
L2:
Push FP[-5]
PushConstant CP#10
PushNull
PushNull
PushConstant CP#11
AssertAssignable 0, CP#12
ReturnTOS
}
ConstantPool {
[0] = Type #lib::B
[1] = InterfaceCall 'dart:core::Object::_simpleInstanceOf', ArgDesc num-args 2, num-type-args 0, names []
[2] = Reserved
[3] = ObjectRef '11'
[4] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
[5] = Reserved
[6] = Type #lib::C < dart:core::String, dart:core::int, dart:core::Object, dynamic >
[7] = InterfaceCall 'dart:core::Object::_instanceOf', ArgDesc num-args 4, num-type-args 0, names []
[8] = Reserved
[9] = ObjectRef '12'
[10] = Type #lib::A < dart:core::int >
[11] = ObjectRef ' in type cast'
[12] = 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 {
Entry 1
CheckStack 0
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 null >
[1] = ObjectRef ''
[2] = SubtypeTestCache
[3] = StaticField #lib::globalVar (field)
}
]static method foo5(dynamic x) void {
self::globalVar = x as{TypeError} core::List<core::Iterable<dynamic>>;
}
[@vm.bytecode=
Bytecode {
Entry 0
CheckStack 0
PushNull
ReturnTOS
}
ConstantPool {
}
]static method main() dynamic {}