dart-sdk/pkg/kernel
Jens Johansen 3dce89fbe0 [scanner] Don't give the Utf8 scanner a 0-terminated byte sequence
Not having to do the read-allocate-copy dance for files to add a 0-byte
at the end results in these changes when using the CFE to compile
(a fixed version of) the CFE:

```
msec task-clock:u: -1.7356% +/- 0.2164% (-73.16 +/- 9.12)
page-faults:u: -2.6957% +/- 0.0111% (-2914.83 +/- 12.00)
cycles:u: -1.7128% +/- 0.2223% (-297927979.70 +/- 38660477.01)
instructions:u: -1.6814% +/- 0.0002% (-361315766.86 +/- 36853.71)
branch-misses:u: -3.3289% +/- 0.9669% (-2153126.00 +/- 625370.97)
seconds time elapsed: -1.7372% +/- 0.2154% (-0.07 +/- 0.01)
seconds user: -1.5998% +/- 0.2740% (-0.06 +/- 0.01)
seconds sys: -4.1451% +/- 2.9801% (-0.01 +/- 0.01)
Scavenge(   new space) goes from 62 to 61
```

TEST=Existing test coverage.

Change-Id: I8e182bcee39839f6ed1e658c30c85c40ecf0b259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385722
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-25 08:33:48 +00:00
..
bin frontend: prepare for curly_braces lint change 2024-02-21 07:28:59 +00:00
doc
lib [scanner] Don't give the Utf8 scanner a 0-terminated byte sequence 2024-09-25 08:33:48 +00:00
test [scanner] Don't give the Utf8 scanner a 0-terminated byte sequence 2024-09-25 08:33:48 +00:00
.gitignore
analysis_options.yaml Ignore TODO in pkg/kernel. 2023-11-29 13:54:08 +00:00
AUTHORS
binary.md [kernel] Remove Extension.isExtensionTypeDeclaration flag 2024-07-22 14:42:13 +00:00
codereview.settings
LICENSE
OWNERS Let the infrastructure team bump the kernel language version. 2024-01-02 14:51:46 +00:00
PRESUBMIT.py [CFE et al] Optimize presubmit scripts 2024-01-31 10:41:20 +00:00
problems.md [cfe] Move fasta/codes/ to src/ and rename to cfe_codes* 2024-06-20 09:36:39 +00:00
pubspec.yaml [cfe] Clean up backend imports 2024-07-08 11:32:30 +00:00
README.md

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.