Commit Graph

320 Commits

Author SHA1 Message Date
Alexander Thomas 182d55dfda [dart2js] Add support for BabelJS to test.py
This adds support for BabelJS to test.py's dart2js compiler
configuration. When --babel is specified directly or through a named
configuration, test.py will run an additional step after dart2js that
post-processes the javascript output by running it through BabelJS with
the specified Babel configuration. BabelJS is added to the DEPS in its
standalone form. d8 is used to run BabelJS standalone to avoid adding
a dependency on NodeJS. d8 can only write to stdout but not to files or
stderr, which makes it necessary to change the test_runner to handle
commands that expect their output to be piped to a file.

Changes:
* Add --babel option to test.py.
* Add babel option to pkg/smith.
* Switch IE11 builder to use babel transformation.
* Fix option list comparison bugs in pkg/smith.
* Change dart2js compiler configuration to generate files using the
  test name rather than just "out.js" (update test that relied on this).
* Remove runtime_configuration dependency on test_suite.
* Remove obsolete blocks adding --preview-dart-2 dart2js arguments.
* Make dart2js' compiler configuration more like DDC's.
* Remove createCommand method that is no longer used.
* Remove support for "OtherResources" which was only used for
  dart:isolate tests on dart2js and DDC.
* Skip co19_2 tests that are slow to transform with babel.
* Simplify the timeout handling in the test runner with Future.timeout.

Change-Id: I32e4917b2a57ecbe684538e40d744f0101c552a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/90402
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-29 08:39:44 +00:00
Johnni Winther 05f3b12960 Add test for native declarations
Change-Id: Iea9d8d27e6fdefa6f47471a459cdb4363aab65e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98011
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-28 10:29:11 +00:00
Johnni Winther 204651f3ab Replace package:expect annotations with @pragma
Change-Id: Ib43d0d71a3ee8b0f0e6d676e6a3e448a107b7ca5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95180
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-05 11:00:17 +00:00
Johnni Winther 013cf68624 Replace js_helper annotations with @pragma
@ForceInline is still used by dart:html, will be removed in a later CL.

Change-Id: I480325fe91cc6baefb17ead49f839442e023d441
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95160
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-05 08:56:18 +00:00
Johnni Winther 33bc628235 Treeshake unread fields
Change-Id: I188df5fd18163e5b32213a364d0fc163300db7b9
Reviewed-on: https://dart-review.googlesource.com/c/92130
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-07 09:58:19 +00:00
Johnni Winther 8c7be910d0 Support compilation with the trivial abstract value domain
Change-Id: I1b42ee48f440db9e424448e794a8f8cc9d8f5f3a
Reviewed-on: https://dart-review.googlesource.com/c/86921
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-12-18 12:20:36 +00:00
Stephen Adams 6c2aaf1241 Remove IrRepresentation annotation
Change-Id: I4cf47dd34fa5fe070bf74b4a422a5ce3e2de0273
Reviewed-on: https://dart-review.googlesource.com/76742
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-09-28 08:49:50 +00:00
Aske Simon Christensen ac77419209 Status file cleanup for dart2js.
Removed all sections labeled $compiler == dart2js and !$fasta.

Removed $fasta from all sections with $compiler == dart2js and merged
with existing sections as appropriate.

Some additional cleanup and normalization.

Change-Id: I8b93283a2cce22ce60e29d364c8d0e70dccbb6e3
Reviewed-on: https://dart-review.googlesource.com/71840
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-08-30 10:28:41 +00:00
Aske Simon Christensen a4b3009ca5 Require super initializer to be at the end of the initializer list.
Drops code to handle special evaluation order rules for super
initializer before the end.

Initializer check code now also recovers from initializer errors.

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

Change-Id: I1024853bfd3acfef42630bdc2fc47782746b07c0
Reviewed-on: https://dart-review.googlesource.com/68060
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-08-22 10:43:08 +00:00
Johnni Winther d7c71862da Check setters in Dart 2
Change-Id: I3a0bb90f34072cb4ef47f2712c43e4779b92fbdd
Reviewed-on: https://dart-review.googlesource.com/70514
Reviewed-by: Stephen Adams <sra@google.com>
2018-08-21 08:21:02 +00:00
Aske Simon Christensen f8a96b88e9 It is an error if a final field is not initialized.
Bug: https://github.com/dart-lang/sdk/issues/33022

This commit adds an error when a final field is not initialized at all
(and there is at least one generative constructor). A later commit
will add an error for the case where a field is initialized by some,
but not all, generative constructors.

A number of classes in the Dart2js and DDC support libraries use
uninitialized final fields to indicate getters in the corresponding
native classes. This commit adds a temporary whitelist for the
affected files, which can be removed when the fields have been
replaced by external getters.

This is tracked by https://github.com/dart-lang/sdk/issues/33762

Change-Id: I6b5cee230c7cd5554da2b61da7ebddb6b0b9396e
Reviewed-on: https://dart-review.googlesource.com/63781
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-08-17 12:37:52 +00:00
Stephen Adams 7cf2607344 Make minified names explicit in printed representation of types.
Supports mixed minified and unminified names (like `List` and `num` below).

Example:
TypeError: Closure 'minified:b3': type '() => minified:o<minified:k<num>>' is not a subtype of type 'List<minified:o<minified:k<num>>>'


Change-Id: I1fc67f189170eb9b9c8614b1e3d33128adc49787
Reviewed-on: https://dart-review.googlesource.com/67303
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-08-06 22:28:11 +00:00
Peter von der Ahé 389b8997b3 Update dart2js extra test wrt. void rules
Change-Id: Ic83252a27fc90dd2d19b799d09c0bc4b111a1caf
Reviewed-on: https://dart-review.googlesource.com/65501
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-07-18 09:48:19 +00:00
Johnni Winther 6acee7cdb7 Fix tracking of native classes needed for rti.
Closes #32286
Closes #33690

Change-Id: Ic62c145ca7bb5257d71c0d062b111b183258b7d0
Reviewed-on: https://dart-review.googlesource.com/64343
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-16 10:09:06 +00:00
Sigmund Cherem a2cca0ad2b Make dart2js_extra and dart2js_native run in dart2js-strong
Change-Id: I48cf6f40eea4509e415930c05addb2d48d413be9
Reviewed-on: https://dart-review.googlesource.com/63264
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-06-29 19:33:20 +00:00
Stephen Adams 6e108d709c Include native classes needed for RTI
Closes #33627

Change-Id: I9ed6bf9941df6445209a64c29af8986e382b7c51
Reviewed-on: https://dart-review.googlesource.com/62521
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-06-28 23:16:28 +00:00
Sigmund Cherem a06f7c9241 Remove dart:_isolate_helper.
The rest of the code was used in a single place, so I've moved the code to the
appropriate library.

Change-Id: Idd0416bf7365e3de05f20ab1184428ae7ae614b2
Reviewed-on: https://dart-review.googlesource.com/54745
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-15 00:21:28 +00:00
Sigmund Cherem c25a9fd46b Remove support for dart:isolate in dart2js.
Change-Id: I1216a0ac91d8a1d13b441809596e1a8b5e51bb34
Reviewed-on: https://dart-review.googlesource.com/54526
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-10 01:20:17 +00:00
Sigmund Cherem 3ec1b929e3 Remove dependencies on isolates.
This starts removing support for isolates. I've kept around the
isolate library for now, but I stopped injecting the isolate logic
unless you directly access an isolate API.

Concrete changes:

* Timer no longer uses the event queue: this was only used in worker
isolates, soon to be removed.

* Checking for whether the code is run within a worker is not dependent
   on initializing the isolates global state. This was important to allow
   deferred-loading to work without the isolate logic.

* Workers no longer track pending async calls correctly. This may make it possible
   to terminate worker isolates early, again this wont be relevant shortly.

Bug: https://github.com/dart-lang/sdk/issues/32684
Change-Id: I05025418e05c3641ba1a3bc34ea75ca558a28fbd
Reviewed-on: https://dart-review.googlesource.com/54160
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-09 16:36:26 +00:00
Alexander Thomas 3851591642 [infra] Keep comments intact when updating status files.
* Preserve empty lines in the file header.
* Add empty entry to the tool's newly created sections.
* Remove extra empty line at the end of the file.

Change-Id: I271583774d5f5497025a9d85bcadf8b0b9e39e81
Reviewed-on: https://dart-review.googlesource.com/37600
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-04-10 19:03:21 +00:00
Sigmund Cherem e38e98afbe Update dart2js_native.status: updated to be accurate with our many configurations
TBR=sra@google.com

Change-Id: Ic294b6b9fba128e82cff934b8f3587cee71292e4
Reviewed-on: https://dart-review.googlesource.com/44663
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-02 01:50:38 +00:00
Sigmund Cherem 9ed595b4b3 Use $fasta instead of $dart2js_with_kernel in our status files.
Note: $fasta is true when passing --dart2js-with-kernel. This change will make it
easier to flip the default: the plan is that $fasta will be true by default
later on, and passing --dart2js-old-frontend will make it false.

TBR=sra@google.com

Change-Id: Ib917d55b2d14db954c56513af057dd9a37b9c825
Reviewed-on: https://dart-review.googlesource.com/44601
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-03-01 21:02:18 +00:00
Sigmund Cherem e33f4f7c2e Fail if mirrors are really used.
Some legacy libraries may import dart:mirrors, but not use it. This CL turns them
into a runtime error temporarily to give some time for the library
maintainers to remove the import to dart:mirrors in the future.

Change-Id: I876133908d2a61300256915aab54730bdff51649
Reviewed-on: https://dart-review.googlesource.com/43640
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-02-27 04:57:27 +00:00
Sigmund Cherem 0e1a407823 Produce a static error when using kernel and mirrors
Just noticed that the 'supportsRelection' flag was not checked when running with
'--use-kernel'.

Change-Id: I9f4bd540ad963c33c8b9013860ac63b1c6707299
Reviewed-on: https://dart-review.googlesource.com/35006
Reviewed-by: Harry Terkelsen <het@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-01-17 00:56:12 +00:00
Emily Fortuna 4cd0593574 Tiny fix to fix type errors in our compiler while running host-checked
and deferred loaded code.

Bug:
Change-Id: I57b51a287fd7ffad59a1a59eae34e739b5e5603b
Reviewed-on: https://dart-review.googlesource.com/29745
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-12-15 18:42:33 +00:00
Johnni Winther 5f06d51d1a Enable inlining by default
Change-Id: I4810959da23193d8a1b572b4feea329a2f4b2f31
Reviewed-on: https://dart-review.googlesource.com/29320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 10:02:54 +00:00
Morten Krogh-Jespersen 3db4b1070b Normalize all status files and enable presubmit hook.
This CL normalizes all status files by the status file normalizer found at
pkg/status_file/bin/normalize.dart.

To make sure all status files are kept in pristine condition, a linter is placed
on the presubmit hook. The linter can be found at pkg/status_file/bin/lint.dart.

Bug:
Change-Id: I20bdb74824be65f079b8c9ab08b7ae38394d637f
Reviewed-on: https://dart-review.googlesource.com/24112
Commit-Queue: Morten Krogh-jespersen <mkroghj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2017-12-07 08:38:30 +00:00
Sigmund Cherem 30f154c8ea Bring status on a few suites up to date for --checked and --fast-startup
TBR=efortuna@google.com

Change-Id: If7196983eecf4cd7932e20332dca5471f24319f0
Reviewed-on: https://dart-review.googlesource.com/27087
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-07 05:08:30 +00:00
Emily Fortuna dc1b5525bf Create temporary Method type in kernel world for compatibility with Dart 1
Bug:
Change-Id: I9efa163ce1a9a76df405f32d35850743e7f090cc
Reviewed-on: https://dart-review.googlesource.com/25723
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-04 19:37:54 +00:00
Emily Fortuna 9e5ad7af1a Populate field setter method body for checked mode.
Bug:
Change-Id: I802fc425b998ce1ff1110a7e48215b557035d442
Reviewed-on: https://dart-review.googlesource.com/22300
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-11-21 01:11:07 +00:00
Emily Fortuna bf94e73568 Fix up type inference to run in checked mode and enable checked mode tests running with kernel script.
Bug:
Change-Id: If720b6868fbdf010f4aac614ceea1ddea533c277
Reviewed-on: https://dart-review.googlesource.com/21222
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-15 22:34:51 +00:00
Lasse R.H. Nielsen 0b58c4bd10 Change some constant declarations to lowerCase.
Retain the old values.

Reapply of https://dart-review.googlesource.com/c/sdk/+/20680 with fixes
for VM method fingerprints.

Change-Id: Ie14e7ccc3194d5561983348e6b6752728913ff4d
Reviewed-on: https://dart-review.googlesource.com/20664
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-14 12:59:14 +00:00
Lasse R.H. Nielsen e61fc07b58 Revert "Change some constant declarations to lowerCase."
This reverts commit c048cfb178.

Reason for revert: VM code fingerprints needs update.

Original change's description:
> Change some constant declarations to lowerCase.
> 
> Retain the old values.
> 
> Change-Id: I03bd326f379fe5f96d8f6081a7133de956d745c0
> Reviewed-on: https://dart-review.googlesource.com/11520
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Florian Loitsch <floitsch@google.com>

TBR=lrn@google.com,floitsch@google.com

Change-Id: I095e8198304ca4e59b39d30b0fdf0af4945e5231
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/20680
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-14 11:23:08 +00:00
Lasse R.H. Nielsen c048cfb178 Change some constant declarations to lowerCase.
Retain the old values.

Change-Id: I03bd326f379fe5f96d8f6081a7133de956d745c0
Reviewed-on: https://dart-review.googlesource.com/11520
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-11-14 11:13:04 +00:00
Johnni Winther ff7cfea850 Turn on inference by default with --use-kernel
Change-Id: I3f320cc5aa8f265b45c73c9d3023950d8ed4240b
Reviewed-on: https://dart-review.googlesource.com/20064
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-13 10:51:03 +00:00
Emily Fortuna 035c85580b Make fast-startup work with kernel!
Bug:
Change-Id: I88bf7fd7609bc816cc6d50daaa7e3a0ec5dc1934
Reviewed-on: https://dart-review.googlesource.com/19403
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-09 01:37:25 +00:00
Harry Terkelsen 0c7fbd7f38 fix dart2js_native test status file
Change-Id: Id99e8403871542ab43e7a7762aca6975ffd2c3e0
Reviewed-on: https://dart-review.googlesource.com/16622
Reviewed-by: Stephen Adams <sra@google.com>
2017-10-25 19:25:30 +00:00
Stephen Adams 2c44adec91 dart2js kernel status updart for dart2js_native and dart2js_extra
Not sure why they changed, but it is useful for other work to have a
'correct' baseline.

TBR=sigmund@google.com

Change-Id: I6d22f731e74f093e39ad0203a668b2ea165946b5
Reviewed-on: https://dart-review.googlesource.com/14362
Reviewed-by: Stephen Adams <sra@google.com>
2017-10-17 02:53:41 +00:00
Stephen Adams b80c0a1dde fix archaic syntax in dart2js_native test
TBR=efortuna@google.com

Bug:
Change-Id: I394985d25513fa213f7ba9270c92b4d357bff91c
Reviewed-on: https://dart-review.googlesource.com/13923
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2017-10-13 22:40:34 +00:00
Johnni Winther f9cb6c4137 Remove dart2js_with_kernel_in_ssa test option
Change-Id: I2da692a4d458acc4b36e14beb99e1fb9d2bdec70
Reviewed-on: https://dart-review.googlesource.com/10861
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 06:53:39 +00:00
Emily Fortuna 1bf53724bb Use in correct version of CommonElements (J vs K entities) for backend.
Bug:
Change-Id: I8731624f7453d47019fbf24be4d9d6db4d5a0318
Reviewed-on: https://dart-review.googlesource.com/7488
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-21 17:57:26 +00:00
Emily Fortuna 942963fa2e Add TypeVariable analysis in closure conversion.
Bug:
Change-Id: I4155ceb042295934cc3c9125d275dc5f034675dd
Reviewed-on: https://dart-review.googlesource.com/6025
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-18 20:26:33 +00:00
Stephen Adams 69b50ed990 dart2js-kernel: Fix bug with finding optional parameter default values
Change-Id: Iefa443318124838aeafa9998e08d1143c1976dc4
Reviewed-on: https://dart-review.googlesource.com/6346
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-15 23:54:22 +00:00
Johnni Winther 5aa3259698 Handle break to labeled statement
No tests yet. Kernel doesn't support file-offsets on labeled statement.

Change-Id: I5dcfcc21433aec5ad0be26bfef5bbca0b609ba35
Reviewed-on: https://dart-review.googlesource.com/5161
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-14 08:59:11 +00:00
Stephen Adams 45d6ed8a01 Allow 'lookup' of native classes declared in dart2js_native and dart2js_extra tests'
R=johnniwinther@google.com

Change-Id: I510fd1f76c5369fdf37b833ccce10dc788810099
Reviewed-on: https://dart-review.googlesource.com/5640
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-14 03:59:00 +00:00
Stephen Adams 0bfad6483e de-dup dart2js kernel status files
TBR=sigmund@google.com

Bug:
Change-Id: I41d0bfdad38f0ab65649cd9d69e82097e9877fe2
Reviewed-on: https://dart-review.googlesource.com/5483
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-13 17:13:03 +00:00
Emily Fortuna b1dd578da7 Don't try to add abstract methods to the codegen work queue to generate bodies
BUG=
R=johnniwinther@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/3012683002 .
2017-09-01 10:21:03 -07:00
Johnni Winther 374df045e7 Handle forwarding constructors to unnamed mixin applications
+ handle instance fields from mixins
+ change class sorting to put unnamed mixin applications last

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/3005823002 .
2017-09-01 19:07:02 +02:00
Emily Fortuna 98e36f719e Add boxing for modified variables
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/3007743002 .
2017-08-29 16:27:28 -07:00
Stephen Adams 5865a13c44 dart2js kernel: update tryInlineNativeMethod to Entities
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2998413002 .
2017-08-25 16:13:38 -07:00