Commit graph

99787 commits

Author SHA1 Message Date
Sam Rawlins cda9755918 dev_compiler: prepare for curly_braces lint change
This aligns this code better with Effective Dart and prepares for the
upcoming lint rule change at https://dart-review.googlesource.com/c/sdk/+/353140.

Change-Id: I1b3ff4a4f85ec2182d06a67acf0e43fbc45129f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353220
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-02-20 16:04:30 +00:00
David Morgan 93b7791c0c [macros] Fix flakiness on Windows related to add during flush and timeouts.
R=jakemac@google.com

Change-Id: I48f5829613ca2999caf23a485648054b920596a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352907
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-02-20 15:47:10 +00:00
Brian Wilkerson e1f1151870 Suggest pattern variables declared in a for loop
Fixes: https://github.com/dart-lang/sdk/issues/52851
Change-Id: Ie44af3d9a336ba6daa26b52abcf29bada88bf660
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352998
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-02-20 15:44:22 +00:00
Martin Kustermann c4fbfc9271 [vm] Make iso-stress builder use valid -Dtest_configuration when compiling the giant stress test
Some tests that are run as part of the giant iso-stress test are relying
on `package:expect/config.config` getters, which in return rely on the
test configuration being set as part of the compilation from the app

=> We pass valid JIT & AOT configurations when compiling the giant iso
   stress test files.

TEST=May fix the iso-stress failures.

Change-Id: Icacbfe941eb01030c010670f35848a76c9a8ee12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353102
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-20 09:39:00 +00:00
David Morgan 980cf725ff [test] Check all local files for error strings.
Based on abandoned change #264261.

Changes to that PR: compare and show file paths, improve part parsing, include analyzer expectations from other files as well as CFE expectations, update unit tests.

Add end to end tests. The simplest case "library_failure_test.dart" passes before this PR, all others require the change in this PR to pick up expectations in other files.
Change-Id: Ia71b78a8f0dced83f603309877132f261b47c5a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345541
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-02-20 09:31:21 +00:00
Alexander Markov c1f5305f49 [vm/compiler] Eliminate unused allocations
Unused object, closure, context and record allocations can be always
eliminated, even when allocation sinking is disabled due to a
'try' block.

TearOff.Inlined.InTry benchmark +534-1481%

TEST=runtime/tests/vm/dart/eliminate_allocations_il_test.dart
Issue: https://github.com/dart-lang/sdk/issues/54808
Change-Id: I5a4094b391079fd0d63af48bec4594179806fdf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350341
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2024-02-20 09:30:56 +00:00
Chloe Stefantsova aa043e90a4 Revert "[analyzer][cfe] Expand TypeAnalyzerOperations. Part 1"
This reverts commit a8cf0a0825.

Reason for revert: The CL broke a few places in google3.

Original change's description:
> [analyzer][cfe] Expand TypeAnalyzerOperations. Part 1
>
> This CL adds more of the type operations required in the subtype
> constraint gathering algorithm into the shared type operation
> class. The added operations are used in the constraint gathering
> algorithms in the Analyzer and the CFE.
>
> Part of https://github.com/dart-lang/sdk/issues/54902
>
> Change-Id: Ia895fc84bd7ab666330a4ab32b6e759f0977e750
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346840
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Paul Berry <paulberry@google.com>
> Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>

Change-Id: Ibf75bb6dda4a4f5f36a2265036703977b28a4333
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353160
Auto-Submit: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-02-20 09:14:00 +00:00
David Morgan 859e359266 [macros] Cleanup after exception changes.
Add `RequestChannelException`, remove unused `RemoteExcepion`, update
some doc comments.

R=jakemac@google.com

Change-Id: Id51d2a9d16e7d4599703470b5c974c2bd438c55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352911
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-02-20 09:07:29 +00:00
Jens Johansen b25ebda686 [macro] Add 'isClosed' to ExternalMacroExecutorBase and throw if using it after
E.g. running
```
out/ReleaseX64/dart pkg/_fe_analyzer_shared/test/macros/executor/executor_test.dart
```

(which is apparently the wrong executable) fails after 12 minutes (!)
with "TimeoutException after 0:12:00.000000: Test timed out after 12
minutes."

With this instead it runs in a few seconds because the stuff that makes
it wait forever throws instead.

Change-Id: Idd8be08438863511769b4cace1a492d613cadb03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352301
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-02-20 08:19:18 +00:00
Sam Rawlins 4c30a89904 analyzer: Correct the scope in a switch statement case
Fixes https://github.com/dart-lang/linter/issues/4457

In the previous code, we set a Scope on the SwitchStatement for the
first `memberGroup`, and then _overwrite_ that Scope for each
subsequent `memberGroup`. This manifests in
`ScopeResolverVisitor.getNodeNameScope` using a scope from one switch
member that does not know about the variables declared in the relevant
switch member.

Change-Id: Ic88a800db339712b83a66d4d647b20005b2b8305
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-20 00:37:43 +00:00
Johnni Winther a765ffc540 [cfe] Generate merged augmentation library for macros
This adds support for generating the merged augmentation library in the
CFE. In order to get the right file offsets in the generated AST the
MacroExecutor.buildArgumentationLibrary function is extended to compute
a list of spans the describe what each segment of the generated source
code contains. These spans are used to compute the offset relation
between the intermediate augmentation libraries and the merged
augmentation libraries.

Change-Id: Ie5b9c23130da67ac874fb824b82827bfd6b88880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349864
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-02-19 12:35:22 +00:00
Johnni Winther c4724e5a89 [cfe] Add Throw.forErrorHandling
This adds a `forErrorHandling` to the `Throw` node. This is used that the `throw` is *not* present in the source code but added to ensure
correctness and/or soundness of the generated code.

This is used for instance in the lowering for handling duplicate writes
to a late final field or for pattern assignments that don't match.

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

TEST=updated ast-to-text

Change-Id: Ie103829d98fda9cd7b64e9e3d893e77d1e86d7d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347900
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2024-02-19 12:12:02 +00:00
Chloe Stefantsova a8cf0a0825 [analyzer][cfe] Expand TypeAnalyzerOperations. Part 1
This CL adds more of the type operations required in the subtype
constraint gathering algorithm into the shared type operation
class. The added operations are used in the constraint gathering
algorithms in the Analyzer and the CFE.

Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: Ia895fc84bd7ab666330a4ab32b6e759f0977e750
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-02-19 10:41:00 +00:00
Chloe Stefantsova 59eb20c04d Test collecting constraints in extension type vs non-extension types
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: I142b57ddddba4e701a1c39af0e90f98f573635be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352861
Reviewed-by: Paul Berry <paulberry@google.com>
2024-02-19 10:41:00 +00:00
Daco Harkes dabad3bb30 [gardening] Mark test as slow
The test runs multiple test cases in sequence.

Bug: https://github.com/dart-lang/sdk/issues/54950
Change-Id: Id57771c2456ad18d14c7b6112a5cd2764336df01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352909
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-02-19 10:21:38 +00:00
Elias Yishak 53cbcc8c81 Revert "Add parameter for analytics instance"
This reverts commit 0e5542211c.

Reason for revert: breaking google3 tests

Original change's description:
> Add parameter for analytics instance
>
> R=sstrickl@google.com
>
> Change-Id: I8ef2fe2c757a7625c2e3aa7eba48513e4c2f4e88
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352561
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
> Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>

Change-Id: Iec1f2eb0224e8ff8b0375736a96f3986c42cacaa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353040
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-02-19 08:58:28 +00:00
Johnni Winther 6e4674d445 [kerne] Remove type parameter from RecursiveVisitor
The type parameter was a left-over from a pre-nnbd encoding of the visitors, but Flutter dependency on the code prevented its removal.

TEST=existing

Change-Id: I02657a469290f169077faa1167cf59b75de13c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350840
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-02-19 07:51:43 +00:00
Brian Wilkerson 1af1f2ea8d Copy lookup methods from InterfaceElement to Augmented classes
Change-Id: Ie93e6aee9dc0f7a918d694303b0f640296e2df42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352971
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-02-17 01:15:37 +00:00
Konstantin Shcheglov 8fe47542f5 Macro. Provide 'macroSupport' to support 'package:build'.
https://github.com/dart-lang/build/pull/3650

Change-Id: I9437205dd42335fdba8e59736ef4d6ba557b9aab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352997
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-17 00:13:49 +00:00
eliasyishak 0e5542211c Add parameter for analytics instance
R=sstrickl@google.com

Change-Id: I8ef2fe2c757a7625c2e3aa7eba48513e4c2f4e88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352561
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2024-02-17 00:09:29 +00:00
Nicholas Shahan 3c13e9f273 [ddc] Cleanup dead code from the runtime library
This code is no longer used now that the new runtime types are always
enabled.

Change-Id: I0c7d627199a10e023d5d1afa581812b360e9a0f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344609
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-02-16 22:33:54 +00:00
pq 8b568142b8 augmented enum camel_case_types test case
I think this should ultimately be supported: https://github.com/dart-lang/language/blob/main/working/augmentation-libraries/feature-specification.md#augmenting-enum-values

See also: https://github.com/dart-lang/linter/issues/4881

Change-Id: Ibb8a175b40410599a28f06b2993ce9da92c1838c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352995
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-16 22:05:51 +00:00
Devon Carew e82324990f Bump web_socket_channel to 3db86bc0a09e1038a0fa418262c8a92211c5de69
Changes:
```
> git log --format="%C(auto) %h %s" 5241175..3db86bc
 https://dart.googlesource.com/web_socket_channel.git/+/3db86bc Require Dart 3.3 and the latest pkg:web (326)
 https://dart.googlesource.com/web_socket_channel.git/+/1c4a923 Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (323)
 https://dart.googlesource.com/web_socket_channel.git/+/041aa3c adjust the HtmlWebSocketChannel ctor parameter type; rev to 2.4.3 (320)
 https://dart.googlesource.com/web_socket_channel.git/+/0e8bedc Allow pkg:web v0.3.0 (306)
 https://dart.googlesource.com/web_socket_channel.git/+/62370cc Bump actions/stale from 8.0.0 to 9.0.0 (312)
 https://dart.googlesource.com/web_socket_channel.git/+/2a0563f Prepare release v2.4.1 (301)
 https://dart.googlesource.com/web_socket_channel.git/+/906c944 CI: test dev SDK with dart2wasm (304)
 https://dart.googlesource.com/web_socket_channel.git/+/a316c53 Rename helper extensions to not collide with pkg:web unreleased (303)
 https://dart.googlesource.com/web_socket_channel.git/+/547184a blast_repo fixes (302)
 https://dart.googlesource.com/web_socket_channel.git/+/969bc6c Fix JS value to Dart conversion when receiving from a web socket (298)
 https://dart.googlesource.com/web_socket_channel.git/+/df096a9 Remove removed lints (299)
 https://dart.googlesource.com/web_socket_channel.git/+/67bf9a3 Drop some use of ! (296)
 https://dart.googlesource.com/web_socket_channel.git/+/d4a8d70 Small tweak (295)
 https://dart.googlesource.com/web_socket_channel.git/+/9e80b8d migrate to pkg web (294)

```

Diff: https://dart.googlesource.com/web_socket_channel.git/+/5241175e7c66271850d6e75fb9ec90068f9dd3c4..3db86bc0a09e1038a0fa418262c8a92211c5de69/
Change-Id: I530ff23837e35b0db386b6710ee0a2ddf747c98a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352994
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-02-16 20:57:06 +00:00
Brian Quinlan 770f44d4e9 [io] Make it possible to change the line ending output by stdout and stderr.
There is a performance impact in:
`stdout.lineTerminator = "\r\n";`

For small writes (<100 chars), the performance loss is lost in the noise of the `write` system call.

For writes of ~500 chars, the performance is about half of that without line terminator translation. But, on a M2 Mac laptop, ~80M characters can be written per second.

Bug: https://github.com/dart-lang/sdk/issues/53161
Change-Id: Icfa0f981dcf6edb856d8aac5e0e270bc0148d498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326761
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-02-16 20:06:03 +00:00
pq 7b63c20fba camel_case_types support for macros
Fixes: https://github.com/dart-lang/linter/issues/4882

Change-Id: I2a70fb7ccd2d55dfcc0045969a861a1b8e158033
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352992
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-02-16 19:55:37 +00:00
Srujan Gaddam fe67789e43 [pkg:js] Update README and prep for 0.7.1 publish
Fixes https://github.com/dart-lang/sdk/issues/54792

Added disclaimers to use dart:js_interop going forward instead
and linked to the documentation. Preps for publish.

Change-Id: I62bd65dd879e3569b8cc0d575701f412e63db7c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352964
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-02-16 18:40:22 +00:00
Sam Rawlins dac7f1686e Bump dartdoc to 7e171fc9d5ae2727ba2f7f7f78d3da5fb0dbbb1e
Change-Id: I8f905ceef84d44ed17eadfae089f597451c46f11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352972
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2024-02-16 18:24:09 +00:00
Konstantin Shcheglov 90fc66fe69 Macro. Code optimizer. Update initializers of constants.
Change-Id: I2f8ae7fc44e8593218b541b1945f6f386889eb1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352993
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-16 18:19:19 +00:00
Sam Rawlins 39ac9ff614 linter: Allow necessary parens in ctor initializer case
Fixes https://github.com/dart-lang/linter/issues/4871

Change-Id: Id294bd4cbfd5af22d9201509210664fb16c31616
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352965
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-02-16 18:02:17 +00:00
Nicholas Shahan 528e1092bc [ddc] Cleanup dead code from the compiler
This code is no longer used now that the new runtime types are always
enabled.

Change-Id: Ic8e59ed43931fc89efeee48269c7da388a6c6553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344606
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-02-16 17:40:08 +00:00
Danny Tuppeny cb578498f7 [analysis_server] Fix some additional tests failing on Windows
Change-Id: I4f03ecb28f4e440faecc75bc5a99d8fedd0dc402
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352865
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-02-16 17:32:34 +00:00
Sam Rawlins 1b1117929d analyzer: Replace traverseNodesInDFS in LeakDetectorProcesors with visitor.
Work towards https://github.com/dart-lang/linter/issues/3745

This markedly improves the runtime of the `close_sinks` rule. The other rule that uses LeakDetectorProcessors, `cancel_subscriptions`, is maybe slightly slower, or the same speed. The change in the benchmark below may be within the margin of error.

Here's what we change:

* Replace the `predicates` field in the `cancel_subscriptions` and `close_sinks` visitors with a static field and getter; reduces memory.

* The diff of leak_detector_visitor.dart shows pretty cleanly what changed: the `_buildVariableReporter` function is simplified, with all of the complexity of visiting nodes going into a new `_ValidUseVisitor`, which determines whether there is a valid "use" of a variable, which might be a subscription cancelation, etc. Each of the top-level functions like `_hasConstructorFieldInitializers` and `_hasReturn` is moved into visit methods in that visitor.

* The implementation is overhauled, but the logic should not be changed in this code; this should be functionally a no-op.

* Performance benefits come from the removal of `traverseNodesInDFS` as well as node-specific visitors. Previously, `_hasReturn` was called for _every node in the tree_! Now it is only called with ReturnStatements.

* Remove the list of `_PredicateBuilder`s needed by a LeakDetectorProcessors instance, replacing it with an enum, `_VariableType`, which has two values, `field` or `local`. Previously, the predicate builders were rather complex lambdas of logic that were hard to reason about, but really boiled down to "apply this filter to fields" and "apply this filter to locals." So using `_VariableType` as a signal, the logic can just be written into the new Visitor, along with all of the other filtering logic.


Benchmarks

| test   | cancel_subscriptions | close_sinks |
|--------|----------------------|-------------|
| base 1 |              15   ms |     54   ms |
| base 2 |              14   ms |     52   ms |
| base 3 |              15   ms |     59   ms |
| avg    |              14.7 ms |     55.0 ms |
|--------|----------------------|-------------|
| PR 1   |              15   ms |     32   ms |
| PR 2   |              14   ms |     32   ms |
| PR 3   |              18   ms |     29   ms |
| avg    |              15.7 ms |     31.0 ms |

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try
Change-Id: Ie3c6af8b3c94992d45279a2430559fd6b4cedb8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348980
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-02-16 17:22:11 +00:00
David Morgan 4be3368d73 [macros] Fix flakiness on socket macro executor shutdown.
There is a race between closing the socket and killing the process that
causes the socket close to fail ~1% of the time on my machine.

R=jakemac@google.com

Change-Id: I16d337534956194a11cc46f29cb722ac1bda5538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352905
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-02-16 16:50:08 +00:00
Sam Rawlins 0f83de7eda linter: Migrate the curly_braces_in_flow_control_structures tests
Work towards https://github.com/dart-lang/linter/issues/4870

Change-Id: I0e52227496d3ea26e498501c59e3b2af0e9c67fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352982
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-02-16 16:42:55 +00:00
Daco Harkes ca9eb4af0f [gardening/test] Cleanup AOT checks in tests
Change-Id: I5235c5ba9824f72806214528ed86ecca2f3a7630
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352863
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-02-16 16:39:09 +00:00
Sam Rawlins ee39f45f76 linter: avoid a crash when running benchmarks w/o internet
Change-Id: Idda61b9632ac2127e58ca85627bc712fba7e7d25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352986
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2024-02-16 15:41:20 +00:00
Devon Carew c19c48d362 Revert "[deps] rev http, markdown, web_socket_channel"
This reverts commit 8d703d1371.

Reason for revert: HHH bot is broken

Original change's description:
> [deps] rev http, markdown, web_socket_channel
>
> Revisions updated by `dart tools/rev_sdk_deps.dart`.
>
> http (f0a02f9..d8b237d):
>   d8b237d  2024-02-15  Kevin Moore  [http] Migrate to the latest pkg:web, require Dart 3.3 (dart-lang/http#1132)
>   5179d1c  2024-02-01  dependabot[bot]  Bump actions/cache from 3.3.2 to 4.0.0 (dart-lang/http#1125)
>   0b803e8  2024-02-01  dependabot[bot]  Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/http#1124)
>   82e0424  2024-01-29  Brian Quinlan  Use preferred flutter version constraints (dart-lang/http#1119)
>   ccefa7c  2024-01-17  Brian Quinlan  Support `BaseResponseWithUrl` in `package:cupertino_http` and `package:cronet_http` (dart-lang/http#1110)
>   e7a8e25  2024-01-16  Brian Quinlan  Add `BaseResponseWithUrl.url` (dart-lang/http#1109)
>   c8f17a6  2024-01-12  Brian Quinlan  Add a contributing guide (dart-lang/http#1115)
>   ebd86b9  2024-01-12  Brian Quinlan  Add the ability to get response headers as a `Map<String, List<String>>` (dart-lang/http#1114)
>   5c75da6  2024-01-12  Brian Quinlan  Add tests for sending "cookie" and receiving "set-cookie" headers (dart-lang/http#1113)
>   c2a6d64  2024-01-12  Alex Li  [cronet_http] ⬇️ Downgrade `minSdkVersion` to 21 (dart-lang/http#1104)
>   661f5d6  2024-01-08  Brian Quinlan  Use `package:http_image_provider` in all `Client` implementation examples (dart-lang/http#1089)
>   473a892  2024-01-04  Brian Quinlan  Remove the "play-services-cronet" dependency in the example app when building `package:cronet_http_embedded` (dart-lang/http#1103)
>   e79ebe1  2024-01-03  Moritz  Fix `labeler.yml` (dart-lang/http#1099)
>   73b0b1c  2024-01-01  dependabot[bot]  Bump actions/labeler from 4.3.0 to 5.0.0 (dart-lang/http#1096)
>   15ec3ba  2023-12-21  Brian Quinlan  Prepare to publish `package:cronet_http` as 1.0.0 (dart-lang/http#1087)
>   26e55c3  2023-12-21  Brian Quinlan  cronet_http: require android API level 28 (dart-lang/http#1088)
>   b10f448  2023-12-22  Alex Li  [cronet_http] Enables CI for `cronet_http_embedded` (dart-lang/http#1070)
>   a5b8eec  2023-12-18  Brian Quinlan  Prepare to publish cupertino 1.2.0 (dart-lang/http#1080)
>   c114aa0  2023-12-15  Brian Quinlan  Add a fake response for PNG images (dart-lang/http#1081)
>   db2cb76  2023-12-14  Kevin Moore  Run web tests with wasm with dev Dart sdk (dart-lang/http#1078)
>   36f98e9  2023-12-12  Brian Quinlan  Fix a bug where BrowserClient was listed as requiring Flutter (dart-lang/http#1077)
>   db7f165  2023-12-07  Brian Quinlan  Provide an example of configuring IOClient with an HttpClient. (dart-lang/http#1074)
>   cd748b6  2023-12-04  Brian Quinlan  Document that runWithClient must be called for every isolate (dart-lang/http#1069)
>   f585947  2023-12-04  Brian Quinlan  Test persistentConnection with large request bodies (dart-lang/http#984)
>   7c05dde  2023-12-04  Brian Quinlan  Add documentation for "no_default_http_client" (dart-lang/http#1068)
>   d8983fa  2023-12-04  Brian Quinlan  Add support for setting headers for all requests (dart-lang/http#1060)
>   c90496e  2023-12-04  Brian Quinlan  Document how to use replacement `Client` implementations (dart-lang/http#1063)
>   c8536e4  2023-12-01  Kevin Moore  [http_client_conformance_tests] Updates to support wasm compilation (dart-lang/http#1064)
>   5dd5140  2023-12-01  dependabot[bot]  Bump actions/setup-java from 3 to 4 (dart-lang/http#1065)
>   064f510  2023-11-30  Devon Carew  misc cleanup of yaml files (dart-lang/http#1061)
>   22f52e2  2023-11-30  Brian Quinlan  Update pubspec.yaml to 0.4.2 (dart-lang/http#1059)
>   40a46d8  2023-11-29  Brian Quinlan  Fix a bug where cronet_http sends incorrect HTTP request methods (dart-lang/http#1058)
>   c125ed5  2023-11-27  Kevin Moore  [http] Allow pkg:web v0.3.0 (dart-lang/http#1055)
>   9fb4cfa  2023-11-22  Kevin Moore  Update lints to latest, etc (dart-lang/http#1048)
>   5e84d9f  2023-11-21  Kevin Moore  Update platform-specific imports for wasm (dart-lang/http#1051)
>   8c9feb5  2023-11-21  Kevin Moore  [http] Fix type cast for dart2wasm (dart-lang/http#1050)
>   a2f0b25  2023-11-21  Kevin Moore  [http] use pkg:web, require Dart 3.2 (dart-lang/http#1049)
>
> markdown (c2b8429..6efe141):
>   6efe141  2024-02-14  Kevin Moore  Migrate example to pkg:web, update minimum required Dart version (dart-lang/markdown#582)
>
> web_socket_channel (5241175..3db86bc):
>   3db86bc  2024-02-15  Kevin Moore  Require Dart 3.3 and the latest pkg:web (dart-lang/web_socket_channel#326)
>   1c4a923  2024-02-01  dependabot[bot]  Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/web_socket_channel#323)
>   041aa3c  2024-01-08  Devon Carew  adjust the HtmlWebSocketChannel ctor parameter type; rev to 2.4.3 (dart-lang/web_socket_channel#320)
>   0e8bedc  2024-01-04  Tyler Dunn  Allow pkg:web v0.3.0 (dart-lang/web_socket_channel#306)
>   62370cc  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (dart-lang/web_socket_channel#312)
>   2a0563f  2023-12-18  Kevin Moore  Prepare release v2.4.1 (dart-lang/web_socket_channel#301)
>   906c944  2023-12-14  Kevin Moore  CI: test dev SDK with dart2wasm (dart-lang/web_socket_channel#304)
>   a316c53  2023-12-13  Kevin Moore  Rename helper extensions to not collide with pkg:web unreleased (dart-lang/web_socket_channel#303)
>   547184a  2023-12-11  Kevin Moore  blast_repo fixes (dart-lang/web_socket_channel#302)
>   969bc6c  2023-12-09  Ömer Sinan Ağacan  Fix JS value to Dart conversion when receiving from a web socket (dart-lang/web_socket_channel#298)
>   df096a9  2023-11-30  Ömer Sinan Ağacan  Remove removed lints (dart-lang/web_socket_channel#299)
>   67bf9a3  2023-11-23  Nate Bosch  Drop some use of ! (dart-lang/web_socket_channel#296)
>   d4a8d70  2023-11-22  Kevin Moore  Small tweak (dart-lang/web_socket_channel#295)
>   9e80b8d  2023-11-22  Kevin Moore  migrate to pkg web (dart-lang/web_socket_channel#294)
>
> Change-Id: I87c4baa07efc5fc2bb283c7b32e69ad69c5a02aa
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352960
> Reviewed-by: Kevin Moore <kevmoo@google.com>
> Commit-Queue: Devon Carew <devoncarew@google.com>

Change-Id: I8723a343908227e39604cba7827c0f99912a10f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352967
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2024-02-16 15:33:01 +00:00
Martin Kustermann 95a61f6392 Roll flute to new version which removes legacy interop usages
Issue https://github.com/dart-lang/sdk/issues/54908

Change-Id: Ia89ed9a145b33ee7e4a4719df09465fc98f6064c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352906
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-16 13:10:04 +00:00
Vyacheslav Egorov 2280b06202 [vm] Improve detection of handled async errors
Improve the handling of code where the async flow forks:
e.g. for `fut.whenComplete(c.complete)` we might proceed
unwinding through awaiters of `c.future` and forget about the
future returned from `whenComplete`. This happens because
we choose to present result of the unwinding as a single
stack and not a tree. In this situation the error will only
propagate into that future and whether or not the error will be
handled depends on that future alone.

As part of this change also start respecting ignored bit on
futures without listeners.

TEST=pkg/vm_service/test/pause_on_unhandled_async_exceptions7_test.dart

CoreLibraryReviewExempt: Comment only changes to core library
Change-Id: I27b689ab07a725e8faa8d91cf40e88ebc8c441a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352904
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-02-16 12:55:22 +00:00
Alexander Thomas 2c11ad08bb [dartdoc] Modernize header and footer
Change-Id: I842b8d96fc0ab005990a15b74e001990a7710633
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352864
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-02-16 12:16:32 +00:00
Vyacheslav Egorov 6cd8c4eb8f [gardening] Mark test as slow on simulator.
It parses DWARF debugging information to symbolize
its own stack trace which is rather slow when
running on a simulator.

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

R=kustermann@google.com

Change-Id: I40721e3c6b68b26f75052ad7975388c3748f5733
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352902
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-02-16 11:50:28 +00:00
David Morgan a626c89b6a [analyzer] Fix golden test.
R=lrn@google.com

Change-Id: I1b35204ff11a119a9899d0485f3040bae065aee9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352903
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
2024-02-16 10:07:56 +00:00
Jake Macdonald 1e0223e6d8 Clean up VariableDeclaration and MemberDeclaration APIs.
- Adds hasInitializer and hasConst to VariableDeclaration.
- Renames isStatic to hasStatic to be consistent with other members.
- Improves serialization tests by randomizing some values, which
  should help to catch ordering errors in serialization.

Change-Id: I44199b1b058444510b9fa55afe0611187b90fc95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2024-02-16 07:42:53 +00:00
Keerti Parthasarathy 5394052641 Use the test file to check for navigation results.
Had added the ability to check navigation for a second file, but tests that use that are timing out on the windows bot. This is an attempt to fix it.

Change-Id: I5b9bbe81edb675442b7d58aa04df335284073fd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352981
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-16 04:04:57 +00:00
Konstantin Shcheglov 774caf2c8b Update ConstVariableElement to 'ExpressionImpl? constantInitializer'.
Change-Id: I43a4c318254346c089a203234809fb39e18dfd78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353020
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-16 01:56:27 +00:00
Alexander Markov 9c34f96822 [vm] Fix deallocation of compressed heap
When VirtualMemory object for the whole compressed pointers heap
region is destroyed in VirtualMemory::~VirtualMemory(), it tests
if the reservation address belongs to a compressed heap via

  VirtualMemoryCompressedHeap::Contains(reserved_.pointer())

If the heap region happens to be reserved at the 4GB aligned address
by the O/S, then reservation address would match base address of
the compressed pointers heap, and this check would pass and
the whole reserved heap region would be passed to
VirtualMemoryCompressedHeap::Free.

However, the reservation size of the whole heap region is
(8GB - 1 page) which is not aligned to kCompressedPageSize (512K).
This would trigger assertion

  ASSERT(Utils::IsAligned(size, kCompressedPageSize));

inside VirtualMemoryCompressedHeap::Free.

The fix is to detect when the whole compressed heap region is being
destroyed and avoid calling VirtualMemoryCompressedHeap::Free
as the region reserved for the whole heap is not managed by
the compressed heap itself.

TEST=python3 tools/test.py -n vm-win-debug-x64c --repeat 10000 co19/LibTest/typed_data/Uint32List/Uint32List.view_A01_t01
Fixes https://github.com/dart-lang/sdk/issues/51170

Change-Id: Icdf02eb0e2e3f39e435cba76fa647726bb383928
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352962
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-02-16 01:05:49 +00:00
Ryan Macnak 688917045f [vm] Use AT_HWCAP instead of /proc/cpuinfo for most ARM feature detection.
Under user-space emulation or 32-bit ARM on a 64-bit ARM system, /proc/cpuinfo describes the host CPU instead of the emulated ARM CPU.

Also fix the encoding of sdiv. Apparently QEMU is stricter than hardware.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/29270
Bug: https://github.com/dart-lang/sdk/issues/54909
Change-Id: Icadf1a276e468dbb8142da49f961f33bca499d27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352680
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-02-15 23:08:48 +00:00
Ryan Macnak 19aa44bd10 [vm] Remove dead copy_parent_code flag.
TEST=ci
Change-Id: Ib167a667f03179f9bc0f38d8b33d08f867ee9423
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352700
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-15 23:02:45 +00:00
Vyacheslav Egorov df6fd34f75 [vm] Improve asynchronous unwinding through Stream methods
This CL adds @pragma('vm:awaiter-link') in various places in
Stream implementation to facilitate unwinding and expands
async unwinding logic with more information about
Stream internals.

At the same time be more conservative when checking if an
exception thrown from async method handled: failing to unwind
the stack fully creates situations when we incorrectly report
caught exceptions as uncaught, which frustrates users.

To distinguish stream subscriptions with and without error
handlers we add a state bit. Otherwise, it looks like all
subscriptions have error handlers because if no error
handler is installed we eagerly install error handler forwarding
the error to `Zone.handleUncaughtError`.

Fixes https://github.com/dart-lang/sdk/issues/53334
Fixes https://github.com/dart-lang/sdk/issues/54788
Fixes https://github.com/dart-lang/sdk/issues/47985

TEST=runtime/vm/dart/awaiter_stacks/stream_methods_test.dart,pkg/vm_service/test/pause_on_unhandled_async_exceptions6_test.dart,pkg/vm_service/test/pause_on_unhandled_async_exceptions7_test.dart

CoreLibraryReviewExempt: No behavioral change. Async changes reviewed by lrhn@
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try
Change-Id: Ic51f926867092dd0adbe801b753f57c357c7ace2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322720
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-02-15 23:00:44 +00:00
Konstantin Shcheglov 25407d3f32 Macro. Include 'correctionMessage' into reported diagnostics.
Change-Id: Ie70c9b33c95a8368ff135613143e0da2a88730f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-15 22:54:43 +00:00