Commit Graph

966 Commits

Author SHA1 Message Date
Dmitry Stefantsov 3eaeec5397 [cfe] Add Extensions to the parser in the CFE type tests
Change-Id: I796fcab752da42c77414170b661dfe5c42e30aec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196492
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-04-23 09:14:01 +00:00
Johnni Winther fdc765faad [cfe] Make TypeParameter.defaultType non-nullable
TEST=existing

Change-Id: I0a8fdf09f742b55357411f12dc6164d4050bb83c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196283
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-04-21 13:51:50 +00:00
Johnni Winther 3e44898e08 [kernel] Make FileUriNode.fileUri non-nullable
TEST=existing

Change-Id: I72583e500cb0b69d9352b040c3e2885f9e0450c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195681
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-04-19 08:03:30 +00:00
Dmitry Stefantsov 91aecfcd5f [cfe] Use i2b at the end of function call inference
Closes #45598.

Bug: https://github.com/dart-lang/sdk/issues/45598
Change-Id: I37430faf057e3559ad6aefaa59d83d8a14320c54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194764
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-04-15 10:33:27 +00:00
Johnni Winther 5f57456528 [cfe] Support experimental flags and language versions in message_suite.dart
Change-Id: I150a93834783219c73f9dc4961eb83a48a7ea7e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194067
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-04-07 11:31:07 +00:00
Johnni Winther 1eda15854d [cfe] Allow experiments only in current sdk version
Experiments that have not be enabled by default should only be allowed
in the current version of the sdk.

Closes #45460

Change-Id: I159f390ac85fe37943920717ce11a4c817d5b4a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193480
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-31 15:20:08 +00:00
Johnni Winther 13556d623f [cfe] Add DartType.toNonNull
Add helper on DartType to compute the `NonNull` of a type and use this
instead of `withDeclaredNullability(Nullability.nonNullable).

Includes a fix in the computation of NonNull of FutureOr.

TEST=existing

Change-Id: I3399cbf89c7d3f3e90f1315b01f40957e798a1b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-30 10:25:28 +00:00
Johnni Winther 57f18c6d38 [cfe] Add tests for issue 45376
These tests show that we handle >> and >>> similarly wrt to allowing
integer operations on double constants with integer values.

https://github.com/dart-lang/sdk/issues/45438 proposes to disallow these,
but that requires a new js evaluation strategy and the issue in 45376
is therefore just a consequence of the current approach.

Change-Id: I703b57d5a6562ff1c1410858b22a96655f59dc4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193406
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-30 10:25:08 +00:00
Jens Johansen 6fff4de306 [CFE] Properly clean-up expectations wrt optional phases for strong/weak tests
Before this CL we could for instance get this result:

```
$ out/ReleaseX64/dart --enable-asserts pkg/front_end/test/fasta/weak_suite.dart -DsemiFuzz=false -DskipVm=true -- weak/general/error_recovery/issue_39058.crash

[...]
1 failed:
weak/general/error_recovery/issue_39058.crash: Pass
```

The reason is, that before it onle rewrote the expectations if there was
exactly one expectation.
`weak/general/error_recovery/issue_39058.crash` for instance (currently)
has two expecations: RuntimeError and SemiFuzzFailure.

All combinations of `-DsemiFuz` and `-DskipVm=true` would thus keep both
of those expectations.

For the combination `-DsemiFuzz=false -DskipVm=true` it actually passes,
though, which doesn't match so it fails saying that the expectations
should be updated.

For any of the other expectations it would be fine because it would get
one of the expected outcomes:
* `-DsemiFuzz=true -DskipVm=true`: Fuzzing is enabled so it would get a
  SemiFuzzFailure which matches one of the expectations.
* `-DsemiFuzz=true -DskipVm=false`: Fuzzing is enabled so it would get a
  SemiFuzzFailure which matches one of the expectations.
* `-DsemiFuzz=false -DskipVm=false`): It doesn't skip the VM so it gets
  a RuntimeError which matches one of the expectations.

This CL fixes the issue by removing the "wrong" expectation(s), leaving
the correct one(s) and adding 'pass' of all other expectation(s) have
been removed.

Change-Id: I8137d16fdfeb322cb76d6af97cafc279222ae205
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192921
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-25 10:25:33 +00:00
Jens Johansen 22551d35c2 [CFE/dart2js] Don't set exit code to 1 in unit tests running analyzer
The testing system - sometimes (see http://dartbug.com/45408) - exits
and turns the bot purple when the exit-code from a test is (e.g.) 1.

This CL removes some instances of having an exit code of 1.

Change-Id: Ic831d151346a28dabe9180e80a8e462af227bf41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192381
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-23 08:36:56 +00:00
Jens Johansen 86e296f3ce [CFE] Make fuzz testing work also when not skipping VM
Also "roll up" fuzz errors/craches to pass if not fuzzing.

Change-Id: Ie044f0c014504f11939d4ce50971bf31930f1193
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192144
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-22 10:12:52 +00:00
Jens Johansen 20cfdeffe5 [CFE] Include .crash_dart in weak tests; better handling of erroneous -D parameters and expectationFileMismatchSerialized on -DupdateExpectations=true
Change-Id: I00da3e4cf8859c65a8d93600804c7dbc56ec0bca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192180
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-19 13:34:17 +00:00
Johnni Winther 03ac05b146 [kernel] Migrate package:kernel/text_serializer.dart
Change-Id: I0b084911fa4ba35593a70ba8c214e818dbf7c219
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190440
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-10 13:26:58 +00:00
Johnni Winther 2d63f26ef5 Reland "[cfe] Encode field references as @getters and @setters"
This removes the @fields and @=fields canonical name
encodings that allowed for encoding of conflicting members
and didn't support field<->getter/setter conversion
between dills or between outline and full dill.

TEST=existing tests+add aot expectation tests

Change-Id: I119b0c95f90e456356146cdc2d9241de4c1b4fff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186680
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-03-09 05:47:16 +00:00
Dmitry Stefantsov c191551fac [cfe] Remove BottomType
TEST=Covered by existing tests.

Change-Id: Ied8be1874164e68e0a3a48e1b2f9a33310071381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183009
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-24 13:21:55 +00:00
Johnni Winther 045a40d2e6 [cfe] Rename incremental_suite to incremental_dartino_suite
- to prepare for renaming incremental_load/initialize_from_dill to
  incremental

Change-Id: Ie47f8e46c90b61de0838a83dcc9a5be6d866aa19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185547
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-19 08:41:07 +00:00
Johnni Winther 667be21ae3 [cfe] Remove old sharding of suites.
Suites are now sharded through unit_test_suites.

Change-Id: Ifa810f9b7031d109ed85da012220cbea44c10245
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185541
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-19 08:41:07 +00:00
Johnni Winther cea1e14c68 [kernel] Make various AST fields non-nullable
Make Extension.name non-nullable
Make Class.name non-nullable
Make Extension.onType late non-nullable
Make LabeledStatement.body late non-nullable
Make SwitchCase.body late non-nullable

Change-Id: Iccf21fc800faa620c5d4b7bea68f74eec8bf62e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185083
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-18 17:52:27 +00:00
Johnni Winther 56f46b0659 Remove non-nullable experiment flag from front_end test cases.
This changes the CFE expectation test suites to use unsound null safety
as default to avoid passing --enable-experiments=no-non-nullable to opt
out old test folders.

This change removes most test folders from the 'strong' tester, since
this now only supports sound null safety, which requires all libraries
to be opted in. Instead, the 'weak' tester now runs all test folders.
Additionally the 'outline' tester is changed to use unsound null safety
so that it call be used on all test folders.

The 'fast_strong' tester is removed since it should just be run locally
and it can be run by passing an option to the other testers.

References to non-existing 'shaker' folder has been removed from
testing.json.


Change-Id: Ibcc306f7b27d06b9637c205238bc408194f1d062
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184787
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-18 12:29:18 +00:00
Jens Johansen f169abcee0 [CFE] Make standard filesystem more synchronous by default; add async versions
This CL:
 * Makes the standard filesystem more synchronous by default.
   This makes reading files for normal compiles faster.
 * Adds a more asynchronous version of `exists` and `readAsBytes`.
   This potentially allows for reading files faster when in a context
   where the files can actually be read in parallel. The client have
   to make the choise though.
 * Skips `Uri.base.resolveUri` when the uri has a scheme. This makes it
   slightly faster in my tests, but does not remove any `.` and `..`.
   Having those when having a scheme seems sort of weird though.
   If this turns out to be a problem we can add it back.
 * Re-orders what the standard filesystem checks in `exists` to assume files
   which seems more likely to happen. This - for files - means less checks
   and should make checking for existance faster. (This was noticed by Siggi).

Using the same measurement procedure as in
https://dart-review.googlesource.com/c/sdk/+/85442
timing how long fasta spends on *reading* files when compiling dart2js
(when compiling via the VM) I get a good speedup.

Note that the measurements are in microseconds:

Before this CL (run like `out/ReleaseX64/dart pkg/compiler/bin/dart2js.dart 2>&1 | grep "Read file (total)" | tail -n 1` 10 times):
Read file (total): 94678
Read file (total): 94232
Read file (total): 91726
Read file (total): 77472
Read file (total): 95582
Read file (total): 88113
Read file (total): 89245
Read file (total): 91575
Read file (total): 96291
Read file (total): 95730

With this CL (run like `out/ReleaseX64/dart pkg/compiler/bin/dart2js.dart 2>&1 | grep "Read file (total)" | tail -n 1` 10 times):
Read file (total): 68379
Read file (total): 69320
Read file (total): 72930
Read file (total): 69692
Read file (total): 68685
Read file (total): 73548
Read file (total): 64649
Read file (total): 71951
Read file (total): 73486
Read file (total): 70621

Difference at 95.0% confidence
        -21138.3 +/- 4193
        -23.111% +/- 4.5843%
        (Student's t, pooled s = 4462.56)


Furthermore, using an internal benchmark (discussed in an email thread)
I get these numbers (note that the measurements are in milliseconds):

before:
4453
4249
4187
4190
4216

after:
2310
2379
2449
2467
2407

Difference at 95.0% confidence
        -1856.6 +/- 131.443
        -43.5924% +/- 3.08625%
        (Student's t, pooled s = 90.1257)

Using the asynchronous versions of exists and readAsBytes and checking for
existance and reading in parallel on the same internal benchmark it gets to
1137
1185
1067
1089
1189


For completion, comparing to using "raw" `File` (again using the internal benchmark):

sequential standard
2377
2419
2485
2373
2431

sequential io_sync
2279
2182
2237
2312
2324

io_sync faster:
        -150.2 +/- 76.3122
        -6.21432% +/- 3.15731%
        (Student's t, pooled s = 52.3245)

sequential standardasync
4865
4915
4753
5185
4760

sequential io_async
4746
4834
4989
4840
4891

No difference proven at 95.0% confidence

parallel standard
2526
2563
2652
2616
2685

parallel io_sync
2335
2184
2244
2341
2401

io_async faster
Difference at 95.0% confidence
        -307.4 +/- 111.037
        -11.785% +/- 4.25691%
        (Student's t, pooled s = 76.1341)

parallel standardasync
1137
1185
1067
1089
1189

parallel io_async
1105
1088
1145
1048
1113

No difference proven at 95.0% confidence

TEST=Existing tests.

Change-Id: I8ba56ab0768df8672bcdb693782d3f1eec86b683
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185101
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-02-17 10:28:00 +00:00
Lasse R.H. Nielsen d352bc28b8 Remove (most) uses of the "non-nullable" experiment flag.
Since the flag is now enabled by default, there should be no mention of it.
There are still some uses in front_end/testcases that are not just removable
(it also uses `no-non-nullable`). There migth be more uses that are not
as easily found as grepping for `--enable-experiment

Removes two VM tests where fixing them meant they were just duplicating
the corresponding non *_2/ tests.
Fixes #44941

TEST= Large number of tests chaged.=(no-)?non-nullable`.

Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-12 17:16:54 +00:00
Johnni Winther ee0c0bcd57 Reland "[kernel] Ensure that visitors don't implicitly returns null"
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.

TEST=Refactoring

Change-Id: Ie8fa5d41b99850d9e4abb59634c72920c64128d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183691
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-10 07:51:52 +00:00
Johnni Winther b60e0aa5a1 Revert "[kernel] Ensure that visitors don't implicitly returns null"
This reverts commit ce81216885.

Reason for revert: Flutter dependency

Original change's description:
> [kernel] Ensure that visitors don't implicitly returns `null`
>
> This is in preparation to migrate package:kernel to null safety.
> For the visitor interfaces to support non-nullable return types, the
> implementations must avoid using `null` as return value in its base case.
>
> TEST=Refactoring
>
> Change-Id: Ie5e4153f8d3779d94957bb13b3d2d2a942040ff2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179760
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>

TBR=jensj@google.com,johnniwinther@google.com

Change-Id: I61b838d3371e6b1de2427716d056324c120be499
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183689
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-09 12:41:12 +00:00
Johnni Winther ce81216885 [kernel] Ensure that visitors don't implicitly returns null
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.

TEST=Refactoring

Change-Id: Ie5e4153f8d3779d94957bb13b3d2d2a942040ff2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179760
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-09 09:46:46 +00:00
Jens Johansen da4e3f4bbe [CFE] Textual outline requires ScannerConfiguration
The incremental compiler now passes the correct nnbd settings and
extension methods settings.

Change-Id: I89e6bad8af330c3c81f141c260b2325aca4a5bb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182630
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-08 12:10:27 +00:00
Dmitry Stefantsov 63737581f8 [cfe] Encourage the use of the const NeverType objects
TEST=Covered by existing test base.
Change-Id: Ie858bd5a765d71fa4095eab3373a6ecdb063b260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183006
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-08 10:36:40 +00:00
Jens Johansen 23a841c463 [CFE] Add a reordering fuzzing step to the strong unit tests
This CL:
* Adds a "reordering fuzzing step", i.e. it tries to sort the fields,
  procedures etc in both ascending order and descending order
  to verify that there are on crashes and no changes in error vs
  no error. This has been tested on http://dartbug.com/34803
  before the fix landed.
* Introduces an attempt at "visiting the outline" of the "direct from
  parser ast".

Change-Id: Ic3f5a776839030bb48a35eeee8575b37c19be453
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182504
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-08 10:00:10 +00:00
Johnni Winther 909c44cecf [cfe] Support dart2js and dartdevc targets in expectation tests
Change-Id: If087dfaf291f02812aa1191328a10ad2a5f135ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183007
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-08 08:30:20 +00:00
Sigmund Cherem 912005267d [web] rename suite dart2js -> web.
Change-Id: I46be49b2effec3e38a3dc44cd45cfe736f77fa78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182680
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-02-04 23:11:32 +00:00
Clement Skau 2236883ff2 [SDK] Removes non-exiting tests from .status
TEST=Tested all configurations.

Change-Id: Iec00d7e6ea56221ffebcf044de22647907f598f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182500
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-02-04 06:46:13 +00:00
Jens Johansen 30ae8e3d14 [CFE] Rename tests that require git; split unit_test_suites; filter tests better
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>
2021-01-28 07:46:10 +00:00
Jens Johansen 6e191c11e5 [CFE] Rename 'verifySkipPlatform' to 'skipPlatformVerification'
Follow-up to https://dart-review.googlesource.com/c/sdk/+/180562

Change-Id: I242da8dc94109008d33611067b62f5352d52f454
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180565
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-25 10:19:52 +00:00
Jens Johansen 97a0d79cd0 [CFE] Make strong tests verification skip platform
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>
2021-01-22 13:03:59 +00:00
Johnni Winther 8f2299304f [cfe] Run transform step in compiler context
Change-Id: I11a655639f18b55f2bb3cd6dc517093b8d3906a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180561
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-22 10:39:39 +00:00
Jens Johansen 8dd585c5b4 [CFE] Initial 'semi-fuzz' option in strong tests
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>
2021-01-22 10:26:58 +00:00
Johnni Winther 34fb48bb8a [kernel,front_end] Migrate first wave of pkg/kernel and pkg/front_end
Migrates libraries dependent only on already migrated libraries.

Change-Id: I0e85ee8dbc2afce031b92e0009e71c206a55af28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179502
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-01-18 15:40:21 +00:00
Johnni Winther cad04f8604 [cfe,dart2js,dartdev] Show null safety mode for dart compile
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>
2021-01-15 11:28:13 +00:00
Johnni Winther 990b03290f [cfe] Mention update_expectations.dart in failure log
Change-Id: I692e6aa8571c14817831b7c6a135b2cd6ef0ed2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178991
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-14 12:06:59 +00:00
Jens Johansen f7052cfbbc [parser] Better handling of eof when parsing 'Stream<List<>>'
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 #42229
Fixes #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>
2021-01-11 09:55:06 +00:00
Johnni Winther 60702d4158 [cfe] Make field assignability immutable
Changes fields to be either mutable or immutable by construction.
This ensure that we don't create setter references for fields that
cannot be assigned to and is a prerequisite for replacing @fields/
@fields= canonical names with @getters/@setters.

TEST=existing expectation tests and verification

Change-Id: I70b9a504ee6f221b7c334ac02620feb0d5f7ae01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176665
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-28 16:11:14 +00:00
Johnni Winther bc9f91587e [cfe] Support extensions by default in textual outline testing
Change-Id: I844aefe253041b755fa04c8467a8503715f232f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176442
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-17 17:57:43 +00:00
Jens Johansen c1d2c25ef1 [CFE] Add constant coverage in expect files
Change-Id: I0fc009708aa6e330366ad0689c4634a1df90d9c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175368
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-12-10 08:57:17 +00:00
Johnni Winther c19225224b [cfe] Handle lowered Map/Set/List constants in constant evaluation
Change-Id: Ib3b3a39478fe0927fc0168a9916684fd9ac09f77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175247
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-12-08 10:42:43 +00:00
Dmitry Stefantsov c0342665bf [cfe] Fix type schema environment test: account for demotion
Closes #44407.

Bug: https://github.com/dart-lang/sdk/issues/44407
Change-Id: If57910b953e67ed43b0281e33562164ad5049112
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175248
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-12-07 16:52:48 +00:00
Lasse R.H. Nielsen 6e29700e16 Update List constructor documentation, deprecate constructor.
Emphasize that the operation is going away,
and mark constructor as deprecated.

TEST= Refactoring+deprecation only, covered by existing tests.

Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-07 16:20:28 +00:00
Dmitry Stefantsov db28d82045 [cfe] Use type parser in type schema environment test for NNBD
Closes #44354.

Bug: https://github.com/dart-lang/sdk/issues/44354
Change-Id: I89b03f759912d5ced7501095d9a24cb3837d590c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175063
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-07 15:23:57 +00:00
Dmitry Stefantsov 26fb376bce [cfe] Use type parser in type schema environment test
Bug: https://github.com/dart-lang/sdk/issues/44354
Change-Id: I046ab5856668d3e5c3a69fc6b3bca961d980a8b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174927
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-07 15:23:57 +00:00
Johnni Winther f7ae22a4c1 Reland "[cfe] Improve encoding of set/list literals for unified collections"
Change-Id: I4f8098e110c9a5e5d6e102b8c6230e85c1575c6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175040
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-04 09:52:20 +00:00
Jens Johansen 321af0844e [CFE] Additions, changes and tests for direct from parser ast stuff
Change-Id: I7457585ddd338cdc6172fee030f93fa4f82ddf1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174642
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-12-02 11:39:17 +00:00
Jens Johansen deca91c86d [CFE] Record const constructor coverage when evaluating constants
This CL records which const constructors were evaluated
(i.e. contributes coverage) but doesn't actually
save the coverage into the dill file.

runtimes for constant evaluation:
dart2js: No difference proven at 95.0% confidence
flutter gallery: No difference proven at 95.0% confidence
big internal app: No difference proven at 95.0% confidence

sdk sizes:
vm: no change
dart2js: no change
flutter: no change

compile sizes:
dart2js: no change
flutter gallery: no change
big internal app: no change

Change-Id: I2567446c1b78180d73fd7613bc9e780e1a067f5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170435
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-01 09:20:14 +00:00