[VM] Remaining fixes for flutter coverage issue

This CL changes:

   * package:kernel/clone.dart: To not clone file offsets if the
     file-uri we copy from is unknown.

   * package:kernel/binary/ast_to_binary.dart: To not write out file
     offsets if the file-uri is not written/indexed (which happens if
     the file uri is not in the `Program.uriToSource` map).

   * It reverts the file renaming part of 60a2cfa2191bd52f79 which
     fixed the name collision problem only partially (it missed to
     rename `runtime/lib/double.dart`, which is not possible because
     there's already a `double_patch.dart` file).

     Instead of renaming, we solve the problem by mangling the names as follows:

         .../sdk/lib/core/double.dart       ->  dart:core/double.dart
         .../runtime/lib/double.dart        ->  dart:core/runtime/lib/double.dart
         .../runtime/lib/double_patch.dart  ->  dart:core/runtime/lib/double_patch.dart

   * It changes the test to ignore any negative token positions.  The vm
     service does not just expose `-1` token positions for places where
     there is no source, but also e.g. `-9` (which means TokenPosition::kMethodExtractor),
     this was one reason why the appjit test failed.

   * It changes the test to try to force-compile everything (unsure if that works).

Issue https://github.com/dart-lang/sdk/issues/32489

Change-Id: Ia9f42ca9d56d987e3041175add549bb7a133f269
Reviewed-on: https://dart-review.googlesource.com/46341
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
9 files changed
tree: a804da7d494b026a41afa1b8474f165490cd2ba2
  1. build/
  2. client/
  3. docs/
  4. pkg/
  5. runtime/
  6. samples/
  7. samples-dev/
  8. sdk/
  9. tests/
  10. third_party/
  11. tools/
  12. utils/
  13. .clang-format
  14. .gitattributes
  15. .gitignore
  16. .gn
  17. .mailmap
  18. .packages
  19. AUTHORS
  20. BUILD.gn
  21. CHANGELOG.md
  22. codereview.settings
  23. DEPS
  24. LICENSE
  25. PATENTS
  26. PRESUBMIT.py
  27. README.dart-sdk
  28. README.md
  29. WATCHLISTS
README.md

Dart

Dart is an open-source, scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps.

Using Dart

Visit the dartlang.org to learn more about the language, tools, getting started, and more.

Browse pub.dartlang.org for more packages and libraries contributed by the community and the Dart team.

Building Dart

If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.

There are more documents on our wiki.

Contributing to Dart

The easiest way to contribute to Dart is to file issues.

You can also contribute patches, as described in Contributing.

License & patents

See LICENSE and PATENTS.