Commit graph

101335 commits

Author SHA1 Message Date
Sigurd Meldgaard 5ae66feaac Mention workspaces in CHANGELOG
Change-Id: I6c2fe0f87292402f5af1399fc6fb4706c32dead6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368342
Reviewed-by: Sarah Zakarias <zarah@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-05-28 10:07:09 +00:00
Jens Johansen f22752f661 [kernel] Give better error message if crashing on .location
In for instance https://github.com/flutter/flutter/issues/148668 we
crash on .location, but don't have anything to go on about why that is.
This CL adds more information (e.g. the url, and - in the particular
crash - it would also have added the name of the procedure it got the
uri from).

If this will actually be enough (once a crash comes in with this info)
to fix the issue, I'm don't know, but it should give us more to go on.

Change-Id: Iceab6f7841380d59aa39f26a728fd8fcad90ffb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368303
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-05-28 07:28:59 +00:00
Ömer Sinan Ağacan a0f1bd5a4b Update test for #45060
Equal types should have the same hash, but they are not necessarily
identical.

Update the test to remove the identity check between a constant type and
a type constructed in runtime.

Change-Id: I0d6c6395c587391d3087c26b00fff36d645b33dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368340
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-05-28 07:10:39 +00:00
Sam Rawlins cf4550718f DAS: Move CorrectionProducer and Selection classes
Work towards https://github.com/dart-lang/sdk/issues/53402

None of the classes which were moved are changed in any way.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: If81098971de044e2f69c1039ec23eff07b108af6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368066
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-05-28 04:54:08 +00:00
Chloe Stefantsova 991fbf4aca [cfe] Avoid concurrent modification in delayed action processing
Closes https://github.com/flutter/flutter/issues/148611

Change-Id: Idb091df6d771f286428809326e65ac6203f09d49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368301
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-05-27 13:11:55 +00:00
dependabot[bot] 9a7e07aca0 Bump github/codeql-action from 3.25.5 to 3.25.6
Closes https://github.com/dart-lang/sdk/pull/55846

GitOrigin-RevId: 94c89fafc90542b8b81056f9ffcaaee12e77eda4
Change-Id: Id9140855246167ceb968692b04fab41154a3be72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368280
Reviewed-by: Alexander Thomas <athom@google.com>
2024-05-27 12:19:44 +00:00
Martin Kustermann 827a7c4e95 [dart2wasm] Only perform compile-time lookup in constant list if index is in-bounds
We have an optimization that will do list lookups at compile time when
the receiver is a constant list and the index is a constant integer.

=> We should only perform this optimization if index is in-bounds.
=> If it's out-of-bounds it should be a [RangeError] thrown at runtime
   (if that code is ever executed)

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

Change-Id: I3e99cdd96c79e7ff3f490babb2d52131cbd83a88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368302
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2024-05-27 11:52:48 +00:00
Johnni Winther 85ab16ff67 [cfe] Add OffsetMap
This adds OffsetMap to avoid using names (or other means) to
connect objects/builders created in the OutlineBuilder with the
DietListener. The OffsetMap uses offsets, through Tokens or
Identifiers, as the key for the created objects.

Change-Id: I704d8f8374402463ea741e36ed15b279acb85535
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366942
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-05-27 08:12:34 +00:00
Ivan Inozemtsev 72b2883c6f Revert "[js_runtime, js_dev_runtime] Implement microsecond field of DataTime"
This reverts commit fb057ea4e0.

Reason for revert: b/342552853

Original change's description:
> [js_runtime, js_dev_runtime] Implement `microsecond` field of `DataTime`
>
> - Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.
>
> - Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.
>
> - The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.
>
> - Both implementations report better errors.
>
> - Fixed VM bug with in-range sentinel.
>
>
> Change-Id: I9156255bdb6ecc195500ae9bc88f91fb315b6297
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366963
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>

Change-Id: I58572256a7710df4589bb5e41c7afee295c2388b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368103
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-05-27 07:54:14 +00:00
Johnni Winther a3f83a9e44 [vm] Generate VM platform dill in strong mode
This changes the VM platform dill from agnostic to strong. The
VM no longer supports weak mode, so agnostic is not needed.

TEST=existing

Change-Id: I85defb6aec15262b71b4f1c199e77bd356826332
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366670
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-05-27 07:52:24 +00:00
Sam Rawlins cf7a697aa5 DAS: Run the shadowing test
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ie7ab482018ecc6c74ac8fd9f3bb533f33ed3bd62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368240
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-25 05:31:18 +00:00
Sam Rawlins f07e042eaf linter: Fix avoid_types_on_closures for inference cases
Fixes https://github.com/dart-lang/linter/issues/1099
Fixes https://github.com/dart-lang/linter/issues/3330

We just add a check that the (approximate) context type is a function type.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I56fe14ff8852375754fdaf6b92b3c632b7df9c95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367982
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-05-25 05:28:39 +00:00
pq aa28753491 quick fix for MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE
Change-Id: I0a397f3aa1fd697014ff20debfbe08a1ea2f62e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368181
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-05-24 22:26:58 +00:00
Parker Lougheed a768742545 [linter] Clarify that none can be specified to disable highlighting
Fixes https://github.com/dart-lang/site-www/issues/5861

Change-Id: Ic0dfdded5f38f1de4a19a7b41e52f87f3f9b9cef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368221
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-24 22:11:51 +00:00
Konstantin Shcheglov f42b019f43 Macro. Support for 'extendsType'.
Change-Id: Ic913d26b630f2d2f22fd6c4dec25ed27814d9f8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368201
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-24 21:38:51 +00:00
Jake Macdonald 0ee590e954 stop importing util.dart, it isn't supported (imports dart:mirrors)
Change-Id: I1dd4d650ace0866e3ef88655582c7edfcf946d01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368222
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-05-24 21:27:04 +00:00
Konstantin Shcheglov f02f12be97 Macro. Start implementing reusing cached results.
Change-Id: I35e145da373abb5d8b3065c7e1c5402434351905
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-24 21:17:38 +00:00
Jake Macdonald ba9af345c2 fix failing pkg/_macro/test/executor/executor_test
Change-Id: I15040720ae47f28b90064db94b1c08cd9db1484f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-24 21:01:54 +00:00
pq 61c46d06c2 Fix removed lint rule test
Change-Id: I8fee5a30ae9135e2af247432887d375acb7e4d26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368200
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
2024-05-24 20:23:08 +00:00
Sigmund Cherem 9dad32ce41 [ddc] Library level expression evaluation for the Dart SDK.
Today, support for expression evaluation in DDC uses a lot of
information.  To properly support compiling expressions in arbitrary
frames, we consume source-maps, module metadata, and full kernel
components at various stages of the process.  This data is already
plumbed and available for non-sdk modules in our debugging systems
(frontend-server, webdev, g3), however it is not available the Dart
SDK module itself.  Because of that, the expression compiler today
rejects all expression evaluation requests when the target is a Dart
SDK library.

Until the fix the availability of this data everywhere, we believe
we can support a limited form of expression evaluation: only
evaluation of libary level expressions. Basically, expressions
where scope data is not necessary and kernel outlines are sufficient to
compile the expression.

Here we introduce logic to recognize the first offset location of a
library, which is a clear indicator that no scope data is needed and
a library level expression evaluation is being requested.

This change is an attempt to help resolve
https://github.com/flutter/devtools/issues/7766.  Note: just like
changes were needed here in the worker and test-compiler files, it
is possible that some change may be necessary in dwds and other
parts of the pipeline.  Additional validation will be needed after
this lands.

Change-Id: Iff081a24ecb05092407279a0a7ed3d38c13cf41d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367981
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-05-24 20:08:37 +00:00
Kallen Tu 70b9b4637b [wildcard-variables] Add async rethrow test and wildcard patterns.
Fix follow up comments with an async rethrow test.
Tests that wildcard patterns still work while mixed with wildcard variables.

Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: If6ab4de68ff27ad51215427a7183f1aed7229947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367501
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-05-24 18:40:47 +00:00
pq 8e405fdff7 quick fix for EXTENSION_TYPE_WITH_ABSTRACT_MEMBER
Change-Id: I6f4874a3919bcaeab094a1488c131542469eb7c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367984
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-24 18:36:07 +00:00
Jake Macdonald 0d2b01bab3 add extendsType API which adds an extends clause to an existing type
refactors builder implementations to fix some bugs, nested builders go through a separate constructor now which has all required params so we can ensure the parent maps are passed down.

update pubspecs/changelogs for release

Bug: https://github.com/dart-lang/sdk/issues/55425
Change-Id: I5bfe3bea3b7574de83d8b3774e92fd9101325b8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368080
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-05-24 18:16:22 +00:00
pq 1e9351672b quick fix for CLASS_INSTANTIATION_ACCESS_TO_STATIC_MEMBER
Change-Id: Id39b57597f8d34084f6b931526dd31b85207da41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-24 18:05:09 +00:00
pq ab41d83dd9 quick fix for UNDEFINED_LINT
Change-Id: I375d523ba7dcf7fbe8ab55c7efb38c80880e24c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367763
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-24 17:07:11 +00:00
Sam Rawlins 51f8b43696 linter: typos in use_build_context_synchronously
Fixes https://github.com/dart-lang/linter/issues/4979

Change-Id: I9692ccaf16b04a37071c16a9fdd172532916c86e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368120
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2024-05-24 16:24:30 +00:00
Sam Rawlins c45bc06571 analyzer: Fix return_of_do_not_store tests
Bug: https://github.com/dart-lang/sdk/issues/48476

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I3af9ad950b2ef42717fb84dde4f9b3c22993df05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367860
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-24 16:22:19 +00:00
Jake Macdonald 7134ba1d6d package:json - drop vendored packages, prep to release
Change-Id: I974f10d91e4213476ac7e32c1ab3b0d0bef6b15e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367841
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
2024-05-24 15:41:05 +00:00
Sergey G. Grekhov 5d959fcef1 [co19] Roll co19 to 3b6147cd64211dace7ea86b9bab7ba48f4a328d2
2024-05-24 sgrekhov22@gmail.com Fixes dart-lang/co19#2684. Update expected errors positions for CFE (dart-lang/co19#2685)
2024-05-24 sgrekhov22@gmail.com dart-lang/co19#2641. Add wildcards do not shadow tests (dart-lang/co19#2683)
2024-05-23 sgrekhov22@gmail.com dart-lang/co19#2641. Add patterns tests (dart-lang/co19#2682)
2024-05-22 sgrekhov22@gmail.com dart-lang/co19#2641. Check that it is still an error to declare more than one enum member named `_` (dart-lang/co19#2674)
2024-05-22 sgrekhov22@gmail.com dart-lang/co19#2641. Add import prefix tests (dart-lang/co19#2681)
2024-05-22 sgrekhov22@gmail.com dart-lang/co19#2641. Add record types tests (dart-lang/co19#2679)
2024-05-22 sgrekhov22@gmail.com dart-lang/co19#2641. Add local functions test (dart-lang/co19#2680)
2024-05-22 sgrekhov22@gmail.com dart-lang/co19#2641. Check that it is still an error to declare more than one extension type member named `_` (dart-lang/co19#2675)
2024-05-21 sgrekhov22@gmail.com dart-lang/co19#2641. Add late variables named `_` tests (dart-lang/co19#2677)
2024-05-21 sgrekhov22@gmail.com dart-lang/co19#2641. Check that it is still an error to declare more than one extension member named _ (dart-lang/co19#2676)
2024-05-19 sgrekhov22@gmail.com Fixes dart-lang/co19#2660. Add missing import to augmented_expression_A01_t05_lib.dart (dart-lang/co19#2673)
2024-05-17 sgrekhov22@gmail.com dart-lang/co19#2641. Check that it is still an error to declare more than one mixin member named `_` (dart-lang/co19#2672)
2024-05-17 sgrekhov22@gmail.com dart-lang/co19#2641. Wildcards. Update expected errors positions for CFE (dart-lang/co19#2671)

Change-Id: Ia94383cb2dc2a5912950ee3e13ee93a9576f3500
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367963
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-05-24 10:46:44 +00:00
Johnni Winther a59faa2636 [cfe] Remove nnbd annotation from id-tests
Change-Id: Ib63b80e19027389cec41adf705829b5d4201c0d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366669
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2024-05-24 10:44:54 +00:00
Vyacheslav Egorov a4dd314c9e [tools] Allow precompiling gen_kernel and compile_platform
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.

This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.

AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.

pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.

Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.

Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.

This relands 5cda2a871c with fixes
for Flutter build.

TEST=manually tested

Change-Id: I552861c80c152890655e41baaf6ea3fb3b03a57e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367961
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-24 09:40:39 +00:00
Sigurd Meldgaard 7dad9a6516 Bump pub to 75ab224376e80e918d3c53494a36d4bf8a2f2af6
Changes:
```
> git log --format="%C(auto) %h %s" e70850b..75ab224
 https://dart.googlesource.com/pub.git/+/75ab2243 `outdated` show transitive dependencies by default (4277)
 https://dart.googlesource.com/pub.git/+/e05f76bf Properly handle case where the client is unable to fetch advisories  (4275)
 https://dart.googlesource.com/pub.git/+/0e870f21 Fix bug in ensureUpToDate fast path, when following workspaceRef (4276)

```

Diff: https://dart.googlesource.com/pub.git/+/e70850b53ef9b15a08af7fb0f0f2dcdbfa762b34..75ab224376e80e918d3c53494a36d4bf8a2f2af6/
Change-Id: Icdd4d09df26fda60a015a5d71816e86a8a707e86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368101
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2024-05-24 08:31:12 +00:00
Jens Johansen 213e679f59 Reapply "[CFE] Coverage on try bot"
This reverts commit 60a52f66f5.

This runs the strong suite, does coverage, and compares the coverage
(percentage) to the (hardcoded) expected percentage.

Change-Id: Ie2885fae05015394e49feadc95b294d46ee9ab8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367901
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-05-24 07:44:08 +00:00
Nate Biggs a52acf1ff2 [dart2js] Fix memory regression in closed world due to member/call pattern on wide type hierarchy.
If the enclosing class is a leaf node search for live matches in "canHit". Do this by iterating the class hierarchy starting at the enclosing class of the element and checking the supertype to see if they're included in the constraint set.

Change-Id: If859bbca1d2744303c03ac91d1601a05c61dfc2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367220
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-05-23 21:02:51 +00:00
Srujan Gaddam 8c049ac2ea Revert "Update package:web rev to 7604578eb538c471d438608673c037121d95dba5"
This reverts commit 751052e826.

Reason for revert: Broke a target in google3 due to name collisions of "Module"

Original change's description:
> Update package:web rev to 7604578eb538c471d438608673c037121d95dba5
>
> Includes 7604578eb5.
>
> Change-Id: I7437304ee64cb71608ed36597d26921991faa3b6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367520
> Auto-Submit: Srujan Gaddam <srujzs@google.com>
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Commit-Queue: Devon Carew <devoncarew@google.com>

Change-Id: I419f2b044be8196554bad7c3a9530e30acabcafc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368041
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-05-23 20:06:21 +00:00
Brian Wilkerson 5bcc5100b3 Remove dead code updating opType
These assignments don't impact any of the following code because we
no longer reference these fields.

Change-Id: I83e294c2dc7f4487f8fe9b2b284c9e6eaf050f1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368040
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-23 19:55:31 +00:00
Daco Harkes b732c96e8a Revert "[vm, gc] Incremental compaction, take 2."
This reverts commit 9077bf991f.

Reason for revert: CBuild and TGP crashes in random Dart code which
look a lot like arbitrary memory corruption.

Original change's description:
> [vm, gc] Incremental compaction, take 2.
>
> - Fix missing store buffer flush when --marker_tasks=0.
> - Fix passing untagged pointer to store barrier check on ARM/ARM64 (6bc417dd17).
> - Fix passing uninitialized header to store barrier check on ARM64/RISCV (1447193053).
>
> TEST=ci
> Bug: https://github.com/dart-lang/sdk/issues/52513
> Bug: https://github.com/dart-lang/sdk/issues/55754
> Change-Id: Id2aa95b6d776b82d83464cde0d00e6f3b29b7b77
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367202
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

Bug: https://github.com/dart-lang/sdk/issues/52513
Bug: https://github.com/dart-lang/sdk/issues/55754
Change-Id: I1d70d33c65fe6bf7089b8c1422d59f9146ae7ebf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367962
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-23 19:00:50 +00:00
Derek Xu b2a27cbf90 [DDS] Add missing await of WebSocketChannel.ready
TEST=pkg/dds/test/unawaited_web_socket_channel_ready_regression_test

Fixes: https://github.com/dart-lang/sdk/issues/55731
Change-Id: I4629618f74ca42927cd3291cb04a63aa4e938b82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368001
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-05-23 18:52:23 +00:00
Alexander Markov 345b437179 [vm, dart2wasm, tfa] Do not infer nullable return type when static type is non-nullable
With sound null safety, implicit "return null" at the end of function
should be taken into account only if return type is nullable.

TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter148617.dart

Issue: https://github.com/flutter/flutter/issues/148617
Change-Id: I209fc9a3b10639fd4024d4b1807591498349e1f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367980
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-05-23 18:19:40 +00:00
Brian Wilkerson 8c26c35950 Add documentation for more lints
Change-Id: I20955662d77591a0cd15f06de845008c3ffeaba1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364164
Reviewed-by: Marya Belanger <mbelanger@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-05-23 17:05:28 +00:00
Stephen Adams cdf35f8782 [dart2js] Simplify access of multiple type variables from same environment
The change adds a new reduction that recognizes the construction of a type environment from components

    HTypeBind(HTypeEval(env, e1), HTypeEval(env, e2))

and replace with an equivalent expression that constructs the same derived type environment directly

    HTypeEval(env, ...e1...e2...)

This change speeds up the benchmarks that iterate `Map.entries` by roughly 10-25%.

---

Type arguments are passed as separate values [1]. This means that the generative constructor factory `MapEntry<K,V>(this.key, this.value)` has four parameters - `MapEntry$(key, value, $K, $V)`. The passed arguments usually come from the same place, perhaps extracted from the type of the current object, `this.$ti._eval("1")` and `this.$ti._eval("2")`.

Inside `MapEntry$`, the type parameters are re-assembled into a type environment:

    $K._eval("@<0>")._bind($V)

which is used to construct the object type

    $K._eval("@<0>")._bind($V)._eval("MapEntry<1,2>")

After inlining:

    $K = this.$ti._eval("1");
    $V = this.$ti._eval("2");
    $K._eval("@<0>")._bind($V)._eval("MapEntry<1,2>")

After GVN, and reducing the adjacent `._eval("1")._eval("@<0>")` to `._eval("@<1>")`:

    t1 = this.$ti
    t1._eval("@<1>")._bind(t1._eval("2"))._eval("MapEntry<1,2>")

The new reduction gives us:

    this.$ti._eval("@<1,2>")._eval("MapEntry<1,2>")

which can be reduced further by combining adjacent HTypeEvals:

    this.$ti._eval("MapEntry<1,2>")


[1]: It would be better to pass the type arguments as a single Rti object to avoid the extract-recombine pattern, but changing the calling convention is a more extensive change. In the meantime, this reduction cleans up the extract-recombine pattern when inlining brings the parts together.

Change-Id: I28801ce5d952d0f4e5ac1d55c252766159dcceef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367240
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-05-23 16:45:00 +00:00
Devon Carew f2c8f79dd4 [deps] rev dartdoc, http, markdown, path
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (476d5cc..1e1a004):
  1e1a004c  2024-05-21  Sam Rawlins  Re-enable CI on stable channel (dart-lang/dartdoc#3774)

http (5c01453..7df2ac8):
  7df2ac8  2024-05-22  Derek Xu  [package:http_profile] Update experimental status notice in README.md (dart-lang/http#1206)
  c8d5479  2024-05-21  Jonas Finnemann Jensen  Add `topics` to `pubspec.yaml` (dart-lang/http#1199)

markdown (7463999..340c76f):
  340c76f  2024-05-22  Tom Yeh  Fix `#601`: checkbox list separated with blank lines (dart-lang/markdown#602)

path (9be79e7..aea50fa):
  aea50fa  2024-05-21  Sarah Zakarias  Add `topics` to  `pubspec.yaml` (dart-lang/path#165)

Change-Id: I023714125518c53ed117b9115331148e54f3e0ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367780
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-23 16:39:13 +00:00
Sam Rawlins 0d5830e541 meta: Support @doNotStore on constructors and mixins
There were no tests of this component of the annotation's description:

> The annotation can also be applied to a class to implicitly
> annotate all of the valid members of the class

So I add those as well.

Bug: https://github.com/dart-lang/sdk/issues/48476
Change-Id: If5f0f4c6057f57b4dfd01d8f648110d69fbc5eb4
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-05-23 16:26:39 +00:00
Moritz 798cbcf2b6 Add fix for creating a parameter
The variant of the parameter, optional/required and named/positional, is inferred from the other parameters used in the method.

Change-Id: I0c26e5d16e759978410ba854c0fed0a75d33724f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365826
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2024-05-23 14:34:32 +00:00
Slava Egorov a17d709a1d Revert "[tools] Allow precompiling gen_kernel and compile_platform"
This reverts commit 5cda2a871c.

Reason for revert: broke Flutter build. 

Original change's description:
> [tools] Allow precompiling gen_kernel and compile_platform
>
> When iterating on core library changes or changes in the AOT compiler
> many seconds are wasted waiting on gen_kernel/compile_platform to
> parse Dart code. This happens because we are running these tools
> from sources on prebuilt Dart SDK.
>
> This CL allows SDK developer to opt-in into AOT compiling these
> tools by adding `precompile_tools=true` to their DART_GN_ARGS.
>
> AOT compilation is performed using prebuilt SDK - so these
> executables do not need to be recompiled if core libraries or
> VM changes reducing iteration cycles.
>
> pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
> contains `precompile_tools=true` and use precompiled
> gen_kernel.exe instead of running it from source.
>
> Using precompiled compile_platform takes vm_platform_strong.dill
> build from 20 seconds to 3 seconds.
>
> Using precompiled gen_kernel takes small benchmark build from
> ~10 seconds to 2 seconds.
>
> TEST=manually tested
>
> Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: Id3e4eb44d33516f31c165d9a1e55911e8d356e7f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367960
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-05-23 13:52:58 +00:00
Vyacheslav Egorov 945153584c [dartdev] Add --depfile option to dart compile
I would like to add an option to our BUILD
files to precompile gen_kernel and
compile_platform to speedup iteration cycles
when working on core library changes.

To make this robust I would like to use
depfile to track dependencies and know
when compile_platform should be
recompiled.

TEST=pkg/dartdev/test/commands/compile_test.dart
R=kustermann@google.com

Change-Id: Id674f7353342c8275a8a0c4a70e3f5eaeb7f05d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367023
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-23 12:58:29 +00:00
Vyacheslav Egorov 5cda2a871c [tools] Allow precompiling gen_kernel and compile_platform
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.

This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.

AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.

pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.

Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.

Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.

TEST=manually tested

Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-23 12:35:21 +00:00
Ömer Sinan Ağacan 6f10e620fa [cfe] Remove unused Target.extraDeclaredVariables method
Change-Id: I9bf04e657657173a8fbb31a2bd081c3de02a6ba6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367920
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-05-23 11:06:48 +00:00
Simon Binder 6b71aa1f3e [dart2wasm]: Add compile-time define identifying tool
Knowing whether Dart code is running in a WebAssembly context is useful
to potentially select different code paths exploiting differences in
JavaScript and WASM behavior or simply to report the information to
users (e.g. for crash reports).

Without such a constant, one has to rely on implementation differences
such as `identical(0, 0.0)` or check the available `dart:` libraries.
Both are error-prone, so having a reliable constant as an alternative
makes this easier.

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

Change-Id: Ia969641e4b78223c394cbf251805cf77a30cb0fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365822
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-23 10:51:50 +00:00
Jens Johansen 1eaa749e0e [kernel/CFE] Remove unneeded default in switches
This CL removes the "default" case when the switch must be exhaustive
and is exhaustive without the default. Found by modifying the CFEs
constant evaluator.

Change-Id: Iaba27864315875257502be8e74fc2ce34f6ce54d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367900
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-05-23 09:32:49 +00:00