Commit graph

97150 commits

Author SHA1 Message Date
Derek Xu
01653dc009 [VM] Add protoc_gen_dart_wrapper
TEST=Tried running
./tools/build.py -mdebug -ax64 runtime/vm:perfetto_protos_dart on both
Linux and Windows

Fixes: https://github.com/dart-lang/sdk/issues/53496
Change-Id: I73c9bd5218dbaacb2096cf48bf7583485bdf0506
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325880
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-09-13 20:26:30 +00:00
Konstantin Shcheglov
47bf677824 Remove unused parameters from buildLibrary()
Change-Id: I4e48001f8de80050bc011aca0c2aa8d05fb01746
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325804
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-13 19:38:40 +00:00
pq
0cb8294574 validate @protected extension type members
See: https://github.com/dart-lang/sdk/issues/53434

Change-Id: I4bd62ec9c4791e9046e285c782bb6e9adfced9eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-13 19:24:18 +00:00
Konstantin Shcheglov
6a3551ce62 Augmentation. Resolve field references.
Change-Id: Ia73a7229470b66d313e2101bb8d85d1c4e576190
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325841
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-09-13 18:27:28 +00:00
Sam Rawlins
339d9f2dc5 analyzer: add doc directive support for example and macro
Work towards https://github.com/dart-lang/sdk/issues/52705

Change-Id: I9c3dc18546345905f179eef01c94bac2277e6bfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325581
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-13 18:03:42 +00:00
Paul Berry
7c38351cbb Improve explanation of noSuchMethod / field promotion interaction in CHANGELOG.
Fixes #53510.

Bug: https://github.com/dart-lang/sdk/issues/53510
Change-Id: I25b9bb4c59a4c438c7d4f48cf955e388c22378f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325740
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-09-13 17:56:25 +00:00
William Hesse
8f556fcb8f [test] Disable Chrome event throttling in background tabs while testing
Timer events and perhaps other events are throttled when a Chrome tab
is in the background or not visible. This may be causing flaky timeouts
in Dart web tests that rely on many timers. In local testing, these
flags completely eliminated the problem.

IntensiveWakeUpThrottling is a web standard feature, and
TimerThrottlingForBackgroundTabs is a Blink-specific feature.

Bug: https://dart-review.googlesource.com/c/sdk/+/324203
Change-Id: I38904015b043768689be3a05bea5a50ad32df434
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325780
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-13 17:55:38 +00:00
Sam Rawlins
283dad4ddc analysis_server: Enforce single quotes preference
Change-Id: I553befc2c45e66bfc569004d810b4e0a958d4baa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325544
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-09-13 17:48:22 +00:00
Danny Tuppeny
ec0dc8fe55 [analysis_server] Handle annotations + default to new protocol for completion metrics tool
Change-Id: I57c8f077ccc853ae7ece44c776e16e0f30401a66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-13 17:47:35 +00:00
pq
2f13f043d5 disallow literal extension type declarations
As per the discussion in https://github.com/dart-lang/sdk/issues/53508, this way of annotating primary constructors is ambiguous. Removing.

Change-Id: I1425b95185ee05cfed953fd8b0b845a2ddd8b8f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325802
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-13 17:06:48 +00:00
Sigmund Cherem
38f62d2159 [cfe,analyzer] tweak to generated files to reduce chance of conflict.
This updates the generator of experimental flags to only refer to one
location for the current default language version.

Semantically the change does nothing, but it could make CLs that bump a
version smaller and easier to revert/patch.

Change-Id: I1c18c8e8105dfb33a302949ad2cfa159dae2addf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325660
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-09-13 16:23:44 +00:00
Konstantin Shcheglov
83fc1c2af8 Augmentation. Adding constructors.
Change-Id: I6c93c00e469dad4799eb9c662d924160fa2d338a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325452
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-13 15:51:19 +00:00
Alexander Aprelev
bc5008a023 [benchmark] Add uimatrix benchmark.
https://github.com/yjbanov/uimatrix is WIP, but already proved useful to highlight areas for some performance improvement.

Change-Id: I8f86163e91e276ee4195b7d5c635ffbf3dbaa075
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325320
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-09-13 15:27:37 +00:00
Ryan Macnak
578f95ad2e Roll double-conversion to 032fa6a7d2c319b20d3928f5d762648fa4029acf.
Bug: https://github.com/dart-lang/sdk/issues/47835
Change-Id: I5c2a278071f3c8e704754cc27fdd33a108eaf7dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325543
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-09-13 14:54:27 +00:00
Johnni Winther
36b93f6b08 [cfe] Make ConstantVisitor(1) a pure interface
This splits ConstantVisitor(1) into a pure interface and a
ConstantVisitor(1)DefaultMixin with the base implementation. This is
a step towards avoid having an accidental default implementation where
a static error would have been preferable.

Also removes BodyVisitor1 which was unused.

TEST=existing

Change-Id: I265754e13e0ebcce5c154b16c7ee36854f4ce9fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325400
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-09-13 14:02:28 +00:00
Johnni Winther
79ad624ef0 [cfe] Handle extension type constructors and instance methods with the same name
These are supported but there synthesized names conflicted.

TEST=pkg/front_end/testcases/constructor_tearoffs/lowering/constructor_member_conflict.dart

Change-Id: I952907eb83d7e496eb7d53f5c6b67d8f1e87308b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324680
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-09-13 13:15:20 +00:00
Alexander Thomas
b555e71ecd [infra] Bump checked-in SDKs to 3.2.0-150.0.dev
Fixes: https://github.com/dart-lang/sdk/issues/53505
Change-Id: I8c3b83919ad2cbc97e92f1d626c6f9105802d2a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325700
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-09-13 11:42:51 +00:00
Ryan Macnak
ea9656ba38 [test] XCode's nm not available on shards that haven't yet run main task.
Change-Id: Ib438cac3acf1842afb4d55a203d1f7a0c91f5918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325451
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-09-13 10:27:59 +00:00
Martin Kustermann
781a8ef9c0 [vm] Mark external methods used in Pointer.asTypedList() with resulting type
It allows the compiler to propagate this information in TFA - which
may be beneficial for cases when those methods aren't inlined.

TEST=ci

Change-Id: I55711806800e2a56e83a42cd51be705b68c3a4f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324701
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-09-13 09:48:56 +00:00
Nate Biggs
655687db77 [dart2js] Cache deferred JS AST bodies during printing and source map generation.
There was a bug in source map generation introduced by this deferring. A map from JS Nodes to source map info is being shared between these two operations and in order to look up nodes in the map, the Node objects must be the same.

This gives up some but not all of the gains from deferring these function bodies. I'm working on a more long term fix that combines these two passes of the AST.

Bugs: https://github.com/dart-lang/sdk/issues/53466
Change-Id: If25d1b24dd32456155e8802725d480454c71d2b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325600
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-09-13 02:35:01 +00:00
Robert Nystrom
b35c645302 Roll the latest dart_style into the SDK.
There are a couple of small format changes, but they are minimal
enough that we might not need to land a pre-built SDK with this.

Change-Id: I1d258c8a782e5db24c2048f407a8b7cf7b948eef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325580
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-09-13 01:44:57 +00:00
pq
293848fd52 fix literal checks for extension type primary constructors
Change-Id: I6d2406b23bdca0639408166129eefacc4fad30a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-13 00:18:51 +00:00
Srujan Gaddam
4efb33e128 [dart:js_interop_unsafe] Rename extensions and make []/[]= take String properties
Strings are the most likely use case of getting and setting
properties, and therefore we should make that easier to use.
This CL also renames the extensions in dart:js_interop_unsafe
to a more relevant name and to avoid conflicts in dart:js_interop.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: Ia8ce6593167c648f9710b47cfe27f80c854be407
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324572
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-09-12 23:11:55 +00:00
Ryan Macnak
3a5a7106ee [build] Define DART_SHARED_LIB for elf_loader.cc.
This makes elf_loader.cc consistent with the other compilation units containing Dart_* functions. Addresses a Mac linker warning that these functions match the export glob but have hidden visibility.

TEST=build
Change-Id: I868c9940a7027c466c1173aa2db2fbeff6fe8999
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325362
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-09-12 22:42:38 +00:00
Vyacheslav Egorov
5c320a108a [vm/compiler] Improve flow sensitivity of CP
Before running CP find all branches of form `Branch(v eq C)`,
where `eq` is one of `===`, `==`, `!==` or `!=` and `C` is
a constant and insert a redefinition of `v` in the true
successor which captures the information that `v` is equal
to `C` guaranteed by the branch.

SCCP algorithm can then use this information when propagating
constants. After SCCP all redefinitions inserted are removed
again.

We don't actually replace `v` with `C` in the dominated code
because this might lead to issues later, for example
it might result in redundant phis `phi(C, v)` (`C` flowing
from a predecessor where `v == C`) which are complicated
to eliminate again.

TEST=vm/dart/comparison_canonicalization_il_test

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-android-release-arm64c-try
Change-Id: I388dddb97b5e35f09d9904000c585864f27400f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324980
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-09-12 22:39:25 +00:00
DEPS Autoroller
16cc32f0ec Roll gn from e3978de3e8da to 991530ce394e
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/gn-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com,dart-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in gn: https://bugs.chromium.org/p/gn/issues/list
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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

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: If061efacb379bc27e1dd246036f2174e42425646
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325462
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2023-09-12 22:24:55 +00:00
Sam Rawlins
10da52b016 linter: Move sized_box_shrink_expand tests
Change-Id: I8fccc19af7ed2895b710e00feae3145e6ff8e401
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325480
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-09-12 22:16:59 +00:00
Konstantin Shcheglov
eeebd36a42 Augment. Use AugmentableElement<T> to share implementation.
Change-Id: Iccd84409eb198995e1a0e014cfb3d706fba99675
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325542
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-12 22:16:52 +00:00
pq
3a24a90cdd add a primaryConstructor getter to ExtensionTypeElements
Change-Id: Ib77fb3caebe2039062063ad75f56947f07487fa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325446
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-12 21:47:33 +00:00
Devon Carew
4722e4deca [deps] rev dartdoc, ecosystem, http, native, test, tools, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (f5750f5..dd28f4c):
  dd28f4ce  2023-09-11  dependabot[bot]  Bump actions/cache from 3.3.1 to 3.3.2 (#3497)
  2ac7e323  2023-09-11  dependabot[bot]  Bump actions/upload-artifact from 3.1.2 to 3.1.3 (#3496)

ecosystem (2e6c3ec..e96fbdb):
  e96fbdb  2023-09-12  Moritz  Try a fix for the health check socket issues (#164)
  4cc5005  2023-09-11  Alexander Thomas  Add missing license header to license.dart (#166)
  3fbab6c  2023-09-10  Moritz  Fix boolean condition in `publish.yaml` (#163)

http (7fb6fd6..de19214):
  de19214  2023-09-12  Sam Rawlins  Avoid passing a nullable value to Completer<nn-type>.complete (#1015)

native (a2dfedc..5177659):
  5177659  2023-09-12  Daco Harkes  [native_assets_builder] Speedup builds for 0 or 1 packages with native assets (#129)
  7f30f4b  2023-09-12  Daco Harkes  [native_assets_builder] Take packageLayout for build and dryRun (#127)
  a7cd31e  2023-09-12  Daco Harkes  `PackageLayout` constructor for already parsed `PackageConfig` (#126)
  9f24b64  2023-09-11  Daco Harkes  [native_toolchain_c] Fix MSVC x86 toolchain resolution (#124)
  07e1de5  2023-09-06  Daco Harkes  Reenable example on CI + roll dep (#122)
  387f894  2023-09-06  Gabriel Terwesten  [native_toolchain_c] Default handling for PIC/PIE compiler flags (#121)
  0a4e5f8  2023-09-06  Gabriel Terwesten  Add support for defines to `CBuilder` (#120)

test (27dcae1..6449495):
  64494959  2023-09-11  Jacob MacDonald  skip failing wasm tests (#2091)
  83ae0d9f  2023-09-07  Jacob MacDonald  Fix running browser tests that use deferred loading (#2090)

tools (2c8cbd6..fa01f9b):
  fa01f9b  2023-09-11  Elias Yishak  `--disable-telemetry` --> `--disable-analytics` (#145)

webdev (9487a45..6b21ecf):
  6b21ecf0  2023-09-11  dependabot[bot]  Bump actions/labeler from 4.2.0 to 4.3.0 (#2177)
  78a5fece  2023-09-11  Sam Rawlins  Avoid passing a nullable value to Future<nn-type>.value or Completer<nn-type>.completer. (#2205)
  6f282432  2023-09-11  Parker Lougheed  [webdev] Hide `--null-safety` option (#2206)
  1c5a7bc7  2023-09-11  Parker Lougheed  Replace deprecated lints (#2208)
  f0656b4a  2023-09-11  Parker Lougheed  Fix a few minor spelling mistakes (#2209)
  158223b2  2023-09-11  Parker Lougheed  Update old dartlang.org links to new .dev equivalents (#2210)
  a8d114c5  2023-09-11  Elliott Brooks  Update the comment for lookupResolvedPackageUris
  76e050c6  2023-09-11  Elliott Brooks  Clear the map of relative URIs on DartUri.clear()
  38a17ced  2023-09-11  dependabot[bot]  Bump dart-lang/setup-dart from 1.3.0 to 1.5.0 (#2212)
  cca9e56d  2023-09-11  Elliott Brooks  Reset Webdev after release (#2227)
  824dcef7  2023-09-11  Elliott Brooks  Reset DWDS after release (#2225)
  45c09a80  2023-09-08  Elliott Brooks  Prepare Webdev for release to 3.0.8 (#2224)
  805d3b7e  2023-09-08  dependabot[bot]  Bump actions/cache from 3.2.2 to 3.3.2 (#2223)
  85d4e760  2023-09-08  Elliott Brooks  Prepare DWDS for release to version 21.0.0 (#2221)
  a3757f06  2023-09-08  Anna Gringauze  Run monorepo generate (#2222)
  c991e85a  2023-09-07  dependabot[bot]  Bump actions/checkout from 3.2.0 to 4.0.0 (#2219)
  9851c23c  2023-09-07  Parker Lougheed  Update SDK constraints for Dart 3.0 and 3.1 stable releases (#2207)

Change-Id: I0caf74af171916d30eb8ee2ab78c15acaebaa229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325560
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-09-12 20:27:57 +00:00
Alexander Markov
3ec9cc86c8 [pkg/vm] Bump language version to 3.0 and cleanup experimental flags
Minimum SDK version is increased in order to be able to use Dart 3.0
language features in pkg/vm.

TEST=ci

Change-Id: I4ef1139b2f8ba8acc7dbcf9bc0fe77f663cc427d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325541
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-09-12 20:18:59 +00:00
Jackson Gardner
67f0d4daf0 Revert "[dart2wasm] Replace struct.new_default with struct.new for object"
This reverts commit 5a4b252252.

Reason for revert: Causing Flutter engine unit test failures, see https://github.com/dart-lang/sdk/issues/53506

Original change's description:
> [dart2wasm] Replace `struct.new_default` with `struct.new` for object
> allocation.
>
> When using the `struct.new_default` instruction for object allocation,
> fields are always nullable and mutable. By using the `struct.new`
> instruction instead, class fields can now have the same mutability and
> nullability in Wasm as declared in Dart. In addition, the class ID and
> type parameters (which are also stored in an object's struct), can now
> be immutable and nonnullable as well.
>
> To do this, object construction is now split into three functions:
> (1) Initializer: evaluates initializers for instance fields and
> constructor initializers (this constructor before super constructor).
> (2) Constructor body: executes the constructor body (super constructor
> before this constructor), with `this` pointed to the constructed object.
> (3) Constructor allocator: which calls (1), allocates the object using
> `struct.new`, then calls (2).
>
> Because fields now have the correct mutability and nullability in Wasm,
> this removes unnecessary null checks for nonnullable fields, and may
> allow for better optimisations by Binaryen.
>
> Fixes https://github.com/dart-lang/sdk/issues/51492
>
> Change-Id: Ib26046686f772a70509a870301217e9b1c91b77e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315820
> Commit-Queue: Jess Lally <jessicalally@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>

Change-Id: I034d3acf3715abadc6811a7393ba780bee974329
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325445
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-12 20:16:56 +00:00
Sam Rawlins
45930e3d62 linter: Mark use_build_context_synchronously stable
Fixes https://github.com/dart-lang/linter/issues/3915



Change-Id: I4909b6440859174852f85084fef4c847f0f46a94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325365
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-12 19:50:09 +00:00
Sam Rawlins
cdf016c6ab analyzer: Support animation doc directive; refactor classes
Work towards https://github.com/dart-lang/sdk/issues/52705

Change-Id: Idc77bf866beace85b40b30d464ff4c7c62e19735
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325360
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-12 19:40:38 +00:00
pq
ba70bed261 @literal support for extension types
See: https://github.com/dart-lang/sdk/issues/53434

Change-Id: I2668b74e2037176d0ac6e6da22300be29ba14d8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325444
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-12 19:04:19 +00:00
Kenzie Schmoll
83b27b8bcf Add a retry to the DevTools handler for static files
Change-Id: Iced8093f894afd5574e3ae898e07f237e02002bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325323
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-09-12 18:52:01 +00:00
Brian Quinlan
f0632629c3 [io/doc]: Provide more references to SocketOption.tcpNoDelay.
Bug: https://github.com/dart-lang/sdk/issues/52102
Change-Id: I759735acfb0a67a3c0e359d6cf4c0ecab97c6c2a
CoreLibraryReviewExempt: doc-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325443
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-09-12 18:15:08 +00:00
Sam Rawlins
252bfcb27a Move UNIGNORABLE_IGNORE from HintCode to WarningCode
Work towards https://github.com/dart-lang/sdk/issues/50796

Change-Id: Idb8d04eb07beeb4f201ca69d0543d85305d62ea8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325127
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-12 17:26:29 +00:00
Ryan Macnak
df54b81dd1 [vm] Remove dead ARMv5 code.
TEST=build
Change-Id: I44b41bb783b5f5cad221d4508fee18ff0a23afe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325144
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-09-12 16:22:19 +00:00
Johnni Winther
df89d602ee [cfe] Make TypeDeclarationBuilder and DeclarationBuilder sealed
Change-Id: I4f61e6ff41bb7505b22c3449f92088ca9f353e41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324060
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-09-12 12:23:33 +00:00
Vyacheslav Egorov
1a0e5dea69 [vm/service] Handle raw types in CollectStringifiedType
This function did not handle raw types correctly: it assumed that
TAV is always non-null, but VM replaces TAVs of form
`<dynamic, ..., dynamic>` with `null`. We needed to handle
this case specially.

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

TEST=service/evaluate_variable_of_raw_type_test

Change-Id: If0a2669fd722fb0e0871138a68814a751888f4b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325420
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Slava Egorov <vegorov@google.com>
2023-09-12 12:09:06 +00:00
Lasse R.H. Nielsen
c15f054809 Hide the existence of EfficientLengthIterable better.
The `EfficientLengthIterable` is an internal marker interface
that allows the SDK to more efficiently check, effectively,
`v is List || v is Set || v is Queue`, and some other
known internal types, which allows it to assume that `.length`
is efficient and doesn't iterate the iterable.

It's not intended for external use, but the current design
both has the name mentioned specifically in the declaration
of the public types `List`, `Set` and `Queue`,
and possibly allows the type to leak through the
least-upper-bound algorithm.

This change moves the mention of `EfficientLengthIterable`
from the public types to an anonymously named private type,
and ensures that the private type is never the result of
a least-upper-bound computation, by adding another
interface with the same depth that all the public
types implementing `EfficientLengthIterable` also implement.

(A longer term solution to `EfficientLengthIterable` looking
like it's a public name could be combining the collection-
related code from `dart:collection`, `dart:core` and
`dart:_internal` into a single `dart:_collection_impl`,
and exporting the relevant types from there. Then
we could make the interface be `_EfficientLengthIterable`
again.)

Change-Id: I717743f0ca253782162be0ad9ff05036fdf57159
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322320
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-09-12 11:08:42 +00:00
Johnni Winther
f7090efca0 [analyzer] Ensure converted errors are reported
This adds an assert to `FastaErrorReport.reportByCode` to help avoid
missing errors because the parser error was accidentically ignored.

Special-casing is added for the messages currently skipped but
reported elsewhere.

Change-Id: I3944569bb858a1956b91c3343a4e982882afb803
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-09-12 09:17:57 +00:00
Sergey G. Grekhov
05d04c79f9 [co19] Roll co19 to 5b9b08fb3210ee83a92ab4afe2268326761dd9a9
2023-09-08 sgrekhov22@gmail.com Fixes dart-lang/co19#970. Don't use Process.kill() to exit a process (dart-lang/co19#2266)
2023-09-08 sgrekhov22@gmail.com dart-lang/co19#2258. Reapply review changes (dart-lang/co19#2267)
2023-09-08 sgrekhov22@gmail.com dart-lang/co19#2258. Update private fields promotion tests according to the new spec. Part 1 (dart-lang/co19#2263)
2023-09-08 sgrekhov22@gmail.com dart-lang/co19#1400. Add late instance variable test (dart-lang/co19#2264)
2023-09-06 sgrekhov22@gmail.com dart-lang/co19#1400. Add promotion of a representation variable test (dart-lang/co19#2262)
2023-09-05 sgrekhov22@gmail.com dart-lang/co19#2258. Rename and reorder private fields promotion tests (dart-lang/co19#2260)
2023-09-05 sgrekhov22@gmail.com dart-lang/co19#2258. Update assertions of private fields promotion tests. Add new ones (dart-lang/co19#2259)

Change-Id: I905f37237a432fa5a6488dbfc4bdddd45cf6c91b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325220
Reviewed-by: Alexander Thomas <athom@google.com>
2023-09-12 08:44:26 +00:00
Vyacheslav Egorov
7ff975c2e5 [vm/compiler] Fix InferredTypeMetadata::IsTrivial
`IsTrivial` is supposed to return true iff `ToCompileType` would
produce a trivial (dynamic) type. However `IsTrivial` was taking
some of the irrevant parts of the `InferredTypeMetadata` into
account - meaning that it returned `false` where it should have
returned `true`.

This lead us to assign useless `dynamic` result type to various `StaticCall`, some of these calls can later be lowered to
`LoadIndexed` instructions, which will then also get the `dynamic`
result type. This useless type will then take priority over more
precise element type which could be inferred by
`LoadIndexedInstr::ComputeType`

TEST=vm/dart/load_indexed_trivial_type_il_test

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-android-release-arm64c-try
Change-Id: I69ee965ba0d0ac85ede3989680371f0dda19d8a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325302
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-09-12 08:13:12 +00:00
Jens Johansen
cef9865586 [CFE/DDC] Fix leak caused by cached diagnosticReporter
In 8f4e5c8194 the `DiagnosticReporter` was cached in
`DevCompilerTarget` which introduced a memory leak.
Unfortunately our weekly bot that looks for leaks has been out of
commission, but is now coming back online.

This CL fixes the leak by overwriting the field every time, meaing we
don't save a reference to the first one (which is a leak).
Maybe ideally we shouldn't save it as a field at all, but that's a
potential for another day.

Change-Id: Ic740a212c436c475688a1de73c55a2344301e688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325260
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-12 06:11:28 +00:00
Zijie He
5282f6e33f [Fuchsia] Create CFv2 support
This change created a CFv2 build target and provided two
implementations of the FuchsiaEmulator, so that I can continually work
on both CFv2 build and test script integration independently.

The v2 target can be built with
```
tools/build.py --os fuchsia --mode release fuchsia_ffi_test_package_cfv2
```
And v2 FuchsiaEmulator implementation can be triggered with
FUCHSIA_CFV2 environment variable.

Bug: #38752
Change-Id: I31936a2ca967fbfeb2bc5628e2f005aef6762687
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322583
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
2023-09-12 01:40:52 +00:00
Sam Rawlins
6f5606d442 Bump dartdoc to f5750f502fdbb887c93cd29aca1e573a92342c53
Change-Id: Iea45fb207114d9284fdba65857cea23f877c3b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-12 00:31:40 +00:00
Sam Rawlins
84655ea85d analyzer: Move FileSystemEntity methods to FileSystemEntity
Change-Id: I029203dbca21e96e5e57d2b347b9577223d32b84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325324
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-11 23:54:30 +00:00
Kallen Tu
f2e11bdeee [analyzer] Allow spreads between const lists and sets in the const evaluator
The change allows const lists to be in the spread of a const set and vice-versa. It also reports the correct error if we use a map in a list/set (and vice-versa) which is necessary when we combine all the error reporting in the `ConstantVisitor` to one location.

Adds some additional tests to make sure the behaviour we want is still working.

Change-Id: I0f64d58c857bd905ac8521346cd34a113b6d4a40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323780
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 23:39:30 +00:00