Commit Graph

35087 Commits

Author SHA1 Message Date
Danny Tuppeny 133f9936e0 [analyzer] Ensure server-generated diagnostics are recorded to be merged in with plugin errors
Fixes https://github.com/dart-lang/sdk/issues/45678.

Change-Id: I90d2908d1299f3b18efe74f3741d32bbd39e3beb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195270
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-14 16:11:38 +00:00
Brian Wilkerson 61fda382c2 Migrate the LSP protocol generator
Change-Id: Ib44004af7ee760c3cec4f6bb72e7adba0b64988e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195180
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-14 16:08:51 +00:00
Johnni Winther 71293ec389 [kernel] Migrate scanner and value_class
Change-Id: Id4ff972a9a56e878a991680f76f6264b55db27eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195240
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-04-14 13:35:44 +00:00
Daco Harkes 4558112105 Rereland "[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.

Reland 1: Allow importing `dart:ffi` from `dart:core` with
          `--enable-ffi=false`.
Reland 2: Allow the new `_Compound` class to extend `NativeType`. (This
          got triggered in this CL on the build because of the import
          from `dart:core`.)

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: I133278e16bd75cd2bb6234e7ddf042ffa0a54fd6
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-linux-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195079
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-14 12:07:18 +00:00
Tess Strickland dc88076767 [vm] Handle WSRs more generally in v8 snapshot profile writing.
Instead of special-casing the current fields that may have
WeakSerializationReferences, handle WSRs appearing as elements
or properties of objects more generally. This removes existing
special casing and avoids the need for it in case of new
future uses of WSRs.

For artificial nodes being added for dropped
WeakSerializationReference targets, add them as kArtificial nodes
(not kSnapshot) that has the original offset (element) or
name (property). The replacement is added as a kSnapshot node
that has a negative offset with the same magnitude as the
artificial node (element) or ":real_<property name>" (property).
This simplifies the work done in pkg/vm_snapshot_analysis to
use the artificial nodes instead of replacement ones for
reassembling hierarchies and the like.

This CL also cleans up the old SerializerWritingObjectScope
class, both moving it to Serializer::WritingObjectScope and
allowing nesting of WritingObjectScopes with the correct
semantics.

Thanks to this, not only can we recur when under a WritingObjectScope
instead of lifting recursion outside of those scopes, but we can
also create artificial nodes for non-empty per-code object pools and
static call target tables instead of attributing their contents
as supposed elements of the Code object being written.

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-try,pkg-win-release-try
Change-Id: Ib945c5afcd89b1458b8be3559b6eae24048aba2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194243
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-04-14 08:44:58 +00:00
Johnni Winther d8f2b7cc44 [kernel] Make .function non-nullable on Procedure, Constructor, and LocalFunction
TEST=existing

Change-Id: I4d0ae16291414e58207b7de0466d989d27997619
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195074
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-04-14 08:17:28 +00:00
Jens Johansen 0c22d58a7e [CFE] Fix 'first compile took' message in leak test
Change-Id: Ib36c1d3316f69983b7e852787850039405efa12b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195073
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-04-14 06:44:08 +00:00
Konstantin Shcheglov cc265dc81c Stop reporting StrongModeCode.TOP_LEVEL_INSTANCE_METHOD
I will work on removing other such hints in following CLs.

Change-Id: I792ec4dde8b11c9e6117bb5d63ef9583cb86fadf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195185
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-14 00:43:08 +00:00
Konstantin Shcheglov 60a53afc5e Revert "Make AnalysisResult.path non-nullable, more non-nullable for ParsedLibraryResult and ResolvedLibraryResult."
This reverts commit 83ca0e87a0.

Reason for revert: breaks google3

Original change's description:
> 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>

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

Change-Id: Iecaa81064450f536a45235d4d79d3b212a93918b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195188
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-14 00:41:59 +00:00
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