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>
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>
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>
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>
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>
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>
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>
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 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>
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>
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>
* 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>
* 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>
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>
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>