Commit graph

35207 commits

Author SHA1 Message Date
Konstantin Shcheglov 5b8ae4c571 Issue 45879. Initializing formals, AKA field formal parameters are effectively final.
Bug: https://github.com/dart-lang/sdk/issues/45879
Change-Id: I9967c722c62ff811164be87f1fe505cd125d2f50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199064
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-10 20:48:51 +00:00
Konstantin Shcheglov bea3d47c46 Issue 45935. Test for yield null into a Stream of non-nullable.
Bug: https://github.com/dart-lang/sdk/issues/45935
Change-Id: I45ad487c33e07a5415c9a88ab4789d56d9f6a5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-10 19:40:11 +00:00
Konstantin Shcheglov a3f5e14649 Issue 45959. Report PRIVATE_COLLISION_IN_MIXIN_APPLICATION when implicit Object supertype.
Bug: https://github.com/dart-lang/sdk/issues/45959
Change-Id: I064c70a1bf869fae09c2f56271a212b910d853ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-10 19:34:30 +00:00
Devon Carew ac7c44e4a9 update the dart create templates to use package:lints
Bug: https://github.com/dart-lang/sdk/issues/45940
Change-Id: I61c8d3e8be8922cfa6a874213349f84aa44baff4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198620
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2021-05-10 16:44:40 +00:00
Lasse R.H. Nielsen f5a1dd57a1 Change parameters named f to something longer on Iterable.
Remove some unnecessary `new`s while here.

Bug: http://dartbug.com/30399
Change-Id: Ie5665fc680bcd25a74dd765ef68dc88e2c54b671
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192385
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-05-10 15:03:20 +00:00
Paul Berry 713b03a5fd Rework AstResolver.
This class is used during summary linking to do some basic resolution
of ASTs reconstituted from summaries.  To prepare for some resolution
work I have in the pipeline, I need to ensure that resolution always
has access to a properly initialized FlowAnalysis object; this rework
makes that possible.

Previously, the lifetime of the AstResolver class was inconsistent;
some callers created one for each AST node to be resolved, and others
shared a single instance for resolving many loosely related nodes.
Now we consistently allocate a fresh AstResolver each time resolution
is needed; this allows AstResolver to use late fields to lazily create
the visitors it needs for resolution.

Also, previously the API for AstResolver was a single resolve() method
with a complex set of behaviors to allow it to handle all the use
cases.  Now there are three simpler methods to handle the three use
cases (resolveAnnotation, resolveConstructorNode, and
resolveExpression).

Change-Id: I891ae621d4a188d906332cb05b6b7f9a50d59dcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-05-10 14:13:07 +00:00
Paul Berry 53b759d630 Remove unused parameter from topLevelDeclaration_enter
Change-Id: I20195e1cfaea49c8e5a89d752dfe2bc33e0ac67d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198840
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-05-10 14:13:07 +00:00
Paul Berry 8df8147363 Add experimental flag for constructor tear-offs.
Change-Id: Ie9e1fc5dc3be1c7d3fe43cc052f94b74996466d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-05-10 13:33:27 +00:00
Brian Wilkerson 29eb10d488 Unify 5 more codes for documentation purposes
Change-Id: Ib6595fe0962f0c314be3194f2b6566a0259735da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-10 13:21:37 +00:00
Martin Kustermann 31364331e9 Revert "[vm] Enable new kernel AST invocation nodes for the VM"
This reverts commit 53e3c079b7.

Reason for revert: This change has seemingly caused errors of the form
```
stderr >> Unhandled exception:
stderr >> Invalid argument(s): Missing canonical name for Reference to <XXX>
stderr >> #0      BinaryPrinter.writeNullAllowedReference (package:kernel/binary/ast_to_binary.dart:894:9)
stderr >> #1      BinaryPrinter.visitTypedefType (package:kernel/binary/ast_to_binary.dart:2410:5)
stderr >> #2      TypedefType.accept (package:kernel/ast.dart:11115:42)
stderr >> #3      BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:403:10)
stderr >> #4      BinaryPrinter.writeOptionalNode (package:kernel/binary/ast_to_binary.dart:496:7)
```

Issue https://github.com/dart-lang/sdk/issues/45966

Original change's description:
> [vm] Enable new kernel AST invocation nodes for the VM
>
> TEST=ci
>
> Issue: https://github.com/dart-lang/sdk/issues/45340
> Change-Id: Ibb307d8df8ff4ae8f2efad177880634ec9e27905
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197586
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,johnniwinther@google.com,askesc@google.com

Change-Id: I05d010378cfcc5ba40f2be58b01b3ed27a8fc31e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/45340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199000
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-05-10 12:32:38 +00:00
Jens Johansen 2dd7386ec5 [CFE] Mark dart2js/late_statics as SemiFuzzFailure in Strong too
This should have been marked in strong in
https://dart-review.googlesource.com/c/sdk/+/197163
as well, but wasn't.
Better late than never.

Change-Id: Ia85b9434edf87ec37fa0ed0c93b9f90dc66229da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198941
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-05-10 09:39:19 +00:00
Alexander Markov 53e3c079b7 [vm] Enable new kernel AST invocation nodes for the VM
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: Ibb307d8df8ff4ae8f2efad177880634ec9e27905
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197586
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-05-09 21:00:28 +00:00
Alexander Markov 237c6eef9e [cfe] Improve support for new invocation nodes in constant evaluator
* FunctionInvocation and LocalFunctionInvocation nodes are now supported.
* Handling of List getters is added to InstanceGet.
* Removed incorrect constant evaluation of .hashCode and .runtimeType
  for List constants.

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I73f3e64e805c0753325463b3e777a6c1b7d0b5fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198181
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-05-09 20:04:38 +00:00
Konstantin Shcheglov 0f8e17083b Generate State<MyWidget> as 'createState()'.
Bug: https://github.com/flutter/flutter/pull/81578
Change-Id: I4128f5473287983c2837a83462261050e72239df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-09 19:55:08 +00:00
Konstantin Shcheglov 920d1d85e1 Stop reporting StrongModeCode.TOP_LEVEL_INSTANCE_GETTER
Initial: https://dart-review.googlesource.com/c/sdk/+/195302
Reverted: https://dart-review.googlesource.com/c/sdk/+/196282

Internal presubmit looks green.
https://test.corp.google.com/ui#id=OCL:372759773:BASE:372759779:1620532577947:b5e08140

Change-Id: I7348692e1f34f26a9aca48902abb16df50fda2c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-09 18:51:18 +00:00
Brian Wilkerson 62feca7095 Unify two diagnostic codes for documentation purposes
Change-Id: I1b37dc4584757da4833f111c2ea4c3d9511513db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198901
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-09 15:51:28 +00:00
Stephen Adams 90127334ea [dart2js] Pass box to inlined generative constructor body
There was a rare mismatch between arguments and parameters when
inlining a constructor body.

The full arguments at the call site of a constructor body (always in a
generative constructor factory) and the parameters at inlining would
not agree on needing a 'box' for the constructor's closed-over mutated
variables (parameters and locals) when the box was needed only for
locals closed over in an assertion.

The fix is to make the condition for accepting a box match the test
for generating the box in the caller.

Bug: 45943
Change-Id: I3b056cb710ffac72bec6943809e04472a838e5bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198741
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-05-07 22:50:27 +00:00
Stephen Adams b7d2dbe9b5 [js_runtime] Cleanup some dynamic calls
Change-Id: I7fe4dab27f1d6fb2e52a171bd8f373c3decc0b7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197562
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-05-07 22:47:47 +00:00
Alexander Markov 7eb2805665 [vm/ffi] Refactor a few duplicated AST patterns in FFI transformer
This change is a pure refactoring. It extracts 3 duplicated code
snippets into helper methods. This is needed to reduce number of
places where PropertyGet and MethodInvocation nodes are created, as
these nodes are going to be replaced with InstanceGet and
InstanceInvocation nodes soon.

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I694805a3761fd389ac8ee005d12ffb9bb9543ea7
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198581
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-05-07 16:32:07 +00:00
Sam Rawlins 28a94024e9 Analyzer: add **basic** generic function type inference tests
This CL just converts one checker_test case into the modern test cases in
resolution/type_inference. Many more of the tests in checker_test deal with
method inference and overrides, which I think should be its own separate test
class in its own CL.

Change-Id: I7ff6787f6a0c343e7948bd6152acc7d579af4afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198742
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-05-07 15:46:07 +00:00
Sam Rawlins 1d3829400e Move one RETURN_OF_INVALID_TYPE test case out of checker_test
Change-Id: I02cf33a254c0c05aaf1da9d0a723e63e551b931d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-05-07 13:33:57 +00:00
Michael Thomsen d0f7a5b6d1 Updated server template
Change-Id: If3a0e3ea3f0f0e4465bf8f875071c92c674600c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197167
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-05-07 12:07:56 +00:00
Brian Wilkerson 454e633461 Fix a bug in the convert_into_expression_body fix
Change-Id: Ieed0452eb1ec89b294e6d567df758b533ac4062f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-07 04:53:44 +00:00
creativecreatorormaybenot 9108f927ab Document same-library access for protected members
I noticed that in the Flutter framework, `@protected` members are called from outside of instance methods. @Hixie responded:

> protected allows access from the same file

I think this should be documented.

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

GitOrigin-RevId: c1a86d4039aeaa5a2126b505cad28e10fe361b0a
Change-Id: If0be693897abe10197516bdf854ec45fcb1be7fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-06 22:53:54 +00:00
Robert Nystrom 7363505cfb Remove support for ancient multitest marker syntax.
TEST=fixing tests

Change-Id: I0857ff9275b4b915e0b79824c7e16f4d07c8a239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198445
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2021-05-06 22:36:04 +00:00
Brian Wilkerson 484c999f12 Add a quick fix for avoid_function_literals_in_foreach_calls
Change-Id: I8f209dc884ef2eb19cc12a7f10f52621237c7964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198560
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-06 18:35:43 +00:00
Sigmund Cherem c47ad2789e [ddc] Avoid collision of a top-level function name with parameter names.
Safari has a bug that makes it a syntax error for a function name
to overlap with names of parameters in functions with default
parameter values.

This CL changes DDC to generates code to circumvent this issue
when emitting top-level methods.  Fortunately, the Safari bug
doesn't trigger with ES6 methods, so we don't need to do anything
for Dart instance methods.

The only other occurrence of named functions in DDC are
`function*` generators that we emit. Those take no arguments,
so we don't need any additional renaming there.

Fixes #43520

Change-Id: I2e4588701a294a8f3c5b47956826ada4ed973e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-05-06 18:06:05 +00:00
Daco Harkes f53af0d445 [cfe/ffi] FFI transformation support incremental compilation
The compounds transformation converting fields into getters and setters
now retains the annotations on the getters so that they can be read
during recompilation.

This splits up `_replaceFields` into `_findFields` and `_replaceFields`.
`_findFields` works for both transformed and non-transformed compounds.

This splits up `_compoundClassDependencies` out from
`_checkFieldAnnotations`. The former is run on all compounds
transitively reached from the compounds being compiled, the latter only
on the compounds being (re)compiled.

`manualVisitInTopologicalOrder` now visits compounds from all libraries,
not just the ones in the libraries being (re)compiled. It is responsible
for filling the `compoundCache` in topological order. And, this CL
introduces the `InvalidNativeTypeCfe` to support processing compounds
with invalid fields, which might be nested later in other compounds.

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

TEST=pkg/front_end/testcases/incremental/crash_05.yaml
TEST=tests/ffi(_2)/*

Change-Id: I07a2214fd460f4d5e6a84df81e8b140dd80401dc
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try
Fixed: 45899
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198281
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-05-06 13:22:22 +00:00
Karl Klose 323cd5914e Reland "[pkg/test_runner] Write experiments to results.json"
This is a reland of 4e34ea06a9

TBR=athom@google.com

Original change's description:
> [pkg/test_runner] Write experiments to results.json
>
> Change-Id: I32423ddf665a24443de1ad60ca8f323f5c6d3aca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196489
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Karl Klose <karlklose@google.com>

Change-Id: I894616f77cb47df25c8da46d2bf6ddb87734db41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198404
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2021-05-06 07:49:52 +00:00
Karl Klose e97329da49 Revert "[pkg/test_runner] Write experiments to results.json"
This reverts commit 4e34ea06a9.

Reason for revert: The data does not show up in bigquery

Original change's description:
> [pkg/test_runner] Write experiments to results.json
>
> Change-Id: I32423ddf665a24443de1ad60ca8f323f5c6d3aca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196489
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Karl Klose <karlklose@google.com>

TBR=karlklose@google.com,athom@google.com

Change-Id: Ifccdf3a6031dd55bebfe5d282bcce21c5ab5632a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198403
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2021-05-06 06:14:54 +00:00
Karl Klose 4e34ea06a9 [pkg/test_runner] Write experiments to results.json
Change-Id: I32423ddf665a24443de1ad60ca8f323f5c6d3aca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196489
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2021-05-06 05:28:02 +00:00
Joshua Litt 7b9cdf0cf0 [dart2js] Defer holder names.
Change-Id: I32f8d1462674ba035d945ac160e28d643303fa44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195300
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-05-06 01:15:12 +00:00
Alexander Markov df3bb63a13 [cfe] Use more precise types for FunctionInvocation and LocalFunctionInvocation in type checker
Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I963b3a3b1143a9fbd0eac700daa11488aa5b183a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198182
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-05 23:31:56 +00:00
Alexander Markov b00233f128 [vm] Support new kernel AST invocation nodes in the VM
TEST=Manual testing with new invocation nodes enabled.

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I7eb5f03b9d9ac16c911812a5dbcd92ad43220278
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197585
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-05 20:39:12 +00:00
Konstantin Shcheglov ee10fab0e6 Move comma-separating extensions to Iterable<String>.
Change-Id: I7ef3565461b40230ce908d642e3cbe2dd5cc924d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-05 20:32:45 +00:00
Ben Konyi 5cbf10febe Revert "[ VM / DDS / CLI ] Add DevTools support to the standalone VM"
This reverts commit ef0e4ea107.

Reason for revert: Flutter HHH and golem builds are red. Rolls to Flutter are failing.

TEST=N/A

Original change's description:
> [ VM / DDS / CLI ] Add DevTools support to the standalone VM
>
> Example output on stdout when DevTools is enabled:
>
> Observatory listening on http://127.0.0.1:8181/CzkZzZaONW4=/
> The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FCzkZzZaONW4%3D%2Fws
> hello world!
>
> vm-service: isolate(1674461414267555)  'main' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/CzkZzZaONW4=/ to debug.
>
> TEST=pkg/dartdev/test/commands/run_test.dart
>
> Change-Id: Icd1afda87ad4a46f228125d53094d10adf8056ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188361
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I50e8dc4e592e13b44c2fb980b2029d5c5cc3ad2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198381
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-05-05 20:31:07 +00:00
Lasse R.H. Nielsen 3e9cdc5644 Seal typed-data types.
Change-Id: Ic20b68fc258ddbf5c007f9d357366d8a41d1f1e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192186
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-05-05 18:04:05 +00:00
Konstantin Shcheglov 2efbd99c47 Issue 45887. Report AMBIGUOUS_EXTENSION_MEMBER_ACCESS with actually conflicting extensions.
Bug: https://github.com/dart-lang/sdk/issues/45887
Change-Id: I8ec587b4479e165056766d433cb0a3c459d5f504
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198240
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-05-05 17:26:55 +00:00
Brian Wilkerson f25fc4287c Improve the code completion metrics tool
Added user tags for profiling and started tracking the distribution of
completion times.

Change-Id: I57153aa550787535ee955359a810cabbdee1941b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-05 16:48:25 +00:00
Robert Nystrom cc1f9b9564 Remove the last vestiges of two dead multitest outcomes.
A multitest section marked "dynamic type error" or "checked mode
compile time error" didn't actually do anything. It was silently treated
as "ok", which makes for a very confusing looking test.

Fixed the only remaining four tests that used "dynamic type error".
The other outcome was not used by any test.

Change-Id: I9727b3b524cf1effb0dd899bf206aa65dbd60803
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198180
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-05-05 15:39:45 +00:00
Jens Johansen 16accc2de8 [CFE] Disable experimental invalidation if changed file(s) involve FFI
Because FFI inlindes contained Structs, changing for instance the
ordering of one class can change the size and position data in another
class. We thus have to disable experimental invalidation when the
changed class is an FFI class (e.g. a Struct).
At least for now that's done crudely by bailing if a changed library
explicitly or implicitly (via imports of libraries that export)
dart:ffi.

http://dartbug.com/45899

Bug: #45899
Change-Id: I2a72df6dace025511f3bbe3a816a8728b713a5e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198045
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-05 14:26:05 +00:00
Jens Johansen 8a03e9e75f [parser] Create parser equivalence test suite for ensuring that files parse 'the same'
This CL creates a new test suite running through *.equivalence_info
(yaml) files where one specifies a number of files that are supposed to
parse 'the same' in the sense that it gives 'the same' listener events
modulo whatever the yaml file specifies is ok is not the same.
This could for instance - and is in the tests added here - be to not
include data after the parenthesis (as it often includes tokens),
ignoring `handleParenthesizedExpression` (as for instance `a < b` and
`(a < b)` should probably parse the same and ignoring
`handleRecoverableError`.

This might be a bit basic, but as future needs come up we can make this
fit our needs.

Change-Id: I4f5dfde9e916a95742f49e104fb5c751a8a9b921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197381
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-05 10:17:22 +00:00
Jens Johansen 08faf7bddb [kernel] Fix speed regression introduced in readAnnotationList recently
In 3c83032c60
(https://dart-review.googlesource.com/c/sdk/+/195517)
a change inadvertently made it in that changed readAnnotationList from
always returning a constant empty list when the size was 0, to only
returning an (almost) constant list if the size was 0 and a non-default
setting was enabled.
In practise that meant that for normal runs we went from returning
a constant list when the size was 0 to returning a new empty list,
and the benchmarking system said
AstFromBinaryLazy (Intel Xeon): +33.2%
AstFromBinaryLazyP90 (Intel Core i5): +87.2%
AstFromBinaryLazyP90 (Intel Xeon): +117%
(i.e. generally much slower).

This CL restore the status quo and my local benchmarks says:
AstFromBinaryLazy(RunTimeRaw): -22.98% +/- 3.91%
AstFromBinaryLazyP50(RunTimeRaw): -6.20% +/- 5.03%
AstFromBinaryLazyP90(RunTimeRaw): -54.25% +/- 3.78%

Change-Id: Ia198cbbb0b2739f49a085435d98efb04740fa593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198280
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-05-05 07:36:32 +00:00
Daco Harkes cf647f5aad [cfe/ffi] Remove empty Struct use site check
After https://dart-review.googlesource.com/c/sdk/+/197740, I realized
we also don't need the other data structure anymore.

In https://dart-review.googlesource.com/c/sdk/+/180189, we disallow
empty `Struct`s on the definition sites, making a check on the use sites
superfluous.

This removes the last dependency between the ffi definitions and ffi
use sites transformers.

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

TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I6eb5a26d4ece713107ba2a9e6bf601a6e029baa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198047
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-05-05 07:19:02 +00:00
Nicholas Shahan 13943449b5 [ddc] Add missing nullability on FutureOr types
FutureOr types now to emit nullability when they are contained inside a
deferred type.

Issue: https://github.com/dart-lang/sdk/issues/45767
Fixes: https://github.com/dart-lang/sdk/issues/45870

Change-Id: I103b575e898b3d7754adbd272df6c4a7e03e50d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197902
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-05-04 19:46:51 +00:00
Nicholas Shahan 18e88e35b7 [ddc] Refactor _normalizeFutureOr return type
Allows the method to be called in other places to get the normalized
type without emitting any code.

Change-Id: Ib05c27560f565a04cf48920f6a1eb392cfc5c82c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197901
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-05-04 19:46:51 +00:00
Alexander Markov df80241899 [vm] Handle new AST invocation nodes in VM kernel transformations
This change extends VM-specific kernel transformations to handle
new AST invocation nodes. The transformations may still generate
old nodes, but they should accept and handle new nodes coming from
the front-end.

TEST=Manual testing with new invocation nodes enabled.

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I2de9f0eb00fcf844ba62fdc93b15a907c2d6b69d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197443
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-04 18:15:01 +00:00
Danny Tuppeny c3683c79a2 [analyzer] Ensure the error message for LSP CodeActions requests with invalid positions is clear
See https://github.com/dart-lang/sdk/issues/42786

Change-Id: I37c5b2cd7620bcb605d4e51c20493a2a505d3d61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-04 16:55:11 +00:00
Danny Tuppeny b3993c9349 [analyzer] Map all LSP integer/uintegers on to Dart's int type
Change-Id: I714bafdf378b8a29ba847c8d39ebe96977fc977e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198043
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-04 15:37:41 +00:00
Jens Johansen 107ed1cbbd [CFE] Incremental compiler + FFI crash reproduction
Run like
```
out/ReleaseX64/dart --enable-asserts pkg/front_end/test/incremental_suite.dart -DupdateExpectations=true -- incremental/crash_05
```

Crashes like this:
```
NoSuchMethodError: The getter 'iterator' was called on null.
Receiver: null
Tried calling: iterator
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1      computeStrongComponents.recursivelySearch (package:kernel/util/graph.dart:36:30)
#2      computeStrongComponents.recursivelySearch (package:kernel/util/graph.dart:41:26)
#3      computeStrongComponents (package:kernel/util/graph.dart:74:24)
#4      _FfiDefinitionTransformer.manualVisitInTopologicalOrder (package:vm/transformations/ffi_definitions.dart:131:33)
#5      transformLibraries (package:vm/transformations/ffi_definitions.dart:89:15)
#6      VmTarget.performModularTransformationsOnLibraries (package:vm/target/vm.dart:162:34)
#7      KernelTarget.runBuildTransformations (package:front_end/src/fasta/kernel/kernel_target.dart:1236:19)
#8      KernelTarget.buildComponent.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:372:7)
```

Run like
```
out/ReleaseX64/dart --enable-asserts pkg/front_end/test/incremental_suite.dart -DupdateExpectations=true -- incremental/crash_06
```

Crashes like this:
```
Class((whatnot)) not found in compoundCache
#0      new NativeTypeCfe (package:vm/transformations/ffi_definitions.dart:775:9)
#1      _FfiDefinitionTransformer._replaceFields (package:vm/transformations/ffi_definitions.dart:494:16)
#2      _FfiDefinitionTransformer.visitClassInTopologicalOrder (package:vm/transformations/ffi_definitions.dart:198:28)
#3      _FfiDefinitionTransformer.manualVisitInTopologicalOrder.<anonymous closure> (package:vm/transformations/ffi_definitions.dart:158:9)
#4      List.forEach (dart:core-patch/growable_array.dart:403:8)
#5      _FfiDefinitionTransformer.manualVisitInTopologicalOrder (package:vm/transformations/ffi_definitions.dart:134:25)
#6      transformLibraries (package:vm/transformations/ffi_definitions.dart:89:15)
#7      VmTarget.performModularTransformationsOnLibraries (package:vm/target/vm.dart:162:34)
```

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

Change-Id: I9d42ed16577a79c80f1c3bd77ee82a135d4e107c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197740
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-04 13:42:31 +00:00