1. A --platform flag is added to dart to give a path to a Kernel
binary for the platform libraries (as produced by building the
runtime_kernel target).
2. This binary is used for bootstrapping. Since it contains libraries
other then the VM's bootstrap libraries, they are also loaded.
3. The frontend does not send any library with a dart: import URI
scheme. Note that it does not (yet) prune the canonical name
table, which will contain a lot of unnecessary names used for
internal linkages in the platform libraries.
4. There is a single dependency in the platform libraries on the
script: _getMainClosure in dart:_builtin. This is patched after
the script is loaded.
BUG=
R=ahe@google.com, kustermann@google.com, vegorov@google.com
Review-Url: https://codereview.chromium.org/2786083002 .
- Instead of a pointer to new'd memory, Kernel strings now have an
offset from the start of the string data.
- When the streaming reader encounters the string data it records the
offset from the start of the binary. This offset is stored in the
Kernel Program and is used to compute the offset for strings.
- When a KernelReader is constructed, the string data is copied into a
Uint8 array in the VM's heap.
- A pointer to the string data is put into every Kernel script so it
can be used for constructing VM strings at compile time.
The source table does not use Kernel strings any more because those
strings are not found in the raw string data. Instead, the source
table uses new'd buffers for strings (but this will be cleaned up
separately).
R=jensj@google.com
Review-Url: https://codereview.chromium.org/2820363002 .
Instead of a list of strings given by their length and UTF-8 encoding,
restructure the string table to consist of a list of string ending
offsets followed by a blob of UTF-8 encoded strings without lengths.
This is a step toward copying the string blob into the VM's heap and
building a heap-allocated structure to give random access to them.
BUG=
R=asgerf@google.com, jensj@google.com
Review-Url: https://codereview.chromium.org/2790073004 .
Before: Canonical names contained pointers to the corresponding Kernel
tree which assumed that the whole tree was in memory whenever the
canonical names were.
Now: Canonical names do not contain these pointers. They were only
really used to perform name-based lookup in the VM's heap so the
canonical name itself is enough.
If we later find that we need to get from a canonical name to its
Kernel tree we can add an offset in the binary (for instance) to the
canonical name or in a separate mapping on the side.
BUG=
R=asgerf@google.com, jensj@google.com, vegorov@google.com
Committed: https://github.com/dart-lang/sdk/commit/ed77783cd32d55fdad61bf9bc749030847ba9384
Review-Url: https://codereview.chromium.org/2781893004 .
Before: Canonical names contained pointers to the corresponding Kernel
tree which assumed that the whole tree was in memory whenever the
canonical names were.
Now: Canonical names do not contain these pointers. They were only
really used to perform name-based lookup in the VM's heap so the
canonical name itself is enough.
If we later find that we need to get from a canonical name to its
Kernel tree we can add an offset in the binary (for instance) to the
canonical name or in a separate mapping on the side.
BUG=
R=asgerf@google.com, vegorov@google.com
Review-Url: https://codereview.chromium.org/2781893004 .
- Offsets on more stuff
- Status file for kernel
-> Testing with (before fasta)
```
python tools/test.py -mrelease -cdartk --no-tree-shake --no-dfe service
```
now shows everything as passing.
Reload stuff, and evaluation stuff (e.g.) has been disabled though.
- Lots of new service tests that tests what positions we stop at when
saying next.
As fasta has now landed debugging does not currently work, but this is still needed in order to both test better and allow for proper kernel debugging support.
R=hausner@google.com, kmillikin@google.com
Review-Url: https://codereview.chromium.org/2680303002 .
This adds a class CanonicalName that can represent a library, class,
or member. All references now go through a Reference object, which is
linked to both the AST node and its CanonicalName, so either can be
created first.
dartk now accepts multiple input files:
- If multiple dart files are given, they are all compiled.
- If multiple binaries are given, they are linked together.
Mixed dart and binary input is not supported by dartk.
dartk now has a flag --include-sdk which includes the entire SDK in
the output. This is so the SDK can be compiled alone and then linked.
Example of compiling separately and then linking:
dartk foo.dart -o foo.dill
dartk main.dart -o main.dill
dartk --include-sdk -o sdk.dill
dartk main.dill foo.dill sdk.dill --target=vm --link -o program.dill
dartk still has incredibly slow cold start due to the analyzer loading
the dart sdk, so this does not actually speed things up at the moment.
BUG=
R=ahe@google.com, kmillikin@google.com, kustermann@google.com, sigmund@google.com
Review-Url: https://codereview.chromium.org/2665723002 .
Previously a functions debuggable field was set to false in the async transformation (and because it wasn't done yet, not in async* and sync* transformation, though it should have been). Now instead, set the original async status and set debuggable on the c++ side equivalently.
Also, on the c++ side, set a functions modifier to async etc if they were originally async etc.
BUG=
R=asgerf@google.com, kmillikin@google.com, kustermann@google.com
Review-Url: https://codereview.chromium.org/2697193008 .
This introduces
- a list of valid token positions, so debugging actually
starts to work, and the observatory can be loaded without crash.
- a list of valid yield positions, so stepping over await stuff
works as expected.
- Adding "DebugStepCheckInstr" to the kernel generated il so stepping
over await stuff works as expected, we can break in empty methods etc.
With this, approximately 80% of the service tests pass in kernel mode.
R=kmillikin@google.com
Committed: https://github.com/dart-lang/sdk/commit/2d5147be9d7435c06dd892d145d8717b6d1f62d5
Review-Url: https://codereview.chromium.org/2632183002 .
This introduces
- a list of valid token positions, so debugging actually
starts to work, and the observatory can be loaded without crash.
- a list of valid yield positions, so stepping over await stuff
works as expected.
- Adding "DebugStepCheckInstr" to the kernel generated il so stepping
over await stuff works as expected, we can break in empty methods etc.
With this, approximately 80% of the service tests pass in kernel mode.
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2632183002 .
Utilize the offsets added in previous CLs.
While this doesn't by it self give anything that resembles
a good debugging experience, it should now be possible to
set *some* breakpoints and actually break on them.
Because of the way observatory works (and because of an
unfinished Script::GenerateLineNumberArray (for kernel))
the formatting of the code you try to load up and 'debug'
has to be quite specific (e.g. no indentation at all),
and even then it mostly doesn't work.
This is step #3 in introducing these things, next step(s) will be
fixing stuff like the above.
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2628693004 .
Added offsets to more nodes.
Added end offsets to some nodes.
Added functionnode debuggability flag.
This changes the dill format.
The new offsets et al. are read on the C++ side, but not used
for anything usefull yet.
This is step #2 in introducing these things, next step(s) will be
using it on the C++ side.
R=asgerf@google.com
Review-Url: https://codereview.chromium.org/2626613002 .
- The flow graph builder is only used to visit Statements and
Expressions so it does not need TreeVisitor as a base class. This
will make refactoring it easier.
- The TranslationHelper is bound to a Thread so we do not need
Thread::Current where we have a TranslationHelper.
- BlockExpression does not exist in Kernel any more, so it can be
removed from the C++ AST implementation.
BUG=
R=kustermann@google.com
Review-Url: https://codereview.chromium.org/2624513005 .
- For now include source uncompressed.
- When running from kernel, use token position 0
(i.e. dummy, but 'real' position) as start and end on functions
and classes to enable Observatory to run with the dill file.
- Debugging does not work, but one can browse the source in
Observatory.
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2587673004 .
This is part of the following CL:
Roll Kernel to fix an async bug.
There was a bug in the translation of await in finally when there
was a return in the try block.
The new async/async* translation revealed a bug in the scoping of
labels. Labels from enclosing functions were visible in nested
functions. That bug is fixed here.
Review URL: https://chromereviews.googleplex.com/536237014 .
R=vegorov@google.com
Review URL: https://codereview.chromium.org/2515323002 .