This reverts commit 5cda2a871c.
Reason for revert: broke Flutter build.
Original change's description:
> [tools] Allow precompiling gen_kernel and compile_platform
>
> When iterating on core library changes or changes in the AOT compiler
> many seconds are wasted waiting on gen_kernel/compile_platform to
> parse Dart code. This happens because we are running these tools
> from sources on prebuilt Dart SDK.
>
> This CL allows SDK developer to opt-in into AOT compiling these
> tools by adding `precompile_tools=true` to their DART_GN_ARGS.
>
> AOT compilation is performed using prebuilt SDK - so these
> executables do not need to be recompiled if core libraries or
> VM changes reducing iteration cycles.
>
> pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
> contains `precompile_tools=true` and use precompiled
> gen_kernel.exe instead of running it from source.
>
> Using precompiled compile_platform takes vm_platform_strong.dill
> build from 20 seconds to 3 seconds.
>
> Using precompiled gen_kernel takes small benchmark build from
> ~10 seconds to 2 seconds.
>
> TEST=manually tested
>
> Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: Id3e4eb44d33516f31c165d9a1e55911e8d356e7f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367960
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
I would like to add an option to our BUILD
files to precompile gen_kernel and
compile_platform to speedup iteration cycles
when working on core library changes.
To make this robust I would like to use
depfile to track dependencies and know
when compile_platform should be
recompiled.
TEST=pkg/dartdev/test/commands/compile_test.dart
R=kustermann@google.com
Change-Id: Id674f7353342c8275a8a0c4a70e3f5eaeb7f05d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367023
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.
This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.
AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.
pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.
Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.
Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.
TEST=manually tested
Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Knowing whether Dart code is running in a WebAssembly context is useful
to potentially select different code paths exploiting differences in
JavaScript and WASM behavior or simply to report the information to
users (e.g. for crash reports).
Without such a constant, one has to rely on implementation differences
such as `identical(0, 0.0)` or check the available `dart:` libraries.
Both are error-prone, so having a reliable constant as an alternative
makes this easier.
Closes https://github.com/dart-lang/sdk/issues/55694
Change-Id: Ia969641e4b78223c394cbf251805cf77a30cb0fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365822
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This CL removes the "default" case when the switch must be exhaustive
and is exhaustive without the default. Found by modifying the CFEs
constant evaluator.
Change-Id: Iaba27864315875257502be8e74fc2ce34f6ce54d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367900
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This is preparing _AbstractCorrectionProducer to be a sealed public
class for plugins:
* Move `_coveringNode` and `coveringNode` to
CorrectionProducer from _AbstractCorrectionProducer; these are only
used by CorrectionProducer subclasses.
* Seal CorrectionProducer; the ultimate subclasses should subclass
either ParsedCorrectionProducer or ResolvedCorrectionProducer.
* Make CorrectionProducerContext final.
Change-Id: Iccbe0d92042eb826c6c53499e052c37442e312ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This introduces CorrectionApplicability.automaticallyButOncePerFile,
used in just 4 producers:
* AddNullCheck
* MoveDocCommentToLibraryDirective
* RemoveLibraryName
* RemoveUnnecessaryLibraryDirective
Also fixes FixProcessorMapTest to actually test registered fixes.
Change-Id: I2ed2d8d6a030f04ea3fa969988719bb9d4c2f8fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367661
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
I convert the `noSuchMethod` tests to (imho) simpler tests of what
property access of `e` or `d` or `D` would look like on an int, via
extension getters.
The noSuchMethod test as it was written cannot be executed at runtime,
because (as of Dart 2, I think, maybe earlier), property access on
expressions is a compile-time consideration. And I think as a compile-
time error test, it's hard to see what it's testing.
Change-Id: I5c0ca728e6e812b8f35adb80b288be351c4b076a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367461
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Change-Id: If1995ff9938df8b08d12a2d7deaf9fc69e39a356
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I49c75bcaa12eefc06b1e906983b482a51466c134
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367740
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I096871271a240b6af30d3c6d6e6afb5fe37f8a1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367660
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
When a server plugins generates diagnostics, they're merged with the servers diagnostics (which are kept cached in `NotificationManager.errors`) and sent to the client.
When a file is removed, we tell the client to flush all results but we did not previously clear this cache. That meant it a plugin subsequently generates diagnostics (even if empty), we would merge with them with the last state of the server errors and send them to the client.
This clears errors from the servers cache at the same time as flushing them on the client.
Fixes https://github.com/Dart-Code/Dart-Code/issues/5113
Change-Id: I047c4531a38edaaad1362f9c7e7714a7e7ab705f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Checking for solo tests is now done as part of `verify_tests_test.dart` so solo tests currently produce two test failures.
This file did check one additional project that doesn't have `verify_tests_test.dart` does not (analyzer_cli) so it isn't exactly the same, but that project is going away (https://github.com/dart-lang/sdk/issues/48457) so it doesn't seem worth making `verify_tests_test` work there (there's a mismatch because it currently uses `all.dart` and not `test_all.dart`, but I suspect that filename may be coded into some bot configuration somewhere).
Change-Id: I7431ed0e141bab1898860f6fbe316833281d6fa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
The error codes are not being generated and the mapping to `EXTRANEOUS_MODIFIER` in tests is unnecessary.
This logic is likely a hold over from when the analyzer had it’s own parser with temporary conversion logic to align it with fasta. With only one parser, these bits are stale and should be safe to remove.
Change-Id: I5b29f0081953c61771b313025595910eef055c2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367540
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Previously these abstract getters were typed as returning
iterables. Although in principle, changing the return types to lists
constrains the implementations more, in practice it makes no
difference because the only implementations are in the CFE, analzyer,
and the mini_types shared tests, and those implementations already
return lists anyhow.
Changing the abstact getters to return lists will simplify future work
by allowing code that interacts with the base SharedRecordType class
to index into the lists rather than having to iterate through them.
Change-Id: Ia257400dbb7c89aabc468be15a939e6baa36e191
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367500
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This method always returned Nullability.nonNullable. Inlining it will
pave the way for removing support for legacy libraries from the type
system, which will in turn make it easier to share type system logic
between the analyzer and front end.
Change-Id: I25757f6f7a65d65c72b28e57153ce0f06ffd38e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367441
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This test shows up as flaky quite often. It's waiting for breakpoint Resolved events by just calling `await pumpEventQueue(times: 5000);` but it appears this sometimes doesn't get all of the events.
This change waits up to 5s for the events to arrive (because we unfortunately have no signal to know when they should have come through). I'm hopeful 5s is more than enough and this won't flake, but we could increase this as not - the goal of this test is not to verify performance but just ensure the events do arrive.
Change-Id: Ia2236b65bbb5d11e2a5519d49869c6b87202a940
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367301
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
- Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.
- Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.
- The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.
- Both implementations report better errors.
- Fixed VM bug with in-range sentinel.
Change-Id: I9156255bdb6ecc195500ae9bc88f91fb315b6297
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366963
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Added a little section for late wildcard variables too.
This CL tests mixing top-level wildcard declarations with local wildcard declarations and the non-shadowing, non-binding behaviour.
Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: I72e7cfb1b2d80a3934af355579c36252881cf3fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367241
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
The id ring was treated as a strong root during minor GC and a weak root during major GC. Before mark-through-new-space, new-space objects could not be collected during a major GC, so in practice the policy was that the id ring was strong for all new-space objects. After mark-through-new-space, new-space object can be collected during a major GC, so service ids could expire very quickly, especially for object just created using the service protocol and not otherwise reachable from the Dart program. Given that service id zones have still not been implemented, this makes it impossible to reliably interact with such an object.
TEST=ci
Bug: https://github.com/flutter/flutter/issues/148704
Change-Id: I0f15c00414f996fad49bcb137c7f1c15bb4955c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367440
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
* CorrectionProducer:
* Remove `errorMessage`; unused.
* Make `configure` abstract; it is only here for the doc comment.
* MultiCorrectionProducer: remove `typeProvider`, `typeSystem`.
* ResolvedCorrectionProducer: make `coreTypeBool` private.
* _AbstractCorrectionProducer:
* Move `invalidNodes`; only used once.
* Remove `strictCasts`; unused.
* Remove `displayStringForType`; unnecessary convenience.
* Move `mightBeImplicitConstructor` to be a private extension
getter.
* Move `nameOfType` to be a private extension getter.
* Move `shouldWrapParenthesisBeforeAnd` to be a public extension
getter.
* Move DartFileEditBuilderExtension to be a private extension.
Change-Id: Icd1e17ccf398fafd1d9fee88d4b6a430a2deb50a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367363
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Change-Id: Ib4d3da6f1dea130b56caf642c0e0a6a0a9a15e2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367400
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This is the last part of the series of patches to implement missing
sync* features and fix bugs.
Move common code generation functions between async and sync* code
generators to the state_machine library, with the name
`StateMachineCodeGenerator`.
This class allows overriding parts that differ between the async and
sync* code generators.
Fixes tests:
- co19/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_sync_t05
- language/sync_star/generator3_test/test1
- language/sync_star/generator3_test/test2
- language/sync_star/sync_star_exception_iterator_test
- language/sync_star/sync_star_exception_nested_test
- language/sync_star/sync_star_exception_test
- language/sync_star/sync_star_exception_current_test
Fixes#51343.
Fixes#51342.
Change-Id: Ife6eab43b2721b003ebf9bc0f03796748fd5df46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367041
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This is the second part of the refactoring to make sync* and async
compilers to reuse code as much as possible.
Move exception handler and label target types from `async` to
`state_machine` library.
This is a change from
https://dart-review.googlesource.com/c/sdk/+/366663, moved to a spearate
CL to make revieweing easier.
The end goal is to share code generation for async and sync* code
generators.
Change-Id: Ie38e4237bd89063ceba1700bf0a996e4839a396a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367040
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
- Generalize `YieldFinder` to consider both `await` and `yield` as a
suspension point.
- Move it to `state_machine.dart`, reuse it in async and sync* code
generators.
This is a change from
https://dart-review.googlesource.com/c/sdk/+/366663, moved to a spearate
CL to make revieweing easier.
The end goal is to share code generation for async and sync* code
generators.
Change-Id: I4c75c746f85b2fedf7c1117a20fcd32152573c6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367021
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
We decided that the existing mechanism, three bool values that can be
overridden by an AbstractProducer subclass, was confusing as it might
give the impression that they are independent, and that any of the 8
possible combinations are valid. But really each author of a
CorrectionProducer just needs to answer one question: how broadly can
this correction be applied?
So to answer that question we decided (loosely in emails) to offer an
enum of a few values that more-or-less represent the sensible
combinations of the bool getters. And more specifically I decided in
this CL what those values should be.
In this CL I also remove the notion of a default value. Each
CorrectionProducer must indicate specifically how broadly it can be
applied.
This PR should functionally be a no-op; no applicability was increased
or reduced. I left comments intact. I left `TODO(applicability)`
comments where no comment is made to justify why a correction cannot
be made any more broadly than "only at specific location."
Change-Id: I3e3a12ee811b2b08f276ff755e7ff638f4fffabf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366740
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>