Commit graph

99383 commits

Author SHA1 Message Date
Paul Berry 3636c8a08b Fix pattern context type schema for cast patterns.
According to the patterns spec, the pattern context type schema for a
cast pattern should be `_`. What was actually implemented was
`Object?`.

This is unlikely to make a difference in practice, since (a) cast
patterns are unlikely to be used in circumstances where the pattern
context type schema makes a difference, and (b) it takes some effort
to come up with expressions whose type inference behavior is differenc
between a schema of `Object?` and a schema of `_`.

Change-Id: I695752c8c163621a34faaa8d62b2b076c8152eb0
Bug: https://github.com/dart-lang/sdk/issues/54640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346383
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-01-31 17:23:20 +00:00
Paul Berry 2958754ed8 Fix assertion failure computing "why not promoted" for a public getter.
The data structure in the front end for recording which getter names
can be type promoted via "field promotion",
`fieldNonPromotabilityInfo`, is a field in the `SourceLibraryBuilder`
class. This means that each library tracks its own notion of which
getter names are promotable. This makes sense because only private
getter names are eligible for field promotion, and private getter
names can only be used to access declarations in the same library.

Prior to this commit, if the user tried to perform type promotion on a
_public_ getter name, the shared flow analysis logic would correctly
deem that public name non-promotable and reject the promotion. If the
front end then called `FlowAnalysis.whyNotPromoted` (which it
typically does to get details about failed type promotions that lead
to compile-time errors), flow analysis would then use
`FlowAnalysisOperations.whyPropertyIsNotPromotable` to query the
`fieldNonPromotabilityInfo` data structure.

Since `fieldNonPromotabilityInfo` is tracked separately for each
library, if the public getter referred to a field declared in some
other library, no information would be found, so
`FlowAnalysisOperations.whyPropertyIsNotPromotable` would return
`null`. This would lead flow analysis to incorrectly conclude that the
reason for the getter name being non-promotable was due to a conflict
with some other getter with the same name in the same library, so it
would return `PropertyNotPromotedForNonInherentReason` to the front
end. The front end would then iterate through
`fieldNonPromotabilityInfo` looking for conflicting getters, again
finding nothing. This led to an assertion failure, because it doesn't
make logical sense for a getter name to be non-promotale due to
conflicts if there are no conflicts. In production builds of the front
end (with assertions disabled), the behavior was that the compile-time
error would simply have no "why not promoted" context message (which
is fairly benign, but still undesirable).

This commit fixes the bug by modifying the shared logic for
`FlowAnalysis.whyNotPromoted` so that if the getter name in question
doesn't begin with `_` (meaning it's public), then it doesn't bother
calling `FlowAnalysisOperations.whyPropertyIsNotPromotable` at all,
because it knows the non-promotion reason is because the name is
public. As a result, the correct context message gets generated, and
there is no assertion failure.

Note that the language test included in this commit doesn't check that
the correct context message is generated, because the test
infrastructure isn't capable of testing context messages that point to
other files. But it does still serve to validate that the assertion no
longer fires.

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

Change-Id: I697f55acad7c162bc5f49f2824c91d172497f344
Bug: https://github.com/dart-lang/sdk/issues/54777
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349405
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-01-31 15:40:38 +00:00
Martin Kustermann 226667e764 [gardening] Fix recent change to language/stack_trace/* tests in CSP mode
In CSP mode we cannot use `eval()`, so use static interop mechanism to
set stack trace limit. It seems `window` is available in Chrome and
others have higher limit anyway.

Change-Id: Id57dc86936d0568338a8ee4436e69e39be8eb32c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349483
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-31 14:38:43 +00:00
David Morgan 52eece2107 Skip test that hangs on reload bots.
R=dacoharkes@google.com

Change-Id: I4b34e53d7011c892e4e8a980739c1e054da5b35f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349480
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-01-31 12:08:34 +00:00
Jens Johansen f0ca213d60 [CFE et al] Optimize presubmit scripts
This CL optimizes how CFE et al presubmits are run.

In the examples below we'll that it takes the presubmit time from 31+
to ~13 seconds, from 31+ to ~20 seconds and from 30+ to ~19 seconds on
a few simple cases and from 76+ to ~27 seconds in a case where files in
both _fe_analyzer_shared, front_end, frontend_server and kernel are
changed.

Before this CL, if there was changes in both front_end and
frontend_server for instance it would run one smoke-test for each.
They would each technically only test things in their own directory,
but they would do a lot of overlapping work, e.g. compiling
frontend_server also compiles front_end; the startup cost of a script
is done several times etc.

The bulk of the change in this CL is thus to only run things once.
Now, if there is a change in both front_end and frontend_server the
python presubmit will still launch a script for each, but it's just a
light-weight script that will take ~400 ms to run (on my machine) if it
decides to not do anything. What it does is that it looks at the
changed files, from that it will know which presubmits will be run and
decide which of them will actually do the work - the rest will just
exit and say "it will be tested by this other one".

Furthermore it then tries to run only the smoke tests necessary.
For instance, if you have only changed a test in front_end it will only
run the spell checker (and only for that file).
Note that this is not perfect and there can be cases where you should
get a presubmit error but wont. For instance if you remove all content
from the spellchecking dictionary file it should give you lots of
spelling mistake errors, but it won't because it won't actually run the
spell checker (as no files it should spell check was changed).
Probably you have to actively try to cheat it though, so I don't see it
as a big problem. Things will still be checked fully on the CI.

Additionally
* the generated messages will have trailing commas which speeds up
  formatting of the generated files (in the cases where the
  generated files will have to be checked).
* the explicit creation testing tool will do the outline of everything,
  but only do the bodies of the changed files.
* building the "ast model" only compiles the outline.

Left to do:
* If only changing a single test, for instance, it will only run the
  spell checker on that file, but launching the isolate its run in
  still takes ~7 seconds because it loads up other stuff too. Maybe we
  could have special entry points for cases where it only should run an
  otherwise simple test.
* The presubmit in the sdk dir (not CFE related) doesn't do well with
  many (big) changed files and testing them for formatting errors can
  easily take 10+ seconds (see example below where it contributes ~5
  seconds for instance). Maybe `dart format` could be made faster, or
  maybe the script should test more than one file at once.


*Example runs before and after*:

Change in a single test file in front_end
=========================================

Now:

```
$ time git cl presubmit -v -f
[I2024-01-25 09:46:08,391 187077 140400494405504 presubmit_support.py] Found 1 file(s).
Running Python 3 presubmit commit checks ...
Running [...]/sdk/PRESUBMIT.py
Running [...]/sdk/pkg/front_end/PRESUBMIT.py
Presubmit checks took 11.5s to calculate.
Python 3 presubmit checks passed.


real    0m12.772s
user    0m16.093s
sys     0m2.146s
```

Before:

```
$ time git cl presubmit -v -f
[I2024-01-25 10:07:08,519 200015 140338735470464 presubmit_support.py] Found 1 file(s).
Running Python 3 presubmit commit checks ...
Running [...]/sdk/PRESUBMIT.py
Running [...]/sdk/pkg/front_end/PRESUBMIT.py
  28.3s to run CheckChangeOnCommit from [...]/sdk/pkg/front_end/PRESUBMIT.py.
Presubmit checks took 30.0s to calculate.
Python 3 presubmit checks passed.


real    0m31.396s
user    2m9.500s
sys     0m11.559s
```

So from 31+ to ~13 seconds.



---------------------------------------------------------------------

Change in a single test file and a single lib file in front_end
===============================================================

Now:

```
$ time git cl presubmit -v -f
Running Python 3 presubmit commit checks ...
Running [...]/sdk/PRESUBMIT.py
Running [...]/sdk/pkg/front_end/PRESUBMIT.py
  15.9s to run CheckChangeOnCommit from [...]/sdk/pkg/front_end/PRESUBMIT.py.
Presubmit checks took 18.0s to calculate.
Python 3 presubmit checks passed.


real    0m19.365s
user    0m33.157s
sys     0m5.049s
```

Before:

```
$ time git cl presubmit -v -f
[I2024-01-25 10:08:36,277 200953 140133274818432 presubmit_support.py] Found 2 file(s).
Running Python 3 presubmit commit checks ...
Running [...]/sdk/PRESUBMIT.py
Running [...]/sdk/pkg/front_end/PRESUBMIT.py
  27.9s to run CheckChangeOnCommit from [...]/sdk/pkg/front_end/PRESUBMIT.py.
Presubmit checks took 30.0s to calculate.
Python 3 presubmit checks passed.


real    0m31.311s
user    2m9.854s
sys     0m11.898s
```

So from 31+ to ~20 seconds.

---------------------------------------------------------------------

Change only the messages file in front_end (but with generated files not changing)
==================================================================================

Now:

```
$ time git cl presubmit -v -f
[I2024-01-25 09:53:02,823 190466 140548397250432 presubmit_support.py] Found 1 file(s).
Running Python 3 presubmit commit checks ...
Running [...]/sdk/PRESUBMIT.py
Running [...]/sdk/pkg/front_end/PRESUBMIT.py
  15.6s to run CheckChangeOnCommit from [...]/sdk/pkg/front_end/PRESUBMIT.py.
Presubmit checks took 17.0s to calculate.
Python 3 presubmit checks passed.


real    0m18.326s
user    0m38.999s
sys     0m4.530s
```

Before:

```
$ time git cl presubmit -v -f
[I2024-01-25 10:10:04,431 201892 140717686302592 presubmit_support.py] Found 1 file(s).
Running Python 3 presubmit commit checks ...
Running [...]/sdk/PRESUBMIT.py
Running [...]/sdk/pkg/front_end/PRESUBMIT.py
  28.0s to run CheckChangeOnCommit from [...]/sdk/pkg/front_end/PRESUBMIT.py.
Presubmit checks took 29.2s to calculate.
Python 3 presubmit checks passed.


real    0m30.550s
user    2m9.488s
sys     0m11.689s
```

So from 30+ to ~19 seconds.

---------------------------------------------------------------------

Change several files:
```
$ git diff --stat
 pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart         | 4 ++--
 pkg/_fe_analyzer_shared/lib/src/parser/listener.dart                  | 2 ++
 pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart | 2 ++
 pkg/front_end/lib/src/base/processed_options.dart                     | 2 ++
 pkg/front_end/messages.yaml                                           | 2 +-
 pkg/front_end/tool/dart_doctest_impl.dart                             | 2 ++
 pkg/frontend_server/lib/compute_kernel.dart                           | 2 ++
 pkg/kernel/lib/ast.dart                                               | 2 ++
 8 files changed, 15 insertions(+), 3 deletions(-)
```
====================

Now:

```
[I2024-01-25 09:57:53,270 193911 140320429016960 presubmit_support.py] Found 8 file(s).
Running Python 3 presubmit commit checks ...
Running [...]/sdk/PRESUBMIT.py
Running [...]/sdk/pkg/_fe_analyzer_shared/PRESUBMIT.py
  17.8s to run CheckChangeOnCommit from [...]/sdk/pkg/_fe_analyzer_shared/PRESUBMIT.py.
Running [...]/sdk/pkg/front_end/PRESUBMIT.py
Running [...]/sdk/pkg/frontend_server/PRESUBMIT.py
Running [...]/sdk/pkg/kernel/PRESUBMIT.py
Presubmit checks took 25.3s to calculate.
Python 3 presubmit checks passed.


real    0m26.585s
user    1m8.997s
sys     0m8.742s
```

Worth noting here is that "sdk/PRESUBMIT.py" takes 5+ seconds here

Before:

```
[I2024-01-25 10:11:39,863 203026 140202046494592 presubmit_support.py] Found 8 file(s).
Running Python 3 presubmit commit checks ...
Running [...]/sdk/PRESUBMIT.py
Running [...]/sdk/pkg/_fe_analyzer_shared/PRESUBMIT.py
  14.6s to run CheckChangeOnCommit from [...]/sdk/pkg/_fe_analyzer_shared/PRESUBMIT.py.
Running [...]/sdk/pkg/front_end/PRESUBMIT.py
  28.0s to run CheckChangeOnCommit from [...]/sdk/pkg/front_end/PRESUBMIT.py.
Running [...]/sdk/pkg/frontend_server/PRESUBMIT.py
  20.9s to run CheckChangeOnCommit from [...]/sdk/pkg/frontend_server/PRESUBMIT.py.
Running [...]/sdk/pkg/kernel/PRESUBMIT.py
Presubmit checks took 75.6s to calculate.
Python 3 presubmit checks passed.


real    1m16.870s
user    3m48.784s
sys     0m23.689s
```

So from 76+ to ~27 seconds.

In response to https://github.com/dart-lang/sdk/issues/54665

Change-Id: I59a43f5009bba8c2fdcb5d3a843b4cb408499214
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348301
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-31 10:41:20 +00:00
Daco Harkes 70e4ff3e1a Revert "[vm/ffi] Unwrap typed data in FFI calls"
This reverts: https://dart-review.googlesource.com/c/sdk/+/338620

We'd like to support this use case with a different API. See the
discussion in https://github.com/dart-lang/sdk/issues/54739.

TEST=tests/ffi

Bug: https://github.com/dart-lang/sdk/issues/44589
Bug: https://github.com/dart-lang/sdk/issues/54771
Change-Id: Ic22fbcab14d374bb9c81bba1f1bf6ae2dfc9e674
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349340
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-31 09:22:45 +00:00
Chloe Stefantsova 4dff1b3b0a [cfe] Report errors on attempts to call a record type
Closes https://github.com/dart-lang/sdk/issues/54616

Change-Id: Ib0a74ae139a56e0660b3cfb00127c898d693a03c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349000
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-01-31 08:46:40 +00:00
Martin Kustermann 8ea636f9f8 [dart2wasm] Make throw call to helper function that gets stacktrace and throws object
This reduces flute complex compiled with `-O4` by 3.2% (or 41kb)

Change-Id: I46e1e933b5b283a7e502571971802885c1c79372
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349261
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-31 08:43:18 +00:00
Devon Carew 2f0e466ca2 Bump webdev to 2539d54bca7143a2dd1a1ec5d55fa38ca481639c
Changes:
```
> git log --format="%C(auto) %h %s" f32fdc4..2539d54
 https://dart.googlesource.com/webdev.git/+/2539d54b Fix release script bugs (2363)
 https://dart.googlesource.com/webdev.git/+/12c1510e Reset webdev to 3.5.0-wip after release (2362)
 https://dart.googlesource.com/webdev.git/+/29da6087 Prepare Webdev for release to version 3.4.0 (2359)
 https://dart.googlesource.com/webdev.git/+/37f5276e Adding tests for cross-module constant equality after hot restart in DDC (2349)
 https://dart.googlesource.com/webdev.git/+/182a6e10 Reset DWDS after release to version 23.4.0-wip (2356)
 https://dart.googlesource.com/webdev.git/+/ab500b18 Prepare DWDS 23.3.0 release (2354)
 https://dart.googlesource.com/webdev.git/+/e382db35 Fix failures on displaying getters (2343)
 https://dart.googlesource.com/webdev.git/+/a5ad7532 Skip record type inspection tests (2352)
 https://dart.googlesource.com/webdev.git/+/0c4d9e52 Filter out internal type properties from the new DDC type system (2348)

```

Diff: https://dart.googlesource.com/webdev.git/+/f32fdc48f0ae7cb7fa8088233fd69e2ed30af457..2539d54bca7143a2dd1a1ec5d55fa38ca481639c/
Change-Id: I6170ed2b341591d7b432f74f2e6e957ae1ab0866
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349441
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-01-31 02:15:42 +00:00
Parker Lougheed 4725b282f9 [js_interop_checks] Update SDK constraint to support Dart 3
The package already uses 3.0 features after 3b294fdab2, but the usage wasn't caught due to https://github.com/dart-lang/sdk/issues/54764.

Since all packages that depend on this all require Dart 3 or greater now, we can increase the constraint and start to take advantage of its features. Also avoids a few checks and lookups :)

Change-Id: Iba539b86dc2f0117406b96e60ed8e92ea9ecf220
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349161
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-01-31 01:54:18 +00:00
Devon Carew 853ace7778 Bump native to 0eafd544d6ebce07b42007560ae9e0858c885d89
Changes:
```
> git log --format="%C(auto) %h %s" 40382ef..0eafd54
 https://dart.googlesource.com/native.git/+/0eafd544 [native_assets_cli] Better fix for dartdoc (951)
 https://dart.googlesource.com/native.git/+/9ee367d8 [infra] Don't fail fast (953)
 https://dart.googlesource.com/native.git/+/d6e69354 [native_assets_cli] Fix dartdoc generation (947)
 https://dart.googlesource.com/native.git/+/9322da76 Merge pull request 942 from dart-lang/patch-release-merge
 https://dart.googlesource.com/native.git/+/519a8b07 [native_assets_builder] Document rolling constraints (943)
 https://dart.googlesource.com/native.git/+/adb74419 Merge commit '153811080d9020c894c4e820053d2ede79ca9012' into x
 https://dart.googlesource.com/native.git/+/15381108 [native_assets_builder] Add `AssetRelativePath` back in

```

Diff: https://dart.googlesource.com/native.git/+/40382efb9c7a0774d2764238fc1802e562e9cbaf..0eafd544d6ebce07b42007560ae9e0858c885d89/
Change-Id: I1840211952f4186ba59ac4d29b960076f9352767
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349440
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-01-31 00:15:21 +00:00
Jake Macdonald 5120fa3418 JSON macro, collections support
Note that this crashes in the CFE currently.

Also, in the analyzer, the diagnostics are being attached to the macro application and not the type annotation which is provided as a target.

Change-Id: Id5fc36eb862314015fd6839167f8ba043cd7d34e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349181
Reviewed-by: Morgan :) <davidmorgan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-31 00:02:58 +00:00
Marya cce16ed108 Drop dart:html from readme
Closes https://github.com/dart-lang/sdk/pull/54775

GitOrigin-RevId: aeef490725f4bc0b627eaaa980920b8b9dfb5d26
Change-Id: I52c2c64826be2304006e1c27f55abf9a402ca5b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349402
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-01-30 22:35:52 +00:00
Devon Carew 15ca9f2288 [deps] rev args, csslib, ecosystem, html, http_multi_server, logging, mime, mockito, test, tools, vector_math
Revisions updated by `dart tools/rev_sdk_deps.dart`.

args (46d5033..03386ba):
  03386ba  2024-01-23  Albert Kaiser  Add missing curly braces in README.md (dart-lang/args#261)

csslib (1ad2d1e..ec86ee5):
  ec86ee5  2024-01-09  Kevin Moore  Require Dart 3.0, update and fix lints (dart-lang/csslib#194)

ecosystem (1e2785d..9ee08a4):
  9ee08a4  2024-01-29  Moritz  Add `ignore` flag to health workflows (dart-lang/ecosystem#218)
  a283d70  2024-01-17  Moritz  Make health testable (dart-lang/ecosystem#224)
  f61a550  2024-01-16  Moritz  Enable experiments for health (dart-lang/ecosystem#226)
  c81f25c  2024-01-16  Moritz  Add submodule support to `publish.yaml` (dart-lang/ecosystem#225)
  b51c356  2024-01-12  Moritz  Add submodules support to `health.yaml` (dart-lang/ecosystem#223)
  d7aaecb  2024-01-10  Moritz  Run `health.yaml` for bots (dart-lang/ecosystem#222)
  971c733  2024-01-10  Moritz  Don't write the failure string when skipping (dart-lang/ecosystem#220)

html (06bc148..910f6d7):
  910f6d7  2024-01-26  Kevin Moore  Update lints, require Dart 3.2 (dart-lang/html#236)
  aaf7d1a  2024-01-25  Kevin Moore  blast_repo fixes (dart-lang/html#235)

http_multi_server (ae48489..491f7c6):
  491f7c6  2024-01-24  Kevin Moore  Update lints, require Dart 3.2 (dart-lang/http_multi_server#63)
  0df95e0  2024-01-24  Kevin Moore  blast_repo fixes (dart-lang/http_multi_server#62)

logging (4d35a4e..e04942d):
  e04942d  2024-01-18  Kevin Moore  update min SDK and deps (dart-lang/logging#155)
  a03a946  2024-01-18  Craig Labenz  Hierarchical logging documentation (dart-lang/logging#146)
  439ec80  2024-01-18  Kevin Moore  blast_repo fixes (dart-lang/logging#154)

mime (ca9f059..99fbdcc):
  99fbdcc  2024-01-24  Kevin Moore  Update to latest lints, require Dart 3.2 (dart-lang/mime#114)

mockito (e15e000..0422551):
  0422551  2024-01-10  Oleh Prypin  Ignore "must_be_immutable" warning in generated files.

test (846d73e..6700049):
  6700049d  2024-01-29  Nate Bosch  Prepare to publish package:checks (dart-lang/test#2178)
  a5c4f010  2024-01-24  Nate Bosch  Use a raw string for console logging with path (dart-lang/test#2177)
  fe3102ee  2024-01-10  dependabot[bot]  Bump js from 0.6.7 to 0.7.0 in /pkgs/test (dart-lang/test#2168)
  c709cde0  2024-01-10  Jacob MacDonald  fix a bug where test html files were not created in precompiled mode (dart-lang/test#2170)
  0eddae47  2024-01-09  Nate Bosch  Document the silent reporter (dart-lang/test#2163)

tools (8ffc077..f6e67f2):
  f6e67f2  2024-01-29  Elias Yishak  Fix logic for first run to fix `shouldShowMessage` behavior (dart-lang/tools#228)
  b97bd5c  2024-01-29  Elias Yishak  Checking for devtools config file for opt out (dart-lang/tools#227)

vector_math (38a00c3..cb976c7):
  cb976c7  2024-01-28  Andrew Brampton  Update README.md to show how to use vector_math_64. (google/vector_math.dart#312)
  d99c903  2024-01-25  Andrew Brampton  Added a toString, operator == and hashCode to the Quad class. (google/vector_math.dart#311)

Change-Id: Ie42ec078b7b4d408d5167e38f05f1f37b754afb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349301
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-01-30 21:49:33 +00:00
Kallen Tu 442c5dc5a1 [analyzer] Clean up unused parameters in library_analyzer.
Found some unused parameters while looking through the LibraryAnalyzer.
This CL does a quick clean up of these helpers.

Change-Id: I90b2f8c6caeb9ac8e9c03b2367f33e93f5c711f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349362
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-01-30 21:46:03 +00:00
Konstantin Shcheglov aff3f425f5 Records. Support for RecordTypeAnnotation in constants.
Change-Id: Ic5e39dc6bdf8740d190346dad67197f445407715
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349302
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-30 21:41:29 +00:00
Stephen Adams bc2a1ef233 [js_dev_runtime] dart format --fix
Update js_dev_runtime and js_shared formatting.

Most changes are doc comments (`/**` to `///`) and some removal of unnecessary `new`.

This brings js_dev_runtime a little closer to js_runtime after the similar automated formatting of js_runtime.

Change-Id: I21b3d01ba4ad75b22c8c9623ac740502d1906d2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349084
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-01-30 20:41:20 +00:00
pq 9e9b56d7f4 migrate context_impl to use an options map
Some of the last steps before we can move to multiple options per context.

---

For anyone following along, the failing CBUILD should be a red herring as it's building against a stale version of Google3.

The breakage should be addressed w/ cl/602743519 (confirmed independently).


Change-Id: I513ed9bd21fa50cc94c2285a5653a14f1480c60e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-01-30 20:18:49 +00:00
MarkZ 91d22a7e40 [ddc] Renaming dart_library.js to ddc_module_loader.js
This also removes deprecated references to the DDC module system as the "legacy" module system.

This is part of an ongoing effort to deprecate the AMD module system: https://github.com/dart-lang/sdk/issues/52361

Change-Id: Ic32c6c6a0b7bf2c3bf0326be42cc9a88db8e303e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348183
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-01-30 19:43:49 +00:00
Konstantin Shcheglov b3551c5168 Prepare to publish analyzer 6.4.1 and _fe_analyzer_shared 67.0.0
Change-Id: Id92537afdf8646fd5019c35e65117930dfbd64e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-01-30 18:01:12 +00:00
Danny Tuppeny 8d936d38fc [analysis_server]/[analyzer_plugin] Make all toJson/fromJson methods go through a central converstion for Path<->URI Strings
This change shouldn't change any current behaviour, but means all "FilePath" types in the legacy protocol spec will go through a (currently no-op) conversion. The server will be able to replace this conversion based on client capabilities in a future CL.

Because a lot of the generated classes are in analyzer_plugin, this also moves the ClientUriConverter class there.

`pkg\analysis_server\test\src\utilities\json_test.dart` contains tests that the toJson/fromJson methods go through the converter recursively (inc. map keys/values/etc.).

Change-Id: If5aec884070128eea594540fd25a9017ada86079
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349060
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-30 16:58:25 +00:00
Daco Harkes 678b8e8746 [analyzer/ffi] Fix crash in ffi_verifier
Fixes a crash in the analyzer that was exercised via dartdoc in
https://dart-review.googlesource.com/c/sdk/+/342763.

Landing the analyzer fix separately, so that it can be rolled first.

Bug: https://github.com/dart-lang/sdk/issues/54754
Change-Id: I40375374cb785c11e3f0b2f21a8a2c74b8f080c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349240
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-30 16:15:39 +00:00
Alexander Markov 21b36928b6 [vm/aot/tfa] Speed up RTA on huge class hierarchies
Avoid iteration of all subtypes in RTA when adding selectors which are
already added. This is important when number of classes is very large
and hierarchy is very wide.

On a huge app (41K classes) RTA time 916723ms -> 56297ms (16x faster).

TEST=ci
Fixes b/322854909

Change-Id: I82b3094e09c010a20065cdde64dc3d7da9fe997a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349143
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-01-30 15:18:29 +00:00
David Morgan 6b5580da62 [macros] Add language test for introspection cycle.
Small changes so it passes on the analyzer, the CFE does not yet detect cycles.

R=jakemac@google.com, scheglov@google.com

Change-Id: Iaeb586da7066e50b5b90c9793bc34b51e0eabbbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345062
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-01-30 13:08:44 +00:00
Tess Strickland 0eac43bf6f [pkg/vm] Enable const functions during platform const field evaluation.
This allows more complicated field initializers that are written using
immediately invoked closures, like

@pragma("vm:platform-const")
final bool foo = () {
  ... do some stuff ...
}();

to be properly evaluated by the VM constant evaluator.

Also throws errors at compile time if the annotated member cannot be
evaluated to a constant or if an invalid member (not an
initialized static field or a static getter) is annotated.

TEST=pkg/vm/test/transformations/vm_constant_evaluator_test

Issue: https://github.com/dart-lang/sdk/issues/31969
Issue: https://github.com/dart-lang/sdk/issues/50473
Issue: https://github.com/flutter/flutter/issues/14233
Change-Id: I14be498bb5f7771f0f339baf7d3b1bec7df5903f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348380
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-01-30 12:48:49 +00:00
Daco Harkes f992bfc7b1 Revert "[vm/ffi] Introduce Struct.create and Union.create"
This reverts commit c2e15cff6d.

Reason for revert: https://github.com/dart-lang/sdk/issues/54754
Version skew somewhere in the analyzer/dartdoc/flutter combination.
We need to land the fix inside ffi_verifier.dart first, and then
reland the API docs that trigger the code path in the analyzer
that throws the exception.

Original change's description:
> [vm/ffi] Introduce `Struct.create` and `Union.create`
>
> Structs and unions can now be created from an existing typed data
> with the new `create` methods.
>
> The typed data argument to these `create` methods is optional. If
> the typed data argument is omitted, a new typed data of the right
> size will be allocated.
>
> Compound field reads and writes are unchecked. (These are
> TypedDataBase loads and stores, rather than TypedData loads and stores.
> And Pointers have no byte length.) Therefore the `create` method taking
> existing TypedData objects check whether the length in bytes it at
> least the size of the compound.
>
> TEST=pkg/analyzer/test/src/diagnostics/creation_of_struct_or_union_test.dart
> TEST=pkg/vm/testcases/transformations/ffi/struct_typed_data.dart
> TEST=tests/ffi/structs_typed_data_test.dart
> TEST=tests/ffi/vmspecific_static_checks_test.dart
>
> Closes: https://github.com/dart-lang/sdk/issues/45697
> Closes: https://github.com/dart-lang/sdk/issues/53418
>
> Change-Id: If12c56106c7ca56611bccfacbc1c680c2d4ce407
> CoreLibraryReviewExempt: FFI is a VM and WASM only feature.
> Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342763
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I285dc39946b5659219b37a1d8f10de479133957e
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349061
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-30 10:43:22 +00:00
DEPS Autoroller f76ec294ca Roll Clang from b3a9e8f7c0af to c58bc24fcf67
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/clang-dart-sdk
Please CC dart-engprod@google.com,dart-vm-gardener@grotations.appspotmail.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Clang: https://bugs.fuchsia.dev/p/fuchsia/issues/list?q=component%3AToolchain
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: I21b22e560a14ee0beae5b4b7b39b9e9f2939aaa2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348740
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-01-30 01:24:19 +00:00
Ryan Macnak 1501d688c0 [vm] Avoid allocation when printing type names.
Avoids recursive assertion failures when a GC assertion failure occurs during a compile.

TEST=ci
Change-Id: I2fd2b29c1a7d83c426ceb437f3880746a4c8d8b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349142
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-01-29 23:53:19 +00:00
Alexander Markov 8c5407b3dd [vm/compiler] Fix truncation of class id when it is stored in FieldGuardState
Class id can occupy more than 16 bits, so bit field
FieldGuardState::GuardedCidBits is extended. Also added assertion that
it has at least target::UntaggedObject::kClassIdTagSize bits.

TEST=ci, manually tested repro from b/322790241.
Fixes b/322790241

Change-Id: I39d0592a5a1c8e0c83b7af7d30de6f966b358fda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349082
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-01-29 23:44:59 +00:00
Konstantin Shcheglov 72fdb26e04 Macro. Remove @SkippedTest() for a test that actually passes.
Change-Id: I23f38f9bc3c0b3fcc81387af4e7d4f6037e7e89c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-29 23:29:27 +00:00
Ryan Macnak 362e5784b5 Roll boringssl to d24a38200fef19150eef00cad35b138936c08767.
TEST=ci
Change-Id: I789fd6c238743f040c229e342880392af2e118ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348761
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-01-29 23:24:36 +00:00
Brian Quinlan af79f2fe22 [io] Fix a bug where Socket.addStream never completes after the socket is destroyed.
Bug:https://github.com/dart-lang/sdk/issues/54735
Change-Id: I8895ff6271eb1019ddad13c171f36cbec5fd84cd
TEST=tests/standalone/io/client_socket_destroy_and_add_stream_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348764
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-01-29 23:09:22 +00:00
Konstantin Shcheglov 6293002ed7 Macro. Support for macro generated files in getFilesReferencingName()
Change-Id: Ie3fe2f10780d7f5b8a119ed35ef4de9c25f5eabd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348767
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-29 22:28:12 +00:00
Konstantin Shcheglov 36e4bf1709 Update expectations for macro files.
This is follow up to https://dart-review.googlesource.com/c/sdk/+/347680

Change-Id: I113e80bf57d369e8435894ef0ce79721653e9961
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-29 22:09:25 +00:00
Danny Tuppeny 6872a0bb77 [analysis_server] Combine writePackageConfig helpers from LSP and legacy server tests
Both LSP and legacy server tests had their own implementation of writing package_config files. This combines them by moving the LSP `ConfigurationFilesMixin` mixin to its own file and updating the legacy test classes to use it.

This removes a little duplication and avoids adding more for the temporary packages required for Macros that's currently only in the LSP version (but required for some upcoming LSP-over-Legacy tests).

Change-Id: Iaa4055c544df4cdd5a0f140b0c6171ff1a406946
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347081
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-29 21:57:13 +00:00
Brian Wilkerson 4cd6c05544 Remove tests for the non-nullable feature from server
Change-Id: I79608f35ca03ff27714dcc15ae372a19066af724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349140
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-29 21:15:47 +00:00
pq 23aff1c23e make RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA an error
Fixes: https://github.com/dart-lang/sdk/issues/54760

My thinking is this doesn't qualify as a breaking change in practical terms but would love Sam's feedback.


Change-Id: I073c478b21377113b3bdbdb3f940ef4dd2bea1d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-29 21:04:28 +00:00
Stephen Adams 0a0e9fb713 [js_runtime] dart format --fix
Update js_runtime formatting.
Almost entirely dropping unnecessary `new`.

Change-Id: I8016c77f405972abd17d2242497a400994e15be5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348860
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-01-29 20:48:09 +00:00
Danny Tuppeny f0e2f96a5c [analysis_server] Fix racy refactor test
This test relied on the file modification being processed during an `await` inside the refactor which could be flaky. Now we artificially pause the handler and resume it only after the test has sent (and awaited) the file update.

Change-Id: Ib99bed8c73cbfb64405908d08193733539669360
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349100
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-29 20:25:13 +00:00
Nicholas Shahan 29f5b4141f [ddc] Don't emit old type system variance
The variance information emitted here is only used in the old
type system so it can be skipped when using the new representation.

Change-Id: I43093c1742f9a89ef018dd76ec7a0bcd477414c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348801
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-01-29 20:08:28 +00:00
dependabot[bot] 67dc465e87 Bump actions/upload-artifact from 4.1.0 to 4.3.0
Closes https://github.com/dart-lang/sdk/pull/54756

GitOrigin-RevId: 9f1ba25ea9dd625ba7f09e102da69c7556ff433f
Change-Id: I047738022027c42e2832989065c377b4b62e7a16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348940
Reviewed-by: Alexander Thomas <athom@google.com>
2024-01-29 17:59:54 +00:00
Parker Lougheed 4ff3f604e0 [analysis_server] Suggest enum keyword at top-level
Fixes https://github.com/dart-lang/sdk/issues/54744

Change-Id: Ic43c761776b92529cb243e2338768ab6ab5f6f43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348543
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-29 17:25:17 +00:00
David Morgan 3c77c86929 [macros] Improvements to exceptions.
Introduce `MacroException` base type that is serializable as a `RemoteInstance`. This means that if a macro implementation does not catch the exception then the exact same instance will be recovered on deserialization.

Add `UnexpectedMacroException`, `MacroImplementationException` and `MacroIntrospectionCycleInspection`.

Update API docs, analyzer and CFE to throw MacroImplementationException instead of ArgumentError.

To do after this PR: update spec, analyzer and tests `StateError`->`MacroIntrospectionCycleInspection`.

R=jakemac@google.com

Change-Id: I76be4ef7687a5f5611c963be40fb0918ac3fb7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347680
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-29 15:53:27 +00:00
Tim Maffett cc309f25d5 change 'appsize' url to correct 'app-size' - Fixes #54724
Closes https://github.com/dart-lang/sdk/pull/54725

GitOrigin-RevId: a5b77575f45296e08707e3eca9701a5916419aa1
Change-Id: I6748c19578797443b83ef78fc9ca8d348066a131
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348187
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-29 14:23:28 +00:00
Chloe Stefantsova 1672177c20 [cfe] Report errors on awaiting types incompatible with await
Closes https://github.com/dart-lang/sdk/issues/54649

Change-Id: I66497f9251710723b983b9f29f3f22eff2c83d96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348640
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-01-29 13:48:39 +00:00
Martin Kustermann a2ee738dfc [dart2wasm] Make cid numbering of concrete classes perfect DFS pre-order
The CL removes a hack that assigned fixed class ids due to the need of
special treatment for masquerading types.

=> Instead of hard coding the type category values, we discover feasible
slots automatically, so we can remove the hack
=> Makes our cid numbering of concrete classes pure DFS pre-order
=> Ensures all concrete subclasses of a class have continious class ids

We also replace an assembly stub that deals with masquerading with one
written in Dart, adding the necessary primitives (e.g.
getting category type table & kinds).

We also align how to get the function type of a closure, namely
add `_Closure._getClosureRuntimeType()` analogous to the method on
`_Record._getRecordRuntimeType()`

Change-Id: I5169fc4953e8e99c4f84a1bbe8e535c08fb47cc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348840
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-29 12:53:57 +00:00
Robert Nystrom 41128c56e2 Roll latest dart_style into the SDK.
The only change here is support for the `macro` keyword which is gated
by the "macros" experiment flag.

Change-Id: I354820fc1847ef2391d2df92b634f7252bfc1000
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348722
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-01-29 08:23:08 +00:00
Martin Kustermann 148d5ac76d [dart2wasm] Add dart2wasm-linux-optimized-jsc builder (to existing configuration with same name)
Change-Id: I9b70605e52a06c3d7d3ce2d64b6dcad0e61f3074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348601
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-01-28 18:15:40 +00:00
Brian Wilkerson 2404a0cb4c Add a flag to disable debouncing of status notifications
I tried to find tests related to the server's command-line options, but
we don't appear to test them.

Change-Id: I0c840deca19402acc59fd5c126be46e4bb2de81d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348765
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-27 16:08:10 +00:00
Daco Harkes c2e15cff6d [vm/ffi] Introduce Struct.create and Union.create
Structs and unions can now be created from an existing typed data
with the new `create` methods.

The typed data argument to these `create` methods is optional. If
the typed data argument is omitted, a new typed data of the right
size will be allocated.

Compound field reads and writes are unchecked. (These are
TypedDataBase loads and stores, rather than TypedData loads and stores.
And Pointers have no byte length.) Therefore the `create` method taking
existing TypedData objects check whether the length in bytes it at
least the size of the compound.

TEST=pkg/analyzer/test/src/diagnostics/creation_of_struct_or_union_test.dart
TEST=pkg/vm/testcases/transformations/ffi/struct_typed_data.dart
TEST=tests/ffi/structs_typed_data_test.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

Closes: https://github.com/dart-lang/sdk/issues/45697
Closes: https://github.com/dart-lang/sdk/issues/53418

Change-Id: If12c56106c7ca56611bccfacbc1c680c2d4ce407
CoreLibraryReviewExempt: FFI is a VM and WASM only feature.
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342763
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-27 09:28:40 +00:00