Commit Graph

34928 Commits

Author SHA1 Message Date
Konstantin Shcheglov 5cd5a9f55d Exclude _fe_analyzer_shared/test/inference/inferred_type_arguments/data/ from analysis.
Change-Id: Ic909a11f29e577f7f4ee39fa52ea5fbd7ecf15b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195184
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-13 23:46:28 +00:00
Konstantin Shcheglov 1dcccbe30b Revert "Replace FileState.external() with Either2<FileState?, ExternalLibrary>."
This reverts commit 1605740703.

Reason for revert: breaks google3

Original change's description:
> Replace FileState.external() with Either2<FileState?, ExternalLibrary>.
>
> Change-Id: I092da57fc3ca57479ea6088ac1a174677c80270b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195170
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com

Change-Id: I0fa3817b6022c0a4a767e48486fac2a6783cd5a0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195186
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-13 23:18:49 +00:00
Konstantin Shcheglov 1605740703 Replace FileState.external() with Either2<FileState?, ExternalLibrary>.
Change-Id: I092da57fc3ca57479ea6088ac1a174677c80270b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195170
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-13 23:16:43 +00:00
Brian Wilkerson 04173573cf Migrate tests of data-driven support
Change-Id: Iac640c945112afa32d413e67f1b0809e58892dea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195169
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-13 19:54:48 +00:00
Nicholas Shahan 825b59ae6d [ddc] Source map fixes for debugger calls
- Fixes calls that pass `when` or `message` arguments
- Updates location information on the expression statement versions to
  point to the beginning of the `debugger()` call instead of the `;` at
  the end of the line.

Change-Id: I56e6d3358a4a4f0f04b4087d062c513fa6729bd3

Issue: https://github.com/dart-lang/sdk/issues/45544
Change-Id: I31838b5877d139554e3aa39c9833fd83ae729a0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195053
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-04-13 19:40:46 +00:00
Brian Wilkerson d7129dc936 Migrate tests of the bulk fix support
Change-Id: Ic2de6d929167c6ba53fcfc2484f593058ceff231
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195166
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-13 18:35:36 +00:00
Konstantin Shcheglov 83ca0e87a0 Make AnalysisResult.path non-nullable, more non-nullable for ParsedLibraryResult and ResolvedLibraryResult.
Change-Id: Iab3a8c6c81ace30049a93d0a453e2473634ba07a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195058
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-13 18:05:28 +00:00
Brian Wilkerson 97f2b1439a Migrate the signature computer
Change-Id: I5e76ffb55747a1865716b649fe209d836fe95cd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195045
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-13 17:34:27 +00:00
Brian Wilkerson 770bc1e55c Migrate fix and assist support for Cider
Change-Id: Ie37bc2b7868a0001aba1937322052bbc73147af5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-13 17:18:06 +00:00
Brian Wilkerson e453325e92 Migrate the supported_lints tool
Change-Id: I4df8b8fd209e96e18e8165d01f3860fe9dbbee7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195161
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-13 17:17:57 +00:00
Ryan Macnak 55645786bc Revert "[vm, compiler] Support unboxed parameters for integer intrinsics."
This reverts commit 1d369b5000.

Reason for revert: Failures on Golem

Original change's description:
> [vm, compiler] Support unboxed parameters for integer intrinsics.
>
> TEST=ci
> Change-Id: I7f29471043c049ef1acf7cd4bcb0890db6d33aa4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192728
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

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

Change-Id: I09e54cd894c0f73bf3af215729567503c156ec3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195165
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-04-13 17:05:47 +00:00
Konstantin Shcheglov 0a2bd758fc Migrate test/src/services/correction/fix/analysis_options/
R=brianwilkerson@google.com

Change-Id: I21bcd019adde36bd85bb6b8871f19ae49cebea8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195164
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-13 16:44:16 +00:00
Konstantin Shcheglov cdbff0e6fb Migrate test/src/services/correction/fix/
R=brianwilkerson@google.com

Change-Id: I61e64a0481b4a4f57fc64fb726315e56d3d82485
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195163
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-13 16:19:56 +00:00
Jens Johansen 97742f827a [CFE] Avoid AllocateContext in Scope.recordUse
Replacing putIfAbsent with containsKey (and inserting if not) gives an
improvement.

When compiling dart2js with fasta (from source), measuring only calls
to `recordUse` (which is called 1,549,231 times) (but measured
'outside' the method itself to include the `AllocateContext` cost)
I get the following:

Difference at 95.0% confidence
        -37.2 +/- 18.2218
        -18.5814% +/- 9.10179%
        (Student's t, pooled s = 12.494)

i.e. almost 40 ms faster.
(this should be seen in a context of the entire compile taking
10+ seconds, but still).

Change-Id: I96cf521bb3cf760f14e4a407ff24638f019a8e21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194760
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-04-13 15:06:36 +00:00
Daco Harkes c33dad37e5 Revert "Reland "[vm/ffi] Disallow Pointers and structs in finalizers and expandos""
This reverts commit 3f0ad61daa.

Reason for revert: Conflicts with https://dart-review.googlesource.com/c/sdk/+/194765

Original change's description:
> Reland "[vm/ffi] Disallow `Pointer`s and structs in finalizers and expandos"
>
> `Dart_NewWeakPersistentHandle` and `Dart_NewFinalizableHandle` in
> `dart_api.h` do no longer accept `Pointer`s and subtypes of `Struct`s
> as values passed in to the `object` parameter.
>
> Expandos no longer accept `Pointer`s and subtypes of `Struct`s
> as values passed in to the `object` parameter.
>
> Cleans up unused object_store->ffi_struct_class.
>
> Closes: https://github.com/dart-lang/sdk/issues/45071
> Breaking change: https://github.com/dart-lang/sdk/issues/45072
>
> TEST=vm/cc/DartAPI_FinalizableHandleErrors
> TEST=vm/cc/DartAPI_WeakPersistentHandleErrors
> TEST=tests/ffi(_2)/expando_test.dart
>
> Change-Id: I9af6d0173db60614091068c218391f73756c135f
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195061
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

TBR=kustermann@google.com,dacoharkes@google.com

Change-Id: I90064b6b73155a43f37388f987c6b29f72ce9770
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195076
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-13 15:05:07 +00:00
Kallen Tu f9536375e1 [cfe] Invalid empty return statements in const function invocations.
Change-Id: Id1408bff917200f3825846bd6d483e52ca326d5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194840
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-04-13 14:49:06 +00:00
Brian Wilkerson 4b4ccbaa0d Migrate tests for data-driven fixes
Change-Id: I845d3dbeb4e6d1726578a2d8f9f01e7c537d54df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195048
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-13 14:00:11 +00:00
Daco Harkes 3f0ad61daa Reland "[vm/ffi] Disallow Pointers and structs in finalizers and expandos"
`Dart_NewWeakPersistentHandle` and `Dart_NewFinalizableHandle` in
`dart_api.h` do no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Expandos no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Cleans up unused object_store->ffi_struct_class.

Closes: https://github.com/dart-lang/sdk/issues/45071
Breaking change: https://github.com/dart-lang/sdk/issues/45072

TEST=vm/cc/DartAPI_FinalizableHandleErrors
TEST=vm/cc/DartAPI_WeakPersistentHandleErrors
TEST=tests/ffi(_2)/expando_test.dart

Change-Id: I9af6d0173db60614091068c218391f73756c135f
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195061
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-13 13:52:36 +00:00
Dmitry Stefantsov 4658b9ee6b [cfe] Introduce ExtensionType into isSubtypeOf
Change-Id: Iea88e7355d7eee9d82c0c41247407fe1178ee049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195068
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-04-13 13:05:57 +00:00
Daco Harkes c57ca14781 [vm/ffi] Refactor CFE transform to compound
In preparation of having `Union` besides `Struct`, renames all mentions
of `Struct` to `Compound`.

Also, changes the type checking to have `allowXYZ` named arguments
always default to false, and remove redundant arguments.

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

tools/test.py ffi ffi_2
TEST=tests/ffi(_2)/(.*)by_value_(*.)_test.dart

Change-Id: Ie5f7cf4189dc315f896e3b3933ff0e0580ac540f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194424
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-04-13 12:50:17 +00:00
Daco Harkes bde9578a39 [vm/ffi] Introduce _Compound NativeType
Introduces the class `_Compound extends NativeType`, for sharing between
`Struct` and `Union`.

Does minimal changes to CFE and IL construction. Follow up refactor CLs
rename everything.

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

tools/test.py ffi ffi_2
TEST=tests/ffi(_2)/(.*)by_value_(*.)_test.dart

Change-Id: I276ceb9249c20bd331c2f8b6ef64e35acb525e9c
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194765
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-04-13 12:50:17 +00:00
William Hesse 0cb6607cf1 [sdk] Bump version to 2.14
TEST=CI presubmit with added tryjobs

Change-Id: I6c4f7de9d3fbe6d1031f6f0161e8ffebcea822a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195062
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-04-13 12:47:27 +00:00
Johnni Winther 9dff91e2a5 [cfe] Add id testing for inferred type arguments
Change-Id: If932af54e184fcd7bb19a6889edf459c660f0cdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195020
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2021-04-13 09:10:38 +00:00
Johnni Winther 8baa649665 [cfe] Add tests to verify that mixin forwarding stub problems have been fixed
With the new class hierarchy builder and mixin stubs we no longer
insert superfluous forwarding stub nor use mixin declaration/clones
as targets inconsistently.

These test expand upon existing tests to verify that these issue have
been fixed.

Change-Id: I27db6e27e86d8c83692e9a16f7c435f633a599c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194787
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-04-13 07:55:46 +00:00
Stephen Adams acd5f6e997 [dart2js] Add test for string method specializers
Change-Id: I4bbc7d7353c6ccc5eb3b0b9feb08c16f35c24fb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194885
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-04-13 06:53:39 +00:00
Mayank Patke 05a0508e7c [dart2js] Implement Cell lowering for initialized local variables.
Change-Id: I99c1274e1a74693be329ad9f582baf2a9817934a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194961
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-04-13 02:25:46 +00:00
pq 88a00c37b2 [test util] display error info on failed parse
Example output:


```
  Invalid argument(s): Content produced diagnostics when parsed:
    MISSING_IDENTIFIER: Expected an identifier. - 9:15
    EXPECTED_TOKEN: Expected to find ';'. - 9:7
    MISSING_IDENTIFIER: Expected an identifier. - 9:12
    MISSING_IDENTIFIER: Expected an identifier. - 9:10
    EXPECTED_TOKEN: Expected to find ':'. - 9:15
    UNEXPECTED_TOKEN: Unexpected text ';'. - 9:15
    EXPECTED_TOKEN: Expected to find ';'. - 9:15
```

Change-Id: Icbeeaca147e70e553a3c2b7809edff1c8fb8721f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195049
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 22:23:06 +00:00
Konstantin Shcheglov 704d18abd8 Migrate test/src/services/correction/assist/
Change-Id: I6ba1f5c9916faa67fffdad26f6addfd7b665849b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195050
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-12 22:12:36 +00:00
Konstantin Shcheglov 68edc773dc Check in getHover() that the result is valid.
Change-Id: I7f97c2ba57500dc540631d678e1bf6aa8a785e65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195044
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 22:09:46 +00:00
Konstantin Shcheglov 050fa8a70a Migrate correction/assist_internal and correction/fix_internal.
Change-Id: I07f44983a14119f34a7637c34cbff1983284a913
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195047
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-12 21:12:26 +00:00
Mayank Patke 5d20034a82 Reland "[dart2js] Implement Cell lowering for uninitialized static fields."
This is a reland of da42b0d323

Original change's description:
> [dart2js] Implement Cell lowering for uninitialized static fields.
>
> Change-Id: If0cd7c95a8e52de19893892acae662619075d87b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193835
> Commit-Queue: Mayank Patke <fishythefish@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

Change-Id: Ic8089989c2c474c4204be9742601be82f9aa108f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194901
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-04-12 21:11:26 +00:00
Konstantin Shcheglov 1d9bb15018 Fix remaining individual correction producers.
R=brianwilkerson@google.com

Change-Id: I80d97654b06a0926ce0f2d6c0ee5930c93f2d8a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195046
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-12 20:35:56 +00:00
Brian Wilkerson 14fea36798 Migrate some of the plugin support
Change-Id: I5e8cdf215836470f8cf237f0da5155c0ac80e281
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195042
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-12 20:07:16 +00:00
Brian Wilkerson 7f1b4f93bd Migrate more of the data-driven fix support
Other than the changes in
  'pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart'
all of these changes have been reviewed before.

This doesn't include some tests that I had previously migrated, but those
depend on a large number of libraries that haven't yet been migrated.
There are some tests that are now migratable, which I'll tackle separately.

Change-Id: I0f77d86d892216bf42d94b098575f6529ca72ed1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 18:59:26 +00:00
Konstantin Shcheglov 81be9be4a6 Migrate several lib/src/services/correction/dart/
R=brianwilkerson@google.com

Change-Id: I7957e3fa724e618e6cf8c6a94344b0b4057aa080
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-12 18:56:16 +00:00
b-stime c1339411bb Adds assist for basic Flutter Builder
Fixes issues such as

* https://github.com/flutter/flutter-intellij/issues/814
* https://github.com/dart-lang/sdk/issues/33957 .

Essentially, in Flutter, it's often useful to create a new context in the UI/widget tree as a place to begin a search towards the trunk of the tree for various state structures attached to lower levels of the tree. The basic `Builder` widget is the official means for creating such a context/entry-point.

The patches in this PR are essentially a copy-paste-tweak from two types of existing, similar assists. The main origin was taken from `FlutterWrapStreamBuilder` which wraps client code with a constructor for the StreamBuilder sub-class. The new assist, provided here, is a little more basic/general than the StreamBuilder so it was able to also adopt assertion and test code from some of the other assists for basic widgets.

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

GitOrigin-RevId: 00a5043e5dbd410f24f30f6503711413341dbe7a
Change-Id: I5f93837af571b4974e35da131112f82cd9359697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 17:33:06 +00:00
Daco Harkes f162db3ba7 [analyzer/ffi] Support Unions
This CL does not add unions to `dart:ffi` yet, only to the mock
SDK in the analyzer for testing the analyzer. This means we can review
and land it separately.

Also, this CL fixes some tests to not use nullable fields in Structs.

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

Change-Id: Ia972f31475859aa57e012adf39b636919995b183
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194788
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 16:50:16 +00:00
Daco Harkes ac2412ca01 Revert "[vm/ffi] Disallow Pointers and structs in finalizers and expandos"
This reverts commit 2376ab5186.

Reason for revert: Importing dart:ffi from dart:core breaks the VM when using --enable-ffi=false

Original change's description:
> [vm/ffi] Disallow `Pointer`s and structs in finalizers and expandos
>
> `Dart_NewWeakPersistentHandle` and `Dart_NewFinalizableHandle` in
> `dart_api.h` do no longer accept `Pointer`s and subtypes of `Struct`s
> as values passed in to the `object` parameter.
>
> Expandos no longer accept `Pointer`s and subtypes of `Struct`s
> as values passed in to the `object` parameter.
>
> Cleans up unused object_store->ffi_struct_class.
>
> Closes: https://github.com/dart-lang/sdk/issues/45071
> Breaking change: https://github.com/dart-lang/sdk/issues/45072
>
> TEST=vm/cc/DartAPI_FinalizableHandleErrors
> TEST=vm/cc/DartAPI_WeakPersistentHandleErrors
> TEST=tests/ffi(_2)/expando_test.dart
>
> Change-Id: I1f11adfa073c7d2c979f3c2bb15c7444c7c767a0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186280
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=lrn@google.com,vegorov@google.com,kustermann@google.com,dacoharkes@google.com

Change-Id: Ib76d27e59391dc6107d3f8e8fba3d67640ea9a5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195060
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-12 16:30:57 +00:00
Brian Wilkerson 41641e9c8f Migrate more completion support
Change-Id: I073972400bb79166a836e517e268452a03b64f52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 16:30:16 +00:00
Kallen Tu 9bd43c3071 [cfe] Uninitialized variable declarations in const functions.
Change-Id: I1c27902a0af7648b4352b0cd21691cf9f88b78fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194460
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-04-12 15:42:26 +00:00
Brian Wilkerson 77cfcff92f Migrate postfix completion
Change-Id: I92a96785777c651fef7c8a68762c954ba652d68f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194964
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 14:12:21 +00:00
Brian Wilkerson ecdb3689b9 Migrate widget descriptions
Change-Id: I2c6cd72b5572ff30642a5c836adea8839fe2e964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194965
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 14:08:16 +00:00
Daco Harkes 2376ab5186 [vm/ffi] Disallow Pointers and structs in finalizers and expandos
`Dart_NewWeakPersistentHandle` and `Dart_NewFinalizableHandle` in
`dart_api.h` do no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Expandos no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Cleans up unused object_store->ffi_struct_class.

Closes: https://github.com/dart-lang/sdk/issues/45071
Breaking change: https://github.com/dart-lang/sdk/issues/45072

TEST=vm/cc/DartAPI_FinalizableHandleErrors
TEST=vm/cc/DartAPI_WeakPersistentHandleErrors
TEST=tests/ffi(_2)/expando_test.dart

Change-Id: I1f11adfa073c7d2c979f3c2bb15c7444c7c767a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186280
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-04-12 14:04:16 +00:00
Johnni Winther 64460ec47f [kernel] Make Member.name non-nullable
Change-Id: Id2befd868e93985d6af463c2ccd410cd56b68187
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194721
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-04-12 13:48:46 +00:00
Paul Berry 4d06516832 Introduce a "mini IR" representation for use in _fe_analyzer_shared testing.
This is a simple string-based intermediate representation for Dart
code, similar to kernel but with a far simpler structure and a compact
string encoding, suitable for use in unit tests.

I've integrated this representation into mini_ast.dart in a
preliminary way, so it is created as a by-product of running flow
analysis tests.  But as yet there are no tests that validate the
correctness of the result.  I plan to refine the representation, and
test it fully, in follow-up CLs.

Change-Id: Idda527efd005d0199ff88861c9e074eb651d82f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193881
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-12 12:46:06 +00:00
Paul Berry adc3c04e7b Flow analysis tests: add context parameter to Expression visit methods.
This paves the way for generalizing the "mini AST" code so that it can
do full type analysis.

For the moment, the context parameter is always `unknownType`.  In
later CLs I will thread the appropriate context types through the
system.

Change-Id: I5d5e0d6644dba590234e363d1d5d0720bdb71d30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-04-12 12:46:06 +00:00
Brian Wilkerson 9b1583101e Migrate statement completion support
Change-Id: I9d6751888286e4a068fc1dac192c93ffb8089b69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194963
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-11 15:28:25 +00:00
Paul Berry a463217f0a Flow analysis tests: move most visitor logic into a new class.
The new class, _MiniAstTypeAnalyzer, currently only handles the "mini
AST" representation we use for flow analysis tests.  In follow up CLs
I plan to extract a base class from it that will be general enough to
form the basis of a shared type analysis engine for the analyzer and
the CFE.

Change-Id: I180e1484aff1733146ccf73bcab5604e9f4ef2f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194620
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-11 15:03:44 +00:00
Konstantin Shcheglov e1539dc3d4 Migrate several lib/src/services/correction/dart/
Change-Id: I49f43e801f13dbbfe67be79fea19073990acb658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194962
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 22:32:16 +00:00
Brian Wilkerson 5b6d517fe8 Migrate PropertyDescription
Change-Id: Id8f02d1e98897f3ba37fb0ebdb4cfff6bfe1a4a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 20:43:04 +00:00