Commit graph

78506 commits

Author SHA1 Message Date
Jonas Termansen 88c24ef66a Roll benchmarks-internal 354c978979c5..076df10d9b77
076df10d9b77af337f2d8029725787155eb1cd52 https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/2420

R=whesse@google.com

Change-Id: If5f6df4d2e539aa28b77cad972e710297542bafe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191363
Auto-Submit: Jonas Termansen <sortie@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-03-16 10:27:18 +00:00
Lasse R.H. Nielsen b250a58d8e Implement int.>>> for DDC.
BUG= https://github.com/dart-lang/sdk/issues/44915

Change-Id: Ia63d1653729ff458f9ebb2a2e33883a00a66378f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191220
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-03-16 09:37:15 +00:00
Jens Johansen 7e2cc73da8 Revert "[infra] Make worktrees work (again?)"
This reverts commit a531b78369.

Reason for revert: Doesn't work on Windows.

Original change's description:
> [infra] Make worktrees work (again?)
>
> History:
>
> * Back in (pre June) 2018 worktrees in git just worked.
> * https://dart-review.googlesource.com/c/sdk/+/48091 made it not work.
> * https://github.com/dart-lang/sdk/issues/33619 was filed.
> * https://dart-review.googlesource.com/c/sdk/+/127485 was created to
>   work around the problem.
>
> I don't know when it happened, but I can't make the above workaround
> work (at least not anymore) --- adding a `default_git_folder` to my
> `args.gn` has no effect.
>
> This CL builds on it and automatically sets the correct path based on
> a call to `git rev-parse --resolve-git-dir .git` which gives the
> correct dir for both worktrees and non-worktrees.
>
> Change-Id: I4dcf0445a44348621752fb88d4dab4c99c6ddd1d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190522
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: William Hesse <whesse@google.com>
> Commit-Queue: Jens Johansen <jensj@google.com>

TBR=whesse@google.com,rmacnak@google.com,jensj@google.com,sigmund@google.com

Change-Id: I7681a7b48abdd6e5901f1e445015adc9bf51ef77
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191361
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-16 09:18:50 +00:00
Jens Johansen a531b78369 [infra] Make worktrees work (again?)
History:

* Back in (pre June) 2018 worktrees in git just worked.
* https://dart-review.googlesource.com/c/sdk/+/48091 made it not work.
* https://github.com/dart-lang/sdk/issues/33619 was filed.
* https://dart-review.googlesource.com/c/sdk/+/127485 was created to
  work around the problem.

I don't know when it happened, but I can't make the above workaround
work (at least not anymore) --- adding a `default_git_folder` to my
`args.gn` has no effect.

This CL builds on it and automatically sets the correct path based on
a call to `git rev-parse --resolve-git-dir .git` which gives the
correct dir for both worktrees and non-worktrees.

Change-Id: I4dcf0445a44348621752fb88d4dab4c99c6ddd1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190522
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-16 08:54:15 +00:00
Alexander Markov e8f57b6605 [vm/aot] Handle FieldInitializer pointing to a Field's Reference which is reused for a getter
This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/186680.
After that change, tree shaker started reusing Reference to a Field
when it is replaced with a getter. As a side-effect, this makes
FieldInitializer.field to crash as Reference is now pointing to Procedure,
not a Field.

The fix is to carefully use 'node.fieldReference.asMember' instead of
'node.field' and then retrieve original Field node if it was replaced
with a getter.

TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_45324_2.dart
Fixes https://github.com/dart-lang/sdk/issues/45324

Change-Id: Ic34e8b9933b00997cd350a4ad93f798c86ac60ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191323
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-16 05:43:34 +00:00
Sam Rawlins 1cb203d8c9 Remove unused code and files from analysis_server:
* ManifestFixKind, PubspecFixKind, ImportElementInfo class
* WithNullSafetyMixin mixin
* suggestionComparator function

Change-Id: I9e332be6345b2f2b7b788bc4ae63a075a21cbe06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190821
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-16 05:08:24 +00:00
Alexander Aprelev 3162957a78 [gardening] Add explicit type to ensure templated function applies.
Follow-up to d42de4ed06

TEST=build engine ios_debug_arm target

Change-Id: I7f86f74467c7e7ed05feddfce921b46f05586e68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191326
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-03-16 04:34:44 +00:00
Ryan Macnak 829ef92778 [vm] Expand compressed heap to 4GB.
We originally sized the compressed heap at 2GB to avoid implementing alignment offsets. (When decompression is sign-extension + base, base should be the middle of a 4GB-aligned region.) After 8db0a975c1, the needed alignment offset is zero, and we no longer need to avoid the high bit being set.

TEST=ci
Change-Id: Ib6e6c40bcb9638e01867edd527b3acaaccec570b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191321
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2021-03-16 01:27:24 +00:00
Ryan Macnak 2472db0031 [vm] Inform the OS that it can reclaim free'd portions of the compressed heap.
TEST=ci
Change-Id: I26c5963d5d3596f95d3089b1dadc482bd2182543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191301
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2021-03-16 00:12:54 +00:00
Anna Gringauze e2baf16ebd Support ddc module format in expression compilation in ddc.
Closes: https://github.com/dart-lang/sdk/issues/45303
Change-Id: I2b1eb9d149c03c138150d126c108ad86af8584c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191023
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2021-03-15 23:58:44 +00:00
Alexander Aprelev 8e7c8c9d8b Roll icu dependency to 81d656878ec611cb0b42d52c82e9dae93920d9ba.
Last roll was from 6/18/2020.
Allows to enable "implicit-int-float-conversion" warning in the dart codebase.

Change-Id: Ida1a3a477e5bc45993dc10e0c3db410265a005ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191300
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-03-15 23:50:04 +00:00
Konstantin Shcheglov 6b575c72ec Prepare to publish analyzer 1.2.0 and _fe_analyzer_shared 18.0.0.
Change-Id: If31ece2507cfb012d5742aa147df2ca781b4f712
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191303
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-03-15 22:58:54 +00:00
Konstantin Shcheglov c0b800ceb5 Issue 45318. Check for dynamic bounded and Function bounded.
Bug: https://github.com/dart-lang/sdk/issues/45318
Change-Id: I5abd2d237cc3a56551471c2a2fc7a9965eb4223c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-15 22:50:14 +00:00
Alexander Markov daae24b488 [vm/aot] Retain fields used in constants
Evaluated constant instances in kernel are represented as a list of
field->value pairs. Tree shaker should not remove fields used in
constants as it may potentially affect identity of constant instances
(non-identical constants may become identical).
Previously, fields used in constants were only marked as written,
so they could still be removed as write-only fields.
Furthermore, if such field was also used as an interface target
it could be converted to an abstract getter, causing the conflict
during kernel AST serialization.

This fix marks fields used in constants as also read, effectively
preventing their tree shaking.

Flutter gallery AOT snapshot size is not affected.

TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_45324.dart
Fixes https://github.com/dart-lang/sdk/issues/45324

Change-Id: Id6d35604757ad6ba1e23f7227aa9b769448c2688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191280
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-03-15 21:50:11 +00:00
Konstantin Shcheglov 369c36e67c Issue 45299. Fix yield type check for function expressions.
Bug: https://github.com/dart-lang/sdk/issues/45299
Change-Id: I0f9477a632b635d7e1ac8d4c51f51254e5058cff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191183
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-15 21:26:44 +00:00
Ryan Macnak c9e10c931c [vm, compiler] Predicate boolean loads.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/29908
Change-Id: I5a5c57a8a79dbe4f2ee5303a4b9436bd36e8d7be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189921
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-03-15 20:53:04 +00:00
Danny Tuppeny cf3dcc4256 [analyzer] Prevent MOVE_FILE using absolute URIs when moving files out of lib
Fixes part of https://github.com/dart-lang/sdk/issues/41889, maybe part of https://github.com/dart-lang/sdk/issues/43602.

Change-Id: Ic7a1e81a280e9786e26f0075ea079e0136e934b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191142
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-15 18:42:44 +00:00
Kallen Tu c906133967 [cfe] Multi-call const function tests to existing behavior.
Change-Id: Id03250e5eeb38d9c69b629c239e573a1d838820f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190980
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-15 18:09:13 +00:00
Alexander Markov 16beb34813 [vm/aot] Remove special cases of dynamic function lookups from precompiler
Flutter gallery AOT snapshot size
release: no change;
release-sizeopt: arm -0.24%, arm64 -0.25%.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/44852
Change-Id: I847bfc311552bb4e80222e0040b50b4766a18dbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190783
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-03-15 17:53:23 +00:00
Brian Wilkerson 55522f9e90 Fix a bug in completion when a setter does not have a corresponding getter
Fixes: https://github.com/dart-lang/sdk/issues/45300
Change-Id: I0a5043b5d395abb426615e8c434f23c20062e182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-15 17:34:53 +00:00
Vyacheslav Egorov d42de4ed06 [vm] Crash on impossible GDT null errors
This CL adds code to detect situations when we hit
null error through GDT call with non-null receiver.

We achieve this by making receiver's cid part of the
GDT calling convention and checking this cid
in runtime entry responsible for throwing the null
error.

This CL is an attempt to narrow down b/179632636
and collapse various impossible crash reports
into a single native crash cluster by crashing VM
instead of throwing a null error.

TEST=tested manually

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try
Change-Id: If2ed4646c4c0f403016266e4e83e296a7b234cb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191141
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-03-15 15:35:10 +00:00
Vyacheslav Egorov 69ec09825a [vm] On Android set abort message before aborting
Android L and newer (API level 21) provides a way to
specify abort message which will be included into
crash report created by debuggerd.

Make sure our DynamicAssertionHelper uses this functionality
if available.

TEST=tested manually

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm64-try,vm-kernel-mac-release-x64-try
Change-Id: If25cd168d43677e0a0fe9b63e21a017415686ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191140
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-03-15 15:35:10 +00:00
Dmitry Stefantsov d6b79dab6c [cfe] Correct argument count in extension member errors
Closes #45204.

Bug: https://github.com/dart-lang/sdk/issues/45204
Change-Id: I5295704a8d470e639fe346dbbbf80ad28ff614a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190520
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-15 10:46:00 +00:00
Jens Johansen b5da327ed9 [parser] Parse and skip metadata according to spec
Make the parser handle metadata properly according to the spec.

There has been some confusion in regards to metadata because
https://github.com/dart-lang/language/blob/master/accepted/future-releases/small-features-21Q1/feature-specification.md
(used to) say we needed a spec update.

That was done in the parser in
https://dart-review.googlesource.com/c/sdk/+/182668
but really that made the parser adhere to the spec as it was which is
also correct (as the spec change wasn't needed at all).

The parser also needs to be able to skip metadata, though, and that
wasn't done it that CL which caused the issues in
https://github.com/dart-lang/sdk/issues/45120

The work directly in this CL is:
* Add lots of comments to parseMetadata to make them more up-to-date with
  the spec.
* Fix skipMetadata to correspond to parseMetadata.
* Tests verifying that 45120 is fixed in the parser and that metadata in
  general works as expected in the parser.

(In working on this, the future specification was corrected to say that the
spec did not need updating. Thanks to Erik for the quick turn-around
there).

Bug: #45120
Change-Id: Id1e4912cac7e5d9113efe083b3ecd06e6834a16e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190880
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-15 08:40:40 +00:00
Tess Strickland dc62c9c3c2 [vm/compiler] Write retained reasons JSON to a file.
Instead of being part of the --trace-precompiler output, there is
is a new flag --write-retained-reasons-to=<path>.

To allow for non-functions to have reasons for retention, the
JSON objects in the array now have one additional field:

* type: a string, the C++ type of the Dart object.

This CL also wraps all the machinery in a RetainedReasonsWriter
class instead of putting it in the Precompiler interface.

TEST=vm/dart{,2}/use_trace_precompiler_flag

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: Ifa40ac64fdcbdad5114499425c7f8b08e327fa76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190525
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-03-15 08:37:40 +00:00
Alexander Markov 11d6203130 [vm/aot] Fix retaining of exception types and auxiliary functions
There are two fixes:

1) If a function was compiled but not retained, precompiler
should still trace through types used in exception handlers.

2) Certain auxiliary functions such as implicit closure functions
and field initializers were added to 'possibly_retained_functions_'
set but were not traced through AddTypesOf and were not added to
'functions_to_retain_' set.

Flutter gallery AOT snapshot size
release - no changes
release-sizeopt arm +0.13%, arm64 +0.14%

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/45179
Issue https://github.com/dart-lang/sdk/issues/44852

Change-Id: Ide9a7e82a7bb9098dc90bc41a76e527e7a5cb603
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190781
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-03-13 00:30:38 +00:00
Kallen Tu a7e5965495 [cfe] If statements for const functions.
Change-Id: If4449eb6613c7a2b53119ed2e8d3f3042624ccd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190800
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-12 21:09:08 +00:00
Dmitry Stefantsov 8ddc7465a8 [cfe] Move ExtensionType into pkg/kernel/lib/ast.dart
Change-Id: I2e8231dad00accafb09d1ec88416242d3d5815a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190483
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-12 19:02:27 +00:00
Anna Gringauze cf7e990233 Add default value for module format in ExpressionCompilerWorker
Current version of dwds does not supply module format to the
expression compiler worker, resulting in initialization failures.
Add default 'amd' format so dwds continues to work with new SDK
version before a matching update that passes format to dwds
lands.

Change-Id: I10e8ddc09b48b91c9c085a6d7579ad01c6e13399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190820
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2021-03-12 18:37:07 +00:00
Ben Konyi 4fde29d1aa [ CLI ] Poll for VM service URI before launching DDS
Service.getInfo().serverUri can be null if the VM service server hasn't
finished starting up. The CLI isolate should wait for this URI to not be
null before attempting to start DDS.

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

Fixed: 44787
Change-Id: Iadce0901351c0bc5238a4dc805483cce818e9e15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190361
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2021-03-12 18:34:08 +00:00
Konstantin Shcheglov 60ea845795 Issue 190731. Support for aliasElement/aliasArguments in TypeParameterType.
Bug: https://github.com/dart-lang/sdk/issues/45291
Change-Id: Ia0378722f0e7c48e7a3042c0ef14d6833c7bf2b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190734
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-12 18:22:47 +00:00
Nate Bosch f54a76f9af Update to the latest package:test
Change-Id: Ia23a5ce61fff38d3d5066b26b7ce1cedbf99619e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190733
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Gary Roumanis <grouma@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-03-12 18:14:37 +00:00
Konstantin Shcheglov 45e3d3c77f Issue 45291. Support aliasElement/aliasArguments for interface types.
Bug: https://github.com/dart-lang/sdk/issues/45291
Change-Id: I97bab24f4d7cf3232a0260ec3c6abec6a4c310be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190731
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-12 17:06:17 +00:00
Konstantin Shcheglov 00a45e425a Remove build mode from analyzer_cli.
Change-Id: I2236c728741837588394f896b37f181fc907d335
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190726
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-12 17:05:37 +00:00
Sam Rawlins e1414089cf Analyzer: avoid dynamic calls while examining Yaml
Change-Id: If569c74bad1d3762deb4cc74ea617d291ec33619
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190727
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-12 16:50:37 +00:00
Kallen Tu ef01825d44 [cfe] Const function tests removed SharedOptions.
Change-Id: I51ceedf4b140f6aef2af407058c5e7c23860c850
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190801
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-12 16:20:17 +00:00
Jens Johansen 31acdc9d92 [parser] Recovery of of new/const/Map/Set/List with said literals
E.g. recover `Map<int, int>{}` by ignoring the map (i.e. it's
just a literal map), recover `new {}` as just `{}` etc.

Fixes #45251.

Change-Id: I44e67ca6d3b9b068014b8e28822a61063c794d57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190022
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-12 10:41:06 +00:00
Konstantin Shcheglov dd706e1c0c Issue 45263. Fix resolveToBound() to resolve the promoted bound as well.
Bug: https://github.com/dart-lang/sdk/issues/45263
Change-Id: I285e675bdec931b1987ac97045e6f97e55ad3fd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190730
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-03-12 07:23:49 +00:00
Mayank Patke 3c5767ccd3 [dart2js] Ensure RTI need/checks account for instantiations.
If a type variable T is used in an `is` or `as` expression (e.g.
`42 is T` or `42 as T`) or is part of a subtype check, then any types
which may be substituted for T via instantiation must also be treated as
participating in a type check.

This CL ensures that the RTI need computation includes type arguments
for those substituted types and that those types are included in the
list of implicit checks.

Additionally, in order for this to work, this CL fixes a bug in which
the impact transformer was failing to register generic instantiations
occurring in (partial) constants.

Fixes: https://github.com/dart-lang/sdk/issues/45046
Change-Id: I98ae0eca0adcbbb26cdd664318da0da578b289b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190460
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-03-12 04:47:59 +00:00
Mayank Patke 97771fb2f2 [dart2js] Add failing tests for issue #45046.
Bug: https://github.com/dart-lang/sdk/issues/45046
Change-Id: I6b0010b78c1781c9c264b9a479dc2136ded3105c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185495
Reviewed-by: Stephen Adams <sra@google.com>
2021-03-12 04:47:59 +00:00
Brian Wilkerson 2f3c274632 Clean up some code in analysis_server
Change-Id: Icaa4cc19d1966e3dbc70f82745e4fd771a18ed16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190728
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-12 04:45:39 +00:00
Anna Gringauze f13285482d Fix expression evaluation failure after hot restart
The lifetime of program compilers in JavaScriptBundler is too short,
moving the program compiler cache to FrontendCompiler instead
so the ProgramCompilers created during main compilation could be reused
for expression evaluation until the next compilation.

Closes: https://github.com/dart-lang/sdk/issues/45266
Change-Id: I7d41476c7064f16cab2783f88c49114a08a0c038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190301
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2021-03-11 23:16:41 +00:00
Kallen Tu 494aaaab39 [cfe] Variable assignments (VariableSet) for const functions.
Change-Id: Iab23493fc09b8fdad78968d905ac8f28e1236aa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190620
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-03-11 23:14:41 +00:00
Vyacheslav Egorov 4e027fae97 [vm/compiler] Force unboxing of int phis on 64-bit platforms
More specifically on 64-bit platforms, when other heuristic fail:

- in AOT mode unbox all int typed phis.
- in JIT mode unbox all non-Smi int typed phis i.e. mixed
  Mint/Smi phis.

This brings treatment of int phis closer to how we treat other
boxed phis.

This considerably improves AOT code quality for loops which
our current conservative heuristic does not currently hit,
for example:

  void foo(int start, int end) {
    for (var i = start; i < end; i++) {
    }
  }

Code like this would use a boxed Phi previously which does not make
sense.

In JIT mode to really benefit from aggressive unboxing we
might need to shift from over-reliance on Smi operations, e.g.
when phi is unboxed we want to cascade that through and unbox
operations which are performed on it transitively. This requires
much more sophisticated algorithm and is outside of scope for this
change.

In AOT we in general treat all arithmetic operations as operations
over 64-bit int values so unboxing phis makes more sense.

As a result of this change we see small improvement in code size:

  flutter_gallery_app_so_gzip_size -0.2392%

TEST=ci


Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try
Change-Id: Iae9a16f353e53f649da4e665d2812ad47099a674
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187860
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-03-11 22:20:51 +00:00
Sam Rawlins fa0f4680df analyzer: Remove nullable types from _DisoverAvailableFilesTask:
* remove `isCompleted` field which duplicates `completer.isCompleted`
* make `completer` non-nullable
* make `files` non-nullable
* move `folderIterator` from class as field to `perform()` as local

Change-Id: Ic67dbf8d4e6487152ae1ca6752c45f5c59c70862
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190725
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-11 21:48:31 +00:00
Keerti Parthasarathy 98d6994a35 Remove keertip@ from watchlists for build changes
Change-Id: I07fe96c5b65615b5c193d78df8ac551d547e9bc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190780
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2021-03-11 21:45:41 +00:00
Sam Rawlins 5aca96546b vm_service: Remove unnecessary '?' from dynamic types
Also update the generator:

* Remove same unnecessary '?'
* Update MemberType.name, TypeRef.ref to be non-nullable

Bug: https://github.com/dart-lang/sdk/issues/45165
Change-Id: I438e9ce1e02faac9417a7d2d4ace143f2cf6feb3
TEST=Just the regular trybots.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190722
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-11 20:14:41 +00:00
Konstantin Shcheglov 54b2948461 Replace TypeAnnotation.type with null check with 'typeOrThrow'.
Change-Id: I16922aef63d294448436c93004386ee8a3439e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190724
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-11 19:41:10 +00:00
Ryan Macnak 8db0a975c1 [vm] Allow garbage in the upper-half of compressed Smis.
Allows removing a branch when decompressing pointers and removing fixup sign-extension after Smi ops that use 32-bit ops to detect overflow. Increases the code size of indexed and stores for some widths due to addressing mode limitations.

TEST=ci
Change-Id: Ia48353cccbbc586dd0d2e055a843c65e37c63a30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185660
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2021-03-11 19:39:01 +00:00
Sam Rawlins d44d590ceb analyzer: Remove unused WorkToWaitAfterComputingResult
Change-Id: I7f3925c19e6375e93fdc67ed394ec1ad472ffd98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190680
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-11 19:30:11 +00:00