Commit Graph

74 Commits

Author SHA1 Message Date
Johnni Winther e7e07f73aa [cfe] Normalize repo dir
Uri.base, Platform.script and dart:io operations use the drive letter capitalization of the current working directory, but git, alas, does not. This normalizes the computeRepoDir to match that of Uri.base, thus avoiding spurious errors on Windows.

Change-Id: If4324874fa9b5c73c679c1b67a9481371ce8808d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421161
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2025-04-08 05:48:41 -07:00
Johnni Winther 06d938046f [kernel] Remove NonNullableByDefaultCompiledMode
and TargetFlags.soundNullSafety

TEST=existing

Change-Id: I5e28d3d187b0f84fa23130c042fd3c55b89c687c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413460
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-19 01:37:07 -07:00
Jens Johansen c075d939e0 [parser/scanner] Remove ScannerConfig enableNonNullable
Change-Id: If6bfbb65a02ac1a4f5708ab9e8c4d66c19ecff86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403984
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-13 00:32:35 -08:00
Jens Johansen 5dfce919cd [parser/scanner] Remove ScannerConfig enableExtensionMethods
Extension methods can no longer be disabled. This CL removes the option
from the scanner config and the parser related specific recovery.
It also removes any specific (triggered) test of the functionality.
A follow-up CL will do the same for NNBD.

Change-Id: Ia385008e5ed1333fb37697b8fe424b8759bce198
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403581
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-13 00:32:25 -08:00
Johnni Winther 72534f18fa [cfe] Remove library fasta.* names
Change-Id: I0a678e971395f70d09a3faf004e6476a9b5a48cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395000
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-11-14 07:32:21 +00:00
Johnni Winther 14097a1aba [cfe] Move suites from test/fasta/ to test/
Change-Id: Ida60cd9bc95c783df6e3a7819560b3836660c10f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394486
Reviewed-by: Jens Johansen <jensj@google.com>
2024-11-14 07:32:21 +00:00
Johnni Winther 717c52383b [cfe] Move test/fasta/ subfolders to test/
Change-Id: Ie65105f3d68e6545ccf2c4cde3b2523014083a40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394445
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-11-12 14:16:01 +00:00
Jens Johansen a9469269d7 [kernel] BinaryReader takes Uint8List, not List<int>
In AOT this makes reading faster:

Output from `out/ReleaseX64/dart pkg/front_end/tool/benchmarker.dart --iterations=10 --snapshot=pkg/front_end/test/kernel_binary_bench.aot.1 --snapshot=pkg/front_end/test/kernel_binary_bench.aot.2 --arguments="--warmups=10" --arguments="--iterations=5" --arguments="AstFromBinaryEager" --arguments="out/ReleaseX64/vm_platform_strong.dill"`:

```
msec task-clock:u: -8.6925% +/- 0.5737% (-167.09 +/- 11.03)
page-faults:u: 0.1410% +/- 0.0051% (243.00 +/- 8.71)
cycles:u: -10.2918% +/- 0.6161% (-732576747.50 +/- 43853449.16)
instructions:u: -14.4988% +/- 0.0004% (-1636799813.90 +/- 39902.18)
branch-misses:u: -3.4891% +/- 2.1142% (-1166085.00 +/- 706582.35)
seconds time elapsed: -8.7005% +/- 0.5634% (-0.17 +/- 0.01)
seconds user: -9.9752% +/- 1.5104% (-0.17 +/- 0.03)
```

Stats running manually (run as e.g. `out/ReleaseX64/dart-sdk/bin/dartaotruntime pkg/front_end/test/kernel_binary_bench.aot.1 --warmups=10 --iterations=5 AstFromBinaryEager out/ReleaseX64/vm_platform_strong.dill`):

```
AstFromBinaryEagerCold: -12.5174% +/- 3.10688%
AstFromBinaryEagerWarmup: -8.33675% +/- 2.62433%
AstFromBinaryEager: -10.3432% +/- 3.68375%
```

I don't expect there to be much of a change (if any) in JIT as the actual type was in practise always Uint8List anyway.

TEST=Existing tests.

Change-Id: I86b16ed207343848dee2e376f42598c223bbc48f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393740
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-11-08 08:23:42 +00:00
Jens Johansen 3dce89fbe0 [scanner] Don't give the Utf8 scanner a 0-terminated byte sequence
Not having to do the read-allocate-copy dance for files to add a 0-byte
at the end results in these changes when using the CFE to compile
(a fixed version of) the CFE:

```
msec task-clock:u: -1.7356% +/- 0.2164% (-73.16 +/- 9.12)
page-faults:u: -2.6957% +/- 0.0111% (-2914.83 +/- 12.00)
cycles:u: -1.7128% +/- 0.2223% (-297927979.70 +/- 38660477.01)
instructions:u: -1.6814% +/- 0.0002% (-361315766.86 +/- 36853.71)
branch-misses:u: -3.3289% +/- 0.9669% (-2153126.00 +/- 625370.97)
seconds time elapsed: -1.7372% +/- 0.2154% (-0.07 +/- 0.01)
seconds user: -1.5998% +/- 0.2740% (-0.06 +/- 0.01)
seconds sys: -4.1451% +/- 2.9801% (-0.01 +/- 0.01)
Scavenge(   new space) goes from 62 to 61
```

TEST=Existing test coverage.

Change-Id: I8e182bcee39839f6ed1e658c30c85c40ecf0b259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385722
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-25 08:33:48 +00:00
Jens Johansen 8767626437 [CFE] Remove rest of CompilerContext.current
Change-Id: Id81f06d80d43ac471b6278ef42a0270761b9d78c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374004
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-07-08 11:55:25 +00:00
Johnni Winther b48d4f224f [cfe] Cleanup imports
Change-Id: I60891b46119d6451810adf2846a05a66050bacd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373246
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-27 08:54:39 +00:00
Johnni Winther 543bc03de8 [cfe] Move /fasta/ content into /base/
These files should be further reorganized but that is for a
future CL.

Part of removing uses of 'fasta'.

Change-Id: I5010789b5901ba51c58d98fe26f13177b13c81b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373080
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-27 07:54:23 +00:00
Johnni Winther 8df57398c9 [cfe] Move src/fasta/ subfolders to src/
Part of removing uses of 'fasta'.

TEST=existing

Change-Id: Ice027678e11b7da8c1a7e756a1e1c8c8284722bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372623
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-06-25 10:05:21 +00:00
Johnni Winther 9a9b33eb0b [cfe] Use generateKernelInternal in expectation tests
Change-Id: I09026eb9cd11d2bcc136a4f7448038ae270df8a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357607
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-05-30 08:17:18 +00:00
Johnni Winther 6bec589f00 [cfe] Add least supported version check of 2.12
Change-Id: Iff8a3ea624b7130cb09359fbc9787a98ba07c4e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364700
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2024-05-08 09:28:45 +00:00
Johnni Winther 3c9d05f255 [cfe] Add symbolic language versions for testing
Change-Id: I0f8bb91d30fac442d781710b24908cd933d86388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365142
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-05-01 13:11:10 +00:00
Jens Johansen b6afc25769 [CFE] Replace line/column with * should also work when running with out/ReleaseX64/dart
Follow-up to https://dart-review.googlesource.com/c/sdk/+/347901 as it
didn't work when running the tests with out/ReleaseX64/dart.

Change-Id: I012d53217e87e087078de3fbff122dfca23b1e9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348261
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-26 10:06:00 +00:00
Johnni Winther e1233c3ccc [cfe] Replace line/column with *
The updates the expectation tests to use * instead of line/column number
for sdk messages.

Change-Id: I882abe6e3b1d88238d87a71d655ca9807869592c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347901
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-01-23 15:34:39 +00:00
Jens Johansen 9abc9fc4d7 [CFE] Strong/weak suites takes error-and-ok-comments into account
A line marked with "// error" should get an error (or it's an error),
and one marked with "// ok" should not get an error (and if it does it's
an error).

Some tests are left unhandled and are programatically ignored in this
first CL. A bug (https://github.com/dart-lang/sdk/issues/54635) has
been filed to sort those out.

Change-Id: I083f62829ceff6ff85121e21cfdb6670bfacb7e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346301
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-01-18 14:40:08 +00:00
Alexander Thomas 9394b30b77 Fix incorrect file reference in license headers
Bug: b/286184681
Change-Id: I903528c4adfbc576644aec7541903df6b9633e26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325523
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-09-18 06:44:08 +00:00
Johnni Winther 0c8ded72dc [cfe] Add FileUriConstantExpression
This adds FileUriConstantExpression, a subclass of ConstantExpression, to support correct file offset of annotations for augmentations and patches.
The FileUriExpression is used to carry the file uri of the expression
before constant evaluation.

TEST=general/patch_annotations

Change-Id: I0dc8a0cb97dd530fd1960785d38c2d5e4883c3dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311660
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-28 07:52:09 +00:00
Martin Kustermann bee46896d8 [cfe] Use Uint8List instead of List<int> for representing bytes
Seems to reduce instruction count by 4% (when using AOT-compiled
pkg/vm/bin/gen_kernel.dart to compile pkg/compiler/lib/src/dart2js.)

Change-Id: Ica88716bd9c06ea446258cd3eb4f26ca1890805b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311121
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-06-26 08:07:13 +00:00
Johnni Winther 82e3a751a9 [cfe] Remove unnecessary_null_comparison code
The frontend is now run with sound null safety so these are no longer needed.

TEST=existing

Change-Id: I6c1776845854695ff34e310a3bb5bc9d86715f06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307901
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-06-08 08:46:47 +00:00
Paul Berry fb12564ecb Upgrade pkg/front_end to language version 3.0
Change-Id: Id5987dfd9d6249c3a5bde57a92ace1f810f6aa60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305460
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2023-05-25 06:11:11 +00:00
Johnni Winther 1114d0c30f [cfe] Add expectation test for file offsets
In preparation for fixing https://github.com/dart-lang/sdk/issues/51812

Change-Id: I810be0a0330f0bf90fc1230b5a2d17f695d6e46b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292007
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-30 13:19:58 +00:00
Ahmed Ashour c3367ced2a [cfe] tests to handle Windows EOL
Bug #50938

Change-Id: I01aeaa83f3a1a1dd143379986821da35450732a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278510
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-18 22:12:27 +00:00
Lasse R.H. Nielsen 8a883fa54d Change : to = for default values in pkg.
Leaves some in parser test:
 pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart

TEST=Refactoring, covered by existing tests.

Change-Id: I7a83ef95df3cbd283878b3685b5c747bd89a1b16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256125
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-08-24 15:57:16 +00:00
Johnni Winther cf6f94567e [cfe] Define incremental properties
This adds [Value] and [Property] classes the helps defined the
properties of the yaml files used for incremental test declaratively.

This also serves as natural point for documented the properties.

Change-Id: Iaa04ffb23608e592b8f0401d3d0fe4bb8fac5066
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251549
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-07-18 15:55:14 +00:00
Johnni Winther 29d7be011e [cfe] Omit line/column from sdk constant coverage
This is done to avoid unnecessary dependency on sdk sources.

Change-Id: I5a72df4bb3a808a5a6398ae45ca587b43734314d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251264
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-07-13 06:52:14 +00:00
Chloe Stefantsova 95d8a5d41a [cfe] Remove Kernel round-trip text serialization
Change-Id: Ifdf0df0b93773f95eb1646a313c15e0a578b5a8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249181
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-06-21 10:28:24 +00:00
Johnni Winther 05bbe907d7 [cfe] Support extraneous references in serialization
This enables the serialization to handle references to libraries that
are not part of the serialized libraries. This is a step towards
removing the need to call computeCanonicalNames from outside the
serialization and to always use library filters for serialization
of a subset of the libraries in a component.

In response to b/235393918

TEST=existing

Change-Id: I48cd8b027795850ac2411a80e4b55efd517bb2cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248588
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-06-17 11:52:39 +00:00
Jens Johansen ac60f6b07e [CFE] Don't serialize platform in suite
This takes running the weak suite - on my machine - from

```
[ 07:14 | 100.0% | + 2268 | -    0 ]: weak/variance/unconstrained_inference

             check errors: 0:00:00.517818 ms
stress constant evaluator: 0:00:00.748959 ms
                    print: 0:00:01.357741 ms
                typeCheck: 0:00:09.610927 ms
                   verify: 0:00:17.063594 ms
       match expectations: 0:00:17.186629 ms
                  compile: 0:00:56.952218 ms
      transform component: 0:01:23.143726 ms
                      run: 0:02:24.114175 ms
              write .dill: 0:04:07.470467 ms


real    7m19.983s
user    10m43.053s
sys     1m29.653s
```

to

```
[ 03:07 | 100.0% | + 2268 | -    0 ]: weak/variance/unconstrained_inference

             check errors: 0:00:00.521563 ms
stress constant evaluator: 0:00:00.760032 ms
                    print: 0:00:01.358365 ms
              write .dill: 0:00:02.451508 ms
                typeCheck: 0:00:09.750399 ms
                   verify: 0:00:17.081690 ms
       match expectations: 0:00:17.723327 ms
                  compile: 0:00:55.593688 ms
                      run: 0:01:11.893074 ms
      transform component: 0:01:21.368430 ms


real    3m12.619s
user    4m20.531s
sys     0m41.589s
```

Change-Id: I9d235e84d10df06737789e8765f3b55521697e21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246961
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-06-02 16:58:24 +00:00
Jens Johansen b99901c433 [CFE] Speedup dill serialization after slowdown in 548bff1
548bff1 was meant to do less.
It actually turns out slower though:

Before 548bff1:
[ 07:52 | 100.0% | + 2252 | -    0 ]: weak/variance/unconstrained_inference

real    7m58.017s
user    11m15.944s
sys     2m42.890s

=> 209.5 ms per test.

After 548bff1:
[ 08:47 | 100.0% | + 2252 | -    0 ]: weak/variance/unconstrained_inference

real    8m53.362s
user    10m27.086s
sys     1m10.925s

=> 234.0 ms per test.

What it did was, that it introduced - I'm guessing this is the reason -
some non-monomorphism in the serialization code by having sinks of
different types.

Running
`time out/ReleaseX64/dart --enable-asserts pkg/front_end/test/fasta/weak_suite.dart --traceStepTiming -DupdateExpectations=false -DsemiFuzz=false`
(with code changed so it's three shards, running only the first one)

I get numbers like this for writing the dill file though:

Before 548bff1: 0:01:28.369107
 After 548bff1: 0:01:44.803383

(again this is for 1 out of 3 shards, but illustrates the point ---
serialization is slower).

This CL changes this to always serialize into the same sink (in memory),
then - if needed (as in the original CL) - write it to disk.
This gets (again with 1 out of 3 shards) writing the dill down to
0:01:21.872812, and the total run looks like this:

[ 07:18 | 100.0% | + 2252 | -    0 ]: weak/variance/unconstrained_inference

real    7m23.361s
user    10m48.069s
sys     1m30.336s

=> 194.4 ms per test.

(rebased run:

[ 07:13 | 100.0% | + 2254 | -    0 ]: weak/variance/unconstrained_inference

real    7m18.828s
user    10m44.163s
sys     1m31.777s

=> 192.1 ms per test.)

Change-Id: I2906807bbab407fb499aa910afd20f41347bc3c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245374
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-05-31 08:17:33 +00:00
Johnni Winther 548bff1d53 [cfe] Skip running tests with no/empty main
+ always serialize to dill, but only to disk when running the test.

Change-Id: If1500931ea951229fb2502defe9d0315ea5f1883
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245006
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-05-18 12:55:07 +00:00
Nate Bosch 33e174084a Replace Uri.scheme == with Uri.isScheme
Use `hasScheme` in place of comparing against the empty string, and
`isScheme` to compare against all other schemes.

TEST=No behavior changes.

Change-Id: Ifc9fd13c6cf37933ebd4a754c4b500dedbcb291b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231185
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-02-08 21:38:57 +00:00
Johnni Winther cb1f1b8102 [cfe] Migrate text serialization suite
Change-Id: Ib44e1c69f5e9aa0e17794b647c50b28fe4cf3d62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220741
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-11-18 12:07:26 +00:00
Jens Johansen 211ad9acb1 [CFE] Don't mark procedures as async when not using await
This CL removes async markers where await wasn't used.

In a few cases this also meant the ability to make the procedure not
return a future at all.

Also - at least on the VM with my benchmark run on my PC - returning
new Future.value(whatever) in a non-async procedure is faster than
returning whatever in an async procedure.

TEST=CI and existing tests.

Change-Id: I4ba888313c87de76bb0ca02c19eb1ab45f168a85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213480
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-17 11:56:29 +00:00
Johnni Winther 3eac19026b [cfe] Add annotate_overrides lint
Change-Id: I90a6d5c7d64ed23acd94b9a8dda58d53da4fe8df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212041
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-09-01 16:24:16 +00:00
Johnni Winther d6d5cb8a13 [cfe] Migrate tests (part 1 of ?)
Change-Id: Idce9122f5e6c797d409cf861ba6b24e6b62e8fe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212006
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-01 11:42:06 +00:00
Dmitry Stefantsov 3b98b1d5dc [cfe] Use 'packageConfig' instead of 'script' in an internal tool
Change-Id: Ibcad91ddbaeb5b466c09a55c2be31f2a705d895f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210461
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-08-20 09:40:44 +00:00
Jens Johansen 915d0f4601 [CFE] Single test for generated files up-to-date checking
Before this CL we had 2 tests:
* One for messages (not checked in presubmit)
* One for experimental features (checked in presubmit)

And had nothing for:
* direct parser ast helper
* parser test listener
* parser test parser

These are now replaced by a single tool that checks all five and is
run in presubmit.

Change-Id: I885f74cc26dd75722804366e1f8bfc4616ad03ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200187
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-21 07:11:36 +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 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
Jens Johansen 93f4ac0a83 [cfe] Actually have both ansi and plain text formatted messages (2nd try)
The CFEs FormattedMessage always had two getters to get the text inside
one that would supposedly give an ansi formated version of the message
and one that would supposedly give a plaintext formated version of the
message. They both returned the same string, though, which would either
be with ansi escape codes or plain text depending on the environment at
compile time.

This CL fixes that by having both messages, and letting the reporting
(i.e. whenever the message is read) decide which to use. That way we
can - for instance - report errors with color if the terminal supports
it correctly when reusing a dill (and reissuing problems, but where the
terminal support changes) and if printing the problem to an html <pre>
field (like observatory does).

It also cleans up two different implementations of whether we think
the terminal supports colors or not, by deleting one of them.

This is the second try. Patchset #1 is the original.
Patchset #2(and possibly beyond) is the changes.

TEST=Existing test suites.

Change-Id: I8e483049ce81ce1bd8e5396b588a31e0ad3a8630
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187402
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-26 13:06:17 +00:00
Jens Johansen 3a4a4f53d0 Revert "[cfe] Actually have both ansi and plain text formatted messages"
This reverts commit f63f7736c5.

Reason for revert: This somehow breaks the Windows bots. `python tools/test.py -n dartk-win-release-x64 standalone_2/io/process_shell_test`.

Original change's description:
> [cfe] Actually have both ansi and plain text formatted messages
>
> The CFEs FormattedMessage always had two getters to get the text inside
> one that would supposedly give an ansi formated version of the message
> and one that would supposedly give a plaintext formated version of the
> message. They both returned the same string, though, which would either
> be with ansi escape codes or plain text depending on the environment at
> compile time.
>
> This CL fixes that by having both messages, and letting the reporting
> (i.e. whenever the message is read) decide which to use. That way we
> can - for instance - report errors with color if the terminal supports
> it correctly when reusing a dill (and reissuing problems, but where the
> terminal support changes) and if printing the problem to an html <pre>
> field (like observatory does (1)).
>
> It also cleans up two different implementations of whether we think
> the terminal supports colors or not, by deleting one of them.
>
> (1) At least sometimes. It works - I think - only for 'evaluateInFrame',
>     but that's another story (and will be fixed in a follow-up CL).
>
> TEST=Existing test suites.
>
> Change-Id: Iedaedd9a5c41458d40c23ed4b706324c004ae943
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186291
> Commit-Queue: Jens Johansen <jensj@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

Change-Id: I0b53f943a61f76705badfead30d9e1ee35baff57
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-02-24 12:30:18 +00:00
Jens Johansen f63f7736c5 [cfe] Actually have both ansi and plain text formatted messages
The CFEs FormattedMessage always had two getters to get the text inside
one that would supposedly give an ansi formated version of the message
and one that would supposedly give a plaintext formated version of the
message. They both returned the same string, though, which would either
be with ansi escape codes or plain text depending on the environment at
compile time.

This CL fixes that by having both messages, and letting the reporting
(i.e. whenever the message is read) decide which to use. That way we
can - for instance - report errors with color if the terminal supports
it correctly when reusing a dill (and reissuing problems, but where the
terminal support changes) and if printing the problem to an html <pre>
field (like observatory does (1)).

It also cleans up two different implementations of whether we think
the terminal supports colors or not, by deleting one of them.

(1) At least sometimes. It works - I think - only for 'evaluateInFrame',
    but that's another story (and will be fixed in a follow-up CL).

TEST=Existing test suites.

Change-Id: Iedaedd9a5c41458d40c23ed4b706324c004ae943
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186291
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-24 10:33:45 +00:00
Jens Johansen e2b6208871 [CFE] Shard front-end try bots better
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>
2021-01-28 14:16:25 +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 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 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