dart-sdk/pkg/kernel
Jens Johansen 7e792e7a8b [kernel/DDC] Fix failing DDC tests; if finding no scope for offset find for a close previous offset instead
When landing https://dart-review.googlesource.com/c/sdk/+/342400
the ddc-mac builder (but not Linux and Windows) started failing.
I could reproduce on Linux though so I'm not sure why those builders
didn't fail (nor why it wasn't caught by the try bot), either way this
fixes the issues:

* Test update: E.g. a breakpoint at the end of the scope doesn't work
  because it will not be inside the (wanted) scope.
* Test update: Evalating "this" now actually works.
* Scope finding update: DDC adds sourcemapping entries for the *end* of
  things so e.g. the getter "c" will have offset and offset+1 added as
  source mappings. When translating from javascript position to dart
  position we might pick that and thus ask for the scope of offset+1,
  but nothing will be found because no node has that offset.
  Here I add a fall-back saying that if we get no results we ask again
  for the nearest lower offset.

Change-Id: I7e4430d9954466494b514cf51d999358483c9f8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345501
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2024-01-12 08:21:00 +00:00
..
bin [cfe] Rename InlineClass to ExtensionTypeDeclaration 2023-08-01 09:04:38 +00:00
doc [cfe] Remove kernel-semantics.tex 2021-09-02 13:54:15 +00:00
lib [kernel/DDC] Fix failing DDC tests; if finding no scope for offset find for a close previous offset instead 2024-01-12 08:21:00 +00:00
test [CFE] More dart scope calculator stuff 2023-12-04 11:25:19 +00:00
tool [frontend_server] CFE team takes ownership of package:frontend_server 2023-12-19 10:38:28 +00:00
.gitignore
analysis_options.yaml Ignore TODO in pkg/kernel. 2023-11-29 13:54:08 +00:00
AUTHORS
binary.md [cfe] Refactor FunctionNode.futureValueType into emitted value type 2023-12-19 08:44:43 +00:00
codereview.settings
LICENSE Update LICENSE 2021-04-07 10:28:38 +00:00
OWNERS Let the infrastructure team bump the kernel language version. 2024-01-02 14:51:46 +00:00
PRESUBMIT.py [build] Python 3.12 compatibility. 2023-12-12 18:19:35 +00:00
problems.md Fix typos 2022-10-12 14:12:42 +00:00
pubspec.yaml [kernel] Add sealed classes GenericDeclaration and GenericFunction 2023-09-08 08:32:25 +00:00
README.md Remove outdated information from pkg/kernel/README.md 2018-10-09 11:09:27 +00:00

Dart Kernel

Dart Kernel is a small high-level language derived from Dart. It is designed for use as an intermediate format for whole-program analysis and transformations, and to be consumed by codegen and execution backends.

The kernel language has an in-memory representation in Dart and can be serialized as binary or text.

Both the kernel language and its implementations are unstable and are under development.

This package contains the Dart part of the implementation and contains:

  • A transformable IR for the kernel language
  • Serialization of kernel code

Note: The APIs in this package are in an early state; developers should be careful about depending on this package. In particular, there is no semver contract for release versions of this package. Please depend directly on individual versions.

See ast.dart for the in-memory IR, or binary.md for a description of the binary format. For now, the textual format is very ad-hoc and cannot be parsed back in.