Commit Graph

91221 Commits

Author SHA1 Message Date
lauren n. liberda 22d666d67a add tools for generating shim headers
Closes https://github.com/dart-lang/sdk/pull/51612

GitOrigin-RevId: 7e71761d5f13e9dff8d60c0287cc12fda56f9642
Change-Id: I76400e00ead54d9fc3d0dae26c2468e8401f3de8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286601
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-04-19 01:37:48 +00:00
Konstantin Shcheglov cef5bcb602 Remove '@experimental' from declarations related to records and patterns.
Change-Id: I4db54e3097c343ec72e041f78df2b38b1835853e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-19 00:51:58 +00:00
Nate Biggs 21de916eb8 [dart2js] Add back kernel source file caching guarded by a flag.
Removing this cache means that errors from dill-loaded sources only display an offset rather than an exact file location. This makes debugging externally reported issues more difficult.

See here for more background: https://github.com/dart-lang/sdk/issues/52020#issuecomment-1513533855

Change-Id: I243d0bd340708ddbf979d77b5e9559751ee1b79e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296040
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-04-19 00:34:03 +00:00
DEPS Autoroller 1c29e9ab3f Roll Clang from fa3cb517e4a5 to e8cfbfd05a95
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://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: I972f69116a6d4181548d46f063c56014c89a402a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296000
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-04-18 23:42:47 +00:00
Jake Macdonald b55b46bcd6 update the serialization bbenchmark to capture the difference between sockets and stdin, and use message grouper
Change-Id: I5736ba0f9687e9dce4e1bf4ad27dd0cb9d9b75ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296100
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2023-04-18 23:30:39 +00:00
Stephen Adams 4c0de8ed89 [dart2js] sync* fixes
Change the calling convention of the sync* body to fix bugs and avoid allocations.

- Body takes the controlling _SyncStarIterator as a parameter.

- `yield` assigns directly to the `_current` field and returns.

- `yield*` calls a method on the controlling iterator (rather than returning the iterable). This avoids an allocation to wrap the iterable, a type test to distinguish `yield` from `yield*`, and allows the `get:iterator` call to happen in the dynamic scope of try-catch surrounding the `yield*` to that it will catch any exceptions.

- Avoid using IIFE to bind constants just to call the body.

- Use a dummy body to avoid the need to testing termination of the body.


Tests now passing:

co19_2/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_sync_t05
language_2/sync_star/move_past_end_test
language_2/sync_star/sync_star_exception_current_test
language_2/sync_star/sync_star_exception_iterator_test
language_2/sync_star/sync_star_exception_nested_test
language_2/sync_star/sync_star_exception_test


Bug: #51992


Change-Id: I397b470e121b8d71242ac28b3130637b78a1d0dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294685
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-04-18 22:24:24 +00:00
Nate Biggs 7714e67efe [dart2js] Merge experimental inferrer into main inferrer branch.
Inference runtime metrics on a large program:
-----Before-----
Duration - Mean: 182.303 Median: 174.500 Max: 292.0
Memory - Mean: 5857.426 Median: 5752.639 Max: 6167.91

-----After-----
Duration - Mean: 144.525 Median: 133.500 Max: 242.0
Memory - Mean: 5867.756 Median: 5727.506 Max: 6262.414

This shows ~20% improvement in runtime and virtually no change in memory usage. Previously we saw a memory regression due to this change. But thanks to improvements in the representation of TypeInformation nodes that memory regression no longer exists.

Code size for this program is also very similar before and after this change.

Before: 43258484 bytes JS
After: 43258444 bytes JS
Change-Id: I6512637f16d83f3127fd1c060bb770ae56405b88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295460
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-04-18 22:15:49 +00:00
Alexander Markov 135443706b [vm] Avoid expanding/flattening type arguments vectors in Type objects
Previously, vectors of type arguments were expanded to include type
arguments corresponding to superclasses both in the instances of
generic classes and in Type objects (after type finalization).
As a result, Type objects after finalization could be recursive and
need to use extra TypeRef objects to break loops. The finalization of
types was very complex and sometimes slow.

This change simplifies the representation of Type objects: now they
always have short type argument vectors, corresponding only to
the type parameters of their own classes (both before and after
finalization). Vectors of type arguments in the instances of generic
classes are still expanded/flattened.

This greatly simplifies type finalization, makes Type objects
non-recursive and removes the need to create and handle excessive
TypeRefs for type arguments corresponding to superclasses,
as those type arguments are no longer included into types.
The only remaining use of TypeRefs is for bounds of type parameters.

In order to expand/flatten type arguments, new methods Type::GetInstanceTypeArguments / Class::GetInstanceTypeArguments
are introduced. They build canonical declaration type arguments
once (for each class), and then instantiate them as needed.

There are also simple helper methods to shrink type arguments (TypeArguments::FromInstanceTypeArguments) and expand type arguments without filling type arguments corresponding to superclasses (TypeArguments::ToInstantiatorTypeArguments).

Time of edge case 'regress_51960_test' 15min -> 300ms.

TEST=ci, runtime/tests/vm/dart/regress_51960_test.dart

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

Change-Id: I75b466b74698a33c0bb5e1dcbd29542e413812a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295060
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-04-18 22:08:21 +00:00
Konstantin Shcheglov c948d37f97 Add CONVERT_TO_SWITCH_STATEMENT for if-case statement.
Bug: https://github.com/dart-lang/sdk/issues/52068
Change-Id: Ia561a8e711272cfcae690a4de1ea3e39906bef47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295724
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-18 21:26:02 +00:00
Ryan Macnak 7b2cfdbc8c [standalone] Remove tcmalloc.
Removes build complexity around which combinations of compiler/architecture/sysroot/libc support tcmalloc, reduces binary size, and reduces memory usage at the expense of some throughput.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51111
Bug: https://github.com/dart-lang/sdk/issues/51535
Bug: https://github.com/dart-lang/sdk/issues/51639
Change-Id: Id73d5b87e2b16c1cd1e5228ba0cbf1aa2521c01a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287001
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-04-18 20:56:00 +00:00
Janice Collins 7c1e2fee70 Fix analytics logic to report on analysis complete transitions.
Bug: https://github.com/dart-lang/sdk/issues/52089
Change-Id: If9fe7d702cd70c3e8804a59e47870d6aad7cf680
Fixes: https://github.com/dart-lang/sdk/issues/52089
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296023
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-04-18 20:48:58 +00:00
pq fffd7e8c6f support destructuring local object pattern variable declarations
See: https://github.com/dart-lang/sdk/issues/52025

Change-Id: I6dc5d2f0c8391d8ad719c23b47aadeac9a8ab969
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295722
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-04-18 20:47:57 +00:00
Stephen Adams 62a67ba5bc [dart2js][js_runtime] Use Array.isArray more consistently
The main reason is to do this change is to avoid inconsistencies in what is considered to be a `JSArray`. Using `Array.isArray` allows js-interop where the JavaScript code subclasses `Array`.

dart2js-production results:

ArrayLoop.pseudopoly.hoisted1-indexing  -50.20%
ArrayLoop.pseudopoly.indexing           -35.18%
Iteration.concat.manual                  11.69%
ListCopy.List.int.unmodifiable.2         12.03%
ListCopy.for.int.2                       12.58%
ListCopy.spread.int.2                    13.57%
ListCopy.toList.fixed.100                16.06%
ListCopy.List.of.fixed.100               16.96%
ListCopy.toList.100                      17.28%
ListCopy.spread.int.cast.2               18.45%
ObjectHash.hash.5                        19.62%
TypedDataPoly.A_UVx5.view.2              21.12%
ObjectHash.manual.5                      21.70%
ListCopy.spread.int.map.2                21.96%
ListCopy.spread.int.cast.100             22.12%
TypedDataPoly.A_UVx5.view.100            23.04%
ListCopy.spread.int.map.100              25.26%
ListCopy.List.of.100                     27.88%
ImagingGaussianBlurOnce                  29.67%
MegaEquality                             37.90%

An investigation of the two regressions shows that they benefit from a micro-benchmarking effect. The previous code was monomorphic at the property access in `receiver.constructor == Array`. If this is forced to be polymorphic, the baseline is quite a bit worse, leading to an improvement in line with some of the other benchmarks.


Change-Id: I5c265b1d7408fbd41da9c6fa17472bf648000c8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287140
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-04-18 20:39:39 +00:00
Konstantin Shcheglov 000655e4d3 Support sealed classes in canBeSubtypeOf()
Bug: https://github.com/dart-lang/linter/issues/4280
Change-Id: Iab92670d7c5db535968b4fe4ac26a5777e1bf6ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295801
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-18 20:02:58 +00:00
Brian Quinlan db491eb671 Set minimum mac SDK version to 10.14
Bug: https://github.com/dart-lang/sdk/issues/47820
Change-Id: I42310999303d1849aaedd800e4222e6863870fc5
Tested: Build-only change - tested with flutter engine build
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295389
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-04-18 19:55:03 +00:00
Derek Xu 6011ba67b3 Reland "Reland "[VM] Begin supporting Perfetto file recorder""
This is a reland of commit 4cd9c9c666

This will be relanded without changes because we discussed the .proto
definition package name clashing problem with the Dart in google3 team,
and we have decided that the best solution is to ignore the checked in
.proto files in google3 builds.

TEST=Recorded traces with the Perfetto file recorder and explored them
in Perfetto's trace viewer, CI

Original change's description:
> Reland "[VM] Begin supporting Perfetto file recorder"
>
> This is a reland of commit 7424295ce9
>
> The differences between this reland and the original CL are: now the
> Perfetto file recorder does not get built in PRODUCT builds, and it does
> not get built unless the SUPPORT_PERFETTO macro is defined.
>
> TEST=Recorded traces with the Perfetto file recorder and explored them
> in Perfetto's trace viewer, CI
>
> Original change's description:
> > [VM] Begin supporting Perfetto file recorder
> >
> > This CL adds the `TimelineEventPerfettoFileRecorder` class, which is a
> > timeline recorder that writes a trace to file in Perfetto's proto
> > format. This CL supports the recording of all types of timeline events
> > except flow events. Support for flow events will be added in a future
> > CL.
> >
> > TEST=Recorded traces with the Perfetto file recorder and explored them
> > in Perfetto's trace viewer, CI
> >
> > Change-Id: Iaa2051e536589a473c5e15f9de9bb9c251f13d38
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278942
> > Reviewed-by: Ben Konyi <bkonyi@google.com>
> > Commit-Queue: Derek Xu <derekx@google.com>
>
> Change-Id: I8713f704b5fbeed5f1231012bce8a32aaf566ae4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286020
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: Ia97ef1f0fe73e76c7022623b9ae7e21a4ea73a46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295804
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-18 19:39:05 +00:00
Sam Rawlins 008ef8c1a9 Bump linter
Change-Id: If108d01736a6fb7a07e4c894752934ea9fc952bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295802
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-04-18 19:25:48 +00:00
Ryan Macnak 30518b205d [infra] Copy llvm to shards, which is the target of the llvm-strip symlink.
Bug: https://github.com/dart-lang/sdk/issues/52010
Change-Id: I44d81ebb2f9e3db5ed86e560f7b043bd26804bf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295747
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-04-18 18:33:10 +00:00
Ryan Macnak b6adf9ff6a [vm] Remove dead current_sp from Dart entry.
This was part of an older mechanism that set the checked stack limit based on the SP values we had seen so far. Today we query the exact stack boundaries on all platforms.

TEST=ci
Change-Id: I5692d97b5d4f9104ee9796de7406eb5f050ac276
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295745
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-04-18 18:31:15 +00:00
Joshua Litt c4167766f2 [js] Restrict imports in strict mode.
Change-Id: I90cdf408e60cf8115c6321448623cf363dc92f66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292960
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-04-18 17:21:27 +00:00
Sam Rawlins 25348fb95c [analyzer] Move 2 more HintCodes to be WarningCodes, UNNECESSARY_*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Iddcb1b6d035e9590600e6bfbd8d2133da39bcc35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295803
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-04-18 16:55:30 +00:00
Ryan Macnak 9d834197bb [vm] Guard against invoking Dart code during AOT compilation.
TEST=ci
Change-Id: Idf213c57ad3d227738958c53e1d5b55d11477f1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295743
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-04-18 16:53:44 +00:00
Jake Macdonald cb4c9c74de Add support for mixin declarations in the macro APIs
Adds MixinDeclaration/IntrospectableMixinDeclaration for introspection.

Adds MixinTypesMacro/MixinDeclarationsMacro/MixinDefinitionsMacro macro
interfaces.

Updates supporting serialization/execution code and tests.

Change-Id: I57245fe7d177b6d5ba57649455fbd844ba1f85c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294380
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-04-18 16:04:00 +00:00
Paul Berry cc4eb93b11 Add dependency overrides for pkg/front_end
These dependency overrides prevent pub from getting confused about the
fact that our SDK development is in a mono-repo; that in turn allows
unit tests to be run from inside vscode using the standard test
integration.

Change-Id: I7629375f0ba4b07cd9ccdbb69f243d8eb0aa555a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295660
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-04-18 12:01:51 +00:00
Ilya Yanok 3c284a0c95 Revert "Reland "[VM] Begin supporting Perfetto file recorder""
This reverts commit 4cd9c9c666.

Reason for revert: reusing the same proto package for copied files breaks rolling it to G3.

Original change's description:
> Reland "[VM] Begin supporting Perfetto file recorder"
>
> This is a reland of commit 7424295ce9
>
> The differences between this reland and the original CL are: now the
> Perfetto file recorder does not get built in PRODUCT builds, and it does
> not get built unless the SUPPORT_PERFETTO macro is defined.
>
> TEST=Recorded traces with the Perfetto file recorder and explored them
> in Perfetto's trace viewer, CI
>
> Original change's description:
> > [VM] Begin supporting Perfetto file recorder
> >
> > This CL adds the `TimelineEventPerfettoFileRecorder` class, which is a
> > timeline recorder that writes a trace to file in Perfetto's proto
> > format. This CL supports the recording of all types of timeline events
> > except flow events. Support for flow events will be added in a future
> > CL.
> >
> > TEST=Recorded traces with the Perfetto file recorder and explored them
> > in Perfetto's trace viewer, CI
> >
> > Change-Id: Iaa2051e536589a473c5e15f9de9bb9c251f13d38
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278942
> > Reviewed-by: Ben Konyi <bkonyi@google.com>
> > Commit-Queue: Derek Xu <derekx@google.com>
>
> Change-Id: I8713f704b5fbeed5f1231012bce8a32aaf566ae4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286020
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: I2da67ffe5bff01d568f32f682455bb2c789499b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295821
Commit-Queue: Ilya Yanok <yanok@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
2023-04-18 11:25:49 +00:00
dependabot[bot] 754aca0049 Bump github/codeql-action from 2.2.11 to 2.2.12
Closes https://github.com/dart-lang/sdk/pull/52053

GitOrigin-RevId: e5391795af051fe4761c4d376784afc6cc9a8cdb
Change-Id: I704cd2830c0c36a87c4582cf22ea44b6b5c8b915
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295561
Reviewed-by: Alexander Thomas <athom@google.com>
2023-04-18 08:20:48 +00:00
dependabot[bot] 7c8e61104f Bump actions/checkout from 3.5.0 to 3.5.2
Closes https://github.com/dart-lang/sdk/pull/52054

GitOrigin-RevId: 50fafd4554841ee069fe126d80b3be36d3a19929
Change-Id: If6be6160b332988fc309c575d821d32e19229448
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295560
Reviewed-by: Alexander Thomas <athom@google.com>
2023-04-18 08:19:56 +00:00
Daco Harkes f9f1030959 [infra] DEPS and test dart-lang/native packages
This CL pulls in dart-lang/native packages and runs them on the
pkg bots.

Bug: https://github.com/dart-lang/sdk/issues/50565
Change-Id: Ifcd8ba25f8bdfeca8f4c161adfc3c20e0ce500d1
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295280
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-04-18 08:04:49 +00:00
Alexander Aprelev b04b084406 [vm/win7] Dynamically load functions for unwinding instructions.
Dynamically probe and load system functions for adding/deleting unwinding instructions to ensure vm can gracefully handle running on Windows 7, where those functions are not available.

Fixes https://github.com/dart-lang/sdk/issues/52071
TEST=ci

Change-Id: If4696bb8172d12f84f49d1d10affd7930a5bedfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295741
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-04-18 02:38:48 +00:00
Janice Collins a6ebd6fa8e Bump tools to 545d7e1c73ce21b8c91f638021f9d487d324a501
This will customize the consent message based on the `dart` or `flutter`
entry points and allow unified_analytics to honor the legacy analytics
opt-out.

Changes:
```
> git log --format="%C(auto) %h %s" 2308c67..545d7e1
 https://dart.googlesource.com/tools.git/+/545d7e1 Honor legacy opt out status (80)

```

Diff: https://dart.googlesource.com/tools.git/+/2308c672e0d7446f5bfdba96594b41f26fa24a2e..545d7e1c73ce21b8c91f638021f9d487d324a501/
Bug: https://github.com/dart-lang/tools/issues/74
Bug: https://github.com/dart-lang/tools/issues/82
Change-Id: I36bffde69b6d7f798a40f140ca5e838336d81d3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295742
Reviewed-by: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
2023-04-17 23:09:14 +00:00
Ryan Macnak c4795a7550 [vm, compiler] Don't do safepoint transitions in generated code under TSAN.
Go to the runtime so TSAN sees the instrumented access to Thread::safepoint_state_, avoiding false data race reports.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/52024
Change-Id: Ic686bac2221d8ac6b9865ce9c82a4c36711037a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295740
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-04-17 22:37:57 +00:00
Danny Tuppeny 39fc15a0b4 [analysis_server] Add missing declaration semantic token modifier on classes/constructors
Fixes https://github.com/Dart-Code/Dart-Code/issues/4498.

Change-Id: Ia1c89d02a12fd51fe6f18ce4208ff88a7fbd7ba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-17 21:19:25 +00:00
Konstantin Shcheglov 609db33dc7 Issue 51985. Quick fix to add missing pattern case to switch expression/pattern.
Bug: https://github.com/dart-lang/sdk/issues/51985
Change-Id: I43a24e889789da962a8ee1359702ea04db2a36f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295391
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-17 20:34:13 +00:00
Konstantin Shcheglov 8fa08ae80b Add 'Convert to if-case statement' quick assist.
Change-Id: I6c65060029c5cf474c59a05b0330a89ebf16082a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295502
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-17 20:27:24 +00:00
pq 17d92f90d0 offer wildcard suggestions for destructured record fields
See: https://github.com/dart-lang/sdk/issues/52025

Change-Id: I298c7f5b82b47b8cb02ca1a401e0658aab8f40a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295680
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-17 20:25:36 +00:00
Danny Tuppeny 3149f813bb [dartdev] Update --enable-analytics to re-enable unified analytics
Previously, running `dart --disable-analytics` would disable this, but `dart --enable-analytics` would not re-enable.

Change-Id: I3da33f0c0ed9a3e29ff4fbbfd66ceeb030014c4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-17 19:54:17 +00:00
Paul Berry eee509140d Add dependency overrides for pkg/analyzer
These dependency overrides prevent pub from getting confused about the
fact that our SDK development is in a mono-repo; that in turn allows
unit tests to be run from inside vscode using the standard test
integration.

Change-Id: Ica94f0a49d8c79f6a1f6395707b02d36da20089d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295661
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-04-17 19:27:27 +00:00
Danny Tuppeny 3069c4f3e2 [analysis_server] Add missing "constructor" semantic token modifiers on constructor declarations
Fixes https://github.com/Dart-Code/Dart-Code/issues/4495.

Change-Id: I5fa21504562f7437be30118e5dc96fd5b49f2853
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295544
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-17 19:12:46 +00:00
Nate Biggs 9834f87c54 [dart2js] Fix noSuchMethod override handling.
This bug manifested as change in 'language/no_such_method/mock_test' from RuntimeError to Passing in 'dart2js-production-linux-d8'.

Change-Id: Ieedb544c3d684437f7c79dfa62b4e30e1970637c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295480
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-04-17 18:48:11 +00:00
Erik Ernst 639a6f06ef Simplify several non-terminals to use regex-like grammar operators
Follow-up to SDK issue #51744.

Change-Id: Ic713ed5adf99bed49f1e93a70817650d5f0c3c46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295545
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-04-17 18:43:31 +00:00
Konstantin Shcheglov f88e3bd77c Issue 51903. Test fixes for ParserErrorCode.VAR_AND_TYPE
I think DartFixKind.REMOVE_VARwas already available.

This CL adds DartFixKind.REMOVE_TYPE_ANNOTATION support.

Bug: https://github.com/dart-lang/sdk/issues/51903
Change-Id: Ie582cc22fad038edb8b58c1f260afab1595fdcac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295388
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-17 17:51:38 +00:00
Danny Tuppeny f4d42303ad [analysis_server] Handle completion in whitespace after string values
Fixes https://github.com/dart-lang/sdk/issues/52049.

Change-Id: Idf594cd528065939b49aa55acf362fe9d909e22a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295543
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-17 17:19:08 +00:00
Modestas Valauskas 70762f0de0 [ANTLR] Transform recursive definition of onParts to use iteration ...
Closes https://github.com/dart-lang/sdk/pull/51744

GitOrigin-RevId: 08a3bb98762275f10f6911f59b7cdf5ac1ae6c1d
Change-Id: Ib50f2361ca392554e9c632d7b780f83008bfbef7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288980
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-04-17 17:11:24 +00:00
Danny Tuppeny 453647022f [analysis_server] Don't fail on invalid/complex setters in LSP code completion
Fixes https://github.com/dart-lang/sdk/issues/52050.

Change-Id: I6cf5420d5e017b501481cb436a7d1b17f46c0e44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295542
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-17 17:11:03 +00:00
Konstantin Shcheglov a565638b91 Issue 51689. Report when 'super' is used as a standalone expression, not as a receiver of an invocation.
Bug: https://github.com/dart-lang/sdk/issues/51689
Change-Id: I1c9a407ff3b17034a18842484a28b0f9c82bcd83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295500
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-17 16:42:47 +00:00
Konstantin Shcheglov b78d89ce0c Fix DynamicTypeImpl to InterfaceTypeImpl cast exception in AddTypeAnnotation, when ambiguous SetOrMapLiteral.
Saw it in crash logs.

Change-Id: I631e4da816b689ec017f44ecd2a5dc70122ceec1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295501
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-17 16:34:37 +00:00
Alexander Aprelev bd9c7a46e2 Roll zlib to 14dd4c4455602c9b71a1a89b5cafd1f4030d2e3f
Bug: https://github.com/flutter/flutter/issues/124971
Change-Id: Ie4abdff9d3b32ba34a7b811080675e0e62905cf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295640
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-04-17 16:32:20 +00:00
Alexander Markov 18b5ecdfc9 [vm] Cleanup dead code around TypeArgumentClassFinder
TypeArgumentClassFinder.FindClass always returns null (because
non-null values are never stored to TypeArgumentClassFinder::klass_).

Consequently, code using TypeArgumentClassFinder
(TypeUsageInfo::PropagateTypeArguments) seems to be redundant and
can be removed, along with another utility class
TypeArgumentInstantiator.

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try
Change-Id: I7bfc98e5c4d5b4d3effa639031ae4bd6dce25643
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295382
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-04-17 16:26:35 +00:00
Sam Rawlins 9d4d48949c Add a top-level variable strict-inference test case
Fixes https://github.com/dart-lang/sdk/issues/38426

Change-Id: I31487b28f32df5109c1cf240d87ce828e718e76c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-04-17 16:24:15 +00:00
Derek Xu 8df1b88877 [VM/Service] Create JSONBase64String class
TEST=CI

Change-Id: Ia14fcb1788a2685bef4fd61babfdd7089dd85a06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287801
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-04-17 15:58:28 +00:00