Commit Graph

93 Commits

Author SHA1 Message Date
Stephen Adams 2c8c05f877 [dart2js] merge generator body into empty entry function
Change-Id: I99a5f16f9a22d3c3cbb4989151a8d3c7bfda16ef
Reviewed-on: https://dart-review.googlesource.com/56037
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-22 21:17:44 +00:00
Johnni Winther 54331b1c4b Delete elements.dart and resolution_types.dart
Change-Id: Ib50dabdbeec72ebf443e85b51b818d9ed0602b4f
Reviewed-on: https://dart-review.googlesource.com/55221
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther 47a67b2b8f Delete AST nodes
Change-Id: Iab9396b3a21cd9502c455fb73633216faed777ef
Reviewed-on: https://dart-review.googlesource.com/55126
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +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
Stephen Adams 6efd3b3654 Refactor output code for generators
sync*/async/async* generators have two parts: an entry, which does
checks and computes the element type of the result, and a body, which
is transformed after lowering to JavaScript.

The split ensures that the code for checks is done at function call
time, rather than e.g. in the moveNext method of a sync* iterator.

A following CL with optimize the split to generate one function when
there are no checks and the type argument is simple enough for textual
substitution.

Change-Id: I5414109ca851f9267871aa113a2e29b16236986d
Reviewed-on: https://dart-review.googlesource.com/54308
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-09 18:22:07 +00:00
Johnni Winther 4c7926107e Remove support for --use-old-frontend option
Change-Id: Ia6e7ded5e312cce4841ded8170fc01a51f07b098
Reviewed-on: https://dart-review.googlesource.com/54229
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-09 09:11:01 +00:00
Johnni Winther 17e22dfcd3 Remove unneeded kernel tests and sourcemap old-frontend tests
Change-Id: Iaf9533a812df5c872f223bce17ec7127f0b46318
Reviewed-on: https://dart-review.googlesource.com/54200
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-09 07:55:08 +00:00
Johnni Winther 831a6ba598 Remove useOldFrontend testing from various tests
Change-Id: Iff97dd60756ae18cb0a3203cffd87c8da9e53757
Reviewed-on: https://dart-review.googlesource.com/53944
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-08 08:31:43 +00:00
Johnni Winther 235b81d045 Remove MockCompiler
Change-Id: I476cb39f8fed068d7c47a15486419783f599a285
Reviewed-on: https://dart-review.googlesource.com/53806
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-07 10:07:40 +00:00
Johnni Winther 794fe1e14f Add stacktrace tests for synchronous async
Change-Id: Iafd66528f9ea3d7a301dc4845118ca16517e235f
Reviewed-on: https://dart-review.googlesource.com/53206
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-03 08:09:33 +00:00
Sigmund Cherem 3c9d0858b0 dart2js: turn on sync-async by default
Closes https://github.com/dart-lang/sdk/issues/32869

Change-Id: I79b2d02d13adccdfbbd3a78158805244aceff7de
Reviewed-on: https://dart-review.googlesource.com/52061
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-04-27 19:48:46 +00:00
Janice Collins 1afe71c08a Enable preview-dart-2 as default for analyzer.
Based on https://dart-review.googlesource.com/c/sdk/+/52340, but adds
the necessary plumbing through the test system to pass through
negations to strong and preview-dart-2.  Also adds support for those
negations to the analyzer.

Change-Id: I9793ff28bb593d25bbb0a2ed8736b5b53e0a62d8
Reviewed-on: https://dart-review.googlesource.com/52461
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-26 17:01:12 +00:00
Johnni Winther 8eb749e032 Fix sourcemaps/name_test for kernel
Change-Id: I77e60ae236cf8a17edc3854496fc900d67915bd0
Reviewed-on: https://dart-review.googlesource.com/47040
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-20 11:35:49 +00:00
Sigmund Cherem c438f8b3f4 Dart2js defaults to the new common front-end
Change-Id: Id0f69d258b010a746b56e259335185bcca7dafec
Reviewed-on: https://dart-review.googlesource.com/45143
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-03-13 19:25:59 +00:00
Johnni Winther d539c78af1 Add source information to parameter stubs.
Change-Id: If942cc13203752361c3104c89190d75979073498
Reviewed-on: https://dart-review.googlesource.com/34440
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-12 21:23:40 +00:00
Johnni Winther 399f0326c9 Move unittests, part #10 of ?
Change-Id: Ia346ac44c75b349b61c35e2e9816a7f3d92f04b4
Reviewed-on: https://dart-review.googlesource.com/31481
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 12:15:06 +00:00
Johnni Winther 410c3c4a69 Move unittests, part #9 of ?
Change-Id: Ief32bb619da08133a4247b2e4f80cad592f18d77
Reviewed-on: https://dart-review.googlesource.com/31423
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 11:40:45 +00:00
Johnni Winther d5447c848a Reuse cached kernel platform libraries in runCompiler in memory_compiler.dart
Change-Id: Ic545371803263add622ddf8af08eddf484d6ca10
Reviewed-on: https://dart-review.googlesource.com/31343
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 10:19:08 +00:00
Johnni Winther c9fc2e7e40 Use a temporary dir for stepping_test
Change-Id: I474552f4c77e4c8a28c545710e823c203c6a51d5
Reviewed-on: https://dart-review.googlesource.com/31340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-22 13:30:27 +00:00
Johnni Winther a521c7f255 First step debugging tests.
Change-Id: I8a947999778f851ed38c1a9fb518af00664f19ec
Reviewed-on: https://dart-review.googlesource.com/30740
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-21 14:03:51 +00:00
Johnni Winther 289671e38e Port unittests, part #3 of ?
Change-Id: If5174e76187d2e045cb14b11df932acdee9e42dd
Reviewed-on: https://dart-review.googlesource.com/30761
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-21 09:35:06 +00:00
Sigmund Cherem 414bad86df Directly create dart2js platform files using its patch files
Change-Id: I1c7d59968bfafeeb5a8b5252fa2d47e3c05b893e
Reviewed-on: https://dart-review.googlesource.com/27404
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-12-19 20:31:57 +00:00
Sam Rawlins b50319ca9f Fix RETURN_OF_INVALID_TYPE for anonymous closures
The displayName of an anonymous closure is a blank String, resulting in messages like:

    [error] The return type 'String' is not a 'int', as defined by the method ''.

After this change, an error might instead look like:

$ xcodebuild/ReleaseX64/dart-sdk/bin/dartanalyzer --strong 26056.dart
Analyzing 26056.dart...
  error • The return type 'String' isn't a 'int', as defined by anonymouse closure at 26056.dart:6:28 • return_of_invalid_type
  1 error found.

Bug: https://github.com/dart-lang/sdk/issues/26056
Change-Id: I4003eea22cb23e0b06479482c06d5ce8a936c756
Reviewed-on: https://dart-review.googlesource.com/28382
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-18 15:33:06 +00:00
Johnni Winther dbadf204aa Add source information to break, continue, == and constructor body calls
Change-Id: I3ca3dc1e1ed55b636808685bff5d017d422678e7
Reviewed-on: https://dart-review.googlesource.com/24923
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-05 11:40:41 +00:00
Johnni Winther 5a238b215a More source information
+ on super calls
+ null tests
+ logical and

Change-Id: I136500544d14afa5cbaf431ec12dfb1516c38d29
Reviewed-on: https://dart-review.googlesource.com/24480
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-30 08:45:39 +00:00
Johnni Winther 93d03da1db Add source information to yield* and async*
Change-Id: I4e3f09f60527c0ea501b266abca6b70dc01d1a64
Reviewed-on: https://dart-review.googlesource.com/23668
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 10:16:54 +00:00
Johnni Winther 9bfef29e21 Add source information to throw/try/await in async and yield in sync*
Change-Id: I8559aaf40c3cb12892113b7373608dc0eed3cb45
Reviewed-on: https://dart-review.googlesource.com/23680
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 09:56:09 +00:00
Johnni Winther 03aab05eea Add source information on try, is and as
Change-Id: I83eaad5913eead816d28286d31e370cafeb7f52b
Reviewed-on: https://dart-review.googlesource.com/23520
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 09:43:20 +00:00
Johnni Winther bc32fb7e42 Add sourcemapping to (simple) async methods.
Change-Id: Ia1dbf85d75b2dd2c3c0308aa8ff4c65605c62481
Reviewed-on: https://dart-review.googlesource.com/23380
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 09:22:10 +00:00
Johnni Winther 758306af54 Provide source info on switch, boxing and capture
Change-Id: I6d8deaa5d523a1f9346c773295f3d1152636f01a
Reviewed-on: https://dart-review.googlesource.com/23665
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 09:06:41 +00:00
Jens Johansen 1e4625ea38 Small changes to stacktrace_helper to prepare for ddc usage
Bug:
Change-Id: Iab4fb0536456cded152646bf2725e8c918e4a8e8
Reviewed-on: https://dart-review.googlesource.com/23020
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-22 14:30:37 +00:00
Johnni Winther b9a222615b Add sourcemap_testing package
Change-Id: I9655ebf5bb93c61f9d1f0eae1fbc615761f23b47
Reviewed-on: https://dart-review.googlesource.com/22520
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2017-11-21 15:09:38 +00:00
Johnni Winther 4dbc717b33 Extract stacktrace_helper from stacktrace_test
- to prepare for reuse by ddc sourcemap testing.

Change-Id: I0d112d164009f263a03dd000d6e1bce1df5ed5f9
Reviewed-on: https://dart-review.googlesource.com/22480
Reviewed-by: Jens Johansen <jensj@google.com>
2017-11-21 13:07:00 +00:00
Johnni Winther 3ee0a42842 Update source_mapping_test* to take arbitrary file input
+ add the missing source information to HStringify found by through testing swarm with it.

Change-Id: Iaba9d8cc5c1ff2bee6a94988eb1916ac4abc66a2
Reviewed-on: https://dart-review.googlesource.com/22140
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-21 10:38:03 +00:00
Johnni Winther 9578eac4e2 Add source information to loops.
Change-Id: I0d0ce8f39cba888741d8adffd7d07826dc82f93e
Reviewed-on: https://dart-review.googlesource.com/22120
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-21 10:23:17 +00:00
Johnni Winther 0a6782bab2 Reorganize source map tests, tools and helpers.
Change-Id: Ie3e5ebb41377c709c6685046b46d6eeb711ddddf
Reviewed-on: https://dart-review.googlesource.com/22040
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-21 09:12:27 +00:00
Johnni Winther 5e6a6bd035 Test all files in sourcemaps/data
Change-Id: I4cab4910818435c7d96bf494770e9b064b30cfc9
Reviewed-on: https://dart-review.googlesource.com/22000
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-21 08:49:28 +00:00
Johnni Winther d578cdb6a0 Test stacktrace sourcemaps for kernel.
Change-Id: Ic2bf02ec8aaff9a1c2495768a9bf1b8362acccca
Reviewed-on: https://dart-review.googlesource.com/21802
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-20 09:17:20 +00:00
Johnni Winther cb0978d691 Read stacktrace_test data from files.
Change-Id: I5dc3a2ef8ec8e77498ec09590f871e07d0beb5c5
Reviewed-on: https://dart-review.googlesource.com/21801
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-20 09:08:35 +00:00
Johnni Winther 253eaef945 Add source information for invocations and operators in the kernel ssa builder.
Change-Id: If9e77c773e5ca722f100e92f6ff4e417efda9d5e
Reviewed-on: https://dart-review.googlesource.com/20700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-16 09:46:29 +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 d3c000beaf Prepare source_mapping_*_tests for kernel.
Change-Id: I89b3b2694adf91fb12cc8bbabd6f94528eb85bb9
Reviewed-on: https://dart-review.googlesource.com/20280
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-14 08:36:04 +00:00
Johnni Winther e8e3fb5224 Reenable source map tests
- and fixes regressions + add more coverage for the regressed parts

Change-Id: Ied0aa54389164650b4fcd8f0363ddabb60c00a77
Reviewed-on: https://dart-review.googlesource.com/20204
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-14 08:18:44 +00:00
Leaf Petersen 4270b99d75 Fix dynamic as bottom uses in front end and dart2js.
Re-enable the dynamic as bottom hint in analysis_options.yaml and fix
the code to be hint clean again.

Fixes #30589
Fixes #30590

Bug:
Change-Id: Idb7910b3ab1c6d931a3ead3eed885d8bd172e621
Reviewed-on: https://dart-review.googlesource.com/17062
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-30 19:54:26 +00:00
Johnni Winther 35733a265f Split cached SourceFileProvider input into utf8 and binary
This (re-)enables the [autoReadFromFile] functionality when using
--use-kernel by allowing to read source files when these have already
been read as binary.

The fasta front-end pulls input as binary meaning that the diagnostics 
handler doesn't know how to print source locations. Splitting the cache
allows us to fetch the source as string when needed for diagnostics.

Change-Id: Ib3bea2fb999be10f86e82ea623ee24a5c1ad9bf4
Reviewed-on: https://dart-review.googlesource.com/3880
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-08 08:41:32 +00:00
Jens Johansen c7be5d9d35 Test tool: translate dart2js stacktrace
This is a first stab at an internal tool that can translate a dart2js
stacktrace to a "dart stacktrace".

First use figuring out a stacktrace in observatory which was done like
this:

dart translate_dart2js_stacktrace.dart http://localhost:9999/main.dart.js.map
<then copy paste the stacktrace into stdin, followed by a few empty lines>

Change-Id: Id33e66182213a3005bba3338df7dd638218609c2
Reviewed-on: https://dart-review.googlesource.com/3140
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-05 11:03:05 +00:00
Johnni Winther 5fe6282ec0 Reformat untouched files.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2990223002 .
2017-08-04 14:52:58 +02:00
Peter von der Ahé 69d6e8e55a All strong mode cleaning of dart2js.
Fixes https://github.com/dart-lang/sdk/issues/29886

Supersedes CLs 2939193003, 2950433002, and 2947583002.

R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2944843002 .
2017-06-19 14:06:38 +02:00