Commit Graph

4 Commits

Author SHA1 Message Date
Moritz 7a83c82b4f [record_use] Don't record locations for usages and other refactorings
In preparation of a merge with the Dart2Js format in a follow up PR.

- Treat default values as passed arguments - `foo(4)` is the same as
  `foo()` for all intents and purposes for a `foo([int i = 4])`.
- Add signatures to lookup, as dart2js forgets them during
  compilation.
- Encode non-constant arguments as `null`, while a `null` passed as an
  argument is a `NullConstant`.

Tested:pkg/vm/test/transformations/record_use_test.dart
Change-Id: Ifd2597d8d1b979627fa45fd4736a762031c17216
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415620
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Moritz Sümmermann <mosum@google.com>
2025-04-28 06:12:00 -07:00
Moritz 7222c2963d Add recording of constant instances to record_use
TESTED=pkg/vm/test/transformations/record_use_test.dart

Change-Id: I73ee5b7f1478286252664c53397270906ead549b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384280
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2024-09-13 09:07:02 +00:00
Moritz 81daf8e563 Use package:record_use
- Rename resource identifiers in the VM to usage recordings.
- Use package:record_use for serialization.
- Rename and use the experimental flag for this feature.
- Recognize tear-offs and top-level methods as well.

Next steps:

- Add constant instance recording.
- Expose API in package:native_assets_cli's link callback.

TEST=pkg/vm/test/transformations/record_use_test.dart

Change-Id: I8af3625165f78925ae943711245af93a239d1012
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383040
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2024-09-12 08:47:53 +00:00
Moritz a9319821bc Add package:record_use
This package provides (de-)serialization for recorded usages (formerly known as resource identifiers).

Adding to the SDK packages for faster development for now - to be moved to dart-lang/ on Github in the future.

See also the review at https://github.com/dart-lang/native/pull/1479.

Change-Id: I4796bbf5616f64ce700a1bc59f279883acb36263
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383340
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-09-06 13:13:16 +00:00