Files
sdk/pkg/dart2bytecode/testcases/closures.dart.expect
Alexander Markov 6195ea86bc [vm] Remove irregular type arguments parameter from factories
In the VM, factory constructors always had an extra "type arguments"
parameter, even if class is not generic. Factory constructor bodies
were using class type parameters instead of function type parameters.

This results in extra code when calling non-generic factories
which is slightly inefficient in terms of code size and performance.
Also, it creates an additional complexity throughout the system as
factories should be special cased in many places.

This change removes artificial "type arguments" parameter, treating
factory constructors basically as static methods. This matches
kernel AST representation.

TEST=ci

Change-Id: I957583cb2ce9a3c408699880a04036e06b01dd31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501762
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-05-12 06:11:15 -07:00

1480 lines
43 KiB
Plaintext

Bytecode
Dynamic Module Entry Point: DART_SDK/pkg/dart2bytecode/testcases/closures.dart::main
Library 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
name '#lib'
script 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
Class '', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
Function 'simpleClosure', static, reflectable, debuggable
parameters [] (required: 0)
return-type dart:core::int
Bytecode {
Entry 4
CheckStack 0
AllocateContext 0, 1
PopLocal r0
Push r0
PushInt 5
StoreContextVar 0, 0
AllocateClosure CP#5
StoreLocal r3
Push r3
Push r0
StoreClosureElement 0
PopLocal r2
Push r2
StoreLocal r3
PushInt 3
Push r3
UncheckedClosureCall CP#7, 2
Drop1
Push r0
LoadContextVar 0, 0
ReturnTOS
}
ConstantPool {
[0] = ClosureFunction 0
[1] = Type dart:core::int
[2] = ObjectRef 'y'
[3] = SubtypeTestCache
[4] = EndClosureFunctionScope
[5] = AllocateClosure 0, num-elements: 1, flags: 0
[6] = Reserved
[7] = ObjectRef ArgDesc num-args 2, num-type-args 0, names []
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::simpleClosure::'<anonymous closure>' (dart:core::int y) -> Null
ClosureCode {
Entry 2
Push FP[-6]
LoadClosureElement 0
PopLocal r0
CheckStack 0
JumpIfUnchecked L1
Push FP[-5]
PushConstant CP#1
PushNull
PushNull
PushConstant CP#2
AssertAssignable 1, CP#3
Drop1
L1:
Push r0
Push r0
LoadContextVar 0, 0
Push FP[-5]
AddInt
StoreContextVar 0, 0
PushNull
ReturnTOS
}
Function 'callWithArgs', static, reflectable, debuggable
type-params <'T1' extends dart:core::Object? (default dynamic), 'T2' extends dart:core::Object? (default dynamic), 'T3' extends dart:core::Object? (default dynamic), 'T4' extends dart:core::Object? (default dynamic), 'T5' extends dart:core::Object? (default dynamic), 'T6' extends dart:core::Object? (default dynamic), 'T7' extends dart:core::Object? (default dynamic), 'T8' extends dart:core::Object? (default dynamic)>
parameters [] (required: 0)
return-type void
Bytecode {
Entry 1
CheckFunctionTypeArgs 8, r0
CheckStack 0
PushConstant CP#0
PushNull
Push r0
InstantiateType CP#1
PushNull
Push r0
InstantiateType CP#2
PushNull
Push r0
InstantiateType CP#3
PushNull
Push r0
InstantiateType CP#4
PushNull
Push r0
InstantiateType CP#5
PushNull
Push r0
InstantiateType CP#6
PushNull
Push r0
InstantiateType CP#7
PushNull
Push r0
InstantiateType CP#8
DirectCall CP#9, 9
DirectCall CP#11, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = ObjectRef < dart:core::Type >
[1] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::callWithArgs::TypeParam/0
[2] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::callWithArgs::TypeParam/1
[3] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::callWithArgs::TypeParam/2
[4] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::callWithArgs::TypeParam/3
[5] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::callWithArgs::TypeParam/4
[6] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::callWithArgs::TypeParam/5
[7] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::callWithArgs::TypeParam/6
[8] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::callWithArgs::TypeParam/7
[9] = DirectCall 'dart:core::_GrowableList::_literal8 (constructor)', ArgDesc num-args 8, num-type-args 1, names []
[10] = Reserved
[11] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
[12] = Reserved
}
Function 'callA', static, reflectable, debuggable
parameters [] (required: 0)
return-type void
Bytecode {
Entry 1
CheckStack 0
PushConstant CP#0
PushConstant CP#2
PushConstant CP#1
AllocateT
StoreLocal r0
Push r0
DirectCall CP#3, 1
Drop1
InterfaceCall CP#5, 2
Drop1
PushConstant CP#7
PushConstant CP#2
PushConstant CP#1
AllocateT
StoreLocal r0
Push r0
DirectCall CP#3, 1
Drop1
InterfaceCall CP#5, 2
Drop1
PushConstant CP#7
PushConstant CP#8
PushConstant CP#1
AllocateT
StoreLocal r0
Push r0
DirectCall CP#3, 1
Drop1
InterfaceCall CP#5, 2
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = ObjectRef < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C3, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C4 >
[1] = Class DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A
[2] = ObjectRef < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C1, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C2 >
[3] = DirectCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[4] = Reserved
[5] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo', ArgDesc num-args 1, num-type-args 2, names []
[6] = Reserved
[7] = ObjectRef < dart:core::List < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C3 >, dart:core::List < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C4 > >
[8] = ObjectRef < dart:core::List < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C1 >, dart:core::List < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C2 > >
}
Function 'testPartialInstantiation', static, reflectable, debuggable
parameters [] (required: 0)
return-type FunctionType (dart:core::int) -> void
Bytecode {
Entry 5
CheckStack 0
AllocateClosure CP#8
StoreLocal r3
Push r3
PushConstant CP#1
StoreClosureElement 0
Push r3
Push r0
StoreClosureElement 1
PopLocal r2
Push r2
PushConstant CP#10
DirectCall CP#11, 2
PopLocal r4
Push r4
ReturnTOS
}
ConstantPool {
[0] = ClosureFunction 0
[1] = EmptyTypeArguments
[2] = DirectCall 'dart:_internal::_prependTypeArguments', ArgDesc num-args 4, num-type-args 0, names []
[3] = Reserved
[4] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::testPartialInstantiation::Closure/0::TypeParam/0
[5] = ObjectRef 't'
[6] = SubtypeTestCache
[7] = EndClosureFunctionScope
[8] = AllocateClosure 0, num-elements: 2, flags: 1
[9] = Reserved
[10] = ObjectRef < dart:core::int >
[11] = DirectCall 'dart:_internal::_instantiateClosure', ArgDesc num-args 2, num-type-args 0, names []
[12] = Reserved
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::testPartialInstantiation::'foo' type-params <'T' extends dart:core::Object? (default dynamic)> (DART_SDK/pkg/dart2bytecode/testcases/closures.dart::testPartialInstantiation::Closure/0::TypeParam/0 t) -> void
ClosureCode {
Entry 3
Push FP[-6]
LoadClosureElement 1
PopLocal r1
Push FP[-6]
LoadClosureElement 0
StoreLocal r0
PushConstant CP#1
JumpIfEqStrict L1
CheckFunctionTypeArgs 0, r2
Jump L2
L1:
CheckFunctionTypeArgs 1, r0
L2:
CheckStack 0
Push r0
Push FP[-6]
LoadClosureElement 1
PushInt 0
PushInt 1
DirectCall CP#2, 4
PopLocal r0
JumpIfUnchecked L3
Push FP[-5]
PushConstant CP#4
PushNull
Push r0
PushConstant CP#5
AssertAssignable 0, CP#6
Drop1
L3:
PushNull
ReturnTOS
}
Function 'main', static, reflectable, debuggable
parameters [] (required: 0)
return-type dynamic
Bytecode {
Entry 0
CheckStack 0
PushNull
ReturnTOS
}
ConstantPool {
}
Class 'C1', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C1
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Class 'C2', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C2
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Class 'C3', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C3
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Class 'C4', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C4
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Class 'C5', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C5
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Class 'C6', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C6
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Class 'C7', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C7
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Class 'C8', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C8
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Class 'A', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
type-params <'T1' extends dart:core::Object? (default dynamic), 'T2' extends dart:core::Object? (default dynamic)> (args: 2)
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::TypeParam/0, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::TypeParam/1 >
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Function 'foo', reflectable, debuggable
type-params <'T3' extends dart:core::Object? (default dynamic), 'T4' extends dart:core::Object? (default dynamic)>
parameters [] (required: 0)
return-type void
Bytecode {
Entry 5
CheckFunctionTypeArgs 2, r0
CheckStack 0
AllocateContext 0, 1
PopLocal r1
Push r1
Push FP[-5]
StoreContextVar 0, 0
AllocateClosure CP#34
StoreLocal r4
Push r4
PushConstant CP#1
StoreClosureElement 0
Push r4
Push FP[-5]
LoadTypeArgumentsField CP#7
StoreClosureElement 1
Push r4
Push r0
StoreClosureElement 2
Push r4
Push r1
StoreClosureElement 3
PopLocal r3
PushConstant CP#36
Push r3
Push r3
UncheckedClosureCall CP#31, 2
Drop1
PushConstant CP#37
Push r3
Push r3
UncheckedClosureCall CP#31, 2
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = ClosureFunction 0
[1] = EmptyTypeArguments
[2] = DirectCall 'dart:_internal::_prependTypeArguments', ArgDesc num-args 4, num-type-args 0, names []
[3] = Reserved
[4] = ClosureFunction 1
[5] = ClosureFunction 2
[6] = ObjectRef < dart:core::Type >
[7] = TypeArgumentsField DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A
[8] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::TypeParam/0
[9] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::TypeParam/1
[10] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::TypeParam/0
[11] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::TypeParam/1
[12] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::Closure/0::TypeParam/0
[13] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::Closure/0::TypeParam/1
[14] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::Closure/1::TypeParam/0
[15] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::Closure/1::TypeParam/1
[16] = DirectCall 'dart:core::_GrowableList::_literal8 (constructor)', ArgDesc num-args 8, num-type-args 1, names []
[17] = Reserved
[18] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
[19] = Reserved
[20] = ObjectRef < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::TypeParam/0, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::TypeParam/1, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::TypeParam/0, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::TypeParam/1, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::Closure/0::TypeParam/0, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::Closure/0::TypeParam/1, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::Closure/1::TypeParam/0, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::Closure/1::TypeParam/1 >
[21] = DirectCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::callWithArgs', ArgDesc num-args 0, num-type-args 8, names []
[22] = Reserved
[23] = EndClosureFunctionScope
[24] = AllocateClosure 2, num-elements: 3, flags: 6
[25] = Reserved
[26] = ObjectRef ArgDesc num-args 1, num-type-args 0, names []
[27] = EndClosureFunctionScope
[28] = AllocateClosure 1, num-elements: 4, flags: 7
[29] = Reserved
[30] = ObjectRef < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C7, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C8 >
[31] = ObjectRef ArgDesc num-args 1, num-type-args 2, names []
[32] = ObjectRef < dart:core::List < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C7 >, dart:core::List < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C8 > >
[33] = EndClosureFunctionScope
[34] = AllocateClosure 0, num-elements: 4, flags: 7
[35] = Reserved
[36] = ObjectRef < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C5, DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C6 >
[37] = ObjectRef < dart:core::List < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C5 >, dart:core::List < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C6 > >
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::'nested1' type-params <'T5' extends dart:core::Object? (default dynamic), 'T6' extends dart:core::Object? (default dynamic)> () -> void
ClosureCode {
Entry 5
Push FP[-5]
LoadClosureElement 3
PopLocal r1
Push FP[-5]
LoadClosureElement 0
StoreLocal r0
PushConstant CP#1
JumpIfEqStrict L1
CheckFunctionTypeArgs 0, r2
Jump L2
L1:
CheckFunctionTypeArgs 2, r0
L2:
CheckStack 0
Push r0
Push FP[-5]
LoadClosureElement 2
PushInt 2
PushInt 4
DirectCall CP#2, 4
PopLocal r0
AllocateClosure CP#28
StoreLocal r4
Push r4
PushConstant CP#1
StoreClosureElement 0
Push r4
Push r1
LoadContextVar 0, 0
LoadTypeArgumentsField CP#7
StoreClosureElement 1
Push r4
Push r0
StoreClosureElement 2
Push r4
Push r1
StoreClosureElement 3
PopLocal r3
PushConstant CP#30
Push r3
Push r3
UncheckedClosureCall CP#31, 2
Drop1
PushConstant CP#32
Push r3
Push r3
UncheckedClosureCall CP#31, 2
Drop1
PushNull
ReturnTOS
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::Closure/0::'nested2' type-params <'T7' extends dart:core::Object? (default dynamic), 'T8' extends dart:core::Object? (default dynamic)> () -> void
ClosureCode {
Entry 5
Push FP[-5]
LoadClosureElement 3
PopLocal r1
Push FP[-5]
LoadClosureElement 0
StoreLocal r0
PushConstant CP#1
JumpIfEqStrict L1
CheckFunctionTypeArgs 0, r2
Jump L2
L1:
CheckFunctionTypeArgs 2, r0
L2:
CheckStack 0
Push r0
Push FP[-5]
LoadClosureElement 2
PushInt 4
PushInt 6
DirectCall CP#2, 4
PopLocal r0
AllocateClosure CP#24
StoreLocal r4
Push r4
Push r1
LoadContextVar 0, 0
LoadTypeArgumentsField CP#7
StoreClosureElement 0
Push r4
Push r0
StoreClosureElement 1
Push r4
Push r1
StoreClosureElement 2
PopLocal r3
Push r3
StoreLocal r4
Push r4
UncheckedClosureCall CP#26, 1
Drop1
PushNull
ReturnTOS
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::A::foo::Closure/1::'<anonymous closure>' () -> Null
ClosureCode {
Entry 3
Push FP[-5]
LoadClosureElement 2
PopLocal r1
CheckStack 0
Push FP[-5]
LoadClosureElement 1
PopLocal r0
PushConstant CP#6
Push r1
LoadContextVar 0, 0
LoadTypeArgumentsField CP#7
PushNull
InstantiateType CP#8
Push r1
LoadContextVar 0, 0
LoadTypeArgumentsField CP#7
PushNull
InstantiateType CP#9
PushNull
Push r0
InstantiateType CP#10
PushNull
Push r0
InstantiateType CP#11
PushNull
Push r0
InstantiateType CP#12
PushNull
Push r0
InstantiateType CP#13
PushNull
Push r0
InstantiateType CP#14
PushNull
Push r0
InstantiateType CP#15
DirectCall CP#16, 9
DirectCall CP#18, 1
Drop1
Push r1
LoadContextVar 0, 0
LoadTypeArgumentsField CP#7
Push r0
InstantiateTypeArgumentsTOS 0, CP#20
DirectCall CP#21, 1
Drop1
PushNull
ReturnTOS
}
Class 'B', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
extends dart:core::Object
Field 'foo', type = dart:core::int, getter = 'get:foo', setter = 'set:foo', reflectable, has-initializer
value = const 0
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::B
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
PushInt 0
StoreFieldTOS CP#0
Push FP[-5]
DirectCall CP#2, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = InstanceField DART_SDK/pkg/dart2bytecode/testcases/closures.dart::B::foo (field)
[1] = Reserved
[2] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[3] = Reserved
}
Function 'topLevel', reflectable, debuggable
parameters [] (required: 0)
return-type void
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
AllocateClosure CP#14
StoreLocal r4
Push r4
Push r0
StoreClosureElement 0
PopLocal r3
Push r3
StoreLocal r4
PushInt 10
Push r4
UncheckedClosureCall CP#16, 2
Drop1
Push r3
StoreLocal r4
PushInt 11
Push r4
UncheckedClosureCall CP#16, 2
Drop1
Push r2
DirectCall CP#11, 1
Drop1
Push r0
LoadContextVar 0, 2
DirectCall CP#11, 1
Drop1
Push r0
LoadContextVar 0, 1
DirectCall CP#11, 1
Drop1
Push r0
PushInt 42
StoreContextVar 0, 3
AllocateClosure CP#21
StoreLocal r3
Push r3
Push r0
StoreClosureElement 0
PopLocal r2
Push r2
StoreLocal r3
Push r3
UncheckedClosureCall CP#10, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = ClosureFunction 0
[1] = Type dart:core::int
[2] = ObjectRef 'y'
[3] = SubtypeTestCache
[4] = ClosureFunction 1
[5] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::B::get:foo', ArgDesc num-args 1, num-type-args 0, names []
[6] = Reserved
[7] = EndClosureFunctionScope
[8] = AllocateClosure 1, num-elements: 1, flags: 0
[9] = Reserved
[10] = ObjectRef ArgDesc num-args 1, num-type-args 0, names []
[11] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
[12] = Reserved
[13] = EndClosureFunctionScope
[14] = AllocateClosure 0, num-elements: 1, flags: 0
[15] = Reserved
[16] = ObjectRef ArgDesc num-args 2, num-type-args 0, names []
[17] = ClosureFunction 2
[18] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::B::set:foo', ArgDesc num-args 2, num-type-args 0, names []
[19] = Reserved
[20] = EndClosureFunctionScope
[21] = AllocateClosure 2, num-elements: 1, flags: 0
[22] = Reserved
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::B::topLevel::'<anonymous closure>' (dart:core::int y) -> Null
ClosureCode {
Entry 4
Push FP[-6]
LoadClosureElement 0
PopLocal r0
CheckStack 0
AllocateContext 1, 2
StoreLocal r1
Push r1
Push r0
StoreContextParent
PopLocal r0
Push r0
Push FP[-5]
StoreContextVar 1, 0
JumpIfUnchecked L1
Push FP[-5]
PushConstant CP#1
PushNull
PushNull
PushConstant CP#2
AssertAssignable 1, CP#3
Drop1
L1:
Push r0
LoadContextParent
Push r0
LoadContextVar 1, 0
PushInt 1
AddInt
StoreContextVar 0, 1
Push r0
LoadContextParent
LoadContextVar 0, 1
PushInt 5
CompareIntGt
JumpIfFalse L2
Push r0
PushInt 4
StoreContextVar 1, 1
AllocateClosure CP#8
StoreLocal r3
Push r3
Push r0
StoreClosureElement 0
PopLocal r2
Push r2
Push r2
UncheckedClosureCall CP#10, 1
Drop1
Push r0
LoadContextVar 1, 1
DirectCall CP#11, 1
Drop1
L2:
PushNull
ReturnTOS
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::B::topLevel::Closure/0::'closure2' () -> void
ClosureCode {
Entry 2
Push FP[-5]
LoadClosureElement 0
PopLocal r0
CheckStack 0
Push r0
LoadContextParent
Push r0
LoadContextParent
LoadContextVar 0, 1
PushInt 2
AddInt
StoreContextVar 0, 2
Push r0
Push r0
LoadContextParent
LoadContextVar 0, 0
InterfaceCall CP#5, 1
Push r0
LoadContextVar 1, 0
AddInt
StoreContextVar 1, 1
PushNull
ReturnTOS
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::B::topLevel::'<anonymous closure>' () -> Null
ClosureCode {
Entry 3
Push FP[-5]
LoadClosureElement 0
PopLocal r0
CheckStack 0
Push r0
LoadContextVar 0, 0
Push r0
LoadContextVar 0, 3
InterfaceCall CP#18, 2
Drop1
PushNull
ReturnTOS
}
Class 'C', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Function 'testForLoop', reflectable, debuggable
parameters [] (required: 0)
return-type void
Bytecode {
Entry 5
CheckStack 0
AllocateContext 0, 1
PopLocal r0
Push r0
PushInt 0
StoreContextVar 0, 0
PushConstant CP#0
PushInt 0
DirectCall CP#1, 2
PopLocal r2
PushConstant CP#0
PushInt 0
DirectCall CP#1, 2
PopLocal r3
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
AllocateClosure CP#5
StoreLocal r4
Push r4
Push r0
StoreClosureElement 0
InstantiatedInterfaceCall CP#7, 2
Drop1
Push r3
AllocateClosure CP#15
StoreLocal r4
Push r4
Push r0
StoreClosureElement 0
InstantiatedInterfaceCall CP#7, 2
Drop1
Push r0
CloneContext 1, 1
PopLocal r0
Push r0
Push r0
LoadContextVar 1, 0
PushInt 1
AddInt
StoreLocal r4
StoreContextVar 1, 0
Push r4
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::_GrowableList:: (constructor)', ArgDesc num-args 1, num-type-args 1, names []
[2] = Reserved
[3] = ClosureFunction 0
[4] = EndClosureFunctionScope
[5] = AllocateClosure 0, num-elements: 1, flags: 0
[6] = Reserved
[7] = InstantiatedInterfaceCall 'dart:core::List::add', ArgDesc num-args 2, num-type-args 0, names [], receiver dart:core::List < dart:core::Function >
[8] = Reserved
[9] = Reserved
[10] = ClosureFunction 1
[11] = Type dart:core::int
[12] = ObjectRef 'ii'
[13] = SubtypeTestCache
[14] = EndClosureFunctionScope
[15] = AllocateClosure 1, num-elements: 1, flags: 0
[16] = Reserved
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C::testForLoop::'<anonymous closure>' () -> dart:core::int
ClosureCode {
Entry 2
Push FP[-5]
LoadClosureElement 0
PopLocal r0
CheckStack 0
Push r0
LoadContextVar 1, 0
Push r0
LoadContextParent
LoadContextVar 0, 0
AddInt
ReturnTOS
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C::testForLoop::'<anonymous closure>' (dart:core::int ii) -> Null
ClosureCode {
Entry 2
Push FP[-6]
LoadClosureElement 0
PopLocal r0
CheckStack 0
JumpIfUnchecked L1
Push FP[-5]
PushConstant CP#11
PushNull
PushNull
PushConstant CP#12
AssertAssignable 1, CP#13
Drop1
L1:
Push r0
Push FP[-5]
Push r0
LoadContextParent
LoadContextVar 0, 0
AddInt
StoreContextVar 1, 0
PushNull
ReturnTOS
}
Function 'testForInLoop', reflectable, debuggable
parameters [dart:core::List < dart:core::int > 'list'] (required: 1)
return-type void
Bytecode {
Entry 5
CheckStack 0
Push FP[-5]
InterfaceCall CP#0, 1
PopLocal r2
L2:
CheckStack 1
Push r2
InterfaceCall CP#2, 1
JumpIfFalse L1
AllocateContext 0, 1
PopLocal r0
Push r0
Push r2
InterfaceCall CP#4, 1
StoreContextVar 0, 0
AllocateClosure CP#8
StoreLocal r4
Push r4
Push r0
StoreClosureElement 0
PopLocal r3
Push r3
StoreLocal r4
Push r4
UncheckedClosureCall CP#10, 1
Drop1
Push r0
LoadContextVar 0, 0
DirectCall CP#11, 1
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] = EndClosureFunctionScope
[8] = AllocateClosure 0, num-elements: 1, flags: 0
[9] = Reserved
[10] = ObjectRef ArgDesc num-args 1, num-type-args 0, names []
[11] = DirectCall 'dart:core::print', ArgDesc num-args 1, num-type-args 0, names []
[12] = Reserved
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::C::testForInLoop::'<anonymous closure>' () -> Null
ClosureCode {
Entry 2
Push FP[-5]
LoadClosureElement 0
PopLocal r0
CheckStack 0
Push r0
Push r0
LoadContextVar 0, 0
PushInt 1
AddInt
StoreContextVar 0, 0
PushNull
ReturnTOS
}
Class 'D', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart'
type-params <'T' extends dart:core::Object? (default dynamic)> (args: 1)
extends dart:core::Object
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::D < DART_SDK/pkg/dart2bytecode/testcases/closures.dart::D::TypeParam/0 >
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
DirectCall CP#0, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
}
Function 'foo', reflectable, debuggable
parameters [DART_SDK/pkg/dart2bytecode/testcases/closures.dart::D::TypeParam/0 't'] (required: 1)
return-type dynamic
Bytecode {
Entry 3
CheckStack 0
AllocateContext 0, 1
PopLocal r0
Push r0
Push FP[-5]
StoreContextVar 0, 0
JumpIfUnchecked L1
Push FP[-5]
PushConstant CP#0
Push FP[-6]
LoadTypeArgumentsField CP#1
PushNull
PushConstant CP#2
AssertAssignable 0, CP#3
Drop1
L1:
AllocateClosure CP#6
StoreLocal r2
Push r2
Push FP[-6]
LoadTypeArgumentsField CP#1
StoreClosureElement 0
Push r2
Push r0
StoreClosureElement 1
ReturnTOS
}
Parameter flags: [2]
ConstantPool {
[0] = Type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::D::TypeParam/0
[1] = TypeArgumentsField DART_SDK/pkg/dart2bytecode/testcases/closures.dart::D
[2] = ObjectRef 't'
[3] = SubtypeTestCache
[4] = ClosureFunction 0
[5] = EndClosureFunctionScope
[6] = AllocateClosure 0, num-elements: 2, flags: 2
[7] = Reserved
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::D::foo::'<anonymous closure>' () -> DART_SDK/pkg/dart2bytecode/testcases/closures.dart::D::TypeParam/0
ClosureCode {
Entry 2
Push FP[-5]
LoadClosureElement 1
PopLocal r0
CheckStack 0
Push r0
LoadContextVar 0, 0
ReturnTOS
}
Function 'bar', reflectable, debuggable
parameters [] (required: 0)
return-type dynamic
Bytecode {
Entry 3
CheckStack 0
AllocateContext 0, 1
PopLocal r0
Push r0
Push FP[-5]
StoreContextVar 0, 0
AllocateClosure CP#8
StoreLocal r2
Push r2
Push FP[-5]
LoadTypeArgumentsField CP#5
StoreClosureElement 0
Push r2
Push r0
StoreClosureElement 1
ReturnTOS
}
ConstantPool {
[0] = ClosureFunction 0
[1] = ClosureFunction 1
[2] = EndClosureFunctionScope
[3] = AllocateClosure 1, num-elements: 2, flags: 2
[4] = Reserved
[5] = TypeArgumentsField DART_SDK/pkg/dart2bytecode/testcases/closures.dart::D
[6] = ObjectRef ArgDesc num-args 1, num-type-args 0, names []
[7] = EndClosureFunctionScope
[8] = AllocateClosure 0, num-elements: 2, flags: 2
[9] = Reserved
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::D::bar::'<anonymous closure>' () -> Null
ClosureCode {
Entry 4
Push FP[-5]
LoadClosureElement 1
PopLocal r0
CheckStack 0
AllocateClosure CP#3
StoreLocal r3
Push r3
Push r0
LoadContextVar 0, 0
LoadTypeArgumentsField CP#5
StoreClosureElement 0
Push r3
Push r0
StoreClosureElement 1
PopLocal r2
Push r2
Push r2
UncheckedClosureCall CP#6, 1
Drop1
PushNull
ReturnTOS
}
Closure DART_SDK/pkg/dart2bytecode/testcases/closures.dart::D::bar::Closure/0::'inner' () -> Null
ClosureCode {
Entry 2
Push FP[-5]
LoadClosureElement 1
PopLocal r0
CheckStack 0
PushNull
ReturnTOS
}
Class 'E', script = 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart', abstract
extends dart:core::Object
Field 'foo1', type = FunctionType (dart:core::int, dart:core::int) -> dart:core::int, getter = 'get:foo1', setter = 'set:foo1', reflectable, is-late
value = null
Function '', constructor, reflectable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
InitLateField CP#0
Push FP[-5]
DirectCall CP#2, 1
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = InstanceField DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::foo1 (field)
[1] = Reserved
[2] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[3] = Reserved
}
Function 'get:foo2', getter, abstract, reflectable, debuggable
parameters [] (required: 0)
return-type FunctionType <'T' extends dart:core::Object? (default dynamic)> (null::TypeParam/0, null::TypeParam/0) -> dart:core::int
Function 'evalArg1', abstract, reflectable, debuggable
parameters [] (required: 0)
return-type dart:core::int
Function 'evalArg2', abstract, reflectable, debuggable
parameters [] (required: 0)
return-type dart:core::int
Function 'getE', abstract, reflectable, debuggable
parameters [] (required: 0)
return-type DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E
Function 'testCallThroughGetter1', reflectable, debuggable
parameters [] (required: 0)
return-type dart:core::int
Bytecode {
Entry 3
CheckStack 0
Push FP[-5]
InterfaceCall CP#0, 1
PopLocal r0
Push FP[-5]
InterfaceCall CP#2, 1
PopLocal r1
Push FP[-5]
InterfaceCall CP#4, 1
StoreLocal r2
Push r0
Push r1
Push r2
UncheckedClosureCall CP#6, 3
ReturnTOS
}
ConstantPool {
[0] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::evalArg1', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
[2] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::evalArg2', ArgDesc num-args 1, num-type-args 0, names []
[3] = Reserved
[4] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::get:foo1', ArgDesc num-args 1, num-type-args 0, names []
[5] = Reserved
[6] = ObjectRef ArgDesc num-args 3, num-type-args 0, names []
}
Function 'testCallThroughGetter2', reflectable, debuggable
parameters [] (required: 0)
return-type dart:core::int
Bytecode {
Entry 3
CheckStack 0
Push FP[-5]
InterfaceCall CP#0, 1
PopLocal r0
Push FP[-5]
InterfaceCall CP#2, 1
PopLocal r1
PushConstant CP#4
Push FP[-5]
InterfaceCall CP#5, 1
StoreLocal r2
Push r0
Push r1
Push r2
UncheckedClosureCall CP#7, 4
ReturnTOS
}
ConstantPool {
[0] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::evalArg1', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
[2] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::evalArg2', ArgDesc num-args 1, num-type-args 0, names []
[3] = Reserved
[4] = ObjectRef < dart:core::int >
[5] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::get:foo2', ArgDesc num-args 1, num-type-args 0, names []
[6] = Reserved
[7] = ObjectRef ArgDesc num-args 3, num-type-args 1, names []
}
Function 'testCallThroughGetter3', reflectable, debuggable
parameters [] (required: 0)
return-type dart:core::int
Bytecode {
Entry 4
CheckStack 0
Push FP[-5]
InterfaceCall CP#0, 1
PopLocal r0
Push FP[-5]
InterfaceCall CP#2, 1
PopLocal r1
Push FP[-5]
InterfaceCall CP#4, 1
PopLocal r2
PushConstant CP#6
Push r0
InterfaceCall CP#7, 1
StoreLocal r3
Push r1
Push r2
Push r3
UncheckedClosureCall CP#9, 4
ReturnTOS
}
ConstantPool {
[0] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::getE', ArgDesc num-args 1, num-type-args 0, names []
[1] = Reserved
[2] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::evalArg1', ArgDesc num-args 1, num-type-args 0, names []
[3] = Reserved
[4] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::evalArg2', ArgDesc num-args 1, num-type-args 0, names []
[5] = Reserved
[6] = ObjectRef < dart:core::int >
[7] = InterfaceCall 'DART_SDK/pkg/dart2bytecode/testcases/closures.dart::E::get:foo2', ArgDesc num-args 1, num-type-args 0, names []
[8] = Reserved
[9] = ObjectRef ArgDesc num-args 3, num-type-args 1, names []
}