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>
This code should be using a `LiteralNull` from the JS AST but was
accidentally using the `NullLiteral` from the Kernel AST.
Add a test to trigger this code path in the expression compiler
because there must not be a source location for the code being
compiled.
Add a retry duration for getting a chrome tab in the test suite.
This fixes a failure I was seeing when I run the test locally.
Change-Id: I6900ace6280f1105c77ccafce4f47d0fc5771d6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252540
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Will make it easier to reuse the normalization when compiling
with the new runtime type representation.
Change-Id: Ie767a2b676950205b0b50eadac305c29914433f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247420
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
`VariableDeclaration.name` could be null when the variable
was synthetically introduced by the compiler. In this case the
expression compiler can ignore the variable because it's value
doesn't reflect the value of a variable in the original dart
source code.
Add a regression test for the expression compiler that
ensures code that introduces a synthetic variable will not
cause a crash when you stop at a breakpoint.
Fixes: https://github.com/dart-lang/sdk/issues/49373
Change-Id: Ifc5f72ab4e5733ead17a20889c222bcc46921f6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250343
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
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>
In response to https://github.com/dart-lang/sdk/issues/47406
The error is currently not reported if the mixin declaration is from
an outline dill.
Change-Id: I94a61d6409d0c238614d9f377b5f324153360bc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249184
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
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>
This is a step towards improving the semantics of these nodes.
TEST=existing
Change-Id: I95bdb86790414b38af73e9e932cc228b3c0f1f6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249040
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
The code path exercised here is used in google3 and expects
a list of preallocated size.
Change-Id: I807603a8bddb1bfead8f3377df4a6252949a8c3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249545
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Update CFE API for ddc to mirror the nullability of fields in
`CompilerOptions`.
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I08d8cc2c5bb1dba4823cb3a7e1f4a540fb3bfef5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248181
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
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>
Fixes#49241
TEST=ci
Change-Id: I6117bf816fc8c4613cce66927f952fef75632725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248120
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reduces the number of libraries that must be migrated to null safety
atomically.
Change-Id: I498f2956471be0435558c1b1a4badcba619f15de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247521
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Static class members could technically be mapped to a name with dots,
but in the early days of JSInterop we thought this was not necessary
since it could also be modeled as a top-level member or by adding
additional classes and exposing the member as a simple name on a deeper
class.
This invariant was assumed by DDC (which crashed if this was not the
case) and ignored by dart2js.
This change adds a static check to ensure both compilers act
consistenlty.
Fixes https://github.com/dart-lang/sdk/issues/27926
Change-Id: I20e59fbb75f0378a58ca88dc3910e079b4eeb7a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247180
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
When compiling the Dart SDK with the `--canary` flag DDC will include
the new shared runtime type library in the compiled SDK.
Change-Id: I7a418033fb7397939aa6f4b7fb84820ead99c3be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241690
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
This adds AbstractSuperMethodInvocation, AbstractSuperPropertyGet,
AbstractSuperPropertySet nodes which are to be used for super access
in mixin declaration.
These super accesses do not resolve to their statically bound target
but instead the interface target on the types in the 'on' clauses, and
need to be updated to the statically bound target upon mixin application.
This has lead backends to disregard the interface target provided by
the CFE and instead always compute targets for super accesses.
This change is a step towards creating a clear separation between the
two use cases, enabling a more precise handling of super accesses.
The new nodes are not created yet with this CL.
TEST=existing
Change-Id: I70ea9baf5b4b970b10cc72b7409633d270d57755
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245168
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This allows the package to be discoverable across web backends
Change-Id: I7d870a7232543d3b719d47de1424017d7f578434
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244261
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Currently the flag does nothing. Follow up changes will add support
incrementally.
Add a `--canary` flag to DDC that will enable all features in
development to simplify use in tests and benchmarks.
Issue: https://github.com/dart-lang/sdk/issues/48950
Change-Id: I4878c771bdb4f4c6e8b8cd618737009268b02cbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237602
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Don't emit dead code branches that are guarded by boolean literals.
Add a single level of simplification for !true -> false, and
!false -> true.
While this might not be very common in code, it does allow for a
useful pattern in the runtime libraries. Branches can be included
into the compiled code or not based on a compile time flag.
Change-Id: Ib90e1e951cea3ef8c75b944635776b292759594a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243363
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Some JS functionality is only exposed through operators, such as
implicit type conversions and BigInt arithmetic. Other than requiring
some minor additions for the exponentiation (`**`) operator, supporting
these through `dart:js_util` is trivial.
Change-Id: I010674303e4f99b42d43b73095de69b8ddcdeb47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242680
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
These will be flagged by the next linter release which updates `non_constant_identifier_names` to flag local functions.
Change-Id: Idf2b91fa3b845d8b921b7eb68b937d19c4ea188e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242502
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
These are now enforced in pkg/js_ast so we don't need to worry about
introducing unwanted diffs between the forked versions.
Change-Id: I89efc97f53a433f98e2a06747690ac7a635c388d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239560
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
When an unexpected "Undetermined Nullability" is encountered the
compiler will throw a message that contains the library being
compiled and the problematic type.
Change-Id: I0d6c3335b8c207b0344354dc4e9a2d7152571b12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239722
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
- Remove lint ignores and cleanup violations when they are either
in code that doesn't exist in or are already fixed in the pkg/js_ast
version.
- Migrate the builder_test.dart (the small test file).
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I1083235de93f028e5f338180b97308f52a45f17f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239363
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
- Removes another diff between this version and the package:js_ast.
- This is helpful for the null safety migration as the expression
in the Case node can now be non-nullable.
Change-Id: Ia6626b2ee8a4e8b66bc6b53ea74d16d2d9f81f7a
Issue: https://github.com/dart-lang/sdk/issues/46617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238663
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This will allow more gradual migration of js_ast.
Change-Id: I3e948ad5c79fa9880b7eb3bccd7c15cbf9786e32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238660
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This won't promote for a nullable field `foo`, so use `?.`:
if (foo != null) foo.accept(this);
-->
foo?.accept(this);
Change-Id: I0f3c92803f8756c44a959d17dfe29b12f9db362c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238501
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>