Commit graph

185 commits

Author SHA1 Message Date
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
Johnni Winther 8510f27d37 [cfe] Change encoding of supported dart: libraries
This CL changes the way dart: libraries are considered supported when
used in conditional imports or bool.fromEnvironment constant using
the "dart.library.*" values.

Library nodes now has an isUnsupported flag which is set according to
the "supported" property in the libraries specification. Furthermore
the Target now supplies a DartLibrarySupport interface that allows
targets to override whether dart: libraries are unsupported.

This allows the JIT/AOT to use the same platform file but still
consider dart:mirrors unsupported in AOT mode, and dart2js to consider
the internal library `dart:_dart2js_runtime_metrics` supported.

Furthermore, the internal handling is changed so that condition imports
and bool.fromEnvironments constants are computed through the same logic
for "dart.library.*" values, avoiding the need for passing these values
through the environment.

TEST=pkg/front_end/testcases/general/supported_libraries/main

Closes https://github.com/dart-lang/sdk/issues/48057
Closes https://github.com/dart-lang/sdk/issues/47814
Closes https://github.com/dart-lang/sdk/issues/47243
Closes https://github.com/dart-lang/sdk/issues/32657
Closes https://github.com/dart-lang/sdk/issues/36460

Change-Id: Ie8f8dff99167de64ced51b71d89918bf0f3bbd13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227020
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-01-11 14:52:38 +00:00
Alexander Markov e698500693 [vm/aot/tfa] Use RTA to improve AOT compilation speed
This change introduces Rapid Type Analysis (RTA) and uses it to
calculate initial set of allocated classes for Type Flow Analysis (TFA).
As a result, TFA converges much faster and AOT compilation time
improves.

RTA is less precise than TFA, so the set of allocated classes is
larger compared to the one calculated by TFA. However, it has only
marginal effect on the size of resulting AOT snapshots.

Time of AOT compilation step 2 on a large Flutter application
118.652s -> 59.907s (-49.5% / improved by a factor of 1.98x)
Snapshot size on armv8: -0.13%

Flutter gallery snapshot size in release and release-sizeopt modes
armv7 +0.19%, armv8 +0.2%

Just in case, RTA can be disabled using --no-rta option.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/42442
Issue: b/154155290

Change-Id: Iffbdabe7d486cad2e138f7592bffcb70474ddc34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222500
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-12-10 15:00:51 +00:00
Johnni Winther 39533c285b [cfe] Pass tracked dill libraries through incremental compiler result
This avoids have tracked dill libraries as part of the incremental
compiler state, and avoids the need for public mutable state on the
incremental compiler.

Change-Id: Ia61f22499f619d7ead4eed23d3d1eb24b8caec9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221464
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-11-30 11:07:34 +00:00
Joshua Litt 4f6d813c3c [dart2js] Add '--no-summary' to compute_kernel.
Change-Id: Ie3493137794c95f5061ed7d2918568127c5e15ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221220
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-11-25 23:39:24 +00:00
Johnni Winther 87c953bd0c [cfe] Pass class hierarchy and core types through IncrementalCompilerResult
TEST=existing

Change-Id: I78a61147998a630d88997e0cebccb3e815592822
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221088
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-11-25 11:27:29 +00:00
Johnni Winther e92e60da78 [cfe] Change computeDelta to return a result object
This prepares for returning more that just the component from an
incremental compilation.

TEST=existing

Change-Id: I3ee269083290097f1a92d77d105b607a6a02f1f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221086
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-11-25 10:15:07 +00:00
Joshua Litt 3d1f6a48b7 [dart2js] Add dart2js target to build summaries.
Change-Id: I1ef0b3f87124333e44cb15001c556b1767ddf28f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219841
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-11-18 00:58:40 +00:00
Jens Johansen 363c71c9c1 [frontend_server] Add option to skip invalidation of files when initializing from dill
This CL adds a flag, `assume-initialize-from-dill-up-to-date`, to the
`frontend_server` which will skip the check and potential invalidation
of files from the dill we're initializing from.
Normally the sources included in the dill is used to figure out what
files that was used to produce the dill has changed and thus needs to
be invalidated after we've initialized from it. If we didn't do that
we'd be in a bad state where some changes would not be discovered.
In some circumstances, though, we might know that the sources haven't
changed and the check is thus not needed. This could for instance be
if we're initializing from a dill that was just build by another build
system.

Change-Id: Id8244125fd79465be89ac81d603cd624339fbc0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219040
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-11-03 08:58:43 +00:00
Kevin Moore 632f3428f3 Update dependencies in unpublished packages
TEST=No SDK affect. Just helping our outdated package tracking

Change-Id: I0d392694e9eb926f60667508b55094ffa208db18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218381
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2021-10-28 15:46:08 +00:00
Sigmund Cherem 38b5a841de [dart-web] Remove dart:web_sql library.
The WebSQL standard was abandoned more than 10 years ago and is not
supported by many browsers.

The `dart:web_sql` library was marked as deprecated in Dart 2.14. This
CL makes the library inaccesible, removes support for `dart:web_sql` imports,
and removes the `Window.openDatabase` API. The old code for `dart:web_sql` is
still generated by the html generators. Removing that will be handled by a
separate change.

Closes https://github.com/dart-lang/sdk/issues/46316

Change-Id: I892107396b3b227b4f33344377585aa5e5328288
Bug: https://github.com/dart-lang/sdk/issues/46316
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216080
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-10-19 01:00:08 +00:00
Nicholas Shahan 6c4593929f Reland "[ddc] Add web library environment variables"
This is a reland of fb36bba5f2 with
a fix to the ordering to ensure all the expectations run.

Original change's description:
> [ddc] Add web library environment variables
>
> Ensure frontend server builds for the `DevCompilerTarget` add the
> environment variables needed for `bool.fromEnvironment()` calls for
> conditional imports.
>
> Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
> Fixes: https://github.com/dart-lang/sdk/issues/47207
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

Change-Id: Id88aeaf0ddc783936d413c06099df031bc7cb0a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214224
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-09-22 23:47:40 +00:00
Nicholas Shahan d0e013b49a Revert "[ddc] Add web library environment variables"
This reverts commit fb36bba5f2.

Reason for revert: New test fails on windows configurations.

Original change's description:
> [ddc] Add web library environment variables
>
> Ensure frontend server builds for the `DevCompilerTarget` add the
> environment variables needed for `bool.fromEnvironment()` calls for
> conditional imports.
>
> Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
> Fixes: https://github.com/dart-lang/sdk/issues/47207
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=johnniwinther@google.com,nshahan@google.com,annagrin@google.com

Change-Id: Iedfc4c1a5b24b515646d4f1b486bcb2f19bb7783
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214222
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-09-22 21:33:26 +00:00
Nicholas Shahan fb36bba5f2 [ddc] Add web library environment variables
Ensure frontend server builds for the `DevCompilerTarget` add the
environment variables needed for `bool.fromEnvironment()` calls for
conditional imports.

Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
Fixes: https://github.com/dart-lang/sdk/issues/47207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-22 20:39:44 +00:00