Commit Graph

3030 Commits

Author SHA1 Message Date
Anna Gringauze cc80ccfaa0 Fix stack overflow in mixin application from separate library
Make sure that calls to super class methods from mixin application
stubs are always generated using `super` and not `this`.

Replacing `super` by `this` should not be used as non-virtual field access optimization in forwarding stubs that intend to redirect to the super class members (using `this` redirects to itself and causes infinite recursion).

Closes: https://github.com/dart-lang/sdk/issues/50119
Change-Id: Ib9c9aebdc88555518998db64aefa1fd0905c5b11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267822
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2022-11-04 21:25:08 +00:00
Johnni Winther 05ff50e6ca [kernel] Add View and ViewType
These are needed for the 'views' feature. No nodes are created yet.

TEST=existing

Change-Id: I0c7a34e460a4d17bd39ee23e7aa6bd8851f4275e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266620
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-03 08:42:06 +00:00
Nicholas Shahan 3bc3a84fd0 [ddc] Add basic support for new interface types
- Support interface types without generic parameters in type tests.
- Add '|' symbol to recipes to separate the library identifier from
  the type. This is used in the modular setting where types are not
  guaranteed to have a unique name.
- Add a runtime method to strip library identifiers when printing
  type names.
- Add a runtime method to retrieve original Dart type name from
  constructors.

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: Ib2a69c29177ebb7c582bff3246ee985666cd5919
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243362
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-10-28 19:26:50 +00:00
Srujan Gaddam 3c5b2d7534 [ddc] Add runtime type for @staticInterop
Seprates our runtime types for package:js into static and
non-static interop types, and adds subtyping rules for them.
Removes erasure from transformations.

Change-Id: I9f5f4a7d4d7a5b8435ba50bde206dcf5348f4cce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265185
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2022-10-28 18:07:38 +00:00
Srujan Gaddam 35cae2d4da [pkg:js] Rename export and mock transformers and separate them
Per previous review comment - this separates the three components into
separate files.

Change-Id: I601bd9ac29ddd032e913a60ce2b5b7dd81e39efc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264603
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-10-26 16:34:38 +00:00
Srujan Gaddam 7f93985005 [pkg:js] Add validation for @JSExport and createDartExport
Creates an external createDartExport function in js_util.

Adds a number of checks for the annotation:
- Classes with the annotation should not have value in the annotation
- Classes with the annotation should have at least one instance member
somewhere in the hierarchy
- There are no export name collisions that are unresolvable accounting
for overrides
- Members with this annotation are instance members with a body only

Also adds checks to createDartExport:
- Checks that the type is a Dart class
- Checks that the type is marked as exportable

Change-Id: I52f27275966e9603e88921ce7897b7615178c4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259511
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-10-24 17:37:09 +00:00
Sigmund Cherem 9846309cf0 [ddc] use snapshot when running worker test.
The snapshot is already available in the build directory, this makes the
test save up 11 times all the parse and warmup costs of loading the
compiler in the VM.

In aggregate, this made the test run in 5 seconds instead of 2 and half
minutes on my local desktop.

Change-Id: Ic0f1ef030b06467999fd0178b599de697f8ccc94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264730
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-10-19 01:27:41 +00:00
Nicholas Shahan 20ad5db3ab [ddc] Fix non-hermetic batch mode crashes
Storing core types in a static caused data to leak between compiles
of separate tests. Compiler crashes on one test could trigger failures
on another.

Fixes: https://github.com/dart-lang/sdk/issues/50044
Change-Id: Ia688a8544576fc0b7ee1bc41ac68a3611c376b8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263144
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-10-13 14:14:59 +00:00
Nicholas Shahan da79baa962 [ddc] Fix bug in FutureOr type normalization
The correct normalization should only normalize FutureOr<Never>
when Never is non-nullable.

Change-Id: I592f3a4856c219b33a8f1ac8377567a956e1148c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261000
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-10-03 20:09:38 +00:00
Nicholas Shahan 76a4d351b8 [ddc] Add non-null assertions when setting fields
!!! NOTE to Google3 rollers:
If this change causes test failures in google3 you can temporarily
set `null_safety_asserts = False` on the failing
`dart_browser_binary` targets until we can fix the mistyped code.
That should allow the test to pass with this change.

Of course feel free to revert this change again if the number of
failures is too high.

Re-land previously reverted change:
https://dart-review.googlesource.com/c/sdk/+/258780

Adds additional tests and more checks to ensure assertions are only
added in libraries that have been migrated to null safety.

Issue: https://github.com/dart-lang/sdk/issues/49918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259120
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Change-Id: Idcab0fe49a8dd98cdd73192eabae4439aebe2013
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260070
2022-09-23 01:22:11 +00:00
Oleh Prypin c0b40136e5 Revert "[ddc] Add non-null assertions when setting fields"
This reverts commit c590001ef0.

Reason for revert: Breaks google3 (b/247639927)

Original change's description:
> [ddc] Add non-null assertions when setting fields
>
> Re-land previously reverted change:
> https://dart-review.googlesource.com/c/sdk/+/258780
>
> Adds additional tests and more checks to ensure assertions are only
> added in libraries that have been migrated to null safety.
>
> Issue: https://github.com/dart-lang/sdk/issues/49918
> Change-Id: If0b9bca9fe0d7db5e15023fe03ccac891af568e8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259120
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

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

Change-Id: Iee2d33005cbabfacab7fc5c45046c6eeb8e31b01
Issue: https://github.com/dart-lang/sdk/issues/49918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260106
Reviewed-by: Oleh Prypin <oprypin@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-09-20 17:19:38 +00:00
Nicholas Shahan c590001ef0 [ddc] Add non-null assertions when setting fields
Re-land previously reverted change:
https://dart-review.googlesource.com/c/sdk/+/258780

Adds additional tests and more checks to ensure assertions are only
added in libraries that have been migrated to null safety.

Issue: https://github.com/dart-lang/sdk/issues/49918
Change-Id: If0b9bca9fe0d7db5e15023fe03ccac891af568e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259120
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-09-19 23:39:03 +00:00
Srujan Gaddam 8a081b95c6 [pkg:js] Add type/conformance checking for createStaticInteropMock
Bug: https://github.com/dart-lang/sdk/issues/49351

Adds checks for the following cases:
- Type arguments to createStaticInteropMock are correct
- No missing members in implementing class
- Inherited and non-overridden @staticInterop members are implemented
- Dart class can implement through inheritance and mixins
- Implemented members are correct subtypes of @staticInterop members
- Potential extension member conflicts that are attempted to be
resolved through subtyping rules

Change-Id: Iacbe5846040ba7fab41459aa19be77351cf1efca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255761
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2022-09-16 20:13:30 +00:00
Emmanuel Pellereau 727e792e77 Revert "[ddc] Add non-null assertions when setting fields"
This reverts commit 27099c121c.

Reason for revert: Breaks google3 (b/246251728)
Original change's description:
> [ddc] Add non-null assertions when setting fields
>
> Fixes: https://github.com/dart-lang/sdk/issues/49918
> Change-Id: I6dddda878afa504bebebb00a80855bac636f8efd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258220
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I5e3fb1c151a85e11025135b8fc95c65192b33791
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258780
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-09-12 11:21:06 +00:00
Nicholas Shahan 27099c121c [ddc] Add non-null assertions when setting fields
Fixes: https://github.com/dart-lang/sdk/issues/49918
Change-Id: I6dddda878afa504bebebb00a80855bac636f8efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-09-09 21:05:25 +00:00
Chloe Stefantsova ddff459c7f [cfe] Add RecordType, RecordLiteral, and associated nodes
TEST=Covered by upcoming language and co19 tests.

Change-Id: Ibe8ecfb7f854adce5646125f6909066e27424665
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256066
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-08-25 10:33:35 +00:00
Srujan Gaddam 9f10a3bc16 [pkg:js] Add JsInteropChecks to Wasm backend
Also cleans up and unifies some behavior across the backends:

- avoiding reinstantiating JsInteropChecks for every library
- having the native classes as a member instead of recomputing on dart2js

Now that these checks exist, we can add lib/js/static_interop_test to
the test directories the wasm trybot runs.

Change-Id: I912aae988afe7915e80cc13d00b8c47818dfa520
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255760
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-08-19 17:48:38 +00:00
Chloe Stefantsova 1611fe6f45 [cfe] Separate out IntersectionType from TypeParameterType
TEST=Covered by existing tests

Change-Id: Ie7b99b1c109edff5198cfbf5d22e1cfb1dc130d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253665
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-08-18 08:47:29 +00:00
Anna Gringauze af1d9eefe8 Remove erroneous cast
Closes: https://github.com/dart-lang/sdk/issues/49580
Change-Id: I3a31a7ef575c910aa2c87f3c3ca17452b9a0c311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254562
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2022-08-11 16:08:18 +00:00
Mark Zhou e3a91f01d3 [ddc] Adding a header comment to DDC-compiled JS.
Displays platform compilation information, module name, and some flags.

Example output:
// Generated by DDC, the Dart Development Compiler (to JavaScript).
// Version: 2.19.0-edge.4d13ff534d0c078ce1140cee1f7f2e112b9df96b (be) (Thu Jul 21 02:51:32 2022 +0000) on "macos_arm64"
// Module: hello_world
// Flags: canary, soundNullSafety(false), enableAsserts(true)
// Experiments: someExperiment

Change-Id: I5966b9653e17dd5ccd897135f8264598dff52ea7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253605
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-08-09 18:04:45 +00:00
Nicholas Shahan 21bc7377aa [ddc] Avoid tagging late local lowering methods
Late local variables are lowered to local get and set functions.
These functions should never need to be tagged with their types.

Avoids including and executing unneeded code in the compiled
output.

Change-Id: I0c7448147a2b5493f818a66dcebae827c36c5330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253825
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2022-08-09 17:58:06 +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
Nicholas Shahan 901d01a45c [ddc] Fix the use of the wrong null literal
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>
2022-07-25 19:22:49 +00:00
Nicholas Shahan 3526954466 [ddc] Update content-length to not be negative
The null safety migration changed the 'content-length' from null to
-1 but a separate change at the same time disallowed negative
values.

Now returning what the 'content-length' would be if the request was
a GET.

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

Change-Id: I2ba3ce1fb604c0fac50f354f56b3d29de6465caa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252005
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-07-21 00:45:35 +00:00
Nicholas Shahan a6478ba4c5 [ddc] Migrate ddb script to null safety
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I34e9c11f6c721ca460a39f0037bf841afb6725f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250352
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-07-19 22:49:54 +00:00
Nicholas Shahan 017401cb35 [ddc] Migrate stack trace utilities to null safety
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: Idfd614e3bcc4e3e8ae1597d69c97d007b7efd306
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250351
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-07-19 21:37:34 +00:00
Nicholas Shahan a710f9727d [ddc] Migrate compile sdk script to null safety
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I48dcf20dc3cada2bd9d0c9dfb0e1f27f07d5e521
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250350
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-07-19 19:35:24 +00:00
Nicholas Shahan ca8b500908 [ddc] Migrate dartdevc entrypoint to null safety
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I6ba216ba41a6c115f9c46908378d21bee0940bdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250349
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2022-07-19 18:45:44 +00:00
Nicholas Shahan 768d6ca0ec [ddc] Migrate dev_compiler library to null safety
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I87d8bcb65e22f4d25cc24694ababa1a16d42bdd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250348
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-07-19 17:50:14 +00:00
Nicholas Shahan 5cc2856daa [ddc] Migrate ddc library to null safety
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I15468560685b1107ec5481f2bda5a0fcb2a6bb7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250341
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-07-19 00:03:04 +00:00
Nicholas Shahan 2f39f86198 [ddc] Migrate last tests to null safety
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I972864df3d5f036a19d3731052e4d5369c399ae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250340
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2022-07-18 23:04:44 +00:00
Nicholas Shahan d795274248 [ddc] Migrate module symbol tests to null safety
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I168a02faeb2288430f4daa998a294ab6bd970031
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250321
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2022-07-18 21:59:43 +00:00
Nicholas Shahan 38dc4ed707 [ddc] Migrate expression_compiler_worker
Migrate library and tests to null safety.

Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I6657ebdeda7c9b4650cc6286229d2f4babdca5be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250260
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2022-07-18 21:14:53 +00:00
Lasse R.H. Nielsen 3fc0bf7e59 Retire the 2.17 language feature experiment flags.
Remove them from tests.
(They should have been removed from tests before launcing 2.17.)

Change-Id: I546f6cb90fdf9e6ed1bb560f3715f9db163b7c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250384
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-07-11 13:02:22 +00:00
Nicholas Shahan 624dd76b6f [ddc] Move FutureOr normalization to its own visitor
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>
2022-07-01 18:55:50 +00:00
Nicholas Shahan f3daca2ef6 [ddc] Fix cast when retrieving annotation name
Name can be null and cast failures start appearing here when
running with sound null safety.

Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I3d96e80283889915cc28a310a1db940a9c6bcab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250409
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-07-01 18:29:10 +00:00
Nicholas Shahan 0f2e021da8 [ddc] Fix non-null assertion crash
`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>
2022-07-01 16:15:53 +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
Johnni Winther e18977ed9c [cfe] Report error for missing concrete super target
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>
2022-06-24 14:04:49 +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
Johnni Winther 391540c889 [cfe] Make (Abstract)Super*.interfaceTarget non-nullable
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>
2022-06-23 09:16:55 +00:00
Nicholas Shahan fed11104ee [ddc] Fix google3 null safety migration break
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>
2022-06-23 00:07:55 +00:00
Nicholas Shahan f1d2813f12 [ddc] Migrate more tests to null safety
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I7f27810c0ca825ea777e6c6bfcade6a8ee2b06e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249065
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-06-22 22:05:25 +00:00
Nicholas Shahan 4c5a046f9d [ddc] Migrate sourcemap and stacktrace tests
- Migrate suites and test files to null safety.
- Fix previous migration of sourcemap_testing to ensure list of
  expected stops could include null values.

Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: Idd3b0937942cef18ae66d35137230437e1e971a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249063
Reviewed-by: Mark Zhou <markzipan@google.com>
2022-06-22 22:05:25 +00:00
Nicholas Shahan 9b9bfc34e9 [ddc] Migrate tests to null safety
Migrate the tests for expression_compiler.

Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I075787dff4ad33d13115b66170bf89260a52015f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248949
Reviewed-by: Mark Zhou <markzipan@google.com>
2022-06-22 22:05:25 +00:00
Nicholas Shahan 3f104a2ab4 [ddc] Migrate command to null safety
Revert small diffs introduced in earlier migrations to avoid an
import of command.dart before it was migrated.

Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: Ia728fd727417fd4fdf8c454a0044e096e9de5756
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248948
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-06-22 21:30:16 +00:00
Nicholas Shahan 6366fddf12 [ddc] Migrate expression_compiler to null safety
Migrate the test file that is unblocked.

Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I65598f5837115d7dce1c51389bb7c762c1ce451e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248884
Reviewed-by: Anna Gringauze <annagrin@google.com>
2022-06-22 21:30:16 +00:00
Nicholas Shahan de90931be4 [ddc] Migrate compiler to null safety
Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: Id6a5e2e435b22fad4afcb5d06d0a50dc617f4bf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248705
Reviewed-by: Anna Gringauze <annagrin@google.com>
2022-06-22 21:30:16 +00:00
Nicholas Shahan c52dd252f8 [ddc] Migrate nullable_inference to null safety
Also migrate the test file and temporarily inline some path
generation logic to break import of command.dart until it is
migrated.

Issue: https://github.com/dart-lang/sdk/issues/46617
Change-Id: I50c158729346f3e31059241b90008ba861a65422
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248341
Reviewed-by: Anna Gringauze <annagrin@google.com>
2022-06-22 21:30:16 +00:00
Nicholas Shahan c53c6890c4 [ddc] Migrate shared_command to null safety
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>
2022-06-21 23:22:18 +00:00