Commit graph

87318 commits

Author SHA1 Message Date
Alexander Markov
438e0ebb35 [vm] Throw error from external functions even if they have a body
TEST=language/constructor/external_constructor_test
Fixes https://github.com/dart-lang/sdk/issues/49912
Fixes https://github.com/dart-lang/sdk/issues/28565

Change-Id: If01fd39c3195afe059da46bf26ab5bcf158933a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258281
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-09 14:18:34 +00:00
Aske Simon Christensen
cded056cf1 Move cast and toSet on immutable sets to implementation classes
These methods create new sets, whose implementation must match the
target platform. Thus, they should be specialized for the VM and
dart2wasm instead of being implemented in the shared mixin.

Change-Id: I102a45686e3eb373463f2fcdf84ee861e202ecc0
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258362
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-09-09 14:04:34 +00:00
Aske Simon Christensen
f2bc59738c Rename the VM's internal hash set classes
Rename `_CompactLinkedHashSet` to `_InternalLinkedHashSet` and
`_CompactImmutableLinkedHashSet` to `_InternalImmutableLinkedHashSet`
to make the names consistent with the corresponding `Map` class names
and to distinguish them from the non-VM-specific hash maps and sets,
which are generally named starting with `_Compact`.

Tested: ci
Change-Id: Ic1ebc44ba8beba34ceab382a4edddc6624fe3fb3
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258002
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-09-09 14:04:34 +00:00
Lasse R.H. Nielsen
5179f5ae94 Make presubmit on Dart files check for default value separator.
This should prevent new code using old syntax.

Change-Id: I0620369a34b3838fb4555f5264c93bccf92acc42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256213
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-09-09 12:34:34 +00:00
Aske Simon Christensen
bab5cfbe74 Add more types to the VM's internal compact hash structures.
This gets rid of some occurrences of `dynamic` and makes the
associated implicit conversions explicit.

Based on https://dart-review.googlesource.com/c/sdk/+/237582

Tested: ci
Change-Id: I7faeffab395c916800b29ea7e56bd3f7d15aac54
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258242
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-09-09 08:38:36 +00:00
Konstantin Shcheglov
680a23c534 Use named parameters in 'for' related nodes.
Change-Id: Id3ae04f383da65780157065278a692b2a654bddd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258500
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-09 00:36:57 +00:00
Konstantin Shcheglov
f31547fecd Use textual dumps in completion/dart/declaration tests.
Change-Id: I935031644543fbc9c8b8811669e41acff880018f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258402
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-09 00:30:23 +00:00
Konstantin Shcheglov
ee57ecbedb Use textual dumps for a few tests in completion/dart/location
Change-Id: I5fdec2ab84a59a2af5b31583c8a6dbf3aad53a0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-08 23:45:33 +00:00
Alexander Aprelev
51a8c5ccd9 [vm/redundant_stores] Clean up liveness update for MayThrow and HasSideEffects instructions.
Ensure that instructions that may throw and also have unknown side effects still load from all places.
Also since this optimization concerns AOT only, instructions that don't deopt but may throw(and don't have unknown side effects), still only load escaping stores.

Follow-up to 88fc8b65d2.
TEST=ci

Bug: https://github.com/dart-lang/sdk/issues/49657
Change-Id: I55b1347badcd74b4c334bb7b37571e91ebb310a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258440
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-09-08 22:34:53 +00:00
Ryan Macnak
e5fc6d652b [vm] Don't pass and copy unused category string when recording timeline events.
TEST=ci
Change-Id: I53b60a977c2b33d29a0ca685120044ba208d3ae4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258321
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-09-08 22:02:46 +00:00
Konstantin Shcheglov
ace52d922b Semantic highlighting for record type annotations and literals.
Change-Id: I16fb395a721f4fdd63cbf23b931551ea0f5c8682
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258323
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-08 21:55:53 +00:00
Brian Wilkerson
0f51055083 Add implementation classes for pattern AST nodes
Visitor support is underway.

Change-Id: If4e54515650d21a202635973e2ce63b686bb98f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-08 21:54:43 +00:00
Kallen Tu
7e13c388fe Clean up - unused typedef and lint ignore for html.
Change-Id: I50f89a2d59478c8e2a63a81d106e0943b496ad46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257427
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-09-08 20:59:24 +00:00
Devon Carew
2dddeeec99 [deps] rev http, intl, protobuf, shelf, test, webdev
Change-Id: I270c6fa43f53cda0816dfb63f2379302c2cfda0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258322
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2022-09-08 19:54:33 +00:00
Mayank Patke
581db69c7a [dart2js] Avoid adding empty type rules.
The fragment emitter already tries to skip the call to `addRules` if the
ruleset is empty, but this occurs too early. The ruleset encoder strips
tautologies like `T <: T` and `InterfaceType <: Object`, but this occurs
after the empty check.

This CL removes the preprocessing from the encoder and instead performs
checks when entries are added to the ruleset, fixing the issue.

Change-Id: I62f937e0ff6abac12973f82b2c89d8ea6f3162b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258040
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-09-08 19:25:43 +00:00
Ahmed Ashour
3584073fbc [analysis_server] AddReturnType to handle operator
Fixes #49913

Change-Id: If7fb8b47d1211f11242f4c58365537ba3ead08b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258241
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-08 18:57:03 +00:00
Danny Tuppeny
292ba46112 [analysis_server] Add some initial docs about running/debugging server from source in VS Code
Change-Id: I1218b3b583bc61d45a9568016ca825460717c12c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-08 18:55:53 +00:00
DEPS Autoroller
cac7058892 Roll Dart Protobuf Support from f246fd64d571 to cd0ff30759d8 (1 revision)
https://dart.googlesource.com/protobuf/+log/f246fd64d571..cd0ff30759d8

2022-09-08 omersa@google.com Fix warning with Dart 2.19 beta

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-protobuf-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Protobuf Support: https://github.com/dart-lang/protobuf/issues
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

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: I3057f4b5644c67ca45e97b51adf6439f538e7f98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258260
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-09-08 18:17:03 +00:00
Brian Wilkerson
d7b0c97859 Replace the literal and constant patterns with a single expression pattern
I believe that this is a change we had wanted to make but that I forgot
about until after I'd committed the earlier CL. If that's not the case,
please let me know.

Change-Id: Ida7c70f8b6f5c7e8c2369fd7b709c68ce4322ca1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-09-08 18:05:04 +00:00
Ahmed Ashour
ac3695447d [analysis_server] update FlutterTest
Fixes #49926

Change-Id: I3b2fe6962498cf40a332e0852702ed0b2e20a43a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258244
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-08 17:28:03 +00:00
Kallen Tu
10a1ac18ab Eliminate dynamic [] calls from common, directory_impl and link.
Change-Id: I91be3303d957d5c746e33099b6238b51243ba60f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257140
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-09-08 17:17:03 +00:00
Alexander Aprelev
88fc8b65d2 [vm/aot/redundancy_elimination] Ensure that MayThrow instructions don't expose non-escaping(non-aliased) allocations.
Bug: https://github.com/dart-lang/sdk/issues/49657
TEST=LoadOptimizer_RedundantStoreAOT
Change-Id: I3f2c59b94b9c1043dd5d9509ae10fc6dc22e3515
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257802
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-09-08 17:12:23 +00:00
Liam Appelbe
fcc759b302 [ VM / Service ] Use same default value logic in toJson as _fromJson
Bug: https://github.com/dart-lang/webdev/issues/1741
Change-Id: I86df5591c3b302e88f76a2f7031215df18bb1431
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258100
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2022-09-08 16:16:43 +00:00
Paul Berry
7eab5ef808 Document and test additional breaking change.
Breaking change https://github.com/dart-lang/sdk/issues/49635 had a
slightly larger effect than I previously understood.  This change
documents the additional effect and adds a test that would have caught
it.

Bug: https://github.com/dart-lang/sdk/issues/49635
Change-Id: I40e9434a7fb87ff00d71b454239e4cadf197a285
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256880
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-09-08 16:05:05 +00:00
Michael Thomsen
0b71ae22fa Fix a few test failures.
Followup to https://dart-review.googlesource.com/c/sdk/+/257642

Fix compile test failing on windows:
https://dart-ci.appspot.com/log/pkg-win-release/unittest-asserts-release-win/21931/pkg/dartdev/test/commands/compile_test

Fix IO tests failing:
https://dart-ci.appspot.com/log/app-kernel-linux-debug-x64/app_jitk-linux-debug-x64/11442/standalone_2/io/stdio_implicit_close_test

Change-Id: Icf8f046a6231168209fd0f0f9ebaa5e00fa5d836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258245
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-09-08 15:34:03 +00:00
Daco Harkes
2cd6fdd100 [doc] Update Uri.queryParameters type
Because the value type is dynamic, I noticed use sites passing in
`Map<String, String?>`. After inspecting the implementation, it looks
like this is by design: `writeParameter` in `_makeQuery` takes a
nullable value.

This CL updates the documented type to reflect this.

Change-Id: I7b6f1c4a59ec44282e5e8b4ada86becafb308d30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258240
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-09-08 14:32:03 +00:00
Brian Wilkerson
f1d4d2be26 Fix exception for function type in unexpected places
Closes https://github.com/dart-lang/sdk/issues/45565

Change-Id: I21089bd5194ab563a4cf205d3a7d0a58510345ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258221
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-08 14:08:53 +00:00
Michael Thomsen
6a274e3fe1 Update CFE compiler output for sound null safety in Dart 3
Fixes: https://github.com/dart-lang/sdk/issues/49924

Change-Id: I9ad951ce8ede57d295508bc6480d10b0204c2579
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257642
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-09-08 10:09:23 +00:00
DEPS Autoroller
ac0138ccb6 Roll Dart Documentation Generator from 3bcfc1c2ba36 to aba679e24310 (1 revision)
https://dart.googlesource.com/dartdoc/+log/3bcfc1c2ba36..aba679e24310

2022-09-07 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.1.21 to 2.1.22 (#3140)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-doc-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues
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

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: I2d94e6cc87b428693808559addd72923e485af5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258080
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-09-08 00:30:22 +00:00
DEPS Autoroller
23a1d9cbcd Roll Dart Protobuf Support from bdd90b2b6d2f to f246fd64d571 (2 revisions)
https://dart.googlesource.com/protobuf/+log/bdd90b2b6d2f..f246fd64d571

2022-09-07 omersa@google.com Check message mutability in merge/deserialize methods (#727)
2022-09-06 kevmoo@users.noreply.github.com Update to latest pkg:mono_repo, use new pubspec feature (#750)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-protobuf-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Protobuf Support: https://github.com/dart-lang/protobuf/issues
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

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: Ic5d1c7fc703304c080b3edbc54cda23e01a58a7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257942
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-09-08 00:30:05 +00:00
Paul Berry
5a65ed7243 Shared type analysis: rework docs and add tests
Update the documentation for TypeAnalyzer and related classes so that
they explain the behavior of each method in terms of its effect on a
stack.  (The test logic already contained an implementation of such a
stack; production clients may or may not need to keep a stack
depending on their requirements).  This should make it more
straightforward to write clients of TypeAnalyzer.

Also, beef up the test logic in flow_analysis_mini_ast.dart and so that:

- In the event of a test error, a source location is shown, so that
  it's easy to debug and/or update the test.  This source location is
  obtained by parsing `StackTrace.current`, an approach which I
  wouldn't recommend for production code, but which is servicable for
  these low-level tests.

- Items that are popped off the stack are checked to make sure they
  have the expected kind.

The kind-checking caught a minor flaw in the previous test logic: it
was failing to distinguish expressions from expression statements.
This as been corrected, and as a result, a few test expectations in
type_inference_test.dart needed to be updated.

Change-Id: I0a2b257f6e970478c0c8e1b663dd5a367e7f24ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257486
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-09-07 23:27:03 +00:00
pq
90303cd221 Extend AST spelunking to allow for ASTs built from Strings
Change-Id: I6aee6473e60f422da6666718f65d9b737b1cef02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-09-07 22:00:43 +00:00
Danny Tuppeny
b5c7af0417 [analysis_server] Don't search the same files multiple times when referenced by multiple drivers
See https://github.com/Dart-Code/Dart-Code/issues/4106#issuecomment-1239564686.

Change-Id: I6fa86c9fe76e7410cbb00f31798ba3f1961e98ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-07 21:55:02 +00:00
Brian Wilkerson
d2dffdf9a8 Add interfaces for the AST nodes to support patterns
Implementation classes will follow after the interfaces have been
finalized, with visitor support following that.

Change-Id: I27e9c12bf299677faa743097869319dc568ad48a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257922
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-09-07 21:07:42 +00:00
Joshua Litt
708264289d [dart2wasm] Use WasmExternRef for JS interop.
Change-Id: I01138d48ba9cc67954ef086968af90dae173fda9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257880
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-07 20:55:27 +00:00
DEPS Autoroller
e4643b54df Roll Dart Documentation Generator from d732c8f4eda4 to 3bcfc1c2ba36 (3 revisions)
https://dart.googlesource.com/dartdoc/+log/d732c8f4eda4..3bcfc1c2ba36

2022-09-07 srawlins@google.com Deprecate linkedParamsNoMetadataOrNames (#3143)
2022-09-07 srawlins@google.com Bump to 6.1.0 (#3141)
2022-09-07 srawlins@google.com Bump to analyzer 4.7.0 (#3142)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-doc-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues
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

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: I148cbeb25af37331694a9c189bc58b7320eefc56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258060
Commit-Queue: DEPS Autoroller <dart-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2022-09-07 18:07:27 +00:00
Alexander Markov
f38a2804a3 [vm/compiler] Fix computation of ParameterInstr type in a catch block
In order to compute type, ParameterInstr::ComputeType() uses
environment index to get a LocalVariable from LocalScope,
assuming that environment index matches a variable index in the scope.
This is only true for direct parameters (which are not copied in
prologue).

This change limits use of LocalVariable type for ParameterInstr
corresponding to direct parameters. Note that it only affects
Parameter instructions used in catch block entries, as
ParameterInstr in function entry always corresponds to a direct
parameter.

TEST=runtime/tests/vm/dart/regress_flutter110715_il_test.dart
Fixes https://github.com/flutter/flutter/issues/110715

Change-Id: I68d423860928d7e65143844522e3006d9ccfcf66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257441
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-09-07 17:58:10 +00:00
Joshua Litt
eb540194ad [dart2wasm] Implement promiseToFuture.
Change-Id: I265441c5c78933f8bdace53f956d22677442d7fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257803
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-07 17:56:17 +00:00
Danny Tuppeny
70e8dc6ee4 [devtools] Ping browsers running DevTools before trying to reuse them
It's possible the browser has been closed but is in the SSE timeout period and therefore looks active. Ping it to see if it's actually responsive before deciding whether to reuse it or launch a new window.

Fixes https://github.com/Dart-Code/Dart-Code/issues/3966.

Change-Id: I2fdcba036b8b63f7ab974e8fef5dd565c2917b64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257581
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-09-07 17:38:57 +00:00
Joshua Litt
2b85e02c5d [dart2wasm] Implement == for JSValue.
Change-Id: I45af5bdabfb0dfa12b6b39094843b9394f4fe510
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257923
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-07 16:37:17 +00:00
Konstantin Shcheglov
6f0fe880c4 Breaking changes for analyzer version 5.0.0
Reland of https://dart-review.googlesource.com/c/sdk/+/243164

Change-Id: I5167844ea1001f026cf8d9b82465a79f560d188d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257267
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-07 16:27:18 +00:00
Lasse R.H. Nielsen
5642199dd0 Remove uses of : as default value separator in some tests/ directories.
Change-Id: I35bb926e53e92fd02e264fb5b14feadf063fb8db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257961
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-09-07 14:49:17 +00:00
Michael Thomsen
0f6c17cbba Refactor tests away from onError which is deprecated
Change-Id: I11350bfbb477b94310d63a6c4626eecca1f23dd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255253
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-09-07 14:42:27 +00:00
Michael Thomsen
17972ddce5 Move swarm to a test folder to avoid confusion that this might
be a customer facing app sample.

Bug: None
Change-Id: I94944d4d5677b08eaf6c27ecf26e8503d8eae38f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255255
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-09-07 14:08:18 +00:00
Danny Tuppeny
94a64a01f6 [dds/dap] Handle duplicate breakpoints and failure to remove breakpoints
Fixes https://github.com/flutter/flutter/issues/111045, along with another issue where multiple client breakpoints that map to the same VM breakpoint could cause an error during removal.

Change-Id: Ifb396b9cb9df4a0297a4b55b31494e229289191d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257962
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-09-07 13:50:27 +00:00
Tess Strickland
be4d469e38 [pkg/dart2native] Refactor MachO parsing.
* Move parsing functions to static methods of the classes that
  represent the data being parsed.

* Move calculations for adjusting offsets in load commands into the
  corresponding classes.

* Make function to insert a new payload segment an instance method
  of MachOFile.

* Remove unnecessary abstractions and definitions for MachO load
  commands that we don't need to parse.

These refactorings are being done to make later changes easier to
review, by first lifting the initial refactorings out into a
separate CL.

Issue: https://github.com/dart-lang/sdk/issues/49783
Change-Id: I133eb368cbb9ee0d8e4f3998ba1a0bbe8555b8aa
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256821
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-07 11:32:37 +00:00
Jonas Termansen
ff212e8540 Fix old CHANGELOG entry at wrong header lever.
Change-Id: If6ccea08ccd27d0ed001892e2d170ca042b40f47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257062
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2022-09-07 09:46:57 +00:00
Chloe Stefantsova
05ddb78364 [cfe] Make DartTypeEquivalence symmetrical for functions and records
Change-Id: I9963ae7401d1e31e07edf90146f411b6586dbc16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256664
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-09-07 09:11:11 +00:00
Ömer Sinan Ağacan
293b6379b8 [infra] Avoid crash in test_runner.dart --help
`testConfigurations` expects at least one configuration, so avoid
calling it when there are no configurations.

This fixes the unhandled exception with `test_runner.dart --help`:

```
No build targets found.
Unhandled exception:
RangeError (index): Invalid value: Valid value range is empty: 0
<asynchronous suspension>
```

With this commit, `--help` just prints "No build targets found" and
exits with 0.

This crash was previously fixed in
02a0396f74.

Change-Id: Id82c83f66871c4e811a7502f1e831a0592db2065
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257580
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2022-09-07 07:44:37 +00:00
Konstantin Shcheglov
6546d85c50 Disallow subtyping class Record.
Change-Id: I5f71e47cc0c60444cf0c7baebb4e9e9d3f105ef0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-09-06 21:04:56 +00:00