Commit graph

75359 commits

Author SHA1 Message Date
Martin Kustermann c4027afb95 [vm/concurrency] Remove unnecessary async marker in benchmark
Change-Id: Ida65d264d83147a85b4ac0c1b8ef3f157f4d3247
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162541
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-09-14 10:58:09 +00:00
Jens Johansen e6ffc0b285 [parser] Issue different warnings for missing identifier based on whether the token is used or not.
E.g. "var = 42;" now has a different error message than "var default = 42;".

Fixes #22553

Change-Id: I58affe988569d8e79190b63f7267b471a1b0ebc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162182
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-14 08:55:18 +00:00
Johnni Winther 3f6af87cd4 [cfe] Use declared nullability in replacement visitors
Legacy erasure on FutureOr<T*> would not yield FutureOr<T*>* as intended.

Change-Id: Ie2ec44900ddd2ee0daa7fd8a5b655e568153b59f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162640
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-14 08:40:39 +00:00
Konstantin Shcheglov ba78db411a Remove DartSdk.analysisContext
Change-Id: I6a67344d928e6182a851741bbbc862284af710c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-13 00:56:36 +00:00
Konstantin Shcheglov ce6a95c15d Revert accidentally landed shared ByteStore.
We decided not to land this, but I change it locally to test faster,
and forgot to revert with one of the CLs.

Change-Id: I4817c768778c0bb10fc0030fb5885bac8fbe2ce4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-13 00:56:18 +00:00
Brian Wilkerson d2004e6811 Support renaming constructors from named to unnamed or vice versa
Change-Id: Id447d6b6d6bb75d88a68b1c9f3ca865290e5cf70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-09-12 23:18:56 +00:00
Konstantin Shcheglov c71ce5234d Remove DartSdk.analysisOptions getter/setter.
Change-Id: I6bdcd1d8c2e998bf4adbf26ddf533f5d649c73c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162620
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-12 21:33:26 +00:00
Konstantin Shcheglov 0567babb06 Include packageLanguageVersion into the linked signature.
It is exposed from LibraryElement.

Change-Id: I6acf704312e185ff8fd8b6391590d5385f9821df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-12 17:23:25 +00:00
Konstantin Shcheglov 38156a5a39 Merge TypeSystem2 into TypeSystemImpl.
Change-Id: I66f9032ed12166966e1e9eefe00d1e252ea175e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162385
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-12 17:21:25 +00:00
Konstantin Shcheglov 44928c7a20 Issue 43397. Fix isDefaultConstructor when view from a legacy library.
Bug: https://github.com/dart-lang/sdk/issues/43397
Change-Id: I1cd4ae4bea441732d1c6ef68a917fcccb144ec62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162584
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-12 16:28:05 +00:00
Paul Berry 337dd5d355 Make flow analysis handle for-each loops more consistently with their desugaring.
Previously the flow analysis equations for a for-each loop `N` of the
form `for (var V in E) S` were approximately as follows:

- Let `before(E) = before(N)`
- Let `before(S) = conservativeJoin(after(E), assignedIn(N), capturedIn(N))`
- Let `after(N) = join(after(E), break(S))`

This CL changes the behavior to:

- Let `before(E) = before(N)`
- Let `before(S) = conservativeJoin(after(E), assignedIn(N), capturedIn(N))`
- Let `after(N) = join(before(S), break(S))`

(In other words, the result of the conservative join is carried
through to the state after the loop).  This isn't strictly necessary
for soundness, but it makes the behavior of a for-each loop more
consistent with its desugared equivalent.  In particular, it means
that if a variable is potentially assigned to or captured in the body
of the loop, then the effect of that potential assignment or capture
will be felt in the code that follows the loop, even if the potential
assignment or capture is not connected to the flow control path.

Change-Id: I7a70a8ae9f87bd40b6592992d8ee985a9aa87e80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-09-12 15:18:15 +00:00
Stephen Adams dfc411cb90 [dart2js] global type analysis for unreachable closure calls
The return value of a closure call on `null` or bottom should be
bottom.

Change-Id: I4520a8d6b13575172cf5407b0fbcbaa0b6be5e63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162384
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-09-12 00:05:35 +00:00
Mayank Patke 6e30428829 [dart2js] Add tests for https://dart-review.googlesource.com/c/sdk/+/162420.
Change-Id: Ifc4f060a72dc273d130ba33d5f61cd4c7e014fdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162580
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-09-11 22:53:35 +00:00
Konstantin Shcheglov 54e98b03d7 Fix for inference when AssignmentExpression references a not yet inferred variable.
Change-Id: I61b57429607454d4cfe002fe6588858853a166dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162560
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-11 21:35:25 +00:00
Konstantin Shcheglov ec65869de7 Use assertNoErrorsInCode() instead of the empty list of errors where possible.
R=brianwilkerson@google.com

Change-Id: Iac17fe779fc44dec3319687d80fc97761e7332f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-11 20:22:53 +00:00
Martin Kustermann 2935fecccb [vm/concurrency] Add EventLoopLatencyJson benchmarks
Issue https://github.com/dart-lang/sdk/issues/36097

Change-Id: Ic364e7dccc15bc14832ce61e45ba6c0e241dbbc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162509
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-09-11 16:46:22 +00:00
张梦 371476bf84 Fix dartvm re-init Flag check crash
Fix dartvm re-init Flag check crash,if dartvm first init set FLAG_causal_async_stacks and FLAG_lazy_async_stacks both true, when we re-init dart vm we will get a crash,it's better to read flag before flag check.

I got this crash when we modified flutter engine [common/settings.h](https://github.com/flutter/engine/blob/master/common/settings.h), because we want to destory dartvm to release memory,but when we recreate the Flutter engine ,we got crash below
```dart
 [VERBOSE-3:dart_vm.cc(421)] Error while initializing the Dart VM: To use --lazy-async-stacks, please disable --causal-async-stacks!
```
So I changed the code order, First to initialize flag from snopshot,then we check the Flag  is legal or not

Closes https://github.com/dart-lang/sdk/pull/43312
https://github.com/dart-lang/sdk/pull/43312

GitOrigin-RevId: d8b05f613751a3516c864a526d5976f570d589d5
Change-Id: I4cb73df93000333963bd68da3d5dae96e382a2e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161720
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-09-11 16:29:52 +00:00
jlcontreras da6cdc55b4 [cfe] Implement addHashCode to valueClass transformation
Change-Id: Ie566cee214b63f986e07c84e4ae28bfecc80e0a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162186
Commit-Queue: Javier López-Contreras <jlcontreras@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-09-11 16:05:52 +00:00
Konstantin Shcheglov af110a7aa4 Change resolution of assignment to PropertyAccess.
Change-Id: Ie9de1166eb0dfd179d539f1b10c54084caf643d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162248
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-11 15:50:20 +00:00
Danny Tuppeny afc2778802 [Analyzer] Don't create new analysis roots for files opened outside an existing root
Change-Id: I55a0bf44551ba1e7abe810fc3fa5654c6cd4ea8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162508
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-11 15:40:22 +00:00
Vyacheslav Egorov 62354c1540 [vm/arm64] Refactor leaf runtime call sequence.
Leaf runtime calls a silently clobbering R23 and R25 registers, which
causes bugs when these calls happen from write barriers (which are not
expected to clobber anything outside of R25).

We introduce a special helper class to handle saving and restoring
necessary registers.

The bug originally reported by Joe Lin <zuojian.lzj@alibaba-inc.com>
who proposed a fix[1]. This CL builds on top of that fix and tries to
make it more safe by forcing users to use a more strict API.

[1] https://dart-review.googlesource.com/c/sdk/+/162300

TEST=vm/dart/write_barrier_register_clobber_test

Change-Id: I93e0a13a3c4c38ad28210b35750a66e615e3e44a
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162191
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-09-11 07:37:51 +00:00
Jens Johansen f4d3f8e0a2 [parser] Delete unused TokenStreamGhostWriter; test used UndoableTokenStreamRewriter
Change-Id: I7f4f053273f70d282b2ced7338715ca314055065
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162190
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-09-11 06:46:11 +00:00
Stephen Adams 8d68480746 [dart2js] Fix global type analysis
https://github.com/dart-lang/sdk/issues/43366

Fixed: 43366
Change-Id: Iac8247c31fa268186c8f2e3f52e0be1cac062598
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162247
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-11 04:07:41 +00:00
Brian Wilkerson e29f248d3e Enable the add-missing-required-argument fix for missing required named
parameters under null safety

Note that the fix is disabled when we can't suggest anything other than
`null` in an opted-in library and the parameter can't accept `null`. We
might want to relax that restriction, even though we'd be introducing an
error, if we think it's better to provide some fix rather than none in
this case. Doing so would violate a long-standing design constraint,
which is why I haven't already done it. Reducing the temptation to do so
is why I provided non-null defaults for so many other types.

Change-Id: I114a495ee2bf3e01f02a51b87cc8659048e56aa2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162440
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-09-11 00:43:10 +00:00
Mayank Patke 39b9a76323 [dart2js] Ensure generator return types are included in closure RTI need
computation.

This fixes the failure on
https://dart-review.googlesource.com/c/sdk/+/73360.

Change-Id: I5f082307abf7e93038d5c03ee54015c59c6b3564
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162420
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-09-11 00:38:01 +00:00
Nicholas Shahan 16140ad716 [ddc] Apply late semantics to statics with initializers
Ensures that static finals with recursive initializers will throw
a `LateInitializationError` after trying to assign the value twice,
even if the value is the same.

Change-Id: Iae85a4fab93f51161a9842a684b0efd2aeba9dbc
Fixes: https://github.com/dart-lang/sdk/issues/43358
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162280
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-09-10 23:16:31 +00:00
Brian Wilkerson 4e9a98bb45 Add a date field for transforms
This also contains a few minor clean-up changes to the parser, mostly
dealing with keys that should have been required but weren't.

I'm tempted to make the date a required field and then use it to sort
the transforms so that they are applied from oldest to newest. Right
now it's optional but provides a way for users to document the date
for their own record keeping. Thoughts appreciated.

Change-Id: If3a22bbc2dea30f760f868c1ca1bf41aaf4654c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162382
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-09-10 22:32:11 +00:00
Konstantin Shcheglov 51f766f5a8 Support for 'dart_package (null_safety = True)' in Cider.
R=brianwilkerson@google.com, keertip@google.com

Change-Id: I840afe2f673651fa941df63255e710d2ccdd1f39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-10 21:11:45 +00:00
Sam Rawlins 151292572c Migrator: Check analysis results before re-running.
* Refactor MigrationCliRunner, mostly simplification.
* Add AnalysisResult class to track analysis errors.
* MigrationState now contains an AnalysisResult, and the previewUrls.
* Add logic in the UI to display analysis results.
* Add logic to the backend to display analysis results.


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

Change-Id: I3304467955cfa81820f0010d32e17931b3c68b08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162400
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-09-10 20:55:14 +00:00
Devon Carew 8e61018d47 [pkg/vm_service] fix to analysis warnings about required arguments
Change-Id: I752d0d09b9cee234fe9e8c06144f210eb9a5bb55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162401
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-09-10 19:10:50 +00:00
Sam Rawlins d266dfb1a4 Analyzer: Refactor _PSDependency factory constructor to not return null
Change-Id: I8bab14bacc14c88fc0d0c3276aee1d48be40116a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-09-10 19:07:37 +00:00
Sam Rawlins 8035d5a0a7 Migrator: Switch styles for un-changed NN type and inserted "?", "!", etc.
Fixes https://github.com/dart-lang/sdk/issues/43125

Some screens:

Old: https://screenshot.googleplex.com/6dqJeWEvX2pYSi4
New w/o position change: https://screenshot.googleplex.com/8HorAjqMw2tMshk
New + bold font (not included in CL; just for reference): https://screenshot.googleplex.com/3N9cMr4RijXv5sM
New w/ position change (included in CL): https://screenshot.googleplex.com/9TfLKpHCCZkzLXX

Change-Id: Ib8aaf3ae56e645beaa01b2cf9e78db68544441b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162242
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-09-10 18:57:58 +00:00
Alexander Aprelev a9ed5d1d1e [dart/sendandexit] Fix validation of the sendAndExit messages and the test.
The validation was not actually traversing the message and the test was not actually testing sendAndExit, rather standard message passing.

Brought error messages reported by sendAndExit in line with regular message passing error messages.

Bug: https://github.com/dart-lang/sdk/issues/43382

Change-Id: Iceb26ab9027a39e9eb3847b42a64ce991521578e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162249
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-10 18:33:37 +00:00
Ben Konyi 19875e9ab4 [ VM / Service ] Fix issue where dart:* sources were not available via
the service

As part of the dartdev refactoring, 'dfe.Init()' was only called when
an explicit script URI was found during option parsing. However, with
--observe provided, 'script_uri' is always null as dartdev is
responsible for determining which script to run. This change ensures
that vm_platform_strong.dill is always loaded by the DFE.

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

Change-Id: I118b83390efba48e3e8d5b793444d189ba3c5ae2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162060
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-10 17:53:19 +00:00
Brian Wilkerson dbbe5c3934 Remove the defaultValue from the add-parameter change
I originally thought we'd need this to handle updating overrides, but I
now think we can get the deafult value from the overridden method and
hence don't need it in the data file. We can always re-add it when we
support the override case if I'm wrong.

Change-Id: I1016841d18badf9deeb92ad2294e5ffe4af94ef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162380
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-09-10 17:44:09 +00:00
Mehmet Fidanboylu ae0fbde71c [dart:io] Enable insecure connection ban for HttpClient.
We are reverting socket level checks at https://dart-review.googlesource.com/c/sdk/+/161581.

Instead, we are moving the checks to upper protocols
such as http and grpc.

Change-Id: Ice1a6bf818810f59937c19b48f5a68bb512c018d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161801
Commit-Queue: Mehmet Fidanboylu <mehmetf@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-09-10 17:42:29 +00:00
Ben Konyi 1c21e4763a [ package:dds ] Fix sseUri not returning a URI with a 'sse' scheme
Change-Id: I323f6a4bec959b63c5dbd95b577cc22c79c8548a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162061
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-10 16:44:10 +00:00
Alexander Thomas d01ef117f8 [co19] Roll co19 to b82516f08b02a10f5a65b7157e8cfdf00f10bdf4
2020-09-10 sgrekhov@unipro.ru LibTests/html tests fixed after tryjob run
2020-09-10 sgrekhov@unipro.ru Fixes 931. Typo fixed
2020-09-09 sgrekhov@unipro.ru Expect ArgumentError instead of RangeError in Float32List.view() and Int32List.view()

Change-Id: I8732ea78e76aae2212fc93b499c0ce23feedfcb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162320
Reviewed-by: William Hesse <whesse@google.com>
2020-09-10 13:20:08 +00:00
Johnni Winther 8008c8d54e [cfe] Make widget transform location field nullable
The widget transformer doesn't handle widgets with optional positional
parameters and therefore doesn't provide locations in these cases.
For this reason we leave the location field nullable and don't null check
it on construction.

Close #43371

Change-Id: I2595eb215e8fab477ab0819b70e25d9fb921ed01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162187
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-10 11:30:15 +00:00
Daco Harkes 4485a270d4 [vm/ffi] Cleanup old documentation references
`Pointer.load` and `Pointer.store` are now extension methods which are
only available for types that are sized.

`allocate` moved to `package:ffi` instead of `dart:ffi`.

Misc: gitignore another clangd cache location.

Change-Id: Ib01ba416f2efa18638a21dd4052d9a35eeab6f4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162188
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-09-10 10:18:55 +00:00
Martin Kustermann 3ab9008fbd [vm] Ensure class is type finalized before looking members in it up
Fixes https://github.com/dart-lang/sdk/issues/43369

Change-Id: I6f181e0a544faf723db86c07649843e895e6ad58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162189
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-09-10 10:04:05 +00:00
Johnni Winther f4dd96c6a9 [cfe] Handle nullable enum in switch case
Closes #43348

Change-Id: Id2bb94f2019e85021c43eb7b2a5d12a651159369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162184
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-10 09:42:15 +00:00
Tess Strickland 3d77741666 [vm/compiler] Unify name checking in dynamic closure call dispatchers.
Instead of possibly looping over the closure function parameter names
array multiple times, just do it once. Check each entry against the
provided argument names. If none match, check the required bit (if in
null-safe mode). Also keep a count of matched names to check that all
provided names matched after the iteration.

Now that optional name checking is part of the fragment built by
BuildClosureCallArgumentsValidCheck, that method builds checks for
exactly the same things as its namesake in Function.

Also refactor the variables used by the checker into read/write ones
that need to be allocated in the parsed function and read-only ones
that can just be temporaries since no Phi nodes are needed.

Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try
Bug: https://github.com/dart-lang/sdk/issues/40813
Change-Id: I3cb421dd538629d7f5499f3bbf0653d34b850dce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160725
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-09-10 07:12:14 +00:00
Jens Johansen b0acaea1e5 [parser] Recover written out binary operators
* Add mechanisms to try out a recovery and only perform it if is
  successful.
* Recover written out binary operators, e.g. "a xor b", "a or b" etc.
  This fixes #26810 and is also how these operators are written in e.g.
  Kotlin. This might be somewhat controversial though.
* Adds a mechanism to _replace_ a token by another token.
  This might be controversial.
  It is done because just inserting the operator causes the same rewrite
  to be attempted on the same token stream several times (at least with
  the way the token stream is parsed via the CFE) in turn causing it to
  be recovered *sometimes*. This is now avoided by actually replacing
  the token.

Change-Id: Icfa806045575d2aa2e5f35126708651b275bcf84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162003
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-09-10 06:23:33 +00:00
Johnni Winther 0e93845ba1 Make update_static_error_tests work on Windows (again)
+ update some test expectations

Change-Id: I63ca86309ea3352a88686f5e3f416311ee7bc03c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162185
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-10 06:21:13 +00:00
Sam Rawlins 4585d4af0a Bump dartdoc to ab98003fc368f484fcc4c055770adea47bc83fbd
Change-Id: I1e1713428bbd5ab713a62aff70d83cc502dde9f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162250
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-09-10 02:20:30 +00:00
Nicholas Shahan 50dfbe9579 [ddc] Escape type name identifiers
Avoids a compiler crash if invalid characters in the type names leak
from the CFE.

Change-Id: I3c9a9fcfd2ac6ef4f7ef5593a53d6f936653955e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162260
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-09-10 01:02:46 +00:00
pq 4d72ed38b8 bulk fix for prefer_final_locals
Change-Id: I9076dbf40aea9f261fe0374aa624bb64e6ec5a8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162246
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-09-09 22:42:06 +00:00
Brian Wilkerson bf80bb23db Add support for add-parameter and remove-parameter changes
Change-Id: Ifc1ed1bbbdd553daf3a91e044ade1c579962dba5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162244
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-09-09 22:14:26 +00:00
Zichang Guo d7483c330c [dart:io] Concurrently resolve IPv4 and IPv6 addresses on iOS.
Original issue: On iOS, The problem is that people on iOS can have their
IPv6 misconfigured so it doesn't work, but it's still turned on.
Additionally getaddrinfo on that platform doesn't handle that case well,
meaning that the IPv6 lookup takes a long time to time out, delaying the
legitimate response.

This fix will issue a concurrent lookup for IPv4 and IPv6 on iOS.
Whichever IP comes first will be used to try to build the connection.

Bug: https://github.com/dart-lang/sdk/issues/41451
Change-Id: I7cda9845f03cf435245bbfad493d7443629b05c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143883
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-09 19:58:09 +00:00