Commit graph

87573 commits

Author SHA1 Message Date
Konstantin Shcheglov 8e9ad1bd7a Implicit cast of RecordLiteral fields from dynamic, tests, also for ImplicitCallReference.
Change-Id: I3a04b404cf7743c3cc383a83fa58080a3b7b294f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-04 19:40:28 +00:00
Alexander Markov f042822993 [vm] Possible fix for data race during TypeRef canonicalization
AbstractType::flags_ is changed to atomic with relaxed memory order
in order to allow accesses to a mutable type state outside of the type
canonicalization mutex and program lock.

TEST=iso-stress bot
Fixes https://github.com/dart-lang/sdk/issues/50065

Change-Id: Iaebd4ea809e7f1bb0b9afe29308e0e6a2bd3d6ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262503
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-10-04 18:55:27 +00:00
Sam Rawlins 15be61ed9a Remove INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES warnings
Fixes https://github.com/dart-lang/sdk/issues/49112

It was decided to remove the "override with equal default value"
restriction both for null safe code, and for pre-null safe code.

CFE had never issued this static warning, and her we remove it from
analyzer.

Change-Id: I1244e4fe46da8bb4bd8c3a77ec8beb95811e30a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262267
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-04 18:23:10 +00:00
Sigmund Cherem 33c1ff60da [dart2js] migrate io/kernel_source_information.dart
Change-Id: I377252c3e715624240460e47bad2b4bc3a12708c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262277
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-10-04 17:08:00 +00:00
Sigmund Cherem d9b74dc377 [dart2js] prepare io/kernel_source_information for migration
Change-Id: I800afd2e8091bc2560bb373f3d1535d15b84e82a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262276
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-10-04 17:08:00 +00:00
Ben Konyi 72506b826a [ CLI ] Add support for --[no-]sound-null-safety to dart compile {jit-snapshot,kernel}
Fixes https://github.com/dart-lang/sdk/issues/50079

Change-Id: I4a71dab1c9003f13ff74741bc64f3ee239c03195
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262620
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-10-04 17:03:29 +00:00
Ben Konyi c8651ac551 [ CLI ] Force isolate running dart2js to use --no-sound-null-safety
Fixes https://github.com/dart-lang/sdk/issues/50090

TEST=N/A

Change-Id: I5e26a88a8daa107fa684009562c4eb2207f41a9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262621
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-10-04 16:59:57 +00:00
Sam Rawlins c7fe783d11 Language test for unnamed-libraries
Bug: https://github.com/dart-lang/language/issues/1073
Change-Id: I9d57c86c35b5712029c610197e6ad823d34c492e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262580
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-10-04 16:45:21 +00:00
Konstantin Shcheglov 97661ec1e3 Include 'constKeyword' into ConstantPatternImpl.childEntities
Change-Id: I40c874a4d4381aaf4748b86c6c20e84b9942d712
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262507
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-04 16:06:28 +00:00
Konstantin Shcheglov fcc9473dab Deprecate CatchClause.exceptionParameter2/stackTraceParameter2
Change-Id: I3f0ae9367f35fe514a125cb0f06ccbdc8fa0dc18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262502
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-04 15:58:11 +00:00
Konstantin Shcheglov 8faa2fa4fd Use named parameters for a few AST nodes.
Change-Id: Ia2cef588184d89347b1381af580ee4ca1345be6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262504
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-10-04 15:57:59 +00:00
Johnni Winther 5b2e23eab0 [cfe,vm,wasm] Handle private injected members like augmentations
This changes the way the CFE handled private injected members. Previously
these were "hidden" within the patch library in which they were declared.
Now they are, like with members injected in augmentation libraries, fully
integrated and accessible within the origin library and all its patches.

This change revealed that the vm and wasm platforms had some
inconsistently declared classes in which injected private members that
were not implemented by all implementing classes. For these, throwing
stubs have been added.

Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Change-Id: I330eade944964ef43b83aa416baef75e3649d023
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262340
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-10-04 14:43:43 +00:00
Johnni Winther b7debf00f7 [cfe] Handle pattern events in BodyBuilder
This supports pattern listener events in the BodyBuilder without
crashing. Currently no AST is created and only dummy objects are put
on the stack.

Change-Id: I24a29073b578bb9aaa07e84d5177e51428074a94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262422
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-10-04 13:31:41 +00:00
Martin Kustermann 2932261f83 Allow tab-completion of exit/quit/help
TEST=runtime/tools/heapsnapshot/test/completion_test.dart

Change-Id: Ia3bffbdf2b115d15ad90c8cc68870af19e3c373e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261822
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-10-04 12:31:45 +00:00
Chloe Stefantsova 1d768f3c75 Reland "Reland "[cfe,corelib] Add class 'Record' to the core library""
This is a reland of commit 4b6a8f35b9

Original change's description:
> Reland "[cfe,corelib] Add class 'Record' to the core library"
>
> Part of https://github.com/dart-lang/sdk/issues/49713
>
> Change-Id: I56bfca49492d14bb561b32993fd9adfe775b7400
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259583
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>

Change-Id: Idaab98c028312ca36bd07f569374ca8b76151a02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260101
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-10-04 12:29:47 +00:00
Chloe Stefantsova 7e57f6e371 [cfe] Implement pointwise implicit downcasts for record literals
This CL implements the adjustment of the static semantics for records
as described in
d19f6d5644. The
adjustment is based on the discussion at
https://github.com/dart-lang/language/issues/2488.

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

Change-Id: I7a9d456f702ad0fb14aa3bd121ba9d2bbd104414
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262202
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-10-04 11:41:45 +00:00
Ömer Sinan Ağacan d968be9021 [dart2wasm] Run finally blocks on break and continue
Fixes https://github.com/dart-lang/sdk/issues/50026

No new tests added: existing tests cover this. These tests now pass:

co19/Language/Statements/Break/execution_t01
co19/Language/Statements/Break/execution_t02
co19/Language/Statements/Break/execution_t04
co19/Language/Statements/Break/execution_t06
co19/Language/Statements/Break/execution_t07
co19/Language/Statements/Break/execution_t08
co19/Language/Statements/Break/execution_t09
co19/Language/Statements/Continue/control_transfer_t01
co19/Language/Statements/Continue/control_transfer_t02
co19/Language/Statements/Continue/control_transfer_t03
co19/Language/Statements/Continue/control_transfer_t04
co19/Language/Statements/Continue/control_transfer_t05
co19/Language/Statements/Continue/control_transfer_t07
co19/Language/Statements/Continue/control_transfer_t08
co19/Language/Statements/Continue/control_transfer_t09
language/exception/finally12_test
language/exception/finally3_test
language/exception/finally9_test
language/exception/try_catch4_test
language/exception/try_finally_regress_25654_test

Change-Id: I7172d7dac9e58d37c2ecfbc1bde495d8d045fc74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262240
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-10-04 11:23:24 +00:00
Ömer Sinan Ağacan 88539e58ea [dart2wasm] Update tracking issue for skipped async tests
Change-Id: I163c2125fb69438ff1339e1aa26eb590b8710e83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262426
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-10-04 10:39:49 +00:00
Sigurd Meldgaard 4f4f446e22 Bump pub to 28a2503d7f4806e6854e3ed0d783f065abfd1b5f
Changes:
```
> git log --format="%C(auto) %h %s" ec35d46..28a2503
 https://dart.googlesource.com/pub.git/+/28a2503d Bump analyzer from 4.7.0 to 5.1.0 (#3582)
 https://dart.googlesource.com/pub.git/+/8dba9574 Crc32c checksum validation and retry of archive downloads (#3546)
 https://dart.googlesource.com/pub.git/+/27da43ec Allow `dart pub add` with existing package, update constraint instead of adding (#3570)
 https://dart.googlesource.com/pub.git/+/2e9338e5  Do resolution before publishing. (#3565)
 https://dart.googlesource.com/pub.git/+/0a487534 Migrate removed command `pub` to `dart pub` in docs & messages (#3506)
 https://dart.googlesource.com/pub.git/+/e2720c27 Fail gracefully when run inside the pub-cache (#3471)
 https://dart.googlesource.com/pub.git/+/a76c1933 Upgrade `package:tar` to 0.5.6 (#3540)
 https://dart.googlesource.com/pub.git/+/c065e559 Remove unnecessary nullability (#3547)
 https://dart.googlesource.com/pub.git/+/8e306f33 Use pub.dev in writing (#3528)
 https://dart.googlesource.com/pub.git/+/08d71024 Use unicode (if available) when drawing file-lists (#3541)
 https://dart.googlesource.com/pub.git/+/a0ca4226 Don't be conservative in upgrade --major-versions without specific pa… (#3539)
 https://dart.googlesource.com/pub.git/+/a59d890e Show file size (#3509)
 https://dart.googlesource.com/pub.git/+/b0ba5cc6 Avoid packageGraph (and therefore getExecutableForCommand) depending on the lock-file (#3533)

```

Diff: https://dart.googlesource.com/pub.git/+/ec35d46261b610e558dfd0d8525ca3fc8387b4b7~..28a2503d7f4806e6854e3ed0d783f065abfd1b5f/
Change-Id: Ia366f75da16982fb9588a0d7aa18e109daea8f8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262346
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2022-10-04 10:11:57 +00:00
Martin Kustermann 756379442e Abstract out the used set implementation in heapsnapshot analysis tool.
Doing so will allow using a more efficient (both memory-wise
and perf-wise) set implementation.

TEST=ci

Change-Id: Ia64ad5785bab6dba668c5fc3e2dcfcaf482d8b83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262424
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-10-04 09:58:19 +00:00
Johnni Winther 3931dc6b08 [cfe] Use reportIfNotEnabled in endRecordLiteral
Change-Id: I9a2bd53838a40419f9aa4779380488b547db5b39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262421
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-10-04 09:30:07 +00:00
Tess Strickland 82897fdfde [vm] Split AbstractType::PrintName functionality across subclasses.
Since none of the subparts of the base method share any local state,
make the base method virtual and override it in all of the subclasses
with the subclass-specific functionality.

Also add an `ASSERT(IsNull());` check to all base implementations to
cause an error in DEBUG mode when forgetting to override in a subclass,
and then perform what should happen in the null case (if anything).
This way, in DEBUG mode, it's easier to distinguish an accidental null
slipping through vs. a lack of overriding.

TEST=Pure refactoring, so existing tests.

Change-Id: I57a669e5eb34119443d84bf1208ce7232a0e4c6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262347
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-10-04 08:51:00 +00:00
Johnni Winther b16e2aea54 [cfe] Ensure Crash.trace is printed when Crash is created directly
The Crash class was used for to conflicting purposes: 1) To encapsulate
a captured crash in the CFE, in which case the trace was printed
directly, and 2) To propagate a crash in the CFE together with the
context in which it crash, in which case the trace was not printed but
just included in the Crash object.

This CL adds a `_hasBeenReported` field to ensure that 1) is rethrown
as intended and 2) is printed and a Crash object of type 1) is returned.

Change-Id: I6efc752414158aad60867b5dbb8d799d5b08036a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262420
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-10-04 07:20:18 +00:00
Konstantin Shcheglov 2a43b37898 Replace ExtractorPattern.typeName/typeArguments with 'NamedType get type'.
Change-Id: Iaa19aef8f2cb8727879b0eea41c6f8220205f226
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262501
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-04 00:35:51 +00:00
Devon Carew 2cf13806b2 [deps] rev dartdoc, html, markdown, and test_process
Change-Id: I2470f7ce7b8ae1f3598d5556bd65de4aad0a0216
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262505
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2022-10-03 23:32:10 +00:00
Ahmed Ashour 6da33ae60f [analyzer] add HintCode.DUPLICATE_EXPORT
Fixes #49439

Change-Id: I511205c6b0960f6b19a2ac45211bc1348568f52c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 23:22:18 +00:00
Konstantin Shcheglov bcd9da806b Use assertParsedNodeText() for PatternsTest.
Change-Id: Ib0e301d6b5b5c51fe16db13cc27ed900dffb89a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 22:01:49 +00:00
Alexander Markov b5061ffae1 [vm] Support dynamic access to record fields in JIT mode
TEST=language/records/simple/dynamic_field_access_test

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I18df67e0bf97944c8e5ef8a71f075b5cd40fec29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262300
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-10-03 21:24:47 +00:00
Konstantin Shcheglov 8a5725ad38 Deprecate 'Directive.element2', use 'element' instead.
Change-Id: I2326b43381d1d3f84d74f69409bc688516f6a0d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262500
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 21:10:58 +00:00
Ryan Macnak d643bcf9c7 [vm, compiler] Remove unnecessary spill from IA32 write barrier.
TEST=ci
Change-Id: Ie501566662f7460b53c0f5277a610c9dbeec9693
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262273
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-10-03 20:47:21 +00:00
Nicholas Shahan da79baa962 [ddc] Fix bug in FutureOr type normalization
The correct normalization should only normalize FutureOr<Never>
when Never is non-nullable.

Change-Id: I592f3a4856c219b33a8f1ac8377567a956e1148c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261000
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-10-03 20:09:38 +00:00
Paul Berry 118f628ecf Patterns: add support for parsing constant patterns
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I601248bc206d9b19521b020fadb2eccd048e0ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261701
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 19:46:16 +00:00
zmtzawqlp 2702e807f2 fix HideElementCombinatorImpl toString error
Closes https://github.com/dart-lang/sdk/pull/49984

GitOrigin-RevId: 96ec38ee2c93be22039d09f23f986e5904db4d08
Change-Id: I340083b0d5b32ecc78790dbe9feeefe684672a24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259681
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 19:34:39 +00:00
Konstantin Shcheglov 572c0c3cee Issue 50104. Report when a const Set element or Map key have non-primitive '=='.
Bug: https://github.com/dart-lang/sdk/issues/50104
Change-Id: Ia60fde7873c3cce27cbb46d45087b0e57b42d42f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262127
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 19:07:15 +00:00
dependabot[bot] 23b0ac68b2 Bump ossf/scorecard-action from 2.0.3 to 2.0.4
Closes https://github.com/dart-lang/sdk/pull/50109

GitOrigin-RevId: d6b888ae5ea3c3bfaa0491cfba1e8c5c64869ee6
Change-Id: Idd12a8e20b928d6cbe5613983d82875a7b5205b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262380
Reviewed-by: Alexander Thomas <athom@google.com>
2022-10-03 18:34:57 +00:00
dependabot[bot] 285ea50bd1 Bump github/codeql-action from 2.1.24 to 2.1.26
Closes https://github.com/dart-lang/sdk/pull/50108

GitOrigin-RevId: b0fe550215a883a10f9423e9be856e6d38fee5fe
Change-Id: I680c4e2aa417c75a5d91e73f50fb5c199e055e64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262362
Reviewed-by: Alexander Thomas <athom@google.com>
2022-10-03 18:34:06 +00:00
Sigmund Cherem 5828f1be7f [dart2js] prepare no_such_method_registry.dart
Change-Id: I9f217a257e4a2ed6d16b98b4b85f41c216c6e1ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262279
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Sigmund Cherem c41cec8f50 [dart2js] migrate world.dart
Change-Id: Ib0bc169bc58675e9202a35fd232cf24f1dfac1e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262278
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Sigmund Cherem 9768f74c59 [dart2js] migrate resolution_listener.dart
Change-Id: I4fcb759ce8b65a59952506ff83462b92859c13eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262275
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Sigmund Cherem 7ab05daa4b [dart2js] prepare resolution_listener.dart
Change-Id: Ic69113e3640985283dc5ba292b060b9bdbe229d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262274
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Konstantin Shcheglov b861b0c1e1 Issue 50096. Use Glob with the parent Folder.
Bug: https://github.com/dart-lang/sdk/issues/50096
Change-Id: I777364acd34e0ad248d4d99a31f45315487557e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262269
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 16:37:18 +00:00
Konstantin Shcheglov 998daf1fc1 Issue 50103. Report equal record typed const Set elements, Map keys.
Bug: https://github.com/dart-lang/sdk/issues/50103
Change-Id: Id8c709ca2cccadb517932097dec0d4224085f597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 16:27:13 +00:00
Johnni Winther 00f85bbb6c [vm,wasm] Share patch libraries
This shares patch libraries between vm and wasm.

The shared libraries are those previously shared as parts, except
the libraries that need private access to other patch libraries.

Change-Id: I69598a0d2ede5138e9ce33fb59dfa46c987eb38a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262320
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-10-03 15:50:19 +00:00
Dan Chevalier 003ea967a5 Bump DevTools DEP to 2.18.0
Change-Id: I2982ddd363d46fcb1bbb3f8137f89a0cb83178f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262400
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-10-03 15:33:04 +00:00
Danny Tuppeny 8941837fb7 [analysis_server] Prevent "Extract Method" refactor showing up for function declarations
Fixes https://github.com/Dart-Code/Dart-Code/issues/4165.

Change-Id: I799220fffabfa39af1b2fd3039cb2de903f90c72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262348
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 15:08:48 +00:00
Martin Kustermann aa4339a9f3 Allow tab-completion of commands, expression types and named sets
This CL extends the heapsnapshot analysis CLI with tab-completion support
for commands, options, filenames, expression types and named sets.

This makes it much more comfortable to use the tool.

TEST=runtime/tools/heapsnapshot/test/completion_test

Change-Id: Iea48b4bd12651a60add6206a92ce06823cbd754a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262243
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-10-03 14:58:58 +00:00
Martin Kustermann f7808a1aeb [gardening] Ensure unboxed fields are considered non-nullable with concrete cid.
Closes https://github.com/dart-lang/sdk/issues/50110

TEST=vm/dart{,_2}/regression_50110_test

Change-Id: I2f0c06febf55dbf20ca96213a0c5941c2f3ef1a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262344
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-10-03 12:36:18 +00:00
Daco Harkes b113fffb65 Reland "[vm/ffi] Throw on returning Error in Handle"
Fix: Check handle contents for Smi.
Closes: https://github.com/flutter/flutter/issues/112726

Orignal CL description:

Makes `Dart_Handle` FFI returns behave as the following snippet:

```
Dart_Handle ExampleSnippet() {
  Dart_Handle result = ...;
  if (Dart_IsError(result)) {
    Dart_PropagateError(result);
  }
  return result;
}
```

Also makes FFI consistent with Dart_NativeFunctions, which will
automatically throw upon return if Dart_SetReturnValue set the result
to an error.

`UnhandledExceptions` cannot flow out into Dart generated code. So,
the implementation needs to be in `FfiCallInstr::EmitNativeCode`.

Using `Dart_IsError` is slow compared to a machine code class id
check. So, we should do the handle unwrapping and class id check in
machine code.

Unwrapping Handles in machine code is only safe when the GC is
guaranteed to not run: Either (1) in `kThreadInGenerated`, or (2) in
`kThreadInNative`, but only when transitioned into safepoint. So, the
handle cannot be unwrapped immediately after the FFI call in machine code. We first need to transition back to generated.

This means we need to transition again to native to do the actual
`Dart_PropagateError` call. We can do so without the stub in JIT
because we never return with normal control flow.

Performance impact of this change is within benchmark noise in both
JIT and AOT.
Size impact is 42 bytes on x64, which is 10% in AOT and 12% in JIT.

For more numbers see: go/dart-ffi-handle-error

TEST=runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc
TEST=tests/ffi/vmspecific_handle_test.dart

Closes: https://github.com/dart-lang/sdk/issues/49936
Change-Id: Id8edfd841a7d6246438386007d83747868a0a151
Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-msvc-windows-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-mac-release-arm64-try,vm-kernel-precomp-win-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262342
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-10-03 12:25:08 +00:00
Johnni Winther 2c3b2e2c45 [cfe] Pass --no-sound-null-safety explicitly
This prepares for changing sound null safety default.

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

Change-Id: I88aa7994dd5542895c829d7777dd42d3b9438a29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262321
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-10-03 11:52:58 +00:00
Jens Johansen 92b97fe6fb [parser] Field formal parameter with explicit record type
Fixes https://github.com/dart-lang/sdk/issues/50007

Change-Id: I4cce2fd49db9a71b344d5d3e3ea1e0a941a434ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262200
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-10-03 07:14:26 +00:00