Commit graph

88564 commits

Author SHA1 Message Date
Ömer Sinan Ağacan
ddbc111067 [dart2wasm] Fix range checks in codeUnitAt methods
New passing tests:

- co19/LibTest/core/String/codeUnitAt_A02_t01
- co19/LibTest/core/String/operator_subscript_A02_t01
- corelib/string_codeunits_test
- language/optimize/string_charat_test
- language/string/charcode_test

Change-Id: I27fe1bc080be8d70d4a33763cbfb737e6c837a50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273143
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-12-01 16:19:10 +00:00
Sigurd Meldgaard
258598eeb6 Bump pub to 21aa23f148a428ae4dd97a27ecc70b08c1328089
Changes:
```
> git log --format="%C(auto) %h %s" 4fd2051..21aa23f
 https://dart.googlesource.com/pub.git/+/21aa23f1 Revert "Create output folder if it doesn't exist in the precompiler (#3676)" (#3677)
 https://dart.googlesource.com/pub.git/+/04f7bce8 Don't consider resolution outdated in dev-releases (#3678)
 https://dart.googlesource.com/pub.git/+/74473e12 Create output folder if it doesn't exist in the precompiler (#3676)
 https://dart.googlesource.com/pub.git/+/5bfd68b1 Avoid .incremental.dill.incremental.dill in temporary file name (#3675)
 https://dart.googlesource.com/pub.git/+/c3870bc1 Unskip test (#3671)

```

Diff: https://dart.googlesource.com/pub.git/+/4fd2051bb8060ea2f2e02b13dfeb2f793d197994..21aa23f148a428ae4dd97a27ecc70b08c1328089/
Change-Id: Ie5060563cc3f96b0bc52e542f7a7b19d17fefd8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273223
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2022-12-01 16:13:50 +00:00
Ilya Yanok
9378d5ca21 Add hints for Angular constructor arguments
The rules are:

1. Arguments annotated with `@Optional` must be nullable (that part
   worked before this change).
2. Arguments annotated with `@Attribute` must be nullable if it's
   a constructor of a component (`@Attribute` can also appear on
   arguments of directives constructors, it doesn't provide any signal
   in the latter case).
3. Arguments of constructors of components or `@Injectable` classes,
   that have neither `@Optional` nor `@Attribute`, must be non-nullable.

Tested:
  Added new test cases to `api_test.dart`
Change-Id: I0f06a128e0f6ec49d39cc6bf025fe1796938f1f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272900
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2022-12-01 15:37:33 +00:00
Vyacheslav Egorov
c704e11ee2 [vm/api] Introduce Dart_WriteHeapSnapshot API
Allows embedders to programmatically request heap snapshot from a
running isolate group instead of relying on a vm-service or hidden
internal Dart APIs

Additionally we allow to include snapshot writing functionality into
PRODUCT builds using DART_ENABLE_HEAP_SNAPSHOT_WRITER define.

TEST=vm/cc/DartAPI_WriteHeapSnapshot

Bug: b/259115846
Change-Id: Ic3ef76e5fb9adcf8f23a1959f5238742b64ecde2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273181
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-12-01 14:38:44 +00:00
Michael Thomsen
7ebe699d85 [co19] Roll co19_2 to 9f28a5f173bd39c9b97a691e7abcba6fdf80b47b
2022-12-01 sgrekhov22@gmail.com Fixes dart-lang/co19#1565. FallThroughError tests removed (dart-lang/co19#1567)
2022-11-14 sgrekhov22@gmail.com dart-lang/co19#1540. Tests error expectations updated (dart-lang/co19#1544)

Change-Id: I4f4904e3c1e002230f4c47c5236fe0f93b18fc8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273220
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-12-01 14:35:25 +00:00
Kevin Chisholm
3e968e5fc4 update changelog on main to include dart 2.18.5 hotfix notes.
Change-Id: Ic3cfe61db296d2ed1500fc0756ee3f6f29832f07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272880
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2022-12-01 13:54:43 +00:00
Jens Johansen
89b6ba91ba [vm] tools/heapsnapshot has download util
Change-Id: I11e8a750a3a40d3fbc2733f4120c50b25194cc82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273183
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-12-01 13:25:47 +00:00
Johnni Winther
05c0f5ca9a [cfe] Add synthesized this to view instance methods
+ generate getters.

Change-Id: Id873e8e6c3f8d64a845b211f18616d807302f180
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273180
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-01 11:53:17 +00:00
Daco Harkes
55b4542dab [pkg/vm] Native assets validator and synthesizer
Validates a yaml format encoding a native asset mapping, and
synthesizes a component containing a pragma with this information.

Yaml example:

```
format-version: [1,0,0]
native-assets:
  linux_x64:
    'package:foo/foo.dart': ['absolute', '/path/to/libfoo.so']
```

Generated format example:

```
@pragma('vm:ffi:native-assets': {
  'linux_x64' : {
     'package:foo/foo.dart': ['absolute', '/path/to/libfoo.so']
  }
})
library;
```

TEST=pkg/vm/test/native_assets/synthesizer_test.dart
TEST=pkg/vm/test/native_assets/validator_test.dart

In a follow-up CL, we will consume the yaml from `gen_kernel`
and consume the pragma in the VM for `@FfiNative`s.

Bug: https://github.com/dart-lang/sdk/issues/49803
Change-Id: Ie8d93b38ff4406ef7485e5513807e89b2772164b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272660
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-12-01 11:33:27 +00:00
Martin Kustermann
e7bd696ce0 [vm] Update CPU register comments on runtime/vm/constants_<arch>.h
TEST=ci

Change-Id: Ibc2225314a18818ac14c8b3047c369017e524210
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273140
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-12-01 10:24:05 +00:00
Tess Strickland
49f998dc31 [vm/compiler] Handle hash caches in the InstantiateTypeArguments stubs.
Lower the threshold for converting from a linear to a hash-based cache
on most architectures from 500 to 10.

Due to register pressure, the InstantiateTypeArguments stub on IA32
continues to go to the runtime for hash caches, and so we do not
lower the threshold for converting to a hash-based cache there.

The following are benchmark results for those benchmark that use enough
Instantiations to trigger the use of hash-based caches. In the following
tables, "Results 1" denotes the benchmark results from only this change,
whereas "Results 2" include from comparing to the results prior to
4f925105cf, when only linear caches were used.

Dart AOT:

* InstantiateTypeArguments.Instantiate100

Arch   | CPU            | Results 1 | Results 2
-------|----------------|-----------------------
ARM    | Odroid-C2      |   382.8%  |   381.5%
ARM    | Raspberry Pi 4 |   486.7%  |   449.2%
ARM64  | Odroid-C2      |   328.1%  |   372.8%
ARM64  | Raspberry Pi 4 |  1283%    |  1281%
ARM64C | Raspberry Pi 4 |  2353%    |  2811%
X64    | Intel Xeon     |   568.7%  |   584.9%

* InstantiateTypeArguments.Instantiate1000

Arch   | CPU            | Results 1  | Results 2
-------|----------------|------------------------
ARM    | Odroid-C2      |   743.7%   |  3821%
ARM    | Raspberry Pi 4 |   486.7%   |  3218%
ARM64  | Odroid-C2      |   584.7%   |  3222%
ARM64  | Raspberry Pi 4 |   430.7%   |  8172%
ARM64C | Raspberry Pi 4 |   491.4%   | 16699%
X64    | Intel Xeon     |   954.1%   |  5528%


Dart JIT:

* InstantiateTypeArguments.Instantiate100

Arch   | CPU            | Results 1 | Results 2
-------|----------------|-----------------------
ARM    | Raspberry Pi 4 |   315.7%  |   295.1%
ARM64  | Raspberry Pi 4 |  1070%    |  1058%
ARM64C | Raspberry Pi 4 |  1769%    |  2095%
X64    | Intel Xeon     |   507.4%  |   496.2%

* InstantiateTypeArguments.Instantiate1000

Arch   | CPU            | Results 1 | Results 2
-------|----------------|-----------------------
ARM    | Raspberry Pi 4 |   565.2%  |  2550%
ARM64  | Raspberry Pi 4 |   406.8%  |  7375%
ARM64C | Raspberry Pi 4 |   379.6%  | 12996%
X64    | Intel Xeon     |   807.9%  |  4459%

During work on this change, an issue was found where cache lookups
in the stub on ARM64C always failed and went to runtime, even with
the old linear-only caches, hence the much larger performance gains
in those rows above.

TEST=vm/cc/TypeArguments_Cache_{Some,Many}Instantiations

Fixes: https://github.com/dart-lang/sdk/issues/48344
Change-Id: I3d29566ba0582502954c9fc59626ceb8fd40317a
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-debug-simriscv64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-nnbd-linux-debug-simriscv64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-linux-release-ia32-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-ia32-try,vm-kernel-nnbd-mac-release-arm64-try,vm-kernel-linux-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270702
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-12-01 10:15:58 +00:00
Johnni Winther
5994c04ef4 [cfe] Initial support for view methods
TEST=pkg/front_end/testcases/views/procedures.dart

Change-Id: I62c26183d8160a3841b74381a256d0a4b5bb9365
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272624
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-01 09:54:40 +00:00
Johnni Winther
b7aa26710a [cfe] Remove the need for transform/visitChildren on internal nodes
These were previously only needed to support calling 'replaceWith' on
TypeAliasedConstructorInvocation, TypeAliasedFactoryInvocation and
FactoryConstructorInvocation. Instead of calling 'replaceWith' on the
nodes themselves, we call 'replaceChild' on the parent, if present.

The 'replaceChild' method on the internal node is overridden to be a
no-op. Since all these internal nodes are not supported in the
external AST and therefore must be replaced during inference, these
can only be found in subtrees that have been removed, typically in
erroneous code, and it is therefore safe to make the replacement a
no-op.

Change-Id: I597d955075dfae51b04bce08b1d499c90dd4d673
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272621
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-01 08:09:08 +00:00
Liam Appelbe
32bfc38a20 Revert "[vm] Skip filtered class earlier in source report."
This reverts commit 86233b55bc.

Reason for revert: https://github.com/flutter/flutter/issues/115719

Original change's description:
> [vm] Skip filtered class earlier in source report.
>
> The main benefit of this is that it avoids cls.EnsureIsFinalized for
> skipped classes. In some cases (eg very small tests with dependencies
> on very large 3rd party packages, such as flutter) this can reduce
> coverage collection time by 20%.
>
> Change-Id: Id756af7f2d2ecdd07a5d1d05a400cea4de7ec408
> Bug: https://github.com/flutter/flutter/issues/100751
> TEST=CI
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266640
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/flutter/flutter/issues/100751
Change-Id: Ie1e9f29fa6e3966f25040aebad8cb1d55b50a745
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273100
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-12-01 02:54:18 +00:00
Konstantin Shcheglov
e89d93f48c Support for 'final' in PatternVariableDeclarationImpl.
Change-Id: I0ea3952e502f5e1ce4bfea412bb9c0a4471da6f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273008
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-12-01 01:59:09 +00:00
Siva Annamalai
be8e94162e Revert "[vm, gc] Assert the whole object is in to-space, not just its beginning."
This reverts commit c870932e45.

Reason for revert: We have a build failure on arm64c
../../third_party/dart/runtime/vm/virtual_memory_compressed.cc:143:35: error: out-of-line definition of 'Contains' does not match any declaration in 'dart::VirtualMemoryCompressedHeap'

TEST=ci

Original change's description:
> [vm, gc] Assert the whole object is in to-space, not just its beginning.
>
> TEST=ci
> Bug: https://github.com/dart-lang/sdk/issues/50564
> Change-Id: I60e7637600a1a7a99d546e8c674901175a119ba5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272863
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I62c83c8e8fa5b263bdc53d2afcf27b1fdd07c087
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/50564
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273060
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Auto-Submit: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2022-12-01 01:35:26 +00:00
Kallen Tu
1c0cb35a87 [cfe] Allow mixin 'on' behaviour for sealed supertypes.
Implements the behaviour discussed in dart-lang/language#2600. All other mixin application or implementing behaviour for sealed families should be unaffected.

Change-Id: I95577d8b2bc69e6c1a365ec43fb156f5d5d9a259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272461
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-12-01 01:18:40 +00:00
Ryan Macnak
1ac82e6463 [vm] Fix uninitialized tail elements from Array::Grow.
These elements were unintialized in the uncommon case that the new array was large enough to get its own page.

Broken in 188dfbd52b.

TEST=ci
Change-Id: I8b07da992aa11eed9c80b6eac3a7fd6716cb3abc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272961
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-30 23:33:31 +00:00
pq
d5c1158b7b pull unrelated_type_equality_checks fix
See: https://github.com/dart-lang/linter/issues/3868

(This should also unblock the fixnum internal roll.)

Change-Id: I9af710b075c6280ee55153c559f91ac6a0b21f3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273007
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-11-30 23:31:45 +00:00
Ryan Macnak
26b9cbe36b [vm, compiler] Factor out PrepareLargeOffset for RISC-V.
Compare ARM64.

TEST=ci
Change-Id: If77e056d31a4f787a2874233910b40f2eb64eeda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273006
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-30 23:25:28 +00:00
Paul Berry
43c68f90ed Add parser support for && and || in patterns.
Previously, the implementation used `&` and `|` for logical-and and
logical-or patterns.  That is being changed to `&&` and `||`.

As a first step, we add support for `&&` and `||`, without removing
support for `&` and `|`.  In a follow-up CL I'll update existing
tests, and then after a day or two I'll remove support for `&` and
`|`.  This should avoid conflicts with other patterns work that's in
progress.

Bug: https://github.com/dart-lang/language/issues/2501
Change-Id: I2d5dc158248160d84e9f0889f5de390b999cbc7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272861
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-11-30 23:16:45 +00:00
Kallen Tu
1d9257ad02 [analyzer] Add sealed modifier to ClassOrMixinElementImpl and source visitor.
Add sealed modifier to element builder summaries and to_source_visitor.
Enable sealed_class experiement in tests to test the changes.

Change-Id: I2929a5a38360c73abfcdb26d1e9b786058ea9335
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272351
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-11-30 22:58:58 +00:00
Ryan Macnak
c870932e45 [vm, gc] Assert the whole object is in to-space, not just its beginning.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50564
Change-Id: I60e7637600a1a7a99d546e8c674901175a119ba5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272863
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-11-30 22:42:16 +00:00
Ryan Macnak
288e524abe [test] Skip new tests with FFI on simulators.
Change-Id: I453ac23b8c07a6eedfbb1f53735bb6f6d5acdca9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273004
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-30 22:24:06 +00:00
Konstantin Shcheglov
66e37d871f Resolve SwitchExpression.
Change-Id: I46e710241198db311eab13c5a17cf507b86d1c0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-11-30 21:49:45 +00:00
Konstantin Shcheglov
f62f614628 Support rewriting PatternVariableDeclarationImpl.expression
Change-Id: Ic5ede337be38f5f184a1177f4dbcd0b13e3a6fde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273001
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-11-30 21:49:18 +00:00
Devon Carew
793367c498 [pkg/dartdev] add windows support for 'dart bug'
Change-Id: Id94a4d9e4a485350cbe37f78d5395e093ccf5892
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272741
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-11-30 20:13:05 +00:00
Michael Thomsen
77d04c4ed0 [co19] Roll co19 to 7d8ce35e4263b14e2fb79c60d34dc00851b14215
2022-11-29 sgrekhov22@gmail.com Fixes dart-lang/co19#1553. Replace NullThrowError by TypeError (dart-lang/co19#1557)
2022-11-29 sgrekhov22@gmail.com dart-lang/co19#1401. [Patterns] List pattern tests added (dart-lang/co19#1552)
2022-11-29 sgrekhov22@gmail.com Fixes dart-lang/co19#1562. Remove deprecated FallThroughError tests (dart-lang/co19#1563)
2022-11-29 sgrekhov22@gmail.com Fixes dart-lang/co19#1526. [Records] Expect error for field names that start with underscore (dart-lang/co19#1527)

Change-Id: Ia99d047bc85db40b0db3448fbc0aae54ea8a16d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272641
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-11-30 18:18:38 +00:00
Devon Carew
ccb092a5f4 [dartdev] remove the package:intl dep
Change-Id: Ia884172c15a61d788b175fd7b08239e72b271665
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272860
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-11-30 18:00:18 +00:00
Konstantin Shcheglov
0ddbdc64c9 Bump dart_style to migrate off deprecated analyzer APIs.
Change-Id: Ic2109e242b72875079aff635470eb82f309b0d76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272483
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-11-30 17:51:08 +00:00
Konstantin Shcheglov
212eae02de Resolve MapPattern(s).
Change-Id: I1f80c7f919018a74525948bd4dbec879fc3e0672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272744
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-11-30 17:44:28 +00:00
Ryan Macnak
f4b34ad31b [vm, gc] Add missing promotion of Finalizer external size. Remove race incrementing external size.
When a FinalizerEntry's target gets promoted, the associated external size needs to also get promoted. We were handling the cases where the FinalizerEntry itself was either already old or remained new, but not the case where it was promoted. Failing to promote the external size meant that when the finalizer was collected, external size was subtraced from old space that was still being attributed to new space, so the old space total external size became negative.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50537
Change-Id: Id2fe2d748311de73f04de367c9cd153d87b74ad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272350
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-30 17:14:59 +00:00
Derek Xu
dba1e5fd3f [VM/Service] Fix package generator
package:markdown was updated to follow CommonMark's rules for encoding
certain special characters as HTMLEntities.
See 43bafebbe8/lib/src/util.dart (L15)

This CL updates the package:vm_service generators to handle these
changes.

Change-Id: I4e2e4c1c800a44ff1f3b9e7e163d60876cd6b013
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272522
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2022-11-30 16:25:57 +00:00
Johnni Winther
be7779ae7f [cfe] Handle switch expression in BodyBuilder
Change-Id: Idf987e8bb59a11d1628fc866d677267f439ed5cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272300
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-11-30 16:21:28 +00:00
Brian Wilkerson
63b779533f Add a flag that will allow plugin support to be disabled when necessary
Change-Id: Ifa80f14a58501054a72a9e82ff66aa35de37b4fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272490
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-11-30 16:02:50 +00:00
Brian Wilkerson
5b76f1dd1a Enable generating URLs for newly documented diagnostics
Change-Id: I301d5a92a1dca5affae7706195cec1f7058c384e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-11-30 15:54:28 +00:00
Paul Berry
701a0d289f Add support for expression statements beginning with a map pattern.
Bug: https://github.com/dart-lang/sdk/issues/50035, https://github.com/dart-lang/language/issues/2662
Change-Id: Ifb141cf563848fc0035423a625e27585cce2ea57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272523
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-11-30 15:18:43 +00:00
Sigurd Meldgaard
3e00e6aecf Bump pub to 4fd2051bb8060ea2f2e02b13dfeb2f793d197994
Changes:
```
> git log --format="%C(auto) %h %s" 867ad17..4fd2051
 https://dart.googlesource.com/pub.git/+/4fd2051b Also use caret syntax for recommending when missing sdk constraint (#3674)
 https://dart.googlesource.com/pub.git/+/ad6b00d8 Use caret syntax in environment recommendations (#3673)
 https://dart.googlesource.com/pub.git/+/06ab0148 Allow caret syntax for sdk constraints (#3672)

```

Diff: https://dart.googlesource.com/pub.git/+/867ad175d81713c4e70473b1ab32107547cbdc3e..4fd2051bb8060ea2f2e02b13dfeb2f793d197994/
Change-Id: I07fc9bf5f01047a873e97e807b9c7fb9eff9fe35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272663
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2022-11-30 14:09:07 +00:00
Alexander Thomas
484c79bdd6 [spec_parser] Add OWNERS
Change-Id: Ie0946865371d9e35de0fff1c972732f96ea09e8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272662
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-11-30 14:01:10 +00:00
Johnni Winther
a9823cdb8a [cfe] Handle views in NameScheme
Change-Id: I529e47ebfda8d1c89f80c02706b5bdf4bcfed00d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272661
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-11-30 13:14:48 +00:00
Sergey G. Grekhov
2d618d9734 [spec_parser] Allow negative numbers and symbols in a constant patterns
Change-Id: Idd0aaec42e1a92f57515dbb6bda27f1011c7d77d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272782
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-11-30 11:41:41 +00:00
Daco Harkes
eba9ada49e [pkg/dartdev] Fix bug_linux_test
Makes test pass when there's snapshots in the current processes.

Makes test pass when there's more digits in the Memory column, the
header is aligned right.

Closes: https://github.com/dart-lang/sdk/issues/50583
Change-Id: Ia0445c38795b60a403b8cba26c0444e829955973
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272820
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-11-30 11:06:51 +00:00
Alexander Thomas
2a035279af [3.0 alpha] Use equals for default values in the SDK
The colons cause test failures when the language version is bumped to 3.0. This CL can be landed before the 3.0 version bump.

Bug: https://github.com/dart-lang/language/issues/2357
Change-Id: Id8396034b16adc18b476689314e28b9617d25f18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272200
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-11-30 10:33:31 +00:00
Johnni Winther
4758d03a4c [cfe] Remove InternalExpressionKind
This enum is no longer used.

Change-Id: I13af962bb95b0359fc979cb8c5e56753a7841563
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272780
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-11-30 10:29:37 +00:00
Alexander Thomas
3f19115234 Make code compatible with Trusted Types.
Closes https://github.com/dart-lang/sdk/pull/50567

Co-authored-by: Jakub Vrána <jakub@vrana.cz>
Tested: Standard CQ
GitOrigin-RevId: b916722ddc03d2b57bae6f51122ee1e7af2486b4
Change-Id: I4f638e7262009744504f0b263bf7a8e23549e5bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272380
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-11-30 09:49:42 +00:00
Erik Ernst
1d7ec85d9c Add CHANGELOG entry for 50383
Issue 50383 is the breaking change whereby all cyclic dependencies are
reported as an error during top-level inference.

Change-Id: I669276c2e356aeed261287a0b295971d11357950
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272781
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-11-30 09:40:40 +00:00
Jens Johansen
e70befdcbd [analyzer] Only search the same files for the same thing once
TL;DR:

56c416430e vs this CL:

textDocument/implementation (non-first runs):
```
Difference at 95.0% confidence
        -3.6465 +/- 0.307413
        -82.3689% +/- 6.94398%
        (Student's t, pooled s = 0.238983)
```
I.e. from ~4.4s to ~0.78s on non-first runs.

textDocument/references (non-first runs):
```
Difference at 95.0% confidence
        -33.1856 +/- 0.789512
        -91.4283% +/- 2.17515%
        (Student's t, pooled s = 0.613768)
```
I.e. from ~36.2s to ~3.11s on non-first runs.

Raw data below.


Details:

When having multiple workspace folders open, sometimes the drivers
representing these folders will have overlapping files.
For instance in my "analyzer" workspace there are a total of ~7000
unique files but if just adding each drives known files there’s
40,000+ files.

When asking for all direct subtypes of a class the a
`_FilesReferencingNameTask` does a lookup in a set for every known file
of that drive, meaning that in practice, often the same set is queried
for the same thing many times.

This CL instead assigns each `Drive` the files it was to look at,
each set will therefore only be querues once per type.

This takes the number of operations (per type) from `N*M` where `N` and
`M` are number of drives and number of files respectively (as each drive
could know all the same files) to just `M`, i.e. number of files.

This CL takes the runtime for asking for implementations of 'ToJsonable'
from package:analysis_server/lsp_protocol/protocol_special.dart in my
analyzer workspace (with 8 workspace folders / drivers) from ~4.4 seconds
to ~0.8 seconds (see below for details).
It also takes a call for "find all references" ("textDocument/references")
on method "newFile" in class "AbstractSingleUnitTest" in
"analysis_server/test/abstract_single_unit.dart" from ~36 seconds
to ~3.2 seconds (see below for details).


Raw data:

HEAD as of 56c416430e

textDocument/implementation
===========================
(notice the first query taking a long time)

(restart analyzer process)
Got answer to query in 0:00:28.921389
Got answer to query in 0:00:04.270255
Got answer to query in 0:00:04.248489

(restart analyzer process)
Got answer to query in 0:00:08.319562
Got answer to query in 0:00:04.232582
Got answer to query in 0:00:04.102793

(restart analyzer process)
Got answer to query in 0:00:09.186371
Got answer to query in 0:00:04.867653
Got answer to query in 0:00:04.840468


textDocument/references
=======================
(notice the first query taking slightly longer)

(restart analyzer process)
Got answer to query in 0:00:41.916106
Got answer to query in 0:00:36.619501
Got answer to query in 0:00:36.502156

(restart analyzer process)
Got answer to query in 0:00:40.353819
Got answer to query in 0:00:37.709369
Got answer to query in 0:00:36.086530

(restart analyzer process)
Got answer to query in 0:00:40.052997
Got answer to query in 0:00:35.273826
Got answer to query in 0:00:35.589722



WITH CL

textDocument/implementation
===========================
(notice the first query taking a long time)

(restart analyzer process)
Got answer to query in 0:00:11.902654
Got answer to query in 0:00:00.742324
Got answer to query in 0:00:00.730748

(restart analyzer process)
Got answer to query in 0:00:04.966440
Got answer to query in 0:00:00.795087
Got answer to query in 0:00:00.820526

(restart analyzer process)
Got answer to query in 0:00:04.838173
Got answer to query in 0:00:00.810417
Got answer to query in 0:00:00.784124

textDocument/references
=======================
(notice the first query taking a long time)

(restart analyzer process)
Got answer to query in 0:00:07.632822
Got answer to query in 0:00:03.098794
Got answer to query in 0:00:03.008570

(restart analyzer process)
Got answer to query in 0:00:07.690932
Got answer to query in 0:00:03.062484
Got answer to query in 0:00:03.088793

(restart analyzer process)
Got answer to query in 0:00:07.786218
Got answer to query in 0:00:03.160477
Got answer to query in 0:00:03.248359

Change-Id: I18a3cbd870f62e87937f92942460baccf8bce088
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-11-30 09:03:39 +00:00
Mark Zhou
aef5a347c0 [dart2js] Re-adding dump info kernel regression tests.
These tests should the in the options file to enable them, but they should only be regenerated from the non-kernel dump info tests.

Change-Id: I4baf7459eb0ffce88363f1a791a585c78af73dbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272701
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-11-30 06:42:58 +00:00
Paul Berry
9d0bca98e9 Rework computation of precedence for patterns.
Previously, we boosted the precedence of `as` inside patterns, to make
it higher than `|` and `&`.  Now, we reduce the precedence of `|` and
`&` to match that of `||` and `&&`.

The new approach should make it easier to transition to using `||` and
`&&` in patterns.

Bug: https://github.com/dart-lang/language/issues/2501
Change-Id: I6658484860ef809bc9029fa75747fdd7ce986836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272700
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-11-30 05:12:47 +00:00
Brian Quinlan
8df8bbf0de Add PathExistsException and PathAccessException FileSystemException subclasses.
Bug:https://github.com/dart-lang/sdk/issues/50436
Change-Id: Ie2954f162c01189cd0d817f58606529acdc13416
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269240
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2022-11-30 04:54:52 +00:00