16fb650d25
Snapshots which contain code are compiled with a particular null-safety mode and it is not possible to change their mode at run time. When running from such snapshot, VM now reads null-safety mode from the snapshot if it is not specified at the command line. This avoids the need for embedders to pass null-safety flag used during snapshot generation also to the runtime, similarly to other VM flags listed in VM_GLOBAL_FLAG_LIST (such as use_bare_instructions). In addition, error for incompatibility of kernel libraries with current null-safety mode is changed from ReportError (which attempts to throw an exception) to a FATAL, because throwing an exception crashes when bootstrapping from a kernel file. Change-Id: I93a791825c25c2da4e33634f1c71736c17928fea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146460 Reviewed-by: Régis Crelier <regis@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>