[VM] Ensure Top level class is finalized for loadedscripts in library
[VM] Ensure Top level class is finalized for loadedscripts in library

The breakpoints sent from IDE will be checked with existing scripts.
Because the loadedscripts() doesn't contain the scripts info for part/part of.
Then the breakpoint will be considerred as a latent breakpoint and didn't get
resolved later. The solution is to finalize the toplevel class before loadedscripts()
uses Dictionary iterator.

Bug: https://github.com/dart-lang/sdk/issues/35859
Change-Id: I90b67ee9e9e6afe2556ca806cdd87eb5661304a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97402
Reviewed-by: Alexander Markov <239e774fd29abc1267878f57afe1a8a03e0ca887@google.com>
Commit-Queue: Zichang Guo <d26af3001798f91912fb1504666bca93c093d553@google.com>

dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk