This CL shards the CFE try bot tests better.
* co19_2 runs was previously made faster, so using 10 shards on that is
way too much.
* sdk_test runs was previously made faster, so using 5 shard on that is
way too much.
* unit_tests was taking ~10 minutes and wasn't sharded. This CL shards
it. Note that this sharding is semi-complicated because a few tests
use git which is not usable on shard-runs. To overcome this a previous
CL renamed the tests that use git and here the sharded runs only run
the tests that doesn't require git. Then the "main bot" runs the tests
that require git.
* unit tests suites was taking ~12 minutes and wasn't sharded. This CL
shards it. Note that this sharding is semi-complicated because a few
of the suites use git which is not usable on shard-runs. Also a single
suite uses many more files that it is reasonable to include in the
fileset for the shards. In both cases these are run on the "main bot"
instead. The suit runnier was already "threaded", but simply launched
all threads (say around 20 or something like that) at the same time.
That's not ideal if having, say, 8 cores to work with (which is what
the bots seem to have) - or 12 (which is what my computer has).
Now only 'cores - 1' "threads" are run at any one time, and most
"sub-suites" are sharded, so that if one finishes early that core
can start another "sub-suite" - hopefully utilizing more of the
resources avaiable on the computer running it.
In total - in my 'benchmarks' (i.e. try bot runs) - the
front-end-linux-release-x64-try bot previously rook around 35 minutes
to complete, and with these changes it takes around 15 minutes to
complete. The biggest entry in the timeline is now building dart which
takes almost half that time. It does so with fewer shards than before,
but each might be utilized for longer.
Change-Id: Ie034058d8f33aafd21bc49f2bc878484563ba01c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181383
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Members declared in mixins are treated as if these were declared in
the class where they are mixed in. This means that use their types as
declared types, instead of including them in a combined member signature.
This failed in the case where a member was synthetically added to the
mixin class, because the types of these we wrongfully be handled as
declared types.
We now skip all synthetic members when reasoning about mixed in members
as declared members.
Change-Id: I9c2311b4472fe16162fcdc4c56fce8db2d946f4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181201
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This CL is a warm-up to a follow-up change that will make running the
CFE trybot faster.
This CL:
* Rename tests that require git (because when working with filesets
and shards in the test system, the "checkout" is not a git checkout
and git commands thus doesn't work properly.
* Filters the front-end unit test setup on the front-end bot the way
it was probably intended, i.e. run tests in pkg/kernel, pkg/front_end
and pkg/fasta (actually, the last one doesn't exist, but still)
instead of just in folders inside the "suite" 'pkg' that somewhere in
the path has something called 'kernel', 'front_end' or 'fasta'.
* Split unit_test_suites.dart into a "forwarding shell" and a impl.
In a follow-up CL the impl will be converted to nnbd to allow for
using 'required' on named parameters, but if the entry point was
nnbd it would run in sound nnbd mode and nothing would compile
because all imports are not nnbd.
Overall this CL should change very little, mostly just run a few less
tests, i.e. for instance skip tests that live inside a folder called
'fasta' somewhere inside the analyzer directory path.
Change-Id: I3226c7261cff8b68cc287cff07dc1715dfd85159
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181381
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This is in preparation for a CL the removes @fields/@=fields canonical
names in favor of @getters/@setters and therefore needs stricter handling
of how duplicates and conflicts are emitted in the AST.
Change-Id: I87220a41c9777c94f9e9bce51ff5223fafdc738f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180342
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
From the times where some of the type arguments should have been
reported as warnings, the procedure was run twice in two different
modes, in order to report some issues as errors and some as warnings.
This CL is a cleanup that invokes the procedure once. Additionally, a
refactoring of the return value discipline is made: it always returns
a list and never returns null. An empty list is returned if there are
no issues.
Change-Id: Id497216bf51f49c86517cf16a52f03da5b65b1fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180570
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
This converts `return e` in async methods in opt-in libraries into
return let v = e in v is Future<FTV> ? await v ; v
where FTV is the future value type of the enclosing function.
Closes#44395Closes#44396Closes#44397Closes#44399
TEST=existing tests
Change-Id: I59687039bfe4a97ffdaa55ac0f193ca4fb208f44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175310
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
For instance one could pass something like
```
--wantErrorOnReload="Error: The getter 'axis' isn't defined for the class 'Constraints'" --noTryToDeleteEmptyFilesUpFront
```
to reproduce https://dart-review.googlesource.com/c/sdk/+/180341
(the --noTryToDeleteEmptyFilesUpFront part might not be neccessary,
but was at one point doing the reproduction / development of this).
Change-Id: I943b715c56f3e1103c6287ed9529aa29c0e74f07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180360
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The analyzer and CFE now report a warning on calls to
`Pointer<T extends NativeType>.elementAt()` and
`sizeOf<T extends NativeType>()` where `T` is a generic.
Adapted from https://dart-review.googlesource.com/c/sdk/+/178200 to
only deprecate but not error out on generic calls.
Does not roll forward `package:ffi` to a version with the `Allocator`
but keeps the generic `sizeOf` invocation. This causes extra warnings
in the pkg/front_end testcases.
Issue: https://github.com/dart-lang/sdk/issues/38721
TEST=tests/ffi/data_test.dart
TEST=tests/ffi/sizeof_test.dart
TEST=tests/ffi/structs_test.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart
Change-Id: I8f41c4dc04fc44e7e6c540ba87a3f41604130fe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180560
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Currently - i.e. without this CL - (almost) every test run by the strong
test suite verifies the platform libraries as well. That's basically a
waste of time.
This CL makes the suite skip it for the platform.
Runtimes changes (on my computer) as follows:
With -DskipVm=true:
With this CL: ~1:55
Without/before this CL: ~8:30
Without -DskipVm=true:
With this CL: ~4:35
Without/before this CL: ~11:30
Change-Id: I6c46b86935bea29911775cbc0544ea7a0b60b779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180562
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This CL introduces a 'semi-fuzz' option in the strong tests, that is
disabled by default.
The current version just compiles with the incremental compiler
and invalidate one file at a time, seing that we get the same
libaries in the output and that we either get errors in both cases
or no errors in both cases.
Future versions should for instance split libraries into more
libraries or parts etc., and the semiFuzz option should be enabled
by default.
Change-Id: I47f7d0f10798b0f2b19c9f2a02287f9431f67608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180145
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
We now track the following additional information:
- All local variable reads and read captures (previously we only
tracked writes)
- For any conditional expression (`?:`) or if-test, the variables
written in the "then" branch
- For any logical and expression (`&&`), the variables written in the
right hand side of the expression
Tracking this information will allow us to implement legacy type
promotion as part of _fe_analyzer_shared, using the same API as flow
anaylsis, which will in turn allow a lot of front end and analyzer
code to be removed and simplified.
Change-Id: I01aaf64cefb989a4450c8e6d3a8373c1ca2b6dec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179980
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This CL is a reproduction of a found bug, where upon recompile
- even with no change to the code - one suddenly gets an error
like this:
```
// org-dartlang-test:///main.dart:9:36: Error: The getter 'axis' isn't defined for the class 'Constraints'.
// - 'Constraints' is from 'package:flutter/object.dart' ('org-dartlang-test:///flutter/object.dart').
// Try correcting the name to the name of an existing getter, or defining a getter or field named 'axis'.
// print(renderObject.constraints.axis);
// ^^^^
```
Run like
`out/ReleaseX64/dart --enable-asserts pkg/front_end/test/incremental_load_from_dill_suite.dart -DupdateExpectations=true -- incremental_load_from_dill/error_on_recompile_with_no_change`
Change-Id: I48b87ca3ce5b8301c4f8b6b7884ded7a328387d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180341
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
A factory is saved as a procedure in kernel, and was thus also indexed
as a procedure for the purpose of experimental invalidation.
This caused trouble when having a "real" procedure and a factory with
the same name.
That is fixed by this CL by indexing factories ad constructors.
Fixes https://github.com/flutter/flutter/issues/74180
Change-Id: Ieef0421c29a61e26f2a7ee4bb4f196672afd8445
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180148
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The new implementation uses the same API as flow analysis. This
should allow us to significantly simplify the CFE and analyzer, by
dropping their implementations of legacy type promotion in favor of
the shared implementation.
This CL just introduces the new implementation and unit tests for it;
it does not integrate it with the analyzer or CFE. I will follow up
with a CL that does the integration.
Change-Id: Ie07b3b39604d6a022ad42f3ae6b648a317c8af28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179560
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
The only references that are promotable are references to variables,
however in the near future I'll be adding logic to flor analysis to
keep track of attempts to promote fields; this will require tracking
references to property gets as well as references to `this`, so we
need to start building up data structures to track those references.
Bug: https://github.com/dart-lang/sdk/issues/38773
Change-Id: I0e3fd44f580bb85db3e8f405675b66aa4069e455
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179280
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This adds a new messages kind 'info' to the CFE for showing general
information during compilation. A 'configuration' options is added
to `CompilerOptions` for telling the CFE how it is run.
The configuration 'compile' is added for when the CFE is invoked to
produces an "executable" as when running `dart compile`. When
configuration is set, the CFE emits an info message about the
null safety compilation mode.
Support for `dart compile exe` and `dart compile js` is added in this
CL. Support for `dart compile kernel|app-jit|aot` is not included.
In response to https://github.com/dart-lang/sdk/issues/44234
TEST=pkg/dartdev/test/commands/compile_test.dart
Change-Id: I08f51e2a3f5ad4841c4d703bcd266b7afb63c7c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178982
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Bug: https://github.com/flutter/flutter/issues/73176
This reverts commit 825f56c6aa.
Both ddc and dart2js keep a set of native class names to make sure
@JS() classes don't conflict. Instead of processing native classes
for every component, this CL caches the set of native classes. This
should address the recompile time issues related to the original
revert.
Change-Id: If8028f0842440e8b9354bec9d7f72d0d42fcd8bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178926
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Adds helpers for extracting original name of a lowered late field, the
original initializer and the field used to hold the value of the lowered
field.
This helps backends to customize late field encoding while still using
the lowering provided by the cfe.
Change-Id: Ib42af539efad84a08a6e32acd29d2efaff129cd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178989
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
commands
- Added support for --define to the VM and dart2js
- Added support for -D and --define for `dart run` and `dart compile js`
Remaining improvements:
- Add support for providing multiple comma separated values for `dart
run`, `dart`, and `dart2js`
Related issue: https://github.com/dart-lang/sdk/issues/44562
TEST=Updated CLI tests and added new dart2js tests.
Change-Id: I9379c7aee1eab377adb3438393d9ad79c4938cc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178262
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
As per planned breaking change to let platforms decide how they and what throw for late initiaization errors,
we no longer need a public `LateInitializationError` class. It's confusing to have one if some platforms throw
something else instead.
Removes the public abstract class. The dart:_internal implementation class `LateError` no longer implements it.
This is the only implementation of the public interface, and the class which platforms either throw directly,
or through front-end lowering of the feature.
Remove mentions in tests. All tests now just expect `Error`, some platform specific tests might test the message.
TEST=rewrote tests referring to LateInitializationError.
Change-Id: I54344a67f89ce101ed770412db134e12354cdcc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174928
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
This CL avoids the infinite loop created by allowing the parser
to parse it as a complex type (despite no actual name after it) and
adds a few asserts in an attempt to catch rewriting on eof (setting a
token after eof).
Fixes#42229Fixes#44477
Change-Id: Ie2da0957894067a3d4748cb6384bc9d6cf32c215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150521
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>