Commit graph

198 commits

Author SHA1 Message Date
asiva 24b6b94637 Migrate tests to not use the mockito package for testing.
Change-Id: Id927ef41e528d5c11776ab66b29e1e9670a528af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260001
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-09-22 16:54:49 +00:00
Johnni Winther 3640b60c8c [frontend_server] Migrate frontend_server_starter
Change-Id: Ic68ba05b920c18cc6d13c5141b71f6c4cb6eca84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259580
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-09-16 08:06:49 +00:00
Johnni Winther 8ab14dc7a8 [frontend_server] Migrate most of the rest of frontend_server to null safety
Bug:https://github.com/dart-lang/sdk/issues/49212

Based on https://dart-review.googlesource.com/c/sdk/+/253301

Change-Id: I248846c30f1ce30de415c8a0722b680add83b9a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258922
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-09-15 08:25:13 +00:00
Gary Roumanis 75f4e3cfdf [Frontend Server] Handle Nullable Options
Closes https://github.com/dart-lang/sdk/pull/49828

GitOrigin-RevId: 4b77259cfc2e5d640fa0f1111482c918a7af67c3
Change-Id: I2a895a6914d5c3b317d635f5d3f6437220d6650b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256430
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Gary Roumanis <grouma@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-08-30 13:58:47 +00:00
Anna Gringauze 6c548cedc2 Make module names and uris match source map relative paths
- Make previous behavior non-conditional
  (already default and flag uses are removed)

- Use relative  paths instead of package uris as module names
  under --debugging-module-names flag, false by default.
  (used as server paths in the browser, need to match relative
   paths in source maps)

- Pass packageConfig to Javascript bundle API

- Add tests

Closes: https://github.com/dart-lang/sdk/issues/49667
Change-Id: I57c2e2629ba5dd756cce9a8ec6ae891fb092e1d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255826
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-08-29 17:41:36 +00:00
Alexander Aprelev 0e9b056f39 [vm/resident_frontend_server] Use File.create(exclusive:true) instead of links.
This makes resident frontend server more Windows-friendly, uses recently introduced api to ensure only one file creator succeeds.

Fixes https://github.com/dart-lang/sdk/issues/49706
TEST=ci

Change-Id: I520487f4f198cc2b2e9d656dca85607889723ef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256543
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-08-26 21:09:11 +00:00
Gary Roumanis c5a5bb8887 [Frontend Server] Redirect Option
Closes https://github.com/dart-lang/sdk/pull/49820

GitOrigin-RevId: 3a0fbd74e57f918e3b63cae746cccc88f4e2d1a4
Change-Id: Ie311a15dbee82ea2f76bdcebb5a009d1f79b835a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256423
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Gary Roumanis <grouma@google.com>
2022-08-26 16:22: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
Michael Richards 89528710ac [frontend_server] These changes ensure that only 1 resident_frontend_server is running when multiple entities request to start the compilation server. Only 1 server is allowed to exist per server information file. Multiple resident_frontend_servers may exist if the user passes in different files each time a server is spawned.
Change-Id: I5cd0eceb391f6a289318c17e74069b63ff37126c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254800
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Michael Richards <msrichards@google.com>
2022-08-16 20:44:42 +00:00
Johnni Winther b928fd3083 [frontend_server] Add FrontendServer wrapper in test
This adds a FrontendServer class that wraps steam communication,
reducing the amount of boilerplate code needed to write frontend
server tests.

Change-Id: I9ff0fe6e04a83503e00eea9fc764231e50d6207a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253666
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-08-15 06:57:46 +00:00
Johnni Winther 1662441541 [cfe] Enable alternative-invalidation-strategy by default
Change-Id: If9f08f883318a5f0487beaa0f7dbd73366ed5074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251107
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-08-10 14:57:18 +00:00
Johnni Winther c3313e85e1 [frontend_server] Add support for advanced invalidation
Update the JavaScript bundler to maintain the state necessary for
the alternative invalidation strategy. This will provide the
javascript compiler with a single library component, so this must
handle re-combining this library with any SCC as well as keeping
the old summaries around.

Revived from https://dart-review.googlesource.com/c/sdk/+/196840

Change-Id: I1dd59d813172ac68ffcb189fcf3904c844828773
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251960
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2022-08-09 00:02:31 +00:00
Michael Richards df87c7819e [frontend_server] This adds a more complete set of compiler options to the resident frontend server, allowing for AOT compilations and more options when used by the run cli command. This also adds the ability for the resident frontend server to shut itself down after a period of inactivity.
Change-Id: I1ac52c0bb7186e840c0af5aa48da42868bb41958
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253640
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Michael Richards <msrichards@google.com>
2022-08-08 16:24:20 +00:00
Johnni Winther 85fea8ff86 [frontend_server] Add test for in-body change
This adds a DDC frontend server test that shows DDC doesn't currently
support advanced invalidation.

Change-Id: Ie6176bc4fa9d91262c0a6e0a30a1fccee96023be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252424
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2022-08-04 07:10:26 +00:00
Michael Richards 1cd8b28cfe [frontend_server] This adds the ability for the frontend server to be a resident process, allowing it to live through invocations of the Dart CLI. This allows the CLI to utilize the frontend's incremental compilation mode and keep cached kernel files for better performance. This currently only supports VM targets.
When launched as a snapshot, the initial compile is slower than the existing pub approach because of a process start time of around 500 ms. When launched as a compiled executable, initial compile times are the same as the existing pub approach. Once launched, experimental results show times to produce a kernel file of at worst 1.5-2x faster than pub's solution and at best 10x faster than pub's solution. The typical workflow of making changes and recompiling results in an average of a 5x speedup with respect to pub's implementation.

Because compiler instances use a lot of memory, there is a limit on the number of active compilers that the resident server will keep alive, and will actively bring instances down when this limit is exceeded. If the user was previously compiling a given project during the lifespan of a ResidentFrontendServer and its compiler is taken down between requests, a new compiler instance will be allocated for the request. Performance is still between 1.5x-5x faster for this case when compared to pub's compile times.

Change-Id: If9ee1ecc71d660d34faf23381c764dc11d6a5902
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252001
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Michael Richards <msrichards@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-08-02 18:08:21 +00:00
Srujan Gaddam 61abaeda3f [CFE/web] Move static interop erasure and remove outline stubber
Deletes the outline stubber as it's not necessary on any backend.
DDC should compile the entire sources and outline dill in one step.
dart2wasm operates similarly, and so only needs the modular transformer.
dart2js moves the erasure to a global transform.

Also, this CL reverts now unnecessary plumbing that was needed for the
outline stubber.

Change-Id: Ic085c4fad5a6bdfc7d6916f7fa575c6ef9b20110
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253000
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-08-01 18:17:44 +00:00
Anis Alibegić 40e18905f2 Fixed various typos in a lot of files
Closes https://github.com/dart-lang/sdk/pull/49478

TEST=Manual

GitOrigin-RevId: f4c9c6869dfe73639295e86574a021523b3d374d
Change-Id: I134a97caed4eec59d70e9cbca16b7e9a472cf2c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251902
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-07-25 12:21:59 +00:00
Alexander Markov 94c120a6ea [vm] Cleanup old async/async*/sync* implementation from kernel
This change removes kernel transformation which was used to
desugar async/async*/sync* functions in the old implementation of
async/async*/sync*.

The useful part of the transformation is retained in
pkg/vm/lib/transformations/for_in_lowering.dart.

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: Ic70c1fb35162a31bcc22eac3a8f6488b61e945b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249944
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-07-11 18:12:41 +00:00
Devon Carew d60cf4938e [pkg/frontend_server] analyze using package:lints
Change-Id: I8890c6afc14e63c32c3f1a3cf8c082251dd1eda2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250774
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-07-07 20:52:16 +00:00
Srujan Gaddam b372fd4c52 [CFE/pkg:js] Find reference of stub if it already exists
Fixes #49301

From https://github.com/dart-lang/sdk/issues/49301#issuecomment-1165536192

Adds referenceFromIndex to outline transformations so that the eraser
can use it to find the reference for the stub if it was already created.
This is needed when the module where the stub exists is invalidated.
Since references in other modules should still be valid, we should
attempt to get that reference.

Change-Id: I5905a002480444aecd57de650cd439bdc34d4eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249729
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-06-28 18:36:02 +00:00
Jens Johansen b4e2012f5b [CFE] Remove support for .packages file
This CL:
* Removed the redirect from .packages to .dart_tool/package_config.json
  (whenever such a file existed).
* Removes support for the old format entirely.
* Updates all tests etc that were found.

Fixes https://github.com/dart-lang/sdk/issues/48939

TEST=Existing tests updated.

Change-Id: Iccf711c455ac1885189aa773ca74dd8f55012964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248603
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-06-24 08:20:39 +00:00
Srujan Gaddam 459d57c8b8 [package:js] Add static interop stub for outlines
Fixes b/235393918

@staticInterop replaces factories with a new named node, a static
method. In order to persist this transformation in modular
compilation, this needs to be done to outlines that can then be
consumed by the source library. In order to allow erasure at the
time of 'performOutlineTransformations', coreTypes is added to that
API.

Change-Id: I90d17fff8bbe143982fcd12cfb06dc3e8d58781a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247928
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-06-17 19:58:49 +00:00
Konstantin Shcheglov ba4b3d20d2 Import dart:typed_data instead of deprecated re-export from dart:io
Bug: https://github.com/dart-lang/sdk/issues/23067
Change-Id: I6bfe7afabe344bb0de690f762b5f80604809021e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248344
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2022-06-14 06:29:37 +00:00
Ahmed Ashour 8bb3a10e40 Fix typos
Fixes #49228

TEST=ci

Change-Id: Idcc625554bcf07807bae9791ea37b73ae9394b87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247960
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-10 15:48:54 +00:00
Jake Macdonald b878294e06 Migrate parts of package:frontend_server to null safety.
This is a re-land of https://dart-review.googlesource.com/c/sdk/+/247601 with some additional changes to allow for certain null uris in some previously migrated package:front_end code.

Note that nulls were flowing through these apis already, this just acknowledges that fact :).

Bug: https://github.com/dart-lang/sdk/issues/49212
Change-Id: I4528bfdec1bc9114715afd3fea06d1249054d2a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247765
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-06-10 14:56:45 +00:00
Jake Macdonald d7accf27b8 Revert "migrate package:frontend_server/compute_kernel.dart to null safety"
This reverts commit 4894ae493f.

Reason for revert: Breaks google3

Original change's description:
> migrate package:frontend_server/compute_kernel.dart to null safety
>
> unblocks https://github.com/dart-lang/language/issues/2274
>
> Bug: https://github.com/dart-lang/sdk/issues/49212
> Change-Id: I8d6b055dbc00dadce5efee57692ee1f21e8fde77
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247601
> Commit-Queue: Jake Macdonald <jakemac@google.com>
> Auto-Submit: Jake Macdonald <jakemac@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

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

Change-Id: I824374df31721fe60a08195b90f545e28460a982
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/49212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247760
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2022-06-09 16:24:03 +00:00
Jake Macdonald 4894ae493f migrate package:frontend_server/compute_kernel.dart to null safety
unblocks https://github.com/dart-lang/language/issues/2274

Bug: https://github.com/dart-lang/sdk/issues/49212
Change-Id: I8d6b055dbc00dadce5efee57692ee1f21e8fde77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247601
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-06-09 15:38:37 +00:00
Alexander Markov 3e0abdbb98 Reland "[vm] Enable new implementation of async/async* in JIT mode"
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: I5b8720b8ef5b8d28773d26c7e94c2e78d876c9d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247603
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-06-09 15:24:13 +00:00
Alexander Markov 3e10d8c833 Revert "[vm] Enable new implementation of async/async* in JIT mode"
This reverts commit b3544c44dc.

Reason for revert: avoid incompatibility between Dart->kernel compiler
and Dart VM during Dart and Flutter rolls (b/234850964).

TEST=ci

Original change's description:
> [vm] Enable new implementation of async/async* in JIT mode
>
> TEST=ci
>
> Issue: https://github.com/dart-lang/sdk/issues/48378
> Change-Id: I0fc069508cb1ce5648deb6604171dfdcd5bcb5c8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246082
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>

TBR=vegorov@google.com,kustermann@google.com,rmacnak@google.com,alexmarkov@google.com,johnniwinther@google.com

Change-Id: I6157623857dbfa9bb07eb1f620d100f5b24314d9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/48378
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247243
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-06-07 17:57:30 +00:00
Alexander Markov b3544c44dc [vm] Enable new implementation of async/async* in JIT mode
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: I0fc069508cb1ce5648deb6604171dfdcd5bcb5c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246082
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-06-02 23:40:15 +00:00
Devon Carew f7c46f145c [pkg] prefer 'any' deps for package dev dependencies
Tested: CI validation
Change-Id: If65cc156130a65ffe00c6f1660ac320e2921afae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246053
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-05-27 01:34:59 +00:00
Johnni Winther f0f1629e20 [frontend_server] Support --verbosity argument
Adds support for the --verbosity argument in the frontend server to
control the printing level.

Closes #44867

Change-Id: I0f4e535c2e30e4d34cb8bc1d3fb4ac21d4009834
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245161
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-05-18 11:48:57 +00:00
Jens Johansen 787f83acab [frontend_server] Fix flutter frontend_try
The test compiles tests from a flutter checkout, finding the packages
to find tests in, by finding .packages files. Now .packages files are
no longer generated and it doesn't find any packages and thus no tests.
This CL fixes this by instead looking for the new file.

Cq-Include-Trybots: luci.dart.try:flutter-frontend-try

Change-Id: I965435ae031c9f4887159fda1933b2ba0f9392b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245001
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-05-17 09:00:56 +00:00
Nate Bosch 6ebd2633cd Use any deps for all unpublished packages
It should not be necessary to ever run `pub get` for a package which is
not published. All packages used in the SDK are controlled by a single
package config, so it's not necessary to declare versions or paths for
any packages.

Remove all dependency overrides.

R=devoncarew@google.com

Change-Id: Icb328813b471f35ee4c99995f4e90aac4d8ed438
Tested: Covered by existing static analysis.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244767
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2022-05-17 01:22:25 +00:00
Alexander Markov c4c9dc5994 [vm] Enable new implementation of async/await in AOT mode
The new implementation results in a much smaller overhead of
async/await on AOT snapshot size. The savings depend on
how often async/await is used.

On a large Flutter app (customer: money)
AOT snapshot size -13.7% (arm64), -12.86% (arm)

Another large Flutter app
AOT snapshot size -8.69% (arm64).

Part 1 (kernel): https://dart-review.googlesource.com/c/sdk/+/241842
Part 2 (vm): https://dart-review.googlesource.com/c/sdk/+/242000

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: Idf99bb98725a1ffb21a15b111f03f5461ed2c9d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242384
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-04-29 01:03:50 +00:00
Konstantin Shcheglov 86a9491759 Set 'includeSources' to 'true' so that stack traces include line / column.
Change-Id: I0db127e55e95a8535bc853ba9b0a45451a151e2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242381
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-26 16:02:23 +00:00
Alexander Markov 2afc34112c [vm,kernel] New async/await implementation in the VM, part 1 - kernel
This change includes kernel-related changes:

* --compact-async option is added to kernel compilers (front-end
  server and gen_kernel). This option disables desugaring of async
  and await on kernel AST. Note that 'await for' is still desugared.

* File offset of the 'await' is now written for AwaitExpression nodes
  in the kernel binaries (will be used for async stack traces).

* Async/async*/sync* functions and AwaitExpression nodes are supported
  in TFA.

Design doc: go/compact-async-await.

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: I4233086b7434bc48347f4220645b0be5f9133456
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241842
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-04-21 15:11:08 +00:00
Jake Macdonald 49f10b2ab8 fix a few issues discovered while implementing the observable example
Change-Id: Ic4c88ab446b682170489289799c63a9d57f8b700
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241802
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-04-20 21:28:58 +00:00
Konstantin Shcheglov 46bc05240d Require '@dart = 2.15' for binary_protocol.dart
Otherwise it fails internally, because the package is not null safe
in google3, and cannot be made because it has dependencies
(compiler and dev_compiler) that are not null safe. But the binary
protocol only talks to null safe code, so can be upgraded to the
newer language version.

Bug: https://buganizer.corp.google.com/issues/229124206
Change-Id: I215799de7d40a673c4c11d4d3a9e1c936b979df0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241143
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-13 20:51:33 +00:00
Konstantin Shcheglov cf99e4af47 Add --binary-protocol-address to frontend_server/.
I plan using this protocol for compiling macros in the analyzer.

Change-Id: Ic0187ac053d7a99125fa21ee1f9ae1a858717280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241043
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-13 18:39:14 +00:00
Jake Macdonald 1f543bcedf Refactor how actual executor instances are created.
- removes the `loadMacro` api entirely
- adds new apis to MultiMacroExecutor
  - registerExecutorFactory
  - unregisterExecutorFactory
  - libraryIsRegistered
- Removes the MacroClassIdentifier, instantiateMacro takes a library uri and class name
- Drop precompiledMacroUris from CompilerOptions, only have a macroExecutor now

Change-Id: Ic33933b34dbfd637da3d841ff496582f688dcd87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239466
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2022-04-05 19:25:13 +00:00
Jake Macdonald ef413b95e0 add a socket communication option for the process executor
Change-Id: I0bf2ca9c8737ec0e0035e1e8e42a5e3aa3ea813c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239581
Reviewed-by: Jens Johansen <jensj@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2022-03-31 16:35:05 +00:00
Johnni Winther e47df63488 [cfe] Refactor experimental flags
Adds GlobalFeature(s) and LibraryFeature(s) to provide more direct
and consistent access to features and their state.

TEST=existing

Change-Id: Iceb29e4fafa471e6790f2ce3c2a7108c8ae2c9a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239660
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-31 16:22:16 +00:00
Konstantin Shcheglov cb726901f7 Set language to 2.15 for frontend_server, opt-out all existing files.
I will add new functionality (binary protocol for macro compilation),
and would like to use modern language version.

Change-Id: I2fc0dc57b64b41669e76a81dff76b0eac93808e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239621
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-31 14:14:55 +00:00
Johnni Winther 51c2f8878f [cfe] Refactor IdentifierImpl
This moves macro implementation into its own subfolder and refactors
the IdentifierImpl implementation to be split into identifier based on
TypeDeclarationBuidler, TypeBuilder, MemberBuilder and
FormalParameterBuilder.

As part of the refactoring, the resolveTypeAnnotation implementation was
rewritten to use DartType instead of TypeBuilder.

Change-Id: Ie59160f4252627849606169b0210aaa83a27d60c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236880
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-15 09:11:19 +00:00
Jake Macdonald 54e773f205 Add support for passing in precompiled macros to the computeKernel entrypoint.
This is used by the modular compilers, so it unblocks more "real" blaze integration, and allows the language repo to create examples that you can actually run.

Note that this also actually enables macros when the experiment flag is passed in to this entrypoint.

Change-Id: Ia5ce82621a63363a17d16599fead5124ddf65faf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2022-03-14 17:57:48 +00:00
Alexander Thomas 30beab0f43 [infra] Add OWNERS to the Dart SDK
* Add team "groups" in tools/OWNERS_<group name>.
* Add top-level OWNERS as a fallback.
* Add OWNERS for all top-level directories.
* Add OWNERS to all packages.

For additional background information see go/dart-sdk-owners.

TEST=No op until code-owners is enabled.
Bug: b/200915407
Change-Id: I7fe6116cc599c749cd50ca16151d6d6a801d99d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229147
Reviewed-by: Jonas Termansen <sortie@google.com>
2022-02-14 14:06:34 +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
Alexander Markov 129304e09b [vm, cfe] Add an option to include extra source files into kernel compilation
This change adds --source option to kernel compilers (front-end server
and gen_kernel). This option instructs compiler to include extra source
files into compilation even if they are not referenced from main
library.

TEST=Added test cases to pkg/frontend_server/test/frontend_server_test.dart
and pkg/vm/test/kernel_front_end_test.dart

Fixes https://github.com/dart-lang/sdk/issues/48144

Change-Id: If3d71538751e9ccfa8c82a5685d810cf811e021c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231334
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-02-04 15:23:39 +00:00
Jens Johansen adb1dc9380 [VM] [CFE]: Make VM send over type information for expression compilation
Missing:
* Function types.
* Type variables in bounds, like "method<T, S extends T>() {}" and
  "method<T extends Foo<T>>() {}"

This is in many ways a follow-up to
https://dart-review.googlesource.com/c/sdk/+/212286

TEST=service and (cfe) expression suite tests added.

Change-Id: I20472b59ed73e9845f073e176d73b2c213f9407a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215760
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-01-28 07:49:21 +00:00