I don't really understand how this fixes it, but it seems to, and it doesn't
cause any test regressions.
Bug:
Change-Id: I6187c41cd211cd41bb90cddf604d8c09ad458342
Reviewed-on: https://dart-review.googlesource.com/25505
Reviewed-by: Vijay Menon <vsm@google.com>
This CL creates the initial DDC-specific CFE entry point.
It is currently mostly a matter of copying the DDC code for running the
front-end into the front-end, although it also applies a workaround for
making batch-mode faster.
Local timings of running
tools/test.py -mrelease -cdartdevk -rnone --strong --checked language_2
before and after change:
* Before: [05:49 | 100% | + 5136 | - 0]
* After: [00:20 | 100% | + 5136 | - 0]
Change-Id: I799b54b406970c4aa8653b71aaffa2ba476ee9d9
Reviewed-on: https://dart-review.googlesource.com/24921
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Uri.base.resolve will correctly resolve relative paths to a absolute URI, but
when given any URI with a scheme (not just package: or dart:) it will resolve it
appropriately.
This change is needed to be able to specify a custom URI for an app-root
location from package:build.
Change-Id: Iecbda1690974d8bb7db5c5f227699dfa1fcb0619
Reviewed-on: https://dart-review.googlesource.com/25503
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This CL deprecates the front-end API and moves it into src/api_prototype.
For now all usages have been updated to point to the new location,
but they should be updated to use custom-client invocations instead (e.g.
one specific way for DDC, another for dart2js etc.)
Bug:
Change-Id: I9b4f41f6ebf55d42510fd35240d942d1dc7292d6
Reviewed-on: https://dart-review.googlesource.com/24822
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
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>
Without this there is no way to get source maps on the else if in e.g.
```
if (core.StateError.is(e$)) {
core.print("StateError");
} else if (core.ArgumentError.is(e$)) {
let e = e$;
{
core.print(dart.str`ArgumentError: ${e}`);
}
}
```
Bug:
Change-Id: I0203fe7f1e0c14c677e16d61e7649624b72d41cd
Reviewed-on: https://dart-review.googlesource.com/23673
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The simple nullability predicate would report that static fields are always
non-nullable. Change this to report that they are always nullable.
Bug:
Change-Id: I47336bc9686c3bee90d77e6130bd5cddfb9f8a68
Reviewed-on: https://dart-review.googlesource.com/23674
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
1. Catch bodies were unconditionally wrapped in a block, even when
they were already a block.
2. Finally was on a line by itself and indented incorrectly because of
an extra newline.
Bug:
Change-Id: I006cd2841c159a0fc86501bfaf282c7ad4c0ab0b
Reviewed-on: https://dart-review.googlesource.com/23580
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Compilation of Kernel's try/finally included a flattening optimization
when the body was a JS try/catch. This optimization duplicated the
catch block, which changes the semantics of exceptions thrown from the
catch block.
Bug:
Change-Id: I65aefa798d7f9026ab24ed6d1d484dea53235955
Reviewed-on: https://dart-review.googlesource.com/23560
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
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>
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>
Unlabeled while loops in Kernel (these are ones that are not the
target of a break) did not shadow labeled ones. The compiler would
generate a break without a label in JS which would target the wrong
loop.
Bug:
Change-Id: Ib060ab66326a3ea0779eaceccaf1ca06ccfafb75
Reviewed-on: https://dart-review.googlesource.com/23421
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
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>
This involves a few main pieces:
- Add code to the GN scripts to generate DDC's patched SDK and then
compile it to summaries and JS in the build output directory.
- Add support to the underlying DDC build scripts to support controlling
which files are built where.
- Update test.dart to use the DDC SDK from the build directory.
- Update create_sdk to use the built SDK instead of the checked in one.
- Fix various internal DDC tools to build their own copy of the SDK
(since they can't easily find the one in the build directory because
it's path if config-specific) and use those.
- Delete the checked DDC SDK JS and summaries.
I think I got everything working. The built Dart SDK looks fine -- it's
identical to one built using the old build scripts.
The various tools and DDC's little test runner I *think* work, but there
may be a bug or two in there. I tried the various things I could and it
seems like they work but it's hard to tell since they may be kind of
broken right now anyway.
Bug:
Change-Id: Iea77915a5c1cc8450f60ebfbdf8c725c7ea2f32c
Reviewed-on: https://dart-review.googlesource.com/18144
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Eliminate uses of the comment syntax in lib/async. This is mostly
done simply by turning explicit (but commented) casts into implicit
casts to avoid regressing dart2js performance.
Bug:
Change-Id: I286c7bffbf609b5e2fa24b9d48b90876c2c45a9b
Reviewed-on: https://dart-review.googlesource.com/21566
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Casts for function types got moved off of the generic path, and hence
are missing the memo cache. Added a second function type cast cache.
Fixes#31392
Bug:
Change-Id: Ie1b87adf630f5059b57d01956778f5adde0533fc
Reviewed-on: https://dart-review.googlesource.com/21525
Reviewed-by: Vijay Menon <vsm@google.com>
For ObjectFormatter right now we just show the class name. Some objects,
e.g. Int64, have descriptive toString() operations that are much more
informative than their internal structure.
This changes the default header to be
Instance of 'Thing'
rather than just
Thing
which is a little worse, but it's much better for these kinds of classes.
For Int64 we will now show
12345 (Int64)
We also clip the toString() if it's too long.
Bug:
Change-Id: Iae6a8e66fdbe1d9f5c157ecdb983a833e26d00f4
Reviewed-on: https://dart-review.googlesource.com/21522
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
The new front end doesn't support generic comment syntax yet, so it's
getting the wrong type for LineSplitter in strong mode. Since we no
longer to preserve legacy mode semantics for LineSplitter, we can just
use the correct strong mode types without generic comment syntax.
Change-Id: If2dcb2fb3fae9eb49685838e4e84958e545650c7
Reviewed-on: https://dart-review.googlesource.com/21286
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Kernel represents break and continue in Dart uniformly as break. When
compiling to JavaScript we would like to use continue where possible and
avoid labeling statements that do not need to be labeled.
The basic idea is: at compile time maintain a list of Kernel targets
(LabeledStatements) that can be compiled to JS break without a label at a
given point in the program, and a list of Kernel targets that can be
compiled to JS continue without a label, and a map from Kernel targets to
the 'effective' target that will be labeled if necessary when compiled to
JS, and a mapping from effective targets to their label names if they must
be labeled.
Change-Id: Ie660cf3dd68399ebff128116fe38c250cb6b7f35
Reviewed-on: https://dart-review.googlesource.com/21120
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Kernel try and finally statements do not necessarily compile to JS
blocks, but the JS AST requires blocks for try and finally. Ensure
that these statements are blocks.
Bug:
Change-Id: I7abe6ae55650dc726cc89d86d12757d21a783064
Reviewed-on: https://dart-review.googlesource.com/20721
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
In many cases function bodies were a block containing a single nested
block. Flatten these cases.
Change the test for whether a lexically-scoped local variable clashes
with a parameter to work on the generated code, not the source.
Change-Id: I74d37fe686e481e3300bb9d37b30857e8e375cb5
Reviewed-on: https://dart-review.googlesource.com/20661
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>