Commit graph

79368 commits

Author SHA1 Message Date
pq 513c1a1c7e Reland "linter 1.4.0"
This is a reland of 17644eea39

Additional supporting changes in flutter (and plugins):

https://github.com/flutter/flutter/pull/81017
https://github.com/flutter/plugins/pull/3823
https://github.com/flutter/flutter/pull/80817
https://github.com/flutter/flutter/pull/80901
https://github.com/flutter/flutter/pull/81210

Additional context in meta linter issue: https://github.com/dart-lang/linter/issues/2609





Original change's description:
> linter 1.4.0
>
> Mitigating PRs:
>
> https://dart-review.googlesource.com/c/sdk/+/196223
> https://dart-review.googlesource.com/c/sdk/+/196180
>
> https://github.com/flutter/flutter/pull/80817
> https://github.com/flutter/flutter/pull/80901
>
>
>
>
>
> Change-Id: Ib916d541076e24b9e8db1d6120dbc043d9e40b87
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196026
> Commit-Queue: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

Change-Id: Ie6b9682a2f54ef039dd7ac9c6a46cb925615acef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196581
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-27 23:53:52 +00:00
Alexander Markov a98500a139 [vm/aot] Discard Code objects of invisible functions
Previously, Code objects of invisible functions were retained
in order to omit frames corresponding to such functions from stack
traces when stack trace is printed.

This change drops Code objects of invisible functions. That also
means that frames corresponding to such functions are no longer
skipped in binary DWARF stack traces.

In order to account for that, DW_AT_artificial attribute is added to
generated DWARF debug information to mark invisible functions.
Stack trace decoding now looks at this attribute and skips those
frames when symbolizing stack trace.

Flutter gallery in release-sizeopt mode:
Heap size of snapshot objects -4.2% (arm), -4.4% (arm64).

A large application in --dwarf_stack_traces mode:
Number of discarded Code objects increased from 72.4% to 83.7%
(out of all Code objects).
Heap size of Code objects -37.4%.
Heap size of all snapshot objects -5%.

TEST=tests/standalone/dwarf_stack_trace_invisible_functions_test.dart
Issue: https://github.com/dart-lang/sdk/issues/44852
Change-Id: Ib804852aba1e083670f1d9b9d66cbaab7dcdcff9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196583
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-04-27 23:31:02 +00:00
Konstantin Shcheglov 3a0a196fed Revert "Issue 45672. Report constant errors when null value where non-nullable type is expected."
This reverts commit ac27053055.

Reason for revert: landed without necessary local changes

Original change's description:
> Issue 45672. Report constant errors when null value where non-nullable type is expected.
>
> Original: https://dart-review.googlesource.com/c/sdk/+/196042
> Reverted as: https://dart-review.googlesource.com/c/sdk/+/196281
>
> Presubmit looks green:
> https://test.corp.google.com/ui#id=OCL:369788056:BASE:369887187:1619108797262:daf61e5&include_skipped=true
>
> Bug: https://github.com/dart-lang/sdk/issues/45672
> Change-Id: I459b7ea3e1218d960583bf4b6ace5b2c40dc7f4a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196300
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: Ia624c5c90195fd2477b068e245a644a62795d35c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/45672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197108
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-27 21:42:21 +00:00
Nate Bosch 71fc33e427 Enable experiment generic_metadata
Change-Id: Iff050e6a2a1c0c2b8baca211a523f9dd77cfbd4a
TEST=Existing tests for the feature.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193748
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2021-04-27 20:16:08 +00:00
Danny Tuppeny 8f2c0e9bb8 [analyzer] Suppress insertion of completion parens/arg placeholders when they already exist
Fixes https://github.com/Dart-Code/Dart-Code/issues/3303.

Change-Id: I284608ba850b5ed2008b8cdd707bc1becc73872d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197045
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-27 18:28:10 +00:00
Danny Tuppeny 115a758d87 [analyzer] Include null postfix operator in display strings for code completion, signature help, etc
Change-Id: Iffeda6b3efa3d2bcd4c09a63ab8870b69bc155aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-27 18:27:48 +00:00
Brian Wilkerson d92ed4d72f Unify duplicate_field_formal_parameter and final_initialized_multiple_times
I started doing this the normal way, but the two codes appear to differ
only based on whether the field was final, and I don't think that factor
is important to the nature of the error, so I think a single code is
sufficient.

Change-Id: I693dcfb1a2a4b47a8b82fe4860e7a61c82ca062e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-27 17:32:18 +00:00
Ryan Macnak 605b211c89 Reapply "[build] Don't list Dart sources up front when creating application snapshots."
Fix `application_snapshot`'s depfile to track the sources of the application instead of the compiler. Split compiling the compiler into a separate GN target with its own depfile.

Bug: https://github.com/flutter/flutter/issues/81074
Change-Id: I0fb23ada40a6241ee3dde7f6cfebdd121b9a4224
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197020
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-04-27 17:22:54 +00:00
Brian Wilkerson 69b6cee683 Improve completion performace related to computing doc comments
Change-Id: Iee1a5d1ab98badd58e5cb722ec20bc8648734e68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-27 17:15:18 +00:00
Konstantin Shcheglov ac27053055 Issue 45672. Report constant errors when null value where non-nullable type is expected.
Original: https://dart-review.googlesource.com/c/sdk/+/196042
Reverted as: https://dart-review.googlesource.com/c/sdk/+/196281

Presubmit looks green:
https://test.corp.google.com/ui#id=OCL:369788056:BASE:369887187:1619108797262:daf61e5&include_skipped=true

Bug: https://github.com/dart-lang/sdk/issues/45672
Change-Id: I459b7ea3e1218d960583bf4b6ace5b2c40dc7f4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-27 17:14:48 +00:00
Michal Terepeta 92c4dbd4bc [analyzer] Improve the detection of file changes in bazel_watcher
Previously we used timestamps to detect if a file has been changed.
This works for files that rarely change. However, for a file that is
changed a lot, this doesn't really work reliably due to the low
resolution of timestamps. This is the case for `command.log` that we
use to detect Bazel builds: Bazel writes to it continuously so we
detect a lot of changes, but the last update to the file might end up
having the same timestamp, which means that we might miss the fact
that a build finished.

This commit changes the code to also use the length of the file when
trying to figure out if a file has been changed. A better check would
be to hash the contents, but I'm slightly afraid of the performance
impact for files like `command.log` that we watch, and which can be
both fairly large (multiple megabytes) and change a lot.  Even for
other files, if we have a large build that finished, we could have
1000s of file that we'd need to read and hash. So for now I went with
the size of the file instead. I could be convinced otherwise though ;)

Bug: http://b/184120864 and http://b/186200325

Change-Id: I1bf13adab5164c9ec04b59b275f2c83b96d08ea4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197043
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-04-27 17:00:48 +00:00
Brian Wilkerson 1b47a8fe92 Update the capitalization of a glossary entry
Change-Id: Iabedb96c5f6837236181706a59b381283f06823a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197101
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-27 16:55:38 +00:00
Joshua Litt cd1195580b [dart2js] Add flag to use integer load ids.
Change-Id: I85e0e404eeff6cbbaf5c69130526f20d61ca9404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196985
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-04-27 16:04:18 +00:00
Danny Tuppeny 8ae2eb94ff [analyzer] Support "Inline Local Variable" refactor in LSP
Fixes https://github.com/Dart-Code/Dart-Code/issues/545.

Change-Id: Ibee992ab1e5ff13b849d6e1151e21d9229087d73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197046
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-27 15:56:08 +00:00
Danny Tuppeny bb8b26596b [analyzer] Support folding enum declarations
Fixes https://github.com/Dart-Code/Dart-Code/issues/3225.

Change-Id: I90aae85c2aaaa034b8190c5bfe1ab66fe6fc0e74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197044
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-27 15:45:38 +00:00
Daco Harkes 0aaf26d265 [vm] Fix OSR entry missing phis in indirect joins
Closes: https://github.com/dart-lang/sdk/issues/45260

TEST=tests/language/vm/regress_45260_test.dart
TEST=Added assert + optcounter bot.

Change-Id: Ic55ecf14678047a006c20bd8be4dd20c39ec4272
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-ia32-try,vm-kernel-optcounter-threshold-linux-release-x64-try
Fixed: 45260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196320
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-04-27 13:12:48 +00:00
Dmitry Stefantsov cc621431f9 [cfe] Implement subtype relation for ExtensionType
Change-Id: I725c6abd4ad2ec7fe217e271fbe60d57af443f7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196933
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-04-27 13:03:38 +00:00
Alexander Thomas 6a7aaf5bc3 [build] Raise minimum mac SDK version to 10.13 to reduce build warnings
This removes warnings like these:
```
 ld: warning: object file (../../buildtools/mac-x64/clang/bin/../lib/libc++.a(memory.cpp.o)) was built for newer OSX version (10.13) than being linked (10.8)
```

These warnings seem to be harmless but may indicate that our builds are
no longer working below macOS 10.13. On developer machines, these
warnings don't seem to occur. We don't test on versions older than 10.13
so we can't guarantee that the Dart SDK works on those.

https://github.com/dart-lang/sdk/issues/40850

Change-Id: I1b146803605daa9e42d4283722efb39ecd66f0ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146803
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-04-27 10:37:30 +00:00
Johnni Winther 8f92864ca3 [kernel] Rename MapEntry to MapLiteralEntry
- to avoid collisions with MapEntry from dart:core

TEST=existing

Change-Id: I7b9592844345313e79ac18d18017c74de7c02106
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196930
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-04-27 10:36:38 +00:00
Aske Simon Christensen a2b951d5db [cfe] Mark issue 45700 regression test crashing.
This avoids analysis crash in VS Code when opening the SDK.

Change-Id: I44f13d9f1c871fe77a023008fc44e42bbfbbe7a3
Bug: https://github.com/dart-lang/sdk/issues/45700
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196670
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-04-27 10:00:28 +00:00
Alexander Thomas 0c9078756a [sdk] Update checked-in SDKs to 2.13.0-211.13.beta
Change-Id: I543cee3c7a70816526a0fa9ed1bcc7e7d127804c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197041
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-04-27 07:34:08 +00:00
Alexander Thomas 17a1c13fdf [co19] Roll co19 to 13f010c4047c4c7d52afe67ecc57ebc415ea4ea8
2021-04-22 sgrekhov@unipro.ru 993. Wrong annotation tests added
2021-04-22 sgrekhov@unipro.ru 993. Packed tests added
2021-04-21 irina.arkhipets@gmail.com Issue 1081: Missing Issue tags added to the tests.
2021-04-21 sgrekhov@unipro.ru Fixes 1004. Add tests that confirms that tight-looped isolate is not killed with Isolate.beforeNextEvent priority
2021-04-20 sgrekhov@unipro.ru Fixes 1078. Expect an error in case of cyclic initialization

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,analyzer-nnbd-mac-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I04d6af2bcf7fd436082f460d9b91c22f7a1f1255
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197040
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-04-27 07:29:00 +00:00
JustWe ac2cd2d73c [vm/ffi] Array dimensions non-positive check in CFE
Bug: https://github.com/dart-lang/sdk/issues/45540
Closes: https://github.com/dart-lang/sdk/pull/45785

TEST=tests/ffi/vmspecific_static_checks_test.dart

GitOrigin-RevId: e4c091a617acf36f60de7ddfc957a58323663813
Change-Id: I393e1dbbf34aa9f72e2e942c3a40c2f37c90e0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196246
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-27 06:56:28 +00:00
Chandru S 871374447f Expose loadId during deferred loading that will allow for advanced bundling optimizations.
Change-Id: Ic4e5edd8dc4761e49b4eb97892c75b869adfc2a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196980
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-04-27 01:40:48 +00:00
Ryan Macnak 1305295051 Revert "[build] Don't list Dart sources up front when creating application snapshots."
This reverts commit a23c31bf8d.

Reason for revert: The bootstrapping compilations are a bit confused about whose deps they're writing

Original change's description:
> [build] Don't list Dart sources up front when creating application snapshots.
>
> GN/Ninja will discover them via the depfile created alongside the snapshot.
>
> Bug: https://github.com/flutter/flutter/issues/81074
> Change-Id: I6e0f07214e8ea29e6d23261c71558da06fd2223a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196982
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,chinmaygarde@google.com

Change-Id: I267b6bac2676a18f57291c8472fab5c2aaa60284
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/flutter/flutter/issues/81074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197000
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-04-26 23:53:39 +00:00
Alexander Markov 869b007e9f [vm/service] Fix service/bad_reload_test
The test was incorrectly assuming the format of response for the
failed hot-reload and that expression evaluation can be performed
on top of the failed hot reload.

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

TEST=service/bad_reload_test
Change-Id: Iac9109371e2bc0b89e7c26ab008e0a174ecb754a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196984
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-04-26 23:31:27 +00:00
Ryan Macnak a23c31bf8d [build] Don't list Dart sources up front when creating application snapshots.
GN/Ninja will discover them via the depfile created alongside the snapshot.

Bug: https://github.com/flutter/flutter/issues/81074
Change-Id: I6e0f07214e8ea29e6d23261c71558da06fd2223a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196982
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-04-26 22:52:47 +00:00
Ryan Macnak 494e5b0380 [build] Remove expensive use of make_version.py for unused OBS_VER.
TEST=ci
Bug: https://github.com/flutter/flutter/issues/81074
Change-Id: I6e06e21d358fd4aafd37960803269796d2e62753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196983
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-04-26 22:51:08 +00:00
Tess Strickland 6b9210df84 [vm/compiler] Fix --resolve-dwarf-paths on Windows.
Fixes https://github.com/dart-lang/sdk/issues/45828

TEST=vm/dart{,_2}/use_resolve_dwarf_paths_flag_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-win-release-x64-try
Change-Id: I40c05a5b4dbb370af197a6c50f7e7dc54e29ee4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196932
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-04-26 22:44:28 +00:00
Ryan Macnak 11c2c4aacc [vm, compiler] Allow further folding of UnboxInt64(Constant) to UnboxedConstant.
TEST=ci
Change-Id: I3a55a007d4b8510faa33593698554f7e9bf982e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196225
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-04-26 20:23:07 +00:00
Alexander Markov db8d71d47e [vm/aot] Discard Code objects of entry points
Calls from C++ to Dart entry points are currently performed by
calling via Function::entry_point() in AOT mode
(with --use_bare_instructions). Such calls no longer use
Code objects, so Code objects can be discarded even if they
belong to a Function which is used as an entry point.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/44852
Change-Id: Iaf9dd67392780ef4344fc518865ffbe30648762e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196720
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-04-26 19:49:58 +00:00
Kallen Tu 8a0801572c [cfe] Instance method invocations for const functions.
Change-Id: I2e7d8b3859f09dd906e78e6e6d44722a0aabaeb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196140
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-04-26 18:11:47 +00:00
Leaf Petersen b101a7d002 Add language versions to _2 test libraries
Change-Id: Ib33169c3e0ffc870915c189404074a1dea472546
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196548
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2021-04-26 17:58:57 +00:00
Stephen Adams a2f48e931a [dart2js] Remove soft-deferred code
The soft-deferred experiment no longer generates working code and is
in the way of some work in progress.

Change-Id: I3f1043b5e289981ab9351247e7b02ee9671f565f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196551
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-04-26 17:57:17 +00:00
Danny Tuppeny 1e51549fab [analyzer] Don't show duplicate code completions for items imported via multiple libraries
Fixes https://github.com/Dart-Code/Dart-Code/issues/3227.

Change-Id: Iac5704fea4f00470040b6b94bbf508dd916ed234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196923
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-26 16:48:28 +00:00
Kallen Tu 931f7dc2e6 [cfe] List [] for const functions.
Change-Id: Ibbd9b828334609bca3d700bd5af7049b78b8a33a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196200
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-04-26 16:40:17 +00:00
Johnni Winther c2ac75a213 [cfe] Migrate first part of wave 7
Change-Id: Ie68bae61379bd489177e587282b833c49f8cf3b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196665
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-04-26 14:05:12 +00:00
Johnni Winther 30bbd2963b [cfe] Migrate wave 6
Change-Id: I4cdc5b6dd1261841217c823e2b8820b97fe9375a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196664
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-04-26 14:05:12 +00:00
Vyacheslav Egorov 9057d9812e [vm/compiler] Fold IntConverter(Constant(...))
This is important for keeping shifts compiling properly on some
platforms: because some shift variants only support constant shift
distances, so an interfering IntConverter inserted by the
representation selection pass causes compilation to fail.

This fixes Meteor benchmark, which is currently crashing the compiler.

TEST=runtime/tests/vm/dart{,_2}/regress_lsl_with_constant.dart

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try
Change-Id: Ie2f316cd917a8ebd8d3d96f394b39eac4d135d95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196662
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-04-26 14:04:12 +00:00
Johnni Winther f209a4aea8 [cfe] Handle duplicate declaration use in parts
Closes #45711

Change-Id: I77d98e2c02bda001ee9a0bf8446f2987e4266ec3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196280
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-04-26 13:57:07 +00:00
Johnni Winther e90063b57b [cfe] Update tests to prepare enabling generic-metadata flag by default
Change-Id: I209e9e03291cfdf282254b4fa2a4a47c6bb36811
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196921
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-04-26 13:56:07 +00:00
Tess Strickland 6730b12edc [vm] Add --resolve-dwarf-paths (disabled by default).
When --resolve-dwarf-paths is enabled, then paths output to DWARF
information will be resolved to either an absolute or relative path.
If this cannot be done, snapshot creation fails.

File URIs are output as absolute paths.

SDK URIs are output as paths relative to the SDK root.

TEST=vm/dart{,_2}/use_resolve_dwarf_paths_flag_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: I63c694f0f707ef6a3d3faa690e001fefe2b26094
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196491
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-04-26 11:44:47 +00:00
Tess Strickland ca224adba0 [vm] Make --code-comments a VM global flag.
This way, it is appropriately enabled if possible during snapshot
loading if the snapshot was compiled with --code-comments, instead of
forcing the user to remember to run the snapshot loader with
--code-comments to avoid a runtime failure.

TEST=vm/dart{,_2}/use_code_comments_flag_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: Ib3de04ecbd95ee4069c3d31ef3e4dc4b2a3ac94c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196668
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-04-26 11:44:38 +00:00
Vyacheslav Egorov 9a266c7fde [vm/arm] Fix vmovd Dd[x], ... simulation
This instruction operations on the lo/hi parts of D register and not
on S registers - which means we should not be using D->(S, S) projection
helpers because not all D registers have corresponding even/odd S
registers.

vmovd D20[0], ...  is a valid ARM instruction, but viewing it as
vmovd S40, ... is incorrect (because there is no such thing as S40).

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

TEST=lib_2/typed_data/float32x4_test on dartkp-linux-debug-simarm-crossword


Change-Id: Ia2fc827e1e629cdf5f2b66502681a080274fd73c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196660
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-04-26 11:08:07 +00:00
Alexander Markov 47eff41aa0 [vm/aot/tfa] Handle classes which implement Future along with another generic type in a cast to FutureOr
When handling a type check to FutureOr in TFA, there is a case
when a ConcreteType is a subtype of Future. In such case, it was
assumed that ConcreteType has only 1 type argument.
This is not true if class extends/implements/mixes-in Future along
with another generic class.

This change adds the logic to query offset of Future type arguments in
the type arguments of a class and also check if the type argument is
known.

TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter81068.dart
Fixes https://github.com/flutter/flutter/issues/81068

Change-Id: I970e649823bafec433fc21a286498acc0126b331
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196546
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-04-26 10:28:47 +00:00
JustWe 417e3ef225 [analyzer/ffi] Array dimensions non-positive check
Bug: https://github.com/dart-lang/sdk/issues/45540
Closes: https://github.com/dart-lang/sdk/pull/45784

GitOrigin-RevId: 09a3c9651488938597142f5a22b42e56ec965394
Change-Id: I1ea38a45aca836060de35e90b47a25f0d6b9947e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196245
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-26 09:17:47 +00:00
Ivan Inozemtsev a5ff656da1 Revert "[vm] Switch datastream Write/WriteUnsigned to (S)LEB128."
This reverts commit 80102c981b.

Reason for revert: b/186359854

Original change's description:
> [vm] Switch datastream Write/WriteUnsigned to (S)LEB128.
>
> This reduces the number of variable-length integer encodings in our
> database from 2 to 1, and chooses the more standard one.
>
> TEST=Existing tests, in particular any that involve snapshots.
>
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-simarm64c-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try
> Change-Id: Ia700158ac873ad32ac28c1027a669895961bc715
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196321
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

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

Change-Id: Idf32bdd879cf8bb7407f6dae764312140ad6eeb2
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-simarm64c-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196920
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2021-04-26 07:52:47 +00:00
Konstantin Shcheglov 50de84a3fb Issue 45467. A setter in lexical scope shadows inherited getter.
Bug: https://github.com/dart-lang/sdk/issues/45467
Change-Id: I1c7c67fcc61f9cc2661ba4a2d73da9634a285d41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-26 00:24:56 +00:00
Brian Wilkerson aaf35b839a Unify some error codes for documentation purposes
Change-Id: I3a0f66f29a446d677b459dc92f5bdded9f480719
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196801
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-25 14:59:36 +00:00
Konstantin Shcheglov 7b9cfb4837 Restore caching of converter in InputConverter.
Change-Id: Ie801d8b7b29f40cd624690d31de1f883cd08260e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-24 20:20:15 +00:00