9dad32ce41
Today, support for expression evaluation in DDC uses a lot of information. To properly support compiling expressions in arbitrary frames, we consume source-maps, module metadata, and full kernel components at various stages of the process. This data is already plumbed and available for non-sdk modules in our debugging systems (frontend-server, webdev, g3), however it is not available the Dart SDK module itself. Because of that, the expression compiler today rejects all expression evaluation requests when the target is a Dart SDK library. Until the fix the availability of this data everywhere, we believe we can support a limited form of expression evaluation: only evaluation of libary level expressions. Basically, expressions where scope data is not necessary and kernel outlines are sufficient to compile the expression. Here we introduce logic to recognize the first offset location of a library, which is a clear indicator that no scope data is needed and a library level expression evaluation is being requested. This change is an attempt to help resolve https://github.com/flutter/devtools/issues/7766. Note: just like changes were needed here in the worker and test-compiler files, it is possible that some change may be necessary in dwds and other parts of the pipeline. Additional validation will be needed after this lands. Change-Id: Iff081a24ecb05092407279a0a7ed3d38c13cf41d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367981 Reviewed-by: Nicholas Shahan <nshahan@google.com> Commit-Queue: Sigmund Cherem <sigmund@google.com>