(The simulators are broken at runtime.)
Change-Id: I10089cad44fca57145cfdd598342279f07c6d7fd
Reviewed-on: https://dart-review.googlesource.com/75205
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
- The new mixin syntax is now handled. It's a little kludgy since the
front end lowers it to the old supermixin representation, so we have
to do a similar lowering to the analyzer representation. Once the
front end has full support for the new mixin syntax, I'll clean this
up.
- Synthetic '__loadLibrary_' functions (inserted by the front end to
cover the corner case where the "loadLibrary" function is torn off)
are ignored.
Drops the number of failing language_2 tests with `--compiler
compare_analyzer_cfe` from 22 to 11. I believe the remaining failures
are genuine bugs in either the front end or the analyzer.
Change-Id: I452ee92c418c04661d35cda1ed129ee5715879cd
Reviewed-on: https://dart-review.googlesource.com/75207
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Read events should only be re-enabled when all available bytes have
been read, or there is an error.
related: FL-109
Change-Id: Iefd4ff3d7f4b79c08ee3d2bca7cdfef70de66ce9
Reviewed-on: https://dart-review.googlesource.com/75200
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This CL relaxes assertion added recently in
c6c4748185 as it could fail in Dart 1
mode.
This should fix 'checked vm tests' step on debug bots which still runs
tests in Dart 1 mode.
Change-Id: Ifdd6e27087b44822ce9cd5be48750af1c7d45a8e
Reviewed-on: https://dart-review.googlesource.com/75201
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
---------------- NEW description (old description shown at end):
This CL is now a reorganization, problem fixing, clarifying update
to dartLangSpec.tex which was created as part of the work on the
rules for call method extraction. That is, all the call method
extraction specific elements have been _deleted_ from this CL
(they will reappear as a separate CL later). This CL is now only
performing "general clean-up work" which is needed in order to
perform many kinds of updates (including call method extraction,
but also anything else where the dynamic semantics depends on the
static analysis & desugaring).
------------------------------------------------ OLD description
Introduced rules for call method extraction.
The previous update to dartLangSpec.tex dealt with invocations, but
omitted the transformation whereby `e` becomes `e.call` when `e` has
a type which is a class with a `call` method and the context expects
a value of type `Function` or of a function type. This CL adds some
rules dealing with that and introduces a concept for the transformation
itself.
One part is missing for the initial patch set: There are no rules
specifying that call method extraction should be applied to actual
arguments. The problem is that static checking of actual arguments
to various invocations (function expression invocation, ordinary
method invocation, super invocation, etc.etc.) seems to be "delegated"
partially to section `Binding Actuals to Formals`, but that section
never defines the syntax for the function which is being invoked and
it is in general rather dynamic in nature. So I'm not quite sure
that the references to static checking at the end of that section
are located optimally.
Some adjustments may therefor be needed before we can specify this
particular feature for actual arguments.
Change-Id: Ia2ab6f16cd50e10a3c467722035f0dc4adb50587
Reviewed-on: https://dart-review.googlesource.com/51323
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Drops the number of failing language_2 tests with `--compiler
compare_analyzer_cfe` from 34 to 22.
Change-Id: I1d35d0ac11816d29a5f3044db81a5c24e1b25477
Reviewed-on: https://dart-review.googlesource.com/75129
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Before this change we used the whole AnalysisOptions.signature as salt.
This means that if two packages have different set of lints, they have
different options signatures, and so we have to parse and compute
unlinked data for SDK and all shared packages separately. But unlinked
data depends only on very small set of options, practically only on
parser options.
This improves performance on workspaces with many modules and empty
cache:
Before:
<= --- Analyzing in 36122 ms.
<= Computed implemented in: 50138 ms.
<= --- Analyzing in 47905 ms.
<= Computed implemented in: 55339 ms.
<= --- Analyzing in 45141 ms.
<= Computed implemented in: 60169 ms.
After:
<= --- Analyzing in 27957 ms.
<= Computed implemented in: 11645 ms.
<= --- Analyzing in 21378 ms.
<= Computed implemented in: 9439 ms.
<= --- Analyzing in 21719 ms.
<= Computed implemented in: 10546 ms.
Here "computed implemented" is computing subtypes of classes in the
open file - it required unlinked data for all files in all available
packages.
It also helps for full cache:
analysis: 6300 vs. 5700 ms.
implemented: 5700 vs. 3700 ms.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: I10dbc6d062617466ad5f35ae77bd1e58a6bb606c
Reviewed-on: https://dart-review.googlesource.com/75128
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This CL refactors the summary resynthesis tests similar to how
05ab41c99b refactored the summary
generation tests. It introduces the following classes:
- The interface `ResynthesizeTestStrategy`, defining the methods that
can be invoked by tests of summary resynthesis.
- An implementation of that interface:
`ResynthesizeTestStrategyTwoPhase`. This drives the summary
mechanism using the old two-phase summary API.
- Mixin classes `ExprBuilderTestCases` and `ResynthesizeTestCases`
containing the test cases themselves.
- Mixin classes `ExprBuilderTestHelpers` and `ResynthesizeTestHelpers`
containing helper methods used by the test cases.
There should be no functional change introduced by this CL, only code
motion.
Change-Id: Ifb84d4d2d8fa17bbc32b833b1f56af7e1217b5ae
Reviewed-on: https://dart-review.googlesource.com/75124
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
These bytecode instructions are added in order to shrink constant pools
and reduce time spent for reading constant pool entries.
Change-Id: I8522f73dc7a6236969ac0422c6cb89b945559b2d
Reviewed-on: https://dart-review.googlesource.com/75125
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
It seems we are still using non-strong mode targets in few
places (e.g. when training front-end server we by accident
train it in legacy mode).
A separate bug is filed to clean that up https://github.com/dart-lang/sdk/issues/34468
For now to unbreak the build we simply check if we are in the
legacy mode and then avoid using getStaticType in async
transformation.
This is followup to eec96f9076.
Bug: https://github.com/dart-lang/sdk/issues/34463
Change-Id: Ib693fddfb9abbf89599ae646cb408d4a9c93f1b6
Reviewed-on: https://dart-review.googlesource.com/75061
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This reduces isolate reload time on a given sample from ~2 seconds to ~200 milliseconds.
Remove ASSERT - you can have replacement finalized when original was non-finalized
Bug: https://github.com/dart-lang/sdk/issues/34461
Change-Id: I39dc5d67e97bd7c0d654cd751b6829b00337e967
Reviewed-on: https://dart-review.googlesource.com/74961
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
- Mixin applications are now handled correctly.
- The front end's synthetic field "_exports#" is now ignored.
- Forwarding semi-stubs were erroneously being skipped; they are now
included, as they should be (since they correspond to methods
explictly declared in the source code).
- Named parameters in function types are now annotated properly (the
annotation was previously missing a ": ").
Drops the number of failing language_2 tests with `--compiler
compare_analyzer_cfe` from 405 to 34.
Change-Id: I148269c967cc0fdf67bcfcd698cba36fc0b66368
Reviewed-on: https://dart-review.googlesource.com/75121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Previously we tried to rely on the assumption that all variables would be
boxed - so the machinery for setting correct catch-entry state only
supported tagged values and constants. However this both leads to worse code
and is not entirely correct assumption.
This also:
- renames various confusingly named classes: we move away from talking
about "catch entry state" to "catch entry moves" - because we only
record a subset of moves that needs to be performed and that does
not describe the whole state;
- refactors a bunch of associated code to be more readable and maintainable;
- adds documentation about catch implementation in optimized code
to runtime/docs/compiler;
Fixes https://github.com/flutter/flutter/issues/21685.
Change-Id: I03ae361a1bb7710acbd9f661ae014e663a163c59
Reviewed-on: https://dart-review.googlesource.com/74860
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Async transformation uses dynamic variables in few places (e.g.
for temporaries and for incomming arguments) - which creates
not strongly typed AST with method invocations having dynamic
receivers and non-null interface targets at the same time.
To maintain strong typedness of the AST we insert unsafeCast
when accessing the temporaries.
Bug: https://github.com/dart-lang/sdk/issues/34463
Change-Id: I11e38c128645ebc8acb0c982a80fe4c5c4036673
Reviewed-on: https://dart-review.googlesource.com/75000
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
For now, if the front end detects an error, we just consider the test
to have passed; we don't try to verify that the analyzer also detects
an error. This will be improved in a future CL.
Drops the number of failing language_2 tests with `--compiler
compare_analyzer_cfe` from 2676 to 405.
Change-Id: Ib4f3c99710df4a0f0aac9a1c22a9a3279c6a6479
Reviewed-on: https://dart-review.googlesource.com/74968
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This includes the unknown potential targets of access to js-interop
members. Since we don't know actual classes implementing the js-interop
classes we just assume it could be any of them.
Change-Id: I4d91ab673fa8221eb701b34e9c32fd16e5a1c381
Reviewed-on: https://dart-review.googlesource.com/74980
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
These getters are private to the analyzer and not used by it.
Change-Id: I203af68124668244dd204bff0cf7a3de4de8e9cd
Reviewed-on: https://dart-review.googlesource.com/74967
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The point is that #32782 requests a fix such that
`typedef F1 = void Function(int)` and `typedef void F2(int)`
satisfy that `F1 == F2` evaluates to true. This is marked
'p3-low' for the common front end but 'p1-high' for DDC.
It seems likely to me that this could create the situation where
code is developed using DDC, is working, and then fails upon
deployment using the vm. Also, there is a single case where
`dart2js` fails in the associated `type_alias_equality_test.dart`,
so deployment on the web would also fail upon deployment, though
only in some of the cases.
However, with some input from Aske I concluded that the situation
might have arisen because there _is_ no work to do for this in the
common front end, because it will be handled by the backend (which
also explains why `dart2js` has it almost right).
This CL is just introducing a tiny change: It changes the issue
indicated for all VM related failures in said test to point to
#32783, which is presumably the right issue for backend work.
Apart from that, I've added you, the reviewers, in order to make
sure that the relevant people get this heads up. We may then decide
to land this CL, change the priority on #31359, do nothing, or
whatever turns out to be the right response. ;-)
Change-Id: I92672547d7fe795e877604c0da1e0e4579e4e04a
Reviewed-on: https://dart-review.googlesource.com/74403
Reviewed-by: Jenny Messerly <jmesserly@google.com>
The set of sets is not comprehensive, no tests for fields and accessors.
R=brianwilkerson@google.com
Change-Id: I105ed6b1d4b5836f61af9f8abe7fed7e7a6b8c59
Reviewed-on: https://dart-review.googlesource.com/74941
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
By removing unnecessary flags isStrongMode and isSharedFrontEnd.
Change-Id: I18ebb15297cc7dde38d61369d9a18b9e3bce895a
Reviewed-on: https://dart-review.googlesource.com/74966
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
These tests were relying on some details of the summary representation
that are no longer present, namely the fact that function elements
appearing within initializers (including the synthetic function
element for an initializer) used to have inferred types associated
with them. The tests have been changed so that they exercise the same
functionality, but they use the inferred type of the variable directly
rather than going through the function elements.
Change-Id: I8e7733674bfa6f8e7f442ea04e7da702f3b11020
Reviewed-on: https://dart-review.googlesource.com/74922
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This test was previously assuming that variables requiring top level
type inference would have their body expressions encoded in the
unlinked summary; with one-phase summary generation this is no longer
the case.
Change-Id: I47b4f81926eb4bc667a201ba83673e3e0db4c8cb
Reviewed-on: https://dart-review.googlesource.com/74924
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This addresses a comment in https://dart-review.googlesource.com/c/sdk/+/74600,
updates the "run fasta generate first" exception message,
and converts more Analyzer errors to be auto generated.
Change-Id: I9c98184d1b9fe642dab4d66fbcd961dc27dfa6f9
Reviewed-on: https://dart-review.googlesource.com/74900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
At some point this test regressed so that it no longer tested the
behavior it purported to test. The underlying behavior is correct;
the test just had to be fixed.
Change-Id: Ia54cb205b8f1a6062f4078009d24d865d70a6bac
Reviewed-on: https://dart-review.googlesource.com/74921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The test was assuming that summaries stored relative paths, which they
haven't done for quite some time.
Change-Id: Iee08f1e95650107886df85750e29aaf4267c60bb
Reviewed-on: https://dart-review.googlesource.com/74920
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
When this flag is enabled, we fail:
2 language_2/ tests;
25 Analyzer tests (mostly by 2 reasons);
0 Analysis Server tests.
There is a know problem: because unlinked summaries don't include
initializers for variables, we fail to recognize API changes related
to inferred types. I will fix this be computing API signatures from
pertinent tokens.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: I61734e96ee26b3e04027a103ccf6850695815127
Reviewed-on: https://dart-review.googlesource.com/74700
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This is required for tracking type arguments, since field initializers can
reference type variables from the enclosing class.
Also a few drive-by spelling fixes.
Change-Id: I91e33f7d8c61e288ccb2d8e18b33f4e67ac22a1b
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/74666
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
* new lint: `prefer_mixin`
* new lint: `avoid_implementing_value_types`
Change-Id: Iaba2d1dd50511db935cf050ba49e7d10746be8cb
Reviewed-on: https://dart-review.googlesource.com/74880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>