Commit Graph

73 Commits

Author SHA1 Message Date
Ryan Macnak d36adbacaf [vm] Remove the VM isolate.
The former contents of the VM isolate are now included into each isolate group. This makes each isolate group's heap independent, and in particular allows each heap to be allocated to a separate pointer cage (not done in this CL).

The duplicated stubs that allowed PC relative calls are removed, since the originals can now be the target of PC relative calls.

The bootstrapping needing to load an AppJIT or AppAOT snapshot is reduced to allocating the oddballs. The code is entirely dropped in the AOT runtime, but the JIT runtime still has it to allow for flags to affect the compilation of the stub code. Further refactoring might be able to remove this for the JIT runtime too, with only gen_snapshot knowing how to bootstrap.

Class serialization no longer distinguishes predefined classes.

The page containing null is marked as never-evacuate. null, false and true must not move because the compiler relies on their low bits having certain patterns for some optimizations. (Previously, the entire VM isolate heap never moved.)

Compaction is disabled for IA32. Due to register pressure, some stub calls must not use a scratch register and embed the address of Code.

The page containing the call-through-safepoint stub is frozen when running with --write-protect-code and the stub is created at runtime (instead of loaded from an AppJIT or AppAOT snapshot). This stub must remain executable even during a safepoint, as a foreign call might during return during a safepoint and only block after the stub directs it to the runtime.

The snapshot symbols are renamed to kDartSnapshotData and kDartSnapshotText. There is no need to distinguish the VM isolate's snapshot, and snaphots are per isolate group not per isolate. Aliases with the old names are added to ease migration.

Some global flags that were automatically set based on the VM isolate's snapshot are now isolate group flags and automatically set by the isolate group's snapshot.

TEST=ci
Change-Id: Iee82016057d609112e9b021d178fc3d4d18b5044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500621
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-18 11:35:03 -07:00
Alexander Markov 51d1c8923a Reland "[vm,dart2bytecode,modular_aot] Variable-length closure objects"
This is a reland of commit 88496ba1c3

Fixes on top of the original change:

* Closure layout is changed to avoid gap between fixed fields and
  variable-length elements on compressed pointers architecture.
  This gap was causing crashes in the GC when scanning closure
  objects.

* pkg/vm_snapshot_analysis/test/instruction_sizes_test is fixed
  on arm64 by decreasing threshold for detecting size changes.

Original change's description:
> [vm,dart2bytecode,modular_aot] Variable-length closure objects
>
> Extend closure objects with variable number of elements to capture.
> This is needed to support capturing multiple independent contexts
> after capturing is computed in the front-end.
>
> The following fixed Closure fields are moved into variable-length
> elements:
>  - delayed type arguments;
>  - instantiator type arguments;
>  - function type arguments;
>  - context.
>
> Number of elements and presence/indices of various type arguments
> are encoded into the new length_and_flags field in the Closure.
>
> Most closure objects don't need any of the type arguments so this
> change will reduce average Closure object size.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61572
Issue: https://github.com/dart-lang/sdk/issues/61635

Change-Id: I8685e632e2d0832766ecdc470f3cf9a6b880de48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494243
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-04-10 06:15:22 -07:00
Alexander Markov 0dfaa16dc7 Revert "[vm,dart2bytecode,modular_aot] Variable-length closure objects"
This reverts commit 88496ba1c3.

Reason for revert: crashes on arm64c

Original change's description:
> [vm,dart2bytecode,modular_aot] Variable-length closure objects
>
> Extend closure objects with variable number of elements to capture.
> This is needed to support capturing multiple independent contexts
> after capturing is computed in the front-end.
>
> The following fixed Closure fields are moved into variable-length
> elements:
>  - delayed type arguments;
>  - instantiator type arguments;
>  - function type arguments;
>  - context.
>
> Number of elements and presence/indices of various type arguments
> are encoded into the new length_and_flags field in the Closure.
>
> Most closure objects don't need any of the type arguments so this
> change will reduce average Closure object size.
>
> TEST=ci
> Issue: https://github.com/dart-lang/sdk/issues/61572
> Issue: https://github.com/dart-lang/sdk/issues/61635
>
> Change-Id: I7ca5cec0fd8725c432a01d51781fb14e803997dd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489482
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Reviewed-by: Tess Strickland <sstrickl@google.com>

Issue: https://github.com/dart-lang/sdk/issues/61572
Issue: https://github.com/dart-lang/sdk/issues/61635
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I94c88f8922f6ea49251e942ba791fee714911e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494261
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-09 14:12:09 -07:00
Alexander Markov 88496ba1c3 [vm,dart2bytecode,modular_aot] Variable-length closure objects
Extend closure objects with variable number of elements to capture.
This is needed to support capturing multiple independent contexts
after capturing is computed in the front-end.

The following fixed Closure fields are moved into variable-length
elements:
 - delayed type arguments;
 - instantiator type arguments;
 - function type arguments;
 - context.

Number of elements and presence/indices of various type arguments
are encoded into the new length_and_flags field in the Closure.

Most closure objects don't need any of the type arguments so this
change will reduce average Closure object size.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61572
Issue: https://github.com/dart-lang/sdk/issues/61635

Change-Id: I7ca5cec0fd8725c432a01d51781fb14e803997dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489482
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2026-04-09 12:22:21 -07:00
Alexander Aprelev 48a80057ee [vm/gardening] Fix instruction_sizes_test.
Revert smallChangeThreshold, update expectation instead.

This is follow-up to https://dart.googlesource.com/sdk/+/2c715e92b66e108c1ee5bf837ff4a5c5860dce40.

BUG=https://github.com/dart-lang/sdk/issues/62232
TEST=ci

Change-Id: I4cfa4ccbcd08442681ccd037cfb4865fbb04a1b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467642
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-12-11 11:58:40 -08:00
Alexander Aprelev 2c715e92b6 [vm/sdk] Use FinalThreadLocal for Iterable toString.
This allows use of toString in isolategroup-bound callbacks.

BUG=https://github.com/dart-lang/sdk/issues/61030.
TEST=ci
CoreLibraryReviewExempt: effectively vm-only change
Change-Id: Iccdc218716cbbe2346aa85bb6134f4129debe057
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451841
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2025-12-11 09:32:41 -08:00
Sigurd Meldgaard 2fe05bd568 Reland "Migrate to use pub workspace"
This is a reland of commit b9b77058a9

Original change's description:
> Migrate to use pub workspace
>
> Use `pub get` to generate `.dart_tool/package_config.json` on gclient sync.
>
> All pkg/ (and a few third_party) packages that are developed inside the sdk repo are included in the workspace from the root `pubspec.yaml`.
>
> All dependencies that are pulled in via DEPS are added as path dependencies via `dependency_overrides` in the root `pubspec.yaml`.
>
> Bug: https://github.com/dart-lang/sdk/issues/56220
> Change-Id: I38c12b608c68da54c57821116cf9aa6696936746
> Tested: relies on CQ of existing tests. Should have no effect on functionality
> CoreLibraryReviewExempt: only core library change is adding a `// ignore:` comment. Should have no influence on functionality
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397164
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Bug: https://github.com/dart-lang/sdk/issues/56220
Change-Id: I29afabade2d2447dea05121cb87ff50bb21a4b76
Cq-Include-Trybots: luci.dart.try:flutter-linux-try,flutter-web-try
Tested: relies on CQ of existing tests. Should have no effect on functionality
CoreLibraryReviewExempt: only core library change is adding a `//
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415561
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-20 06:19:16 -07:00
Sigurd Meldgaard 6c4de1ab7e Revert "Migrate to use pub workspace"
This reverts commit b9b77058a9.


Revert "Add missing sample pubspec to workspace"

This reverts commit 892ea15ac7.


These seem to break the engine.

Change-Id: Ieee26deb7928c3869a1b6265326c3ce568ffe731
Tested: this is a revert.
CoreLibraryReviewExempt: this is a revert
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415582
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-14 09:08:20 -07:00
Lasse R.H. Nielsen 7fd5108794 Remove .packages from .gitignore files.
The `.packages` file is no longer a special Dart file,
so any existing file lying around is garbage to be cleaned up.
We shouldn't be hiding it.

Change-Id: I269099bd66e392d630d5b23f4617a705a66a0800
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414101
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-03-14 07:08:55 -07:00
Sigurd Meldgaard b9b77058a9 Migrate to use pub workspace
Use `pub get` to generate `.dart_tool/package_config.json` on gclient sync.

All pkg/ (and a few third_party) packages that are developed inside the sdk repo are included in the workspace from the root `pubspec.yaml`.

All dependencies that are pulled in via DEPS are added as path dependencies via `dependency_overrides` in the root `pubspec.yaml`.

Bug: https://github.com/dart-lang/sdk/issues/56220
Change-Id: I38c12b608c68da54c57821116cf9aa6696936746
Tested: relies on CQ of existing tests. Should have no effect on functionality
CoreLibraryReviewExempt: only core library change is adding a `// ignore:` comment. Should have no influence on functionality
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397164
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-14 05:21:40 -07:00
Sigurd Meldgaard 1e93ed73b5 Bump language version for pkg/vm_*
Extracted from https://dart-review.googlesource.com/c/sdk/+/397164

Change-Id: I73d4f1425e44d1e9dc152c189207ce09e811e2e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412083
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2025-02-27 01:16:11 -08:00
Devon Carew 98befcf281 [pkg] rev packages to have a min sdk verison of at least 3.0
Change-Id: I365abf095f0801bb8ce864f3bbaa57ff298164c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402881
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2025-01-06 14:54:35 -08:00
Martin Kustermann ebb856af29 Also add global owners to CFE/VM packages
This is a follow-up CL to [0] that tightened ownership.

[0] https://dart-review.googlesource.com/c/sdk/+/337980

TEST=ci

Change-Id: Icccdf95cec886cb03b84951949210daa71d48f2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338121
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-11-27 14:35:52 +00:00
Martin Kustermann 31130b14e7 CLs that change VM/CFE packages should get approval from the corresponding team
TEST=none
Change-Id: Iee3d8921f0ee28dc384490d1e235108a50ade415
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337980
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-11-23 11:09:50 +00:00
Devon Carew 6917656134 [pkg] remove duplicate config from the analysis options files
Change-Id: I149a97bbe260600a3de664b28c4d212dd9adb889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335862
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-11-14 00:37:53 +00:00
Alexander Thomas 4d308f3911 [build] Move runtime/third_party into third_party proper
* Add a chromium LICENSE file for binary_size.
* Update BUILD.gn files to still work.

Tested: CQ+flutter-linux-try
Cq-Include-Trybots: luci.dart.try:flutter-linux-try
Bug: b/286184681
Change-Id: Ia52839bc3edd9e42c2df27d0cb7d290851712249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332963
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-11-07 16:13:11 +00:00
Tess Strickland 1bdbafff49 [pkg/vm_snapshot_analysis] Allow old 'patched_class_' field.
While in more recent SDK versions the 'patched_class_' field has
been replaced with 'wrapped_class_', this package can still be
used with the earlier SDK versions if we fall back to checking it.

Issue: https://github.com/flutter/flutter/issues/130009
Change-Id: Ifb1250393b72e58bbdc0764c7e2ce96269e659ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312802
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-07-07 11:36:59 +00:00
Tess Strickland 1133598168 [pkg/vm_snapshot_analysis] Don't assume Code objects have an owner.
For regular stubs, the owner will be null.

Issue: https://github.com/flutter/flutter/issues/130009
Change-Id: I8c85e3130128af79c596f381869d61631221cf9e
Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312660
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-07 09:52:50 +00:00
Ryan Macnak a4f59b8c20 [gardening] Update PatchClass::patched_class_ to wrapped_class_ in pkg/vm_snapshot_analsysis.
Cf. 99db606bab

Change-Id: I653ab3d8d4bb0ccee0bfeed7e8ab5d2c219b6924
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311928
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-29 18:34:37 +00:00
Tess Strickland 766a2be5a4 [pkg/vm_snapshot_analysis] Use program.stubs as owner for TTS stubs.
Also remove the '<anonymous signature>' check, since we stopped
generating function objects for function types before the current
minimum SDK version for the package.

Change-Id: I47c0522ae4ba778221ee98f93fdae8c22a57d688
Bug: https://github.com/flutter/flutter/issues/128402
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307860
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-06-08 11:48:58 +00:00
Devon Carew 00972339e6 [pkg/vm_snapshot_analysis] update the readme for tool name changes
Change-Id: I0ea1f228d7d3405b0da24858fd5f03aa7e2c8ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289442
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-20 17:57:51 +00:00
Konstantin Shcheglov 895540889e Update SDK constraints for SDK packages.
https://dart-review.googlesource.com/c/sdk/+/287660 implements it.
I want to fix pre-existing violations before enabling.

Bug: https://github.com/dart-lang/sdk/issues/34978
Change-Id: Ie7731162c643018a2312b265f444bc00534c0a51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287664
Reviewed-by: Leon Senft <leonsenft@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-09 19:52:47 +00:00
Josh Soref 77978889eb Spelling
Closes https://github.com/dart-lang/sdk/pull/51143

GitOrigin-RevId: 9e21c99a222d588e4fc95980725a2f8c9784965c
Change-Id: If0870e8936c7649935dce7e23cd783d62aa5610c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279916
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-30 18:29:59 +00:00
Josh Soref 84e3c8b50f Spelling tests
Closes https://github.com/dart-lang/sdk/pull/50920

GitOrigin-RevId: fa87531bd0f52b69485c9d02ff9e44a4a29c6a91
Change-Id: I0ae8574a5b77087895e004079f221201bb550cf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278535
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-19 16:24:29 +00:00
Alexander Aprelev 4ae1500152 [gardening] Fix instruction_sizes_test on Windows
Bug: https://github.com/dart-lang/sdk/issues/45354
Change-Id: Idbf22076bf01e9dcbe20a6d99993b3283edc067f
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267244
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-11-03 01:50:48 +00:00
Alexander Aprelev 82dc3cbee9 [gardening] Fix closure naming, instruction_sizes_test
Fixes https://github.com/dart-lang/sdk/issues/48339
TEST=ci

Change-Id: I40b634e78b5b6744fd8c7c8d6d574bec333da82d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266820
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-11-01 14:50:02 +00:00
Jens Johansen b4e2012f5b [CFE] Remove support for .packages file
This CL:
* Removed the redirect from .packages to .dart_tool/package_config.json
  (whenever such a file existed).
* Removes support for the old format entirely.
* Updates all tests etc that were found.

Fixes https://github.com/dart-lang/sdk/issues/48939

TEST=Existing tests updated.

Change-Id: Iccf711c455ac1885189aa773ca74dd8f55012964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248603
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-06-24 08:20:39 +00:00
Devon Carew d798a7be34 [pkg] prep to publish package:vm_snapshot_analysis
Change-Id: I52ea64c667649a631f1232fe3cdf8933aee36e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246302
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-05-31 16:39:14 +00:00
Devon Carew f7c46f145c [pkg] prefer 'any' deps for package dev dependencies
Tested: CI validation
Change-Id: If65cc156130a65ffe00c6f1660ac320e2921afae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246053
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-05-27 01:34:59 +00:00
Devon Carew 2a20d4be24 [pkg] ensure each publishable package has a repository pubspec field
Change-Id: I06c0d10c87c3f329098352a7abe9ef9fa0b1532e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241504
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-04-19 22:13:51 +00:00
pq 47ac47fe90 lints 2.0 fixes
In anticipation of lints v 2.0.

(Note the ignores -- I was leery of making API changes but happy to with some guidance.)

See: https://dart-review.googlesource.com/c/sdk/+/237746

Change-Id: I93323e912911bbd62a583b379f0f8140a8ca448d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237764
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-03-17 23:41:27 +00:00
Alexander Thomas 30beab0f43 [infra] Add OWNERS to the Dart SDK
* Add team "groups" in tools/OWNERS_<group name>.
* Add top-level OWNERS as a fallback.
* Add OWNERS for all top-level directories.
* Add OWNERS to all packages.

For additional background information see go/dart-sdk-owners.

TEST=No op until code-owners is enabled.
Bug: b/200915407
Change-Id: I7fe6116cc599c749cd50ca16151d6d6a801d99d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229147
Reviewed-by: Jonas Termansen <sortie@google.com>
2022-02-14 14:06:34 +00:00
Polina bb81a1c1a0 Make dominator nullable.
TEST="tested with the added test 'root-dominator-is-null'"

Bug: https://github.com/flutter/devtools/issues/3025
Change-Id: Ifd6f926e3ecd486d383b03e8b81289310a653bb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230882
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
Commit-Queue: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
2022-01-31 21:26:14 +00:00
Michael Thomsen 24c35304c7 Fix windows extension
TEST=Not applicable, fixing existing test

Change-Id: Ie39b7d71fdd1260471f44d98b0f75fe2d5a39153
Bug: https://github.com/dart-lang/sdk/issues/46970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211060
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-08-24 18:01:23 +00:00
Michael Thomsen 6c5fb84716 Discontinue dart2native (use dart compile)
TEST=Existing tests updated to use dart compile

Change-Id: Ia3478069df2354a3bf057fedae0f1eea9415de95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210241
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-08-23 20:53:09 +00:00
Devon Carew a3256e6b2f [pkg/vm_snapshot_analysis] switch to using package:lints
Change-Id: Ia36b1bf1127e0b78e0294422cff78338ef19ec26
TEST=this CL updates static analysis settings and address associated warnings
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204640
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-06-24 17:07:48 +00:00
Tess Strickland 5eb887bfbc [pkg/vm_snapshot_analysis] Fix size check again after 7131d318.
After 7131d318 landed, the instruction size for the modified function
(which removes all but one closure) shrank enough to more than outweigh
the extra nodes that get attributed to it compared to the original.

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test

Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try
Change-Id: I05f2dbd6ec2850a66b38c9f70fb67a905208c384
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199660
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-05-13 14:36:11 +00:00
Tess Strickland aa952090fe [pkg/vm_snapshot_analysis] Update expectations in test.
Fixes https://github.com/dart-lang/sdk/issues/45986

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test
Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try
Change-Id: I0ab4ffb04349208007f01ff989a26efd297ec64b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199427
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-05-12 14:31:50 +00:00
Vyacheslav Egorov f72a31695c [vm_snapshot_analysis] Bump version number
TBR=alexmarkov@google.com
TEST=ci

Change-Id: Id7a6afc3df6d971372712707896d9976ecb038cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196493
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2021-04-22 20:55:46 +00:00
Vyacheslav Egorov 458be23fa7 [vm_snapshot_analysis] Migrate to null-safety
Fixes https://github.com/dart-lang/sdk/issues/45683

TEST=pkg-*-try bots

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-try,pkg-win-release-try
Change-Id: Ie10f313da9778d001f9c4fb618997e3b3c781dd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195263
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-04-15 12:03:47 +00:00
Tess Strickland dc88076767 [vm] Handle WSRs more generally in v8 snapshot profile writing.
Instead of special-casing the current fields that may have
WeakSerializationReferences, handle WSRs appearing as elements
or properties of objects more generally. This removes existing
special casing and avoids the need for it in case of new
future uses of WSRs.

For artificial nodes being added for dropped
WeakSerializationReference targets, add them as kArtificial nodes
(not kSnapshot) that has the original offset (element) or
name (property). The replacement is added as a kSnapshot node
that has a negative offset with the same magnitude as the
artificial node (element) or ":real_<property name>" (property).
This simplifies the work done in pkg/vm_snapshot_analysis to
use the artificial nodes instead of replacement ones for
reassembling hierarchies and the like.

This CL also cleans up the old SerializerWritingObjectScope
class, both moving it to Serializer::WritingObjectScope and
allowing nesting of WritingObjectScopes with the correct
semantics.

Thanks to this, not only can we recur when under a WritingObjectScope
instead of lifting recursion outside of those scopes, but we can
also create artificial nodes for non-empty per-code object pools and
static call target tables instead of attributing their contents
as supposed elements of the Code object being written.

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-try,pkg-win-release-try
Change-Id: Ib945c5afcd89b1458b8be3559b6eae24048aba2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194243
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-04-14 08:44:58 +00:00
Franklin Yow 03101c0c2b Update LICENSE
Changes to comply to internal review

Closes https://github.com/dart-lang/sdk/pull/45568
https://github.com/dart-lang/sdk/pull/45568

TEST=CL contains no code changes.

No-Try: true
GitOrigin-RevId: 65796784e5fdfddaa021b5c55ad435b1db419700
Change-Id: I085a948f16dc9a0de128ed0bd456ae69adf6c124
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193888
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-04-07 10:28:38 +00:00
Tess Strickland bc924667f4 [vm/compiler] Add artificial nodes for dropped parent functions.
Fixes https://github.com/dart-lang/sdk/issues/45483

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-try,pkg-win-release-try
Change-Id: I9e347bd38ec339b22d2ecefcce1b276d8ce3e3e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193303
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-04-07 04:48:46 +00:00
Tess Strickland e7d3a6027c [vm] Create more Function helper methods for code clarity.
Creates HasParent() as a predicate for Function objects with a non-null
parent function and makes IsLocalFunction() specific to local closures
(i.e. explicit closures with non-null parent functions).

Creates HasSavedArgumentsDescriptor() as a predicate to determine when
saved_args_desc() can be used, to avoid the caller having to do explicit
predicate checks for each dispatcher type that contains one.

Also simplifies Function::PrintName, creates different suffixes for a
SyncGenClosureMaker and its associateed SyncGenClosure, adds suffixes
for skipping more than one generated body when printing the parent name,
and changes ArgumentsDescriptor::PrintTo to match the compact syntax
Function::PrintName used for signifying the arguments descriptor for
certain dispatchers.

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test

Cq-Include-Trybots: luci.dart.try:app-kernel-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,pkg-linux-release-try
Change-Id: I0ac1226d1ffe1d81743b5c6788da170d5a4010c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191560
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-03-23 12:21:26 +00:00
jonahwilliams 48e952470a [vm_snapshot_analysis] bump dependency constraints
Flutter cannot update args dependency due to <2.0.0 constraint in package:vm_snapshot_analysis.

TEST=pkg-linux-release-try

Fixes #77856

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try
Change-Id: I93a057d023efe95a13a9a95d85b9405bf9de5ece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191988
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2021-03-18 21:18:53 +00:00
Vyacheslav Egorov 6d3f07f252 [vm_snapshot_analysis] Publish a new version
Issue flutter/flutter#76313

TBR=alexmarkov@google.com
TEST=not needed

Change-Id: I2a2fd49dff3dabaade8bbb8adf1f55b95956bc33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186144
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-02-22 09:16:01 +00:00
Vyacheslav Egorov d499f68df5 [vm] Fix vm_snapshot_analysis logic and tests
* When looking for Code node owner simply always check for synthetic
  owner (referenced through ':owner_' property) first. If it is present
  then it means 'owner_' property is invalid anyway. 25fd0200ef changed
  how WSRs are written into snapshot (instead of writing WSRs we are
  simply writing SMI CIDs) which broke previous logic.
* When building ProgramInfoNode for a Class node accommodate for the
  existence of classes which don't have 'library_' property (e.g. base
  objects like void and dynamic). Additionally, adjust how these base
  objects are written into the snapshot profile so that we preserve
  their names.
* Tweak tests diff and diff-collapse tests to pass, they were failing
  because prologue removal compiler change made some of the diffs so
  tiny that they are ignored by threshold filtering.
* Add two more tests: one that verifies that tracings flags don't have
  any impact on the snapshot size and one that checks we correct
  attribute instructions size to the function node from which these
  instructions originated. This last test is added in anticipation of
  Code object removal to make sure that vm_snapshot_analysis continues
  to work correctly.
* Adjust sorting rules for Code cluster to make it more stable between
  slightly different programs to stabilize output of
  --print-instructions-sizes-to (depends on the sorting algorithm used
  in libc, the test was failing on Mac but not on Linux).

These fixes should unblock relanding of b6dc4dad4d

Fixes #44507
Fixes flutter/flutter#76313

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test.dart

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: Iee0221dd3a507cb4f36d530404693ebfab3b7bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185826
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-21 15:48:27 +00:00
Lasse R.H. Nielsen 6e29700e16 Update List constructor documentation, deprecate constructor.
Emphasize that the operation is going away,
and mark constructor as deprecated.

TEST= Refactoring+deprecation only, covered by existing tests.

Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-07 16:20:28 +00:00
Vyacheslav Egorov 4d182203ca [vm] Include static call references into V8 profile
Code objects might be connected by static calls and these references
were not included into the profile. This lead to some objects being
unreachable from the root.

This CL also adds a test which computes dominators for all nodes
in the snapshot (this in turn verifies that there are no
unreachable nodes).

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: I2af4107fdb7f875624192e892ce1cec78cbf0dd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161709
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-08 12:11:34 +00:00
Vyacheslav Egorov 80504c8ffe [vm_snapshot_analysis] Fix issues with artificial nodes
This CL addresses two problems, which only reveal themselves when
analysing snapshots produced when function dropping is enabled.
When tests for snapshot analysis were written functions were dropped
in PRODUCT build by default - by currently this functionality needs
to be enabled separately or is automatically enabled when DWARF stack
traces are enabled. This CL changes test suite to enable DWARF stack
traces.

* When constructing ProgramInfo from V8 snapshot profile we should
not assume that Function nodes have any fields outside of owner_,
because Function node might be artificial and thus have no real
fields except for owner link.
* When writing V8 snapshot profile we should take care not to call
CreateArtificalNodeIfNeeded inside TraceStartWritingObject scope,
because CreateArtificalNodeIfNeeded might itself call
TraceStartWritingObject and these calls don't nest, the second one
overwrites the first one.

R=sstrickl@google.com

Bug: b/167601345
Change-Id: I40879ee087c38992388776af58b81bbefd147631
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161703
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-09-03 13:31:14 +00:00