We include two pieces of data:
1. If the named type was raw, the instantated type.
2. If the type was not regular bounded, also the inverted type.
Bug: https://github.com/dart-lang/sdk/issues/47364
Change-Id: Idc8fce998f755e68bee0ada2caa715b59101cc84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215484
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This change standardizes most of the analyzer to refer to problem
messages and correction messages using the names `problemMessage` and
`correctionMessage` (consistent with the naming convention used in the
analyzer and CFE `messages.yaml` files).
Change-Id: I72f078a368c65b346626f560cc721fcff4836452
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215151
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
The vm-service sees alternating bursts of activity and idle periods. Before this change, the vm-service would often quickly reach the maximum new-space size; after it usually stays at the initial size.
TEST=--verbose-gc
Change-Id: I13e80a114e04ae91a837fbe9c8b1967ad5e8c4c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215141
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Add a GCReason for store buffer overflow instead of using a separate print.
This is a pure refactoring that doesn't change GC policy.
TEST=ci
Change-Id: Idcd95b0701a36f45ebaa02db2c2fac9a9081d7c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215102
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
As I was fixing up old references to "dartfmt", I noticed the resource
package is marked archived. It doesn't seem to be used anywhere in the
SDK, so can we remove it?
Change-Id: I9a2230c6f8c42c446e7d2576a8d26f8d06e0cfb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215157
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Change-Id: I0f47aa783625d01e3e632cde8a36e865bb85fd27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215481
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I1da2fc67dcfa1502b63b2cdbb7e460a86ac22967
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215159
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
AnalysisDriver.addFile() means: analyze this file when anything about
its dependenciea changes, e.g. it is a part of an open directory. But
generated files are not, we don't want to analyze *them* per se. But
they might affect added files, so we should call changeFile() instead.
Change-Id: I729119b3be077cbc99480ca66698d6b67425c79f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Michal Terepeta <michalt@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This change updates the classes Message, MessageCode, Template,
LocatedMessage, and FormattedMessage so that they uniformly refer to
error message text using the terminology `problemMessage` and to
correction suggestions using the terminology `correctionMessage`.
This brings them into alignment with the names we've decided to use to
unify the structure of front_end and analyzer, and makes them match
the names used in the anlayzer and front end's `messages.yaml` files.
Change-Id: Idcbb7ccfff6bb4e99ca22a3ef3c19d83880cf3c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215154
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
For errors that are shared between the front end and the analyzer, we
move the `documentation` and `comment` fields from
`pkg/analyzer/messages.yaml` to `pkg/front_end/messages.yaml` (where
the rest of the information about the error is). This eliminates the
need to have any entries at all for these shared errors in the
`pkg/analyzer/messages.yaml` file, so we no longer need the boolean
flag `copyFromCfe` in this file.
This simplifies generation of analyzer error codes, so we go ahead and
take this opportuntity to remove the old `syntactic_errors.g.dart`
file, and instead code generate all the shared messages directly into
`syntactic_errors.analyzer.g.dart`.
In a follow-up CL I'll rename `syntactic_errors.analyzer.g.dart` back
to `syntactic_errors.g.dart` to reduce confusion.
Change-Id: I1e314e51c94ef595d9d6de8ba2b30e12a18382a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215155
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This is an attempt to enable archiving of coredumps on the
"iso-stress" builder, since we're often unable to reproduce crashes from
that builder.
Issue https://github.com/dart-lang/sdk/issues/46823
TEST=Adds test infra.
Change-Id: I9b7276198db9a6c98a74f55d466bf832b03e24f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214407
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This moves all implementation code from Loader and TargetImplementation
down to the concrete subclasses, Dill/SourceLoader and Dill/KernelTarget,
respectively, and removes all unneeded code. Since TargetImplementation
is now only an interface, it replaces the role of its supertype Target.
Change-Id: I8a556ac5bc559432dbd19a6a48151469a2cb0238
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214020
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
`ConstantEvaluationEngine.evaluateConstructorCall` was ~350 lines long,
with a few short-circuit returns scattered in various for-loops, and
variables used >100 lines from where they were declared or written to.
Much of the code in ConstantEvaluationEngine was dedicated to evaluating
some special functions like `String.fromEnvironment`, etc.
Moving to a new class, _InstanceCreationEvaluator, allows us to move
several helper methods which were only used by that method, and several
static functions. I also split the method into several single-purpose
helper methods.
Improvements to const instance creation expression evaluation should
be more straightforward with this new code, with more single-purpose
methods.
* Move `checkFromEnvironmentArguments`, `checkSymbolArguments`,
`evaluateSuperConstructorCall`, `followConstantRedirectionChain`, and
`isValidPublicSymbol` to the new class.
* ConstantEvaluationEngine is reduced from 800 lines to 300 lines.
* Make `getConstRedirectedConstructor` and `_nullObject` static.
* Refactor `ConstantEvaluationEngine.runtimeTypeMatch` into an extension
on TypeSystem.
* Rename static strings and regexp to use lower_case.
* Use `var` where possible.
* Use single-quoted strings.
Change-Id: Ie28cb961d04c372836783ab2166b02d8ac67d149
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215158
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
- Adds tests for various types of constructors.
- Recognize when a constructor is const and mark the class symbol
accordingly.
Change-Id: I9ae7fc2837a6821b196f06a267603fd18c3e5075
Issue: https://github.com/dart-lang/sdk/issues/40273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208362
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This is follow-up to 56403a0d35.
Change-Id: I222c04fd4d41e272eeb3e8fd62c55035eee1c12c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215143
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This change adds debug prints for flaky crash in compiler which
only appears on bots.
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/47314
Change-Id: I6653df11612d24e8a8e67e3e177484a70e308dcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215152
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
In Dart 2.15, we're removing "dartfmt" in favor of "dart format", so I'm
going through and fixing all the dangling references to the old name.
TEST=Only changing tools
Change-Id: I83a5c00be925fdb536014a47dff2b488ed9f478b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215186
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
When running DAS from sources, so might be not exactly as when running
from the snapshot, currently we have following numbers:
Before reverting to allow available declarations:
{das-flutter-completion-start: {micros: 15030209}, das-flutter-completion-smallFile-body: {micros: 619210}, das-flutter-completion-smallFile-body-withoutPrefix: {micros: 484791}, das-flutter-completion-smallLibraryCycle-largeFile-smallBody: {micros: 2348386}, das-flutter-completion-mediumLibraryCycle-mediumFile-smallBody: {micros: 3701027}, das-flutter-completion-mediumLibraryCycle-mediumFile-api-parameterType: {micros: 3332297}}
Current 2021-09-30 master:
{das-flutter-completion-start: {micros: 15194069}, das-flutter-completion-smallFile-body: {micros: 22721}, das-flutter-completion-smallFile-body-withoutPrefix: {micros: 7796}, das-flutter-completion-smallLibraryCycle-largeFile-smallBody: {micros: 552269}, das-flutter-completion-mediumLibraryCycle-mediumFile-smallBody: {micros: 3076925}, das-flutter-completion-mediumLibraryCycle-mediumFile-api-parameterType: {micros: 3010509}}
Current 2021-10-01 master, with snapshot:
{das-flutter-completion-start: {micros: 6657503}, das-flutter-completion-smallFile-body: {micros: 20596}, das-flutter-completion-smallFile-body-withoutPrefix: {micros: 7073}, das-flutter-completion-smallLibraryCycle-largeFile-smallBody: {micros: 556415}, das-flutter-completion-mediumLibraryCycle-mediumFile-smallBody: {micros: 85024}, das-flutter-completion-mediumLibraryCycle-mediumFile-api-parameterType: {micros: 331850}}
Change-Id: I1d76f4f15d36e316b553ffc6cfaf24551c7f9bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215240
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Dart 2.15 won't contain it as a separate snapshot.
Change-Id: I8f356a4b9c88fd736f755d8f85b68f8e18f6ec78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215182
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Change the terms `template`/`tip` in the analyzer and front end's
`messages.yaml` files to `problemMessage`/`correctionMessage`.
Rationale: these terms were previously agreed on for unifying the
analyzer and front end, and they are currently used in the
`Diagnostic` class, which is part of the analyzer public API.
Change-Id: Ifaed92ab5176bba7b7f4c3bb915e9839520330f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215149
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Aims to automate the process of bumping a single dependency.
To bump pub_semver to the newest commit invoke as:
```
> dart tool/manage_deps.dart bump pub_semver
```
Change-Id: I16a3edabfb03adbd4460fb3cd81738a792e44d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213764
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
I've included both the YAML file (`messages.yaml`) and the script I
used to create it (`extract_errors_to_yaml.dart`), so that we can keep
the YAML file up to date until we finish writing logic that code
generates the analyzer errors from the YAML file.
Change-Id: Icbdcaf63a37105b666b11f7356e3fa246a8d65cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214133
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This fix is pretty simple; we have the inferred type available on [node], so we just need to create a new DartObject which uses that type.
Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: Ib53ff381b8c9c864f97eb2a4869d3798e028c30f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215003
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>