Commit graph

36610 commits

Author SHA1 Message Date
Kevin Moore b67a67e03c pkg:analy* - don't call .hashCode within Object.hash functions
Follow-up to cb7c932f7b

Change-Id: Ie00e7759880bfc80f7b04a79979325d26607f148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214581
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-26 21:49:04 +00:00
Konstantin Shcheglov 5f18cd99a4 Fix AnalysisDriverCachingTest on Windows.
Change-Id: I4b10e4fb5ebbf9d3e12ce5b8217d8d86564ae4f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214509
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-26 18:28:44 +00:00
Brian Wilkerson 84c56cc846 Add more documentation for diagnostics
Change-Id: Ic135d6645a8987e9eab0e0ed406a076c81b7b4c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214507
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-26 16:48:33 +00:00
Konstantin Shcheglov 667e879ded Remove only libraries potentially affected by the changed file.
For a small analyzer library the time to analyze it 100 times,
each time changing that file that we are analyzing, so simulating
typing in this file, goes from 1000 ms to 100 ms; for a bigger
library 2400 vs 800 ms.

For a tiny Flutter hello_world the difference is 100x, 5800 vs 50 ms.

Bug: https://github.com/flutter/flutter-intellij/issues/5761
Change-Id: I15c43f4cd66399788ffe6032c52fb365665de7f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214502
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-25 17:56:10 +00:00
Kevin Moore b85488cedd pkg:compiler - enable and fix null operator lints
Change-Id: I5aaef20fdd61fd6ac9dc69978111fb680c7f99e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211624
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-09-24 23:07:19 +00:00
Kevin Moore 70533ae7fa pkg:compiler - enable and fix prefer_final_fields lint
Change-Id: I042f6047c2c10490121398027489217c6291425d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211622
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-09-24 21:37:39 +00:00
Brian Wilkerson 4daa1ed206 Add a test to ensure that a single diagnostic never has multiple bulk appliable fixes
This includes an allow list for the diagnostics that we're already
approved, and we can add more as needed, but I don't want us to have
multiple bulk fixes without first confirming that they are mutually
exclusive. This should help prevent an oversight.

Change-Id: I73c4a52e36005f256b416372bfbf8bf7db38400e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214424
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-24 19:24:39 +00:00
Alexander Markov d78abd0a69 [vm/aot/tfa] Cache negative results of dispatch target lookup
When looking for a dispatch target, also cache not found selectors
to avoid repeated lookups.

Improves time of AOT compilation step 2 (TFA) on a large
Flutter application 189s -> 171s (-9.5%).

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/42442
Change-Id: I21686e1f40a09ef62abf010bfa3670615c108942
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214342
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-09-24 16:27:45 +00:00
Kevin Moore 22f1cee9d6 analysis_server: Fix OrganizeImports correction
Sort `a.dart` before `a/b.dart`

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

Change-Id: Ic16cf3dc1d0651e450cc476bf02d86afa9abf3fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214310
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2021-09-24 15:57:17 +00:00
Kevin Moore 1b3415b069 Ignore .dart_tool and .packages in pkg dir
Change-Id: I053668459b21e10e2a3f7343296f913f82118768
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214309
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-24 15:22:08 +00:00
Paul Berry faa03308f6 Migration: don't add !s to expressions of type Null.
Previously, we had a rule in the migration tool that we didn't add
`!`s to the literal `null`, because such a change would be guaranteed
to fail at runtime; instead we issued a warning to the user that there
is no valid migration for their code, so user intervention is
required.

This change extends the rule to apply to any expression whose type is
`Null`.  Notably, this makes migration of code using Mockito much
easier, because it prevents the migration tool from trying to add a
`!` to expressions like `any`, `anyNamed(...)`, `argThat(...)`,
`captureThat(...)`, etc. (all of which have a return type of `Null`).

Bug: https://b.corp.google.com/issues/200173910
Change-Id: I70ce5da5002e6254397024da5a9e9f69eb04f21c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214313
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-24 13:25:24 +00:00
Clement Skau 22652a3b49 [vm/ffi] Privatizes dart:nativewrappers' getNativeField(..)
TEST=Updated dart_api_impl_test.

Change-Id: Ib72667b2a20adc342f724a6eff7d326e2e106257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214401
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-24 13:13:55 +00:00
Lasse R.H. Nielsen e4f12438a4 Add documentation on Future and Stream showing async programming.
The documentation on `Future` and `Stream` was only showing
the class API, not `async` programming.
Added examples of using `async`, `async*`, `await`, `await for`,
`yield` and `yield*`.

Fixes #47082

Bug: http://dartbug.com/47082
Change-Id: Ib8b4e8642412073e9e6124429d66747c277f89a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212470
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-09-24 13:07:40 +00:00
Johnni Winther 5b7968346d [kernel] Add Field.fieldReference
This adds a third reference to Field declaration, so that we know have
three references, one for each use case:

1) fieldReference used for initialization; in FieldInitializer and as
   the key in the InstanceConstant.fieldValues map.
2) getterReference used for reading; in InstanceGet, StaticGet and
   SuperPropertyGet
3) setterReference used for writing; in InstanceSet, StaticSet and
   SuperPropertySet

TEST=existing

Change-Id: I223f130e808e7f19a831c1fe5e3a4725d1bcdc3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203770
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-09-24 12:01:08 +00:00
Danny Tuppeny 4389cf7bba [dds] Add support for services/service extensions to DAP
Change-Id: I4f63fd60bf2128c8e88c999c0963b8a1e5304178
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214281
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-24 11:53:15 +00:00
Sam Rawlins 5e0f4c24c5 Move function reference const tests to evaluation_test.dart
This change moves tests out of the older-style test file. In addition:

* additional tests for uninstantiated function tearoff identity.
* additional tests for using a type parameter as a type argument in a
  function tearoff in a const expression.

Change-Id: I6c6a6db13144e02794a62d78337013b4a525549a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214139
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-24 05:39:59 +00:00
Riley Porter e559b80f52 Remove getProperty js_util optimization
Removing usage of the foreign JS function from the js_util
CFE optimizations. Keeps foreign JS calls only injected by
the compilers. There will be no change in generated JavaScript
for dart2js, it was already inlining getProperty calls. There
will be a small change for generated JavaScript for ddc, but
we will work on adding a simple ddc inliner to account for it.

Change-Id: Iadcc81a6798a8af397205bf6bb89d0bfbd095432
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214306
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-09-24 01:41:48 +00:00
Riley Porter dc4d16fc1b Use Extension Member data instead of desugar api.
Swap to finding the mapping of Procedure to ExtensionMemberDescriptor
data, instead of using the front_end desugar api for extension
member kind, name, and isStatic information.

Change-Id: I4bca55e8f1d3044def420060ddecc75600452a11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214305
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-09-24 01:41:48 +00:00
Ben Konyi bd067153d5 [ CLI ] Hide exe and aot-snapshot subcommands from dart compile on IA32
The AOT runtime is not supported on IA32, so generating snapshots and
executables requiring the AOT runtime is not possible on IA32.

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

TEST=pkg/dartdev/test/commands/compile_test.dart

Change-Id: I99e9a16f6a93b3b63b8ed15acc1472f9ca619c08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213680
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-09-24 01:21:08 +00:00
Konstantin Shcheglov ec29dce8e0 Remove CompilationUnitElementImpl.sourceContent
I hoped to get hints on why we get out of sync with the number
of classes, getters, etc in the AST and the element model. Unfortunately
it don't not help, we might have a unit without any variables, the
corresponding code, but AST has variables.

So, this code does not help, and I want to remove it.

It was also used for Move File refactoring, we would need some different
solution later. For now I revert to the state it was not long ago.

Change-Id: If7468aac33ce000f85e94f96bfa2d2966892e560
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214341
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-23 22:59:09 +00:00
Kevin Moore 6459e73570 telemetry: allow the latest pkg:usage
Change-Id: I2c3d97b5b999e03682e60a6a62947257f597c182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214308
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-23 21:49:28 +00:00
Paul Berry 5f73b659e8 Extract non-error-code-related members from TodoCode.
This paves the way for code generation of the `TodoCode` class.

Change-Id: I25e113f90194f3f7ac5ab0ae2a17b9836e56b835
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214302
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-23 21:16:08 +00:00
Paul Berry 1042903683 Fix some analyzer error codes that have gotten out of sync with their declarations.
Change-Id: Ifa803f6fd86db7aa6f73abf83e85bee1f83ee6b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214074
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-23 20:20:28 +00:00
Sam Rawlins 032738141e Fix constructor references in assignments
I maintain the choice to _not_ rewrite a PrefixedIdentifier to a
ConstructorReference in the case that it is the left side of an
AssignmentExpression, because doing so requires extra additional
checking during assignment verification, and probably a new error code
saying a constructor cannot be assigned to, similar to the error code
saying that a method cannot be assigned to. This is all feasible, but
I think it is very reasonable, in AstRewrite, to say, "This prefixed
identifier does seem to refer to a constructor, but it's the left
side of an assignment, so I'm not going to confidently do a rewrite;
instead I will leave this alone and let the assignment verification
code handle it."

Bug: b/200948019
Change-Id: I90c6a157c2992d4935acfb593f38518f0388bced
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-23 19:38:49 +00:00
Konstantin Shcheglov 6207d1da35 Revert "Stop using available suggestions for already imported libraries"
This reverts commit 3cc518b3cc.
Initial CL: https://dart-review.googlesource.com/c/sdk/+/201021

Bug: https://github.com/flutter/flutter-intellij/issues/5761
Change-Id: I62e57deef819f78f1d08934ad924585eaa52223b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214225
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-23 18:39:07 +00:00
Konstantin Shcheglov 57e71e33c5 Fix RemoveUnusedField when some SourceRange(s) being removed are fully covered.
Change-Id: I7ae8b9286c473a368def9c9db22b2f2b828c7b81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-23 16:34:03 +00:00
Chloe Stefantsova 65184a9ff4 [cfe] Don't serialize an empty show/hide clause
TEST=existing

Change-Id: Ie63444c4dbeaa45b38fd195e554780f14fed878e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213767
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-23 14:01:54 +00:00
Jens Johansen 1197e15a7e [CFE] Enable avoid_void_async lint
This CL enables the avoid_void_async lint in the CFE, makes the needed
changes and adds the missing `await` (because the lint
`unawaited_futures` doesn't react to void async methods).

Change-Id: Iffc1f173badd3c2d48356ee02e81a9aed492ce5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213481
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-23 11:58:18 +00:00
Johnni Winther 2fa89236d7 [cfe] Handle potentially constant types in instantiations
Part of https://github.com/dart-lang/sdk/issues/46232

Closes #47154

Change-Id: I71fe16d26facf29bdae1b98971c4ccfe18f95e80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213772
Reviewed-by: Chloe Stefantsova <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-23 09:04:12 +00:00
Konstantin Shcheglov aad3389eb0 Implement LintDriver using AnalysisContextCollection.
This change requires a change to linter to be rolled.
https://github.com/dart-lang/linter/pull/2949

Change-Id: Ib49438e0dcd6145d79f2914fef30af5e3009e14f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213290
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-23 06:45:03 +00:00
Konstantin Shcheglov b553298024 Deprecated TypeName, use NamedType instead.
Change-Id: Ic7c2bef44277db3d4b3de495fbf9fbadf15f3db8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214223
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-23 06:08:34 +00:00
Nicholas Shahan 6c4593929f Reland "[ddc] Add web library environment variables"
This is a reland of fb36bba5f2 with
a fix to the ordering to ensure all the expectations run.

Original change's description:
> [ddc] Add web library environment variables
>
> Ensure frontend server builds for the `DevCompilerTarget` add the
> environment variables needed for `bool.fromEnvironment()` calls for
> conditional imports.
>
> Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
> Fixes: https://github.com/dart-lang/sdk/issues/47207
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

Change-Id: Id88aeaf0ddc783936d413c06099df031bc7cb0a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214224
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-09-22 23:47:40 +00:00
Paul Berry 68aac9d9ec Fix uniqueName for analyzer error codes.
Previously, we had an inconsistent convention for whether the class
name should be included when supplying an optional `uniqueName`
parameter to an error constructor.  (Some error class constructors
added it automatically, others didn't).  And we didn't always follow
the convention properly, so some errors were missing the class name
from their `uniqueName` property.

This change adopts the consistent convention that we never include the
class name when supplying an optional `uniquename` parameter to an
error constructor; it is always added in automatically by the
constructor.

Change-Id: Iff7a213b9fe05b1539c22bdbf935c6e54d49f3e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-22 22:55:00 +00:00
Nicholas Shahan d0e013b49a Revert "[ddc] Add web library environment variables"
This reverts commit fb36bba5f2.

Reason for revert: New test fails on windows configurations.

Original change's description:
> [ddc] Add web library environment variables
>
> Ensure frontend server builds for the `DevCompilerTarget` add the
> environment variables needed for `bool.fromEnvironment()` calls for
> conditional imports.
>
> Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
> Fixes: https://github.com/dart-lang/sdk/issues/47207
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=johnniwinther@google.com,nshahan@google.com,annagrin@google.com

Change-Id: Iedfc4c1a5b24b515646d4f1b486bcb2f19bb7783
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214222
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-09-22 21:33:26 +00:00
Konstantin Shcheglov e1b5db7478 Deprecate getters that return TypeName, replace with returning NamedType.
Change-Id: I13764db3da27d5eabe972aab32cdf587a7de53e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-22 21:01:58 +00:00
Nicholas Shahan fb36bba5f2 [ddc] Add web library environment variables
Ensure frontend server builds for the `DevCompilerTarget` add the
environment variables needed for `bool.fromEnvironment()` calls for
conditional imports.

Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
Fixes: https://github.com/dart-lang/sdk/issues/47207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-22 20:39:44 +00:00
Stephen Adams 2ad84a22c8 [dart2js] dart format --fix on remaining lib/src/ files
Change-Id: I09b77a6ba8ed590b3b53ed328c9fc8def444b729
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214001
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-22 20:39:14 +00:00
Kevin Moore 1809cb757f analysis_server_client: remove unused JenkinsSmiHash class
Towards https://github.com/dart-lang/sdk/issues/27698

Change-Id: I403a3e7fdc232debd0a527a8cc69692596516653
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214221
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 20:20:24 +00:00
Riley Porter a0d9d35b80 Add external extension methods.
CFE transformation to add a function body for external
extension methods. Routes to `js_util.callMethod` with the
arguments in a ListLiteral to then be further optimized to
the `callMethodUnchecked` version if possible.

Change-Id: Iccdda7b8c16c19b37e20b7cbceb8c32498e64d3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213721
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-09-22 19:52:10 +00:00
Sam Rawlins 1379c867a4 Check type parameters in const function tearoff
Fixes https://github.com/dart-lang/sdk/issues/47213

Change-Id: I6c1c7e386e64b877e1ea7d312335d924488f2306
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214134
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 19:36:04 +00:00
Stephen Adams f1e6092dd8 [dart2js] More shared_messages.dart cleanup
- Remove references to deleted file.
- Remove message that is unreachable in kernel.

Change-Id: I5fe772a3a6fbd00b31d085f10c47d63778a64217
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214071
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-22 19:20:54 +00:00
Konstantin Shcheglov 1c125b4868 Deprecate AstVisitor.visitTypeName(), add visitNamedType().
Change-Id: I736a568068c2acfdc7074bb16b11fd38b656a13a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214135
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 19:15:54 +00:00
Kevin Moore cb7c932f7b analyzer: use Object.hash functions, deprecate JenkinsSmiHash
Also bump min SDK for pkg:analyzer

Towards https://github.com/dart-lang/sdk/issues/27698

Change-Id: Ic32c839c02f18afd99fdb98eb382540aae7da88a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214126
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 19:11:24 +00:00
Konstantin Shcheglov 31922b8c57 Fix an invalid null check in InlineMethodRefactoring.
Saw it failing in the crash log.

Change-Id: I6cf715aeb6f41e405af58a00b69b8742fd7c5ed0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214182
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 17:53:10 +00:00
Mayank Patke d992af7e9c [dart2js] Preserve "signatures" when lowering late variables.
When we lower an uninitialized static field to a cell, we gives the cell
a mangled name and create a getter/setter pair with the original field
name. The getter/setter simply call the appropriate members on the cell.

This means that other libraries, even ones that haven't been transformed
(e.g. during modular compilation) will still interoperate correctly,
since the transformed library still has the same external signature.

Change-Id: I88edcb71fa5cb910869b4266628a029ad358b77e
Fixes: https://github.com/dart-lang/sdk/issues/45854
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214064
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-09-22 16:55:26 +00:00
Konstantin Shcheglov 31a04e775d Remove the path from the file read exception message.
Change-Id: Ic43ce2132344fd64bdff31fd1105796cb6204847
Bug: https://buganizer.corp.google.com/issues/200468974
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 16:53:07 +00:00
Konstantin Shcheglov dfd7d7b37a Deprecate NodeList<TypeName> getters and replace with NodeList<NamedType>.
Change-Id: I6a772a7bca75e9c2ab4b3612d51c04ea6114ed6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214130
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-22 16:25:56 +00:00
Johnni Winther 6c4b75237a [kernel] Rename isFieldFormal to isInitializingFormal
+ update ast-to-text, including previous renames of covariant

TEST=existing

Change-Id: Ia29847cba791096ccd9c6c383a1b633a6150cd94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214042
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <dmitryas@google.com>
2021-09-22 15:56:07 +00:00
Konstantin Shcheglov fdf5014697 Get the language version of BazelWorkspace from the dart/build_defs/bzl/language.bzl
Presubmit looks green.
https://fusion2.corp.google.com/presubmit/tap/398141496/OCL:398141496:BASE:398160873:1632289516597:2c6df414/targets

Change-Id: Ibe12b4d0709cd38be0307a6c211962dca7a69de6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214075
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-22 15:17:47 +00:00
Konstantin Shcheglov 34f1bddb88 Replace TypeName with NamedType in AstTestFactory.
Change-Id: I9920d1a3394c179a066f8a8ab339284e682175ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214129
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 15:01:59 +00:00