Commit graph

35 commits

Author SHA1 Message Date
Jake Macdonald f48b8c6908 Support prebuilt macros in the incremental compiler mode for DDC
Also adds support for modular tests with precompiled macros, and one test exercising that.

Change-Id: Ie372ea7fcb270ecd55baa54c4ed1c4ae5a527df4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361261
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-04-09 07:37:26 +00:00
Nicholas Shahan 47b9e3e6df [tests] Add repro for cross module constant
There is an issue with cross module constant extension types that causes
the CFE to crash.

Change-Id: Id6af3a5400e55ecb2534ce71a07c5c1ecb17a46f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335384
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-11-13 22:21:40 +00:00
Alexander Thomas 9394b30b77 Fix incorrect file reference in license headers
Bug: b/286184681
Change-Id: I903528c4adfbc576644aec7541903df6b9633e26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325523
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-09-18 06:44:08 +00:00
Johnni Winther 21cc667dca [Reland][cfe] Support external constructor with final fields
This adds support for having a final field and an external constructor
without error, assuming that the external constructor initializes the
final field. This supports the inline class with external members use
case.

Change-Id: I33b78275e967636ed0697d17f7921e9eee30401b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279095
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-01-17 17:29:28 +00:00
Srujan Gaddam 6efce3b407 [pkg:js] Enable modular compilation for exports
Requires making caches use references instead of TreeNodes, and
classes are revisited if needed due to deserializing another module.
Extensions are stored in a library to extensions map so they can be
invalidated easier. Modular tests are added.

Change-Id: Ic33e1190f02f201591616d988de6cc6c8ddad89d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263540
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2022-10-26 16:34:38 +00:00
Srujan Gaddam b6526beeab [pkg:js] Disallow staticInterop generative constructors
Fixes https://github.com/dart-lang/sdk/issues/48730

Change-Id: I4c7f687ec8d2724de0e031aa5ebe887f93843761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254101
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-10-18 17:47:29 +00:00
Nicholas Shahan 76b615b80d [test] Fix expected and actual ordering
Not a big deal but I was confused for longer than I would like to
admit because the failure message labels the "expected" and "actual"
values as such.

Change-Id: I433d263b873286a54725b7a2a0ba536dd29aae47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262664
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-10-04 23:47:59 +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
Ahmed Ashour 85700570f6 Fix typos
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>
2022-06-15 11:08:28 +00:00
Joshua Litt 2783cca57d [dart2js] Fix bug in impact data serialization.
Change-Id: I1e4915624b609aafa9392fc651f5935bf658a71b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244184
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-05-10 03:34:13 +00:00
Joshua Litt 43cfa8cea3 [dart2js] Support trimming modular analysis data.
Change-Id: I0e0902813fd71c0bda5de6171487fa0e941f6bad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241246
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-04-20 21:58:29 +00:00
Joshua Litt 84497e41ca [package:js] Add @trustTypes annotation.
Adds an experimental `@trustTypes` annotation which can be used during
migration to static interop to preserve the older semantics for JS interop.

Change-Id: Ic00a6c968b15f8c8f5d0840b82db5a6670eaf0eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241362
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-04-20 15:24:18 +00:00
Sigmund Cherem d2d810a8e8 [modular_test] Remove uses of .packages altogether.
Embed in the modules.yaml any extra paths needed for package dependencies
instead.

This is one step to help towards https://github.com/dart-lang/sdk/issues/48275

Change-Id: I22ef02b2b2327a0c798f2fea73d59c758a8bb0bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240651
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-04-09 00:35:13 +00:00
Joshua Litt 0ad7f27990 [dart2js] Apply mixin transform globally.
This cl applies the mixin transform only on the full dill. In addition,
this cl also adds a concatenate dills step to more closely match
modular builds in production.

Change-Id: Icb37c5e2180c9e8246334143a6f772a203f80bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-03-23 18:38:51 +00:00
Srujan Gaddam 758cb462f5 [pkg:js] Erase static interop types
Closes https://github.com/dart-lang/sdk/issues/47324

Erases static interop class types in favor of `BaseJavaScriptObject`.
Types are erased everywhere except for constructors, whose invocations
are instead wrapped with a cast. Constructor type erasure is avoided
to ensure the AST is still type-valid. Factories with bodies have
static stubs added instead, and tests are added for this change.

Change-Id: I7231aaaf32d22bc6261adb672a602e8a9e6c86a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215948
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2021-12-10 18:36:00 +00:00
Joshua Litt 2da9688cfb [modular] Create repro of issue building full dills from summaries.
Change-Id: I67db9eefe508ddbe072238e8773109c7b7f25d1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222560
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-12-10 17:00:00 +00:00
Nicholas Shahan 7f009e528d [ddc] Fix private class exposed by typedef
- Ensure public fields of private classes exposed by typedef are
  properly treated as virtual.
- Add modular test that exercises the errors fixed by this change.

Change-Id: If97f66de5b0742612024a2f727d83ca9dc73389c
Fixes: https://github.com/dart-lang/sdk/issues/45512
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193899
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-04-05 18:54:56 +00:00
Johnni Winther dd5b455a0c [dart2js] Handle super access in mixin declarations
This crashed because the canonical name for the replace procedure
was unbound before all references to it had been loaded, causing
subsequent reads of the canonical name to create reference without
a target.

This broke the flutter web smoke tests.

Change-Id: I6249cfda85ff76b5e2dd31bb0cf8d6312ad50c1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177861
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-07 13:45:18 +00:00
Johnni Winther 4025dee2f8 [cfe] Ensure that default values on synthesized constructor are included in outlines
Closes #43538

Change-Id: I58f03d6d71e6de4744003cc28519a20c7e9e7f12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164787
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-29 11:09:14 +00:00
Joshua Litt 107862e2bf [dart2js] Fix bug in modular_test_suite.
Change-Id: I37954e14e8b53e70e0cfc4c3bcfb216e9f4d482f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148000
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-28 21:30:36 +00:00
Nicholas Shahan aa47d74666 [ddc] Run modular test suite in weak mode
Preparation to unfork the SDK.

- Added the test suite to run in weak mode. Need to assess how we
  want to migrate these tests in the future.
- Updated one test to be legacy/nnbd agnostic.
- Update step names from DDK to DDC.

Change-Id: I0d2f1218c9acad82ab70dd525b0a0ad3cdc2ca92

Issue: https://github.com/dart-lang/sdk/issues/40266
Change-Id: If92e7778984de6a5a049faaf421a069c6f492b36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142557
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-04-08 18:25:14 +00:00
Jens Johansen 81d4ac07d4 [CFE] Use package config v2
Change-Id: I32da9e8b2c1040db1521af4345f8e952c22bd30d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130864
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-12 10:07:25 +00:00
Nicholas Shahan 2aa6e73ae7 [dartdevc] Cleanup all temporary nnbd modular tests
All of these tests are now running under the regular test infrastructure.
The only reason they were created as modular tests was because we wanted more
control over the SDK sources used.

Change-Id: I2ad5aa616ff8bccd10cfac2d49bfaa39ab50c192
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128801
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-18 00:43:44 +00:00
Nate Bosch 2ffdc54d24 Handle exported extensions in dill library builder
- Add a modular test to demonstrate the bug.
- Handle `Extension` nodes in `finalizeExports`.

Change-Id: Ie16f0c97059d24a122150a607e26fba258d80cfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120926
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-10-09 18:48:54 +00:00
Mark Zhou 26b1aca71e [dartdevc] Canonicalizing partial instantiation constants
Fixes #38703

This fixes the last whitelisted DDK test.

Change-Id: I1fd79c2bc361b2a4bf7fce60a406be521408024b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119921
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-10-03 20:45:13 +00:00
Sigmund Cherem 33494de2f9 (ddk modular test) exclude sources from dill files.
This fixes the issue we had with shared/diamond depedencies.  This also matches
more closely how DDK is invoked internally and externally.

While the change to use `--dart-sdk-summary` is not necessary, this brings the
API closer to how it is used elsewhere. It should be cleaned up in the future to
reuse the `--input-summary` flag instead.

Change-Id: Iec3695b5541ffaf7f5762a3d77f071a596237da1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119723
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-10-02 22:22:11 +00:00
Johnni Winther b03d472e4c [cfe] Handle default values on extension methods
Closes #38541

Change-Id: I078800cc98b5444c2c7f6f87b2d89bcf764bfc23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118582
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-09-25 08:45:27 +00:00
Vijay Menon 596bd5b61c [dartdevc] Add modular NNBD test
Change-Id: I61cdd4a1f03232f1f8bab8b029e50b34bf7a1648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117760
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-09-19 16:53:50 +00:00
Johnni Winther 34004f7f6b [cfe] Support modular compilation of extensions
Includes serialization/deserialization of Extension and
ExtensionMemberDescriptor.

Change-Id: I04df581355b0d6f9e6bfa638241c8b7f210d3ce5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115369
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-09-05 11:19:53 +00:00
Aske Simon Christensen 88c0c11612 Remove constant-update-2018 flag from tests.
Change-Id: I85d3d0180bb7f5973ad2da946a3519c553fc7f92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113991
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-08-22 11:00:54 +00:00
Johnni Winther 9ec8d9ff25 [ddc] Merge modular/issue37523 test into modular/nested_constants test
Change-Id: I5d60de4468f8608fe275fccd2e4f833a8bcfb89d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112340
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-09 17:33:44 +00:00
Vyacheslav Egorov 573789f7f1 [cfe] Insert default super initializer when outlining const constructor
This ensures that it is invoked when performing constant evaluation
in modular setting.

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

Bug: 37794
Change-Id: I26c891044e030ac7702f02b2d4996984f9e898c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112383
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-09 11:26:59 +00:00
Johnni Winther d68b482f26 [cfe] Handle constructor from external libraries
Closes #37532

Change-Id: I8b07addeb1da6bc4fe165ff535944fab8c6698b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109261
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-07-17 06:26:34 +00:00
Vijay Menon 5dc14be041 [dartdevc] add regression test for consts in outlines
Fixes https://github.com/dart-lang/sdk/issues/37161

Change-Id: I1718628fe92776dd5bc9f1ce51404e67ba7a70d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106483
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-19 15:44:35 +00:00
Sigmund Cherem f6d67a549b Turn ddc and dart2js modular tests into suites and share their test cases
For this to work properly, we first need the test infrastructure to have support
for the `--output-directory` flag (see base CL)

Change-Id: I75f788d19ad3b4e9523830250c4a1c9de8418cda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-07 21:54:56 +00:00