Open osa1 opened 1 year ago
It seems like f4200fed2b5796ef8030222e216c094c2109bfdf probably made this worse.
With that commit, vtable entry generators now use the Constants
class (to be able to generate empty const _Type
lists), which needs some class infos (with fields) to be initialized.
So ClassInfo
generator uses Constants
, which needs some ClassInfo
to be generated.
Interestingly, the reason why Constants
needs ClassInfo
s on initialization is because it generates an empty List<_Type>
constant on initialization, the constant we use in dynamic call entries.
Currently vtable entries (trampolines) for instantiation closures are delayed to make sure we generate Wasm functions for them after collecting imports: https://github.com/dart-lang/sdk/blob/ec5123ada6dcebab4f1fb679c0b06cfc14f9edc4/pkg/dart2wasm/lib/closures.dart#L324-L329
This is no longer necessary as we collect imports and exports as first thing now. The code can be simplified to generate trampolines directly, instead of delaying them using thunks.