Commit Graph

78705 Commits

Author SHA1 Message Date
Danny Tuppeny 387e9d9ab2 [analyzer] Include ConditionalExpressions in Flutter Outlines
Fixes https://github.com/Dart-Code/Dart-Code/issues/3196.

Change-Id: I369e48285329c808a092ff677440e159aa7a103b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192688
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-24 15:01:21 +00:00
Martin Kustermann f41277178c Revert "[vm/compiler] Always allow CSE of LoadStaticField & loosen assertion in AllowsCSE"
This reverts commit ff1c9c9916.

Reason for revert: Most likely cause of failures in AOT, e.g.

    python tools/test.py -n dartkp-strong-linux-release-x64 co19/LanguageFeatures/nnbd/late_A06_t05

Original change's description:
> [vm/compiler] Always allow CSE of LoadStaticField & loosen assertion in AllowsCSE
>
> Loosening of assertion:
>
> There is no guarantee that a static-final field has been initialized by
> the time a function is compiled (in optimized mode) that uses such a
> field.
>
> We should therefore loosen the ASSERT to not require the field to be
> initialized and rather allows CSE
>
> Enabling of CSE:
>
> In the past we had separate InitStaticField and LoadStaticField. The
> load itself had no side-effects and could therefore be moved
> arbitrarily. Though we couldn't allow it to be moved before it's
> InitStaticField. This dependency was not explicitly made and we
> therefore disabled CSE / LICM if the actual field was not initialized
> (or field may be reset) - see [0].
>
> Though after merging of InitStaticField and LoadStaticField in [1] there
> is no longer a need for tracking any dependencies: The side-effects
> of InitStaticField are now reported by LoadStaticField.
> => We can therefore always allow CSE of LoadStaticFieldinstr and
> any code motion would respect side-effects of the instruction.
>
> [0] https://codereview.chromium.org/1497783002
> [1] https://dart-review.googlesource.com/c/sdk/+/148283
>
> TEST=Fixes flaky test.
>
> Closes https://github.com/dart-lang/sdk/issues/45133
>
> Change-Id: I547702586d980f5d02fde0e8d12b057ca4d8c363
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192740
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

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

Change-Id: I921c6e8929bbc9f58392d6be6db599dddb8e4b4c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192922
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-03-24 14:45:13 +00:00
Jens Johansen 8270944c5d [CFE] Extend weekly test - fuzz tests and advanced invalidation leak test
We currently run our leak tests weekly.
This extends it so we also run leak tests with advanced invalidation,
as well as our strong and weak tests with fuzzing enabled.

Change-Id: I2c941f58594791d1981c6b6612db2205b68f5e19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192682
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-24 14:44:51 +00:00
Paul Berry 58dc586929 Remove redundant line number from referencedBeforeDeclaration.
Context messages are already displayed in a way that makes it easy for
the user to locate the line of code in question; it's unnecessary to
include the line number in the context message itself.

See discussion at
https://buganizer.corp.google.com/issues/179782591#comment9.

Change-Id: I2d1383c4cee0ece0d302449302d1f1902fbf136c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-24 14:07:51 +00:00
Jens Johansen 9d5f3187ad [CFE] Crash reproductions
Change-Id: Iddf58c3af16fd56aa7cc9bd1a988ec45a4a042a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175243
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-24 13:45:31 +00:00
Sam Rawlins 97cd131c9a analyzer: Introduce cannot-ignore analysis option.
Fixes https://github.com/dart-lang/sdk/issues/45404, which describes the option
in detail.

This removes all unfortunate exceptions for dart2js test code and for flutter
code. This removes the lateness of one final field.

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

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

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

Related to https://github.com/flutter/flutter/issues/52899

Change-Id: I054f487fafe2742ae57da1d2ccd2d52dce4188bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192560
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-24 13:32:49 +00:00
Sam Rawlins 3efcdb3ff0 front_end: Remove unnecessary import
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I631483a90d89268c0ffd75ee2e1c27ba19f084cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192609
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-24 13:30:49 +00:00
Martin Kustermann 6127386cfa [vm/compiler] Ensure allocate instructions have correctly pruned lazy deopt environment
Since allocation instructions can throw OOM exceptions, they require
deopt information. In general it's rather hard to test that this deopt
information is correct.

In order to test this, this CL makes those IR instructions support lazy
deopt and add tests that exercise this deopt sequence, thereby ensuring
the deoptimization environment is correct.

Issue https://github.com/dart-lang/sdk/issues/45213

TEST=New vm/dart_2/isolates/deopt/*_test.

Change-Id: I6a02dcf5a0c47636f1f0aa4cd8cc0d2b4f032ca0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192687
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-03-24 12:48:29 +00:00
Paul Berry da29d5af66 Share checkForFieldInitializerNotAssignable betwen resolver and ErrorVerifier.
In order to implement "why not promoted" functionality for constructor
field initializers, we will need to call
checkForFieldInitializerNotAssignable from the resolver, so that we can pass it
failed promotion information.  So move it into the
ErrorDetectionHelpers mixin.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I95094e198a97608bf27f84cfb3cac40824a30ba4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192723
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-24 12:10:09 +00:00
Paul Berry ca8663492d Share checkForInvalidAssignment betwen resolver and ErrorVerifier.
In order to implement "why not promoted" functionality for variable
declaration initializers, we will need to call
checkForInvalidAssignment from the resolver, so that we can pass it
failed promotion information.  So move it into the
ErrorDetectionHelpers mixin, along with _checkForAssignableExpression
(which it calls).

_checkForAssignableExpressionAtType can now be private, since all of
its callers are now in ErrorDetectionHelpers.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I6655e3a655d330d61459692804854c89c0dcff70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192612
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-24 12:10:09 +00:00
Paul Berry 20d9c6eb3a Flow analysis: implement "why not promoted" logic for boolean conditions
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: Ia8f3a5ad2971dfb6baeefb0d2f9c6998af0d897e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192611
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-24 12:10:09 +00:00
Paul Berry eb37227666 Flow analysis: implement "why not promoted" logic for logical binary operators.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: If03750edf6bdf13fc2677e0c09f49f70d0da744e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192608
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-24 12:10:09 +00:00
Paul Berry 6c665c4607 Flow analysis: implement "why not promoted" logic for most binary operators.
`&&` and `||` will be addressed in a follow-up CL go through a
different code path in the analyzer.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I20732ceceb113017a0b1e77134b1e28c4c924fbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192607
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-24 12:10:09 +00:00
Martin Kustermann 6a585a2089 [vm/compiler] Assign deopt id to all allocation instructions
An allocation can - in the slow path - go to runtime which can cause a
pre-allocated OutOfMemory exception to be thrown. It therefore requires
correct deopt information.

Issue https://github.com/dart-lang/sdk/issues/45213

TEST=Existing test suite. A follow-up CL will add actual deoptimization tests for those instructions.

Change-Id: Iaf44904b82ec021919352483f58e9e8fed473955
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192685
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-03-24 11:55:44 +00:00
Martin Kustermann bdb77e4f3d [vm/compiler] Mark all allocation IR instructions as potentially throwing
Allocation instructions can end up going to runtime - and in rare cases
- throw a pre-allocated OutOfMemory exception. We have to mark
allocation IR instructions therefore as potentially throwing.

We make this CL separately from follow-up related changes, to see
possible effects on benchmarks.

Issue https://github.com/dart-lang/sdk/issues/45213

TEST=Existing tests. Will add validation of correct deopt environment in future CL.

Change-Id: Ic3ed5c277c222f8432f5f72da18d32182e566dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192683
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-03-24 11:48:49 +00:00
Martin Kustermann ff1c9c9916 [vm/compiler] Always allow CSE of LoadStaticField & loosen assertion in AllowsCSE
Loosening of assertion:

There is no guarantee that a static-final field has been initialized by
the time a function is compiled (in optimized mode) that uses such a
field.

We should therefore loosen the ASSERT to not require the field to be
initialized and rather allows CSE

Enabling of CSE:

In the past we had separate InitStaticField and LoadStaticField. The
load itself had no side-effects and could therefore be moved
arbitrarily. Though we couldn't allow it to be moved before it's
InitStaticField. This dependency was not explicitly made and we
therefore disabled CSE / LICM if the actual field was not initialized
(or field may be reset) - see [0].

Though after merging of InitStaticField and LoadStaticField in [1] there
is no longer a need for tracking any dependencies: The side-effects
of InitStaticField are now reported by LoadStaticField.
=> We can therefore always allow CSE of LoadStaticFieldinstr and
any code motion would respect side-effects of the instruction.

[0] https://codereview.chromium.org/1497783002
[1] https://dart-review.googlesource.com/c/sdk/+/148283

TEST=Fixes flaky test.

Closes https://github.com/dart-lang/sdk/issues/45133

Change-Id: I547702586d980f5d02fde0e8d12b057ca4d8c363
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192740
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-03-24 11:47:39 +00:00
Sergey G. Grekhov dac02ba37a [co19] skip test that uses dart:mirrors on precompiled and web platforms
Change-Id: I69466760bb870fc94415311d92359d669c07f097
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192744
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-03-24 11:25:19 +00:00
Alexander Thomas 424c554b73 Revert "Bump pub"
This reverts commit 633d4ace6b.

Reason for revert: breaks dependency resolution in some cases.

Original change's description:
> Bump pub
>
> New commits included:
> ```
> > git log --format="%C(auto) %h %s" 0e657414a472e74ca5dd76ae0db50cc060251dec..255a3091fc278b04be74d246a3bec8743ef4d0b7
>  255a3091 Vendor package:tar and package:chunked_stream (#2932)
>  86bf8b20 Handle relative git-url-paths correctly when --directory (#2919)
>  3716a681 Let `pub add` fail if extra arguments are passed (#2927)
>  a03ac729 Minor cleanup to reduce risk of using path.current (#2924)
>  e87b7b66 Added null check for name in UserInfo class (#2918)
>  056a8c9a pub deps --json (#2896)
>  53a69e27 Fix .packages entries of relative path deps when using --directory (#2916)
>  d6308efc pub upgrade command shows count of discontinued packages (#2908)
>  51744805 Upgrade to the null safe versions of all dependencies (#2913)
>  e0d538c7 Introduce .pubignore (#2787)
>  79f3a8b9 pub outdated: added clear message when no outdated packages. (#2898)
>  22463872 `cache clean` (#2904)
>  11e7b2ce `publish --dry-run` informs that the server might do more checks (#2883)
>  b6977d50 Remove untrue assert (#2884)
>  35841f8d Merge branch 'cherry_picks_for_2_12'
>  0db3255b Don't fail on failed status listing (#2877)
>  53e8ecca Don't allow outdated taking arguments (#2872)
>  e83a1dc1 Enable asserts when testing pub (#2754)
>  178f2edb Add --directory option (#2876)
>  5aadb70e Don't fail on failed status listing (#2877)
>  4bf8a927 Remove unused field (#2878)
>  73ad5426 Don't allow outdated taking arguments (#2872)
>  9a70949e Use Dart library to read and write tar files (#2817)
>  2f74230c Do not recommend decativating packages (#2871)
>  b1697a27 Use full error message string in CommandResolutionFailedException (#2870)
>  16a6210d Upgrade `downgrade --help`: `downgrade` actually updates `pubspec.lock` (#2859)
>  6e240ea9 Use cached version listings as heuristic when prefetching (#2851)
>  58152f7c Allow trailing slash in PUB_HOSTED_URL (#2856)
>  b1bf9a33 Handle poor package-listing responses robustly. (#2847)
>  d941bd24 Fix request metadata when overriding dependencyType (#2848)
>  ```
>
> Change-Id: Id6ed5698330fc0cdb507e024eabc34f925ca9208
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192304
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
> Reviewed-by: Jonas Jensen <jonasfj@google.com>

TBR=sigurdm@google.com,jonasfj@google.com

Change-Id: I364a26468a36438bbbc887e613241030decef4d3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192748
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-03-24 09:03:36 +00:00
Alexander Thomas 5be4e20b16 [co19] Roll co19_2 to 6b71fed8c0f6cf396c085ba2d405d5a9af1daf45
2021-03-24 sgrekhov@unipro.ru extension-methods experimental flag removed from co19_2 tests
2021-03-24 sgrekhov@unipro.ru 1028. Tests that use nonfunction-type-aliases removed from co19_2 repository
2021-03-23 sgrekhov@unipro.ru 1021. Remove expecting errors on web configurations for some negative numbers
2021-03-23 sgrekhov@unipro.ru 1028. Remove triple shift operator from co19_2 repository
2021-03-23 sgrekhov@unipro.ru 1028. Remove triple shift tests from co19_2 repository
2021-03-22 irina.arkhipets@gmail.com Fixes 1015: removed test because triple-shift feature is not supported in this branch.
2021-03-18 sgrekhov@unipro.ru Fixes 1014. Expect compile error on dart2js as [web]
2021-03-17 sgrekhov@unipro.ru Fixes 1014. Expect compile error on dart2js for big numbers
2021-03-17 sgrekhov@unipro.ru Fixes 1017. Use => for setter returning value tests
2021-03-16 sgrekhov@unipro.ru Fixes 1013. Fix cast failures in Type_Cast/syntax_t01 test
2021-03-16 sgrekhov@unipro.ru Fixes 1012. Fix Additive_Expressions/syntax_t01 test
2021-03-16 sgrekhov@unipro.ru Fixes 1010. Description updated for method_definition tests
2021-03-16 sgrekhov@unipro.ru Fixes 1011. Expect an error if non-function type is called as a function
2021-03-16 sgrekhov@unipro.ru Fixes 1009. Missed experimental flag added
2021-03-16 sgrekhov@unipro.ru Fixes 1008. Calling constructor without new keyword is not an error
2021-03-16 sgrekhov@unipro.ru Fixes 1007. Missed experimental flag added
2021-03-16 sgrekhov@unipro.ru Fixes 1006. Import library first before export it

Cq-Include-Trybots: dart/try:analyzer-linux-release,analyzer-mac-release,analyzer-win-release,dart2js-strong-hostasserts-linux-ia32-d8,dart2js-strong-linux-x64-chrome,dart2js-strong-linux-x64-firefox,dart2js-strong-mac-x64-chrome,dart2js-strong-mac-x64-safari,dart2js-strong-win-x64-chrome,dart2js-strong-win-x64-edge,dart2js-strong-win-x64-firefox,dart2js-strong-win-x64-ie11,ddc-linux-release-chrome,ddc-win-release-chrome,ddk-linux-release-firefox,front-end-linux-release-x64,front-end-mac-release-x64,front-end-win-release-x64,vm-kernel-linux-debug-ia32,vm-kernel-linux-debug-x64,vm-kernel-linux-debug-x64c,vm-kernel-linux-product-x64,vm-kernel-linux-product-x64c,vm-kernel-linux-release-x64,vm-kernel-linux-release-x64c,vm-kernel-mac-debug-x64,vm-kernel-mac-debug-x64c,vm-kernel-mac-product-x64,vm-kernel-mac-product-x64c,vm-kernel-mac-release-x64,vm-kernel-mac-release-x64c,vm-kernel-precomp-linux-release-x64,vm-kernel-win-release-x64,vm-kernel-win-release-x64c

Change-Id: I7dda06f20991d47c5a6e83321c0a18005e645a72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192745
Reviewed-by: William Hesse <whesse@google.com>
2021-03-24 08:52:17 +00:00
David Morgan 0155436ba0 Bump bazel_worker.
Change-Id: I33f23f9f56d8b4a624c912981c04aa260078e25b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192300
Commit-Queue: David Morgan <davidmorgan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-03-24 08:36:33 +00:00
Konstantin Shcheglov 4a04e0ae3d Prepare to publish analyzer 1.3.0 and _fe_analyzer_shared 19.0.0.
Change-Id: Ic0983c724e01ca11d1eb72cd9e5424a74874dcc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192862
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-24 06:13:43 +00:00
Martin Kustermann 2fa31c9dbd [vm/compiler] Explicitly use near jumps in InstantiateTypeArgumentsInstr
This addresses a small performance regression introduced in a
refactoring (see [0]).

[0] https://dart-review.googlesource.com/c/sdk/+/192185

TEST=Existing test suite.

Change-Id: Ib4a7374d7172ce8a87ac608b2a0afa38cfd89a4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192741
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-03-24 04:42:53 +00:00
Konstantin Shcheglov 6b7398227f Fix unlinked API signature for adding '=<nothing>;'.
Change-Id: Idfab6f4e977170c03f0e75476e3524c9312b01ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192860
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-03-24 04:08:47 +00:00
Konstantin Shcheglov edec078c89 Return the actual first token from VariableDeclarationListImpl.firstTokenAfterCommentAndMetadata
Otherwise we cannot find the node when using the offset of `const` token.


Bug: https://github.com/Dart-Code/Dart-Code/issues/3205
Change-Id: Ida8dbc0bd48f4ae4c857d2ffd236b80a1c6cbc74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192840
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-24 03:22:23 +00:00
Nate Bosch 614e1a547d Update to the latest package_config
Change-Id: I3941b4513c6db04f782227dc55f6fc92d28e499e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192562
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2021-03-24 03:03:35 +00:00
Konstantin Shcheglov 2371d74664 Use single quoted string in AnalyzeCommand.
TBR

Change-Id: I0f0d908df54d69763b4588d857852aa560a982a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192861
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-24 02:02:08 +00:00
Konstantin Shcheglov df59fd9a3e Issue 45127. Fix for metadata on enum constants.
Bug: https://github.com/dart-lang/sdk/issues/45127
Change-Id: I8e98bc5fd0ba1e04cd88c3a175a08f67034ebb82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-24 01:10:51 +00:00
Ben Konyi a49bea950d [ CLI ] Use 'project' instead of 'package' in CLI help messages
Initial updates, related to
https://github.com/dart-lang/sdk/issues/45279.

Change-Id: I459e719ad6e92378f9240a612e0bd8229d0fcb2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192727
Reviewed-by: Devon Carew <devoncarew@google.com>
2021-03-23 23:05:33 +00:00
Joshua Litt fd4eefc22d [dart2js] Move determination of fragments to emitter phase.
Change-Id: I0aaf02a8900445fc76b87de17e21b6488ca2fe46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191240
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-03-23 21:55:53 +00:00
Konstantin Shcheglov 7f3f3e66ac Skip BazelChangesTest on Windows.
Change-Id: I88259cf2d101c80b35b16bec5cdefd3dc85a5356
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-23 21:24:01 +00:00
Ben Konyi 5e88959488 [ Service ] Deprecate CpuSamples.timeSpan
The implementation of CpuSamples.timeSpan has never matched the
specification and has never been returned properly from the service
(returned as 'timespan' instead of 'timeSpan'). Since timeSpan is
effectively the same value as timeExtentMicros, timeExtendMicros should
be used instead.

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

TEST=N/A

Change-Id: I3a1fda81e199718824ad80eb955adb3214ae192c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192780
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-03-23 21:23:31 +00:00
Ryan Macnak d007362b61 [vm, gc] Mention handles in the high-level GC documentation.
Change-Id: Ibb1eb43c7256096c0a915a2c624626a537f5f95a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192601
Reviewed-by: Liam Appelbe <liama@google.com>
2021-03-23 21:14:45 +00:00
Brian Wilkerson 9b8f93b7a1 Ignore text that is not a valid error code in ignore comments (take 2)
I considered doing the bigger refactor I described in the first CL, then
I realized that I can't because the constructors for `ErrorCode` are
`const`. We should still have some kind of tests, but they won't be as
complete as we might hope.

Change-Id: I02f397642a367af2823f67b90ffdca2113fdb8e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192725
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-23 20:22:51 +00:00
Sam Rawlins 78121c713e dev_compiler: Remove unused imports
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I3fe1093fbd0a01e1dc5e99750c4c7e9441c3d056
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192610
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-23 20:13:13 +00:00
Sam Rawlins 6e63b8b8b8 analyzer: ErrorFilterOptionValidator improvements
* error codes are static and final; no need for a public getter
* lint codes are `late final` because they may be registered up until the
  options are validated; the field is lazily calculated at such time.

Change-Id: I8d9c1e9ab4d69be77be49b44f62e605c3f06fd2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-23 20:07:41 +00:00
Ben Konyi 19b67901f2 [ VM ] Add missing locks in timeline recorder cleanup
Fixes https://github.com/flutter/flutter/issues/78076

Reverts commits ddcb60a3d9 and 3ecbfd927f.

TEST=runtime/vm/timeline_test.cc

Change-Id: I5eeb66e01a1a1b842edf9183fa876fc97e992398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192500
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2021-03-23 20:05:11 +00:00
Sam Rawlins d693078bbf Analyzer: new diagnostic: UNNECESSARY_QUESTION_MARK
`null` is already a valid value of `dynamic` and `Null`, so adding a question
mark to make `dynamic?` or `Null?` is unnecessary, and could lead to confusion.

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

Change-Id: I710ff12935767dd635edfdb026033aa8e27e7804
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190041
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-23 19:55:11 +00:00
Konstantin Shcheglov e8d7058f16 Include debug data for state error in ResolvedLibraryResultImpl
Bug: https://github.com/dart-lang/sdk/issues/45430
Change-Id: If1f75ac54dc73fa8b0fe6fc0666acd48b3ff1357
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-23 19:28:01 +00:00
Konstantin Shcheglov 85f460594b Include debug data for NPE in _ContextTypeVisitor
Bug: https://github.com/dart-lang/sdk/issues/45429
Change-Id: Ibb8a72666eaa7af16a4bb173526f16c7bab14c1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-23 18:57:01 +00:00
Brian Wilkerson bd19cbf1d2 Add a json format to the dart analyze command
Change-Id: I5667d845d305fa087934f73fbf09cc9b166c8461
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192240
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-23 18:21:51 +00:00
Sigurd Meldgaard 2178411b06 Bump package:usage version
New commits:

```
> git log --format="%C(auto) %h %s" 6c64d9e7b6b3758d06d030efcb5afe20bfc04dde..HEAD
 5b7317b Force close the http-client on IOAnalytics.close() (#155)
 21e6d3c publishing a null safe stable release (#153)
```

Bug: https://github.com/dart-lang/sdk/issues/45235
Change-Id: I47d6119cdeb8210db2207a9247a5f38e0c1841dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192686
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2021-03-23 16:06:26 +00:00
Stephen Adams 20bdf38514 [dart2js] Fix variable allocator live-range bug
The controlling condition of a control-flow operator (?:, &&, ||)
needs to have the same live range as the other operands.

Change-Id: Iee999a1b400ef35ccbb761fcd7266952c9a95be9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192605
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-03-23 15:38:36 +00:00
Stephen Adams 93313bf12d [dart2js] Fix stack overflow on optimizing '%'
The back-edge test failed to take into account that a block can have a
back-edge to itself.

Fixed: 45413
Change-Id: Ib623e6baa2c1de6df131fc67462978a042df5a4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192606
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-03-23 15:37:46 +00:00
Sam Rawlins 07bb38c8c6 analyzer: Report INVALID_SECTION_FORMAT in 4 more places
* Invalid section (not a Map) under `analyzer: errors:`
* Invalid value (not a Scalar) under `analyzer: errors:`
* Invalid section (not a Map) under `analyzer: strong-mode:`
* Invalid section (not a Map) under `analyzer: optional-checks:`

Change-Id: Iad0b33d312f65af8a995677fe4e57389fea520c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-23 15:20:47 +00:00
pq 706758a142 linter 1.2.1
Change-Id: I4d2ccc0bcc4128d60d76ea5119594d946fec35c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192483
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-03-23 15:01:16 +00:00
Sigurd Meldgaard ccb8643e0c Remove tar_rev from DEPS
Accidentally added in 633d4ace6b

Change-Id: I949da425c08415ce51a02e60a1d625a3f44a0f2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192684
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2021-03-23 14:24:26 +00:00
Martin Kustermann deb946745c [vm/compiler] Correctly prune environment for lazy-deopt in IR instructions
This ensures the following IR instructions use a correctly pruned
lazy-deopt environment:

  * AssertBoolInstr
  * AssertSubtypeInstr
  * InstantiateTypeInstr
  * InstantiateTypeArgumentsInstr

Issue https://github.com/dart-lang/sdk/issues/45213

TEST=New vm/dart_2/isolates/deopt/*_test.

Change-Id: I3d44909f0933c5df109d69e0a61f2d9d7dcc1247
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192184
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-03-23 14:03:56 +00:00
Daco Harkes 043ea3b4f4 [vm/service] Fix tests in obfuscation
Added entry-point pragmas to prevent obfuscation of global vars.

Removed expectation checking for standard library `Expando` class name.

Closes: https://github.com/dart-lang/sdk/issues/45422

TEST=Fixes various service_2 tests in obfuscation mode.

Change-Id: I91bb856c7f1ff44afe1cceec8e94e3b97ab56e44
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-obfuscate-linux-release-x64-try
Fixed: 45422
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192681
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-23 13:28:36 +00:00
Sigurd Meldgaard 633d4ace6b Bump pub
New commits included:
```
> git log --format="%C(auto) %h %s" 0e657414a472e74ca5dd76ae0db50cc060251dec..255a3091fc278b04be74d246a3bec8743ef4d0b7
 255a3091 Vendor package:tar and package:chunked_stream (#2932)
 86bf8b20 Handle relative git-url-paths correctly when --directory (#2919)
 3716a681 Let `pub add` fail if extra arguments are passed (#2927)
 a03ac729 Minor cleanup to reduce risk of using path.current (#2924)
 e87b7b66 Added null check for name in UserInfo class (#2918)
 056a8c9a pub deps --json (#2896)
 53a69e27 Fix .packages entries of relative path deps when using --directory (#2916)
 d6308efc pub upgrade command shows count of discontinued packages (#2908)
 51744805 Upgrade to the null safe versions of all dependencies (#2913)
 e0d538c7 Introduce .pubignore (#2787)
 79f3a8b9 pub outdated: added clear message when no outdated packages. (#2898)
 22463872 `cache clean` (#2904)
 11e7b2ce `publish --dry-run` informs that the server might do more checks (#2883)
 b6977d50 Remove untrue assert (#2884)
 35841f8d Merge branch 'cherry_picks_for_2_12'
 0db3255b Don't fail on failed status listing (#2877)
 53e8ecca Don't allow outdated taking arguments (#2872)
 e83a1dc1 Enable asserts when testing pub (#2754)
 178f2edb Add --directory option (#2876)
 5aadb70e Don't fail on failed status listing (#2877)
 4bf8a927 Remove unused field (#2878)
 73ad5426 Don't allow outdated taking arguments (#2872)
 9a70949e Use Dart library to read and write tar files (#2817)
 2f74230c Do not recommend decativating packages (#2871)
 b1697a27 Use full error message string in CommandResolutionFailedException (#2870)
 16a6210d Upgrade `downgrade --help`: `downgrade` actually updates `pubspec.lock` (#2859)
 6e240ea9 Use cached version listings as heuristic when prefetching (#2851)
 58152f7c Allow trailing slash in PUB_HOSTED_URL (#2856)
 b1bf9a33 Handle poor package-listing responses robustly. (#2847)
 d941bd24 Fix request metadata when overriding dependencyType (#2848)
 ```

Change-Id: Id6ed5698330fc0cdb507e024eabc34f925ca9208
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192304
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2021-03-23 12:55:06 +00:00
Martin Kustermann dec7b4f5b6 [vm/compiler] Avoid pruning deopt environments during SSA construction
Generally speaking, the optimizing compiler should be able to use
(deopt-id, deopt-environ) of any IR instruction and use it as an eager
deopt target (e.g. optimizing compiler might insert TestCidsInstr
with eager (deopt-id, deopt-environ) from AssertAssignable).

Currently we prune the environment eagerly during SSA construction for
some instructions This pruning breaks the above mechanism, since the
deopt-environ isn't usable as eager deopt target. (It is effectively
changing the environment on the IR instruction to be a lazy-deopt
environment).

This CL makes the [Environment] represent both the eager deopt target as
well as the lazy deopt target. It distinguishes the two by remembering
how many slots the eager deopt target needs to be pruned to come to the
lazy deopt target. The SSA construction will populate this information.

Effectively we move the deopt env pruning from SSA construction to the
place when we need it (e.g. inlining, emitting after-call metadata).

Issue https://github.com/dart-lang/sdk/issues/45213

TEST=Refactoring of existing code.

Change-Id: I6c2a117b33f35764e556372484e4beaa294b708d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192141
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-03-23 12:22:16 +00:00