Shut down and restart the Dart VM as needed. (#7832)
The shell was already designed to cleanly shut down the VM but it couldnt earlier as |Dart_Initialize| could never be called after a |Dart_Cleanup|. This meant that shutting down an engine instance could not shut down the VM to save memory because newly created engines in the process after that point couldn't restart the VM. There can only be one VM running in a process at a time. This patch separate the previous DartVM object into one that references a running instance of the DartVM and a set of immutable dependencies that components can reference even as the VM is shutting down. Unit tests have been added to assert that non-overlapping engine launches use difference VM instances.
Showing
runtime/dart_vm_data.cc
0 → 100644
runtime/dart_vm_data.h
0 → 100644
runtime/dart_vm_lifecycle.cc
0 → 100644
runtime/dart_vm_lifecycle.h
0 → 100644
想要评论请 注册 或 登录