Commit Graph

19 Commits

Author SHA1 Message Date
Jens Johansen 4b8415dd5a [DDC] Sourcemap tests no longer spawn external dart process
Previously a separate dart process would be spawned to compile a dart
file to JS.
This CL internalize it instead, giving a massive speedup.

Bug:
Change-Id: Ib0c073b1f99ecc0c0531aa83a8299278d90762c8
Reviewed-on: https://dart-review.googlesource.com/29200
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-14 14:20:18 +00:00
Jens Johansen 627fb6ac6c [DDC-kernel] Fix sourcemaps after fileUri was added to Constructors
When fileUri was added to Constructors a few tests had to be marked as
failing. This CL fixes the issue.

Bug:
Change-Id: I1168fab05a8edfcd17416476b3abbaf9322d88b9
Reviewed-on: https://dart-review.googlesource.com/29580
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-14 09:07:17 +00:00
Sigmund Cherem f34af36ef9 [pkg:kernel] Add fileUri to Constructors
We have a fileUri for fields and procedures and it was missing in constructors.

This is needed to be able to correctly store the patch URI in patched
constructors and to be able to workaround
https://github.com/dart-lang/sdk/issues/31579.
Change-Id: Ic80d3dc87450ada8b39b555e9b16e162d0e40b45
Reviewed-on: https://dart-review.googlesource.com/29003
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-13 19:35:34 +00:00
Jens Johansen b2dd8418d9 [DDC-kernel] Fix of various annoyances
* Fix possibly null-pointer at end of batch mode
 * Fix changed fileUri type in source map printer
 * Silence a few warnings in tests.

Bug:
Change-Id: Ief1b9b62205a7bc20924a9e5efc06b9c9c34896a
Reviewed-on: https://dart-review.googlesource.com/27945
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-11 08:42:17 +00:00
Jens Johansen 9d8d2aec57 [DDC-step-test] Use absolute paths
Bug:
Change-Id: I3637e6f6693f1629746090f56cc466cc3e91f12e
Reviewed-on: https://dart-review.googlesource.com/27180
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2017-12-11 08:34:37 +00:00
Jens Johansen 03090df3fa [DDC/dart2js] Move sourcemap testing to shared place
This moves the logic previously used in DDC for testing stepping via
sourcemaps to a shared location so both DDC and dart2js can make use
of the same thing.

Bug:
Change-Id: I83a2b1fc4fe5cefe3c8537e50d03c3e41e0490a8
Reviewed-on: https://dart-review.googlesource.com/24110
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-30 11:10:51 +00:00
Jens Johansen ac245f73af [DDC-kernel] Finish stage 1 of adding source maps
This CL "finishes" the first iteration of adding sourcemaps to the
DDC-kernel pipeline. There will likely still be some work left to do,
but it can be added as it is noticed. Ideally by adding a test first.

This CL adds testing and fixes source maps for

- (Better) handling of async, async* and sync*
- Conditional expressions
- await for
- multi catch (catch on (...) { ... } catch on (...) { ... })
- yield
- variable set
- static set
- == and identical
- string concatenation
- is and as
- throw
- map literals

Bug:
Change-Id: Ia3e5145eff049d9829cb636864ef76f300e09615
Reviewed-on: https://dart-review.googlesource.com/24105
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-11-30 10:28:51 +00:00
Jens Johansen dd18d2b288 [DDC] Add --network to commandline example in sourcemap tests
When running tools/testing/dart/http_server.dart on should probably
use "--network 127.0.0.1", or it will by default listen to 0.0.0.0
(i.e. everything).

Bug:
Change-Id: I13756c9b84a7760784baf1527d77ba766ab45e76
Reviewed-on: https://dart-review.googlesource.com/24103
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-28 09:33:44 +00:00
Jens Johansen b561850fb5 [DDC] Stacktrace tests
This CL copied stacktrace test ccases from dart2js and updates them
to DDC (mostly kernel version).

Some tests fail (marked in status file) because of dartbug.com/31451.

Bug:
Change-Id: If89c292eedb162fe7fe2832e909654e4ee083340
Reviewed-on: https://dart-review.googlesource.com/23500
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-24 14:05:20 +00:00
Jens Johansen c69cf9312d [DDC-kernel] Add source information to async wrapper and named parameter
This CL adds source information to the wrapping code for async and named
parameters. This is done for the source mapping not making Chrome (etc)
point to something completely wrong.

Tests are added too.

Bug:
Change-Id: Ifcd16428e0ca8c273fd6377e93297bbfbb37d773
Reviewed-on: https://dart-review.googlesource.com/23480
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-11-24 14:05:20 +00:00
Jens Johansen 19a0100a96 [DDC-kernel] Add source mapping to classes
This CL adds (initial) source mapping to classes and adds (some) tests
of wanted behaviour.

Bug:
Change-Id: I07a38930963b9d93e3bae5206b9eceda69643f7d
Reviewed-on: https://dart-review.googlesource.com/23300
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-11-24 14:05:20 +00:00
Jens Johansen 139e8f4175 [DDC-kernel] Make source-map stepping test output html too
Make the tests output html too so it's easy to fire the test up in
"real Chrome" too and step through it in the browser.

Make the test *NOT* delete the output folder when failing and it's run in
debug mode.

Bug:
Change-Id: I1f004e0a408238dcd9b6a296566c808e31b73ccd
Reviewed-on: https://dart-review.googlesource.com/23261
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-11-24 14:05:20 +00:00
Jens Johansen 28607729fc [DDC-kernel]: Stepping into constructor with initializers
This CL adds a test for stepping into a constructor with initializers.
It additionally changes the stack map in the kernel pipeline to produce
a better result in this case.

Bug:
Change-Id: If0a43b030446c4a7370f386f0f51411d223dda83
Reviewed-on: https://dart-review.googlesource.com/20720
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-11-24 14:05:20 +00:00
Jens Johansen bf81788671 [DDC-kernel]: Stepping over foo = new Foo.named()
This CL adds a test for stepping over - among others - a reassignment of
a variable with a new named constructor.
It additionally improves the situation in DDC via kernel.

Bug:
Change-Id: I1658d433575e6614b1cbbbeb7f1765651b0d34bb
Reviewed-on: https://dart-review.googlesource.com/20667
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-23 11:58:26 +00:00
Jens Johansen e97f818778 [DDC-kernel] Stacktrace test
First stacktrace test making use of the shared testing functionality
originally used by dart2js.

Bug:
Change-Id: Ia3528e2860a5bea48365c32a6526811d06ec001c
Reviewed-on: https://dart-review.googlesource.com/23060
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-23 11:25:16 +00:00
Jens Johansen c41c39d876 [DDC-kernel] Add missing copyright notice to sourcemap testing files
Bug:
Change-Id: Iec24647acc9ad7ee49ed3f4e83bf534d483e94b8
Reviewed-on: https://dart-review.googlesource.com/22981
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-23 08:49:36 +00:00
Jens Johansen 64be0aa210 [DDC-kernel] Use package:sourcemap_testing, delete copied file
Now that some files were factored out into a separate package, delete
the copied file and use the package instead.

Bug:
Change-Id: I3e58ae0213517234b179d6dcfcf251830cb1166a
Reviewed-on: https://dart-review.googlesource.com/22980
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-22 14:54:37 +00:00
Jens Johansen 49dc9f5a8d [DDC-kernel] Make source map tests report better errors; fix paths.
Update the expected paths for summary, sdk and dill files.
Report errors saying that it cannot find specific files instead of
letting ddc crash with some exit code.

Bug:
Change-Id: I88348dc28ebad8cc4b630b85555be978244c8cd7
Reviewed-on: https://dart-review.googlesource.com/22920
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-22 14:12:27 +00:00
Jens Johansen df1d05a7a1 [DDC-kernel] Initial source maps; testing framework for sourcemaps
This CL adds the bare minimum of source map generation for the kernel
pipeline in DDC.

It additionally introduces a testing framework that compiles dart files
with DDC (with or without kernel), steps through it via D8 and compares
the positions stopped at to the expected stop positions.

Bug:
Change-Id: Ie9e06164d8e51c973b83c46a8472e044876e4317
Reviewed-on: https://dart-review.googlesource.com/20662
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-21 10:23:08 +00:00