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 .
For compiling the platform libraries separately and for hot reload, we
will not link canonical names of Kernel libraries, classes, and
members to their Kernel definitions. Those definitions will not be
persistent.
As a first step, change name-based lookup of libraries and classes to
be be based on the canonical name instead of the Kernel definition.
BUG=
R=kustermann@google.com
Review-Url: https://codereview.chromium.org/2762213002 .
Don't create getters for uninitialized static fields.
This fixes two assert hits that was hit when running service tests in debug mode via kernel. These can thus now be enabled.
BUG=
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2771443003 .
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 .
When we were implementing bootstraping from Kernel in https://github.com/dart-lang/sdk/commit/23fd1a184b393825f29444243780f3593ce0b3c1 we switched ClassID.cid* fields to become 'static final' lazily initialized fields instead of constants as they were before. This was mainly done to allow dartk compile patched_sdk - because these fields were previously injected in runtime and never existed in the text form.
However this regressed code quality for app-jit and app-aot snapshots because 'static final' fields are reset by snapshotting so resulting code contains InitStaticField and LoadStaticField instructions.
BUG=
R=kustermann@google.com
Review-Url: https://codereview.chromium.org/2693863006 .
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 .
The CL adds metadata support for Fields/Classes/Functions/Constructors. There
are other places where annotations can be put in the Dart language but the
Kernel IR currently does not store it in the AST.
Whenever a element (e.g. a function) gets annotated, the VM will make a [Field] for this
element whos value is an array of evaluated constant metadata annotations.
This CL attaches to these [Fields] a `kernel_function` which is then used to do the constant
evaluation.
R=vegorov@google.com
Review-Url: https://codereview.chromium.org/2632253002 .
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 .
- 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 .
- Kernel-to-IL translation leaves behind some unused constants without temp indices assigned.
- Let compile time errors propagate instead of failing with FATAL error in the post load class finalization.
R=kustermann@google.com
BUG=
Review URL: https://codereview.chromium.org/2528763002 .
E.g.
file1:
------------
library crash;
part "file2.dart";
main() {
print(field2);
}
crash() {
try {
throw "Crashing!";
} catch(exception, stacktrace) {
print(stacktrace);
}
}
file2:
------------
part of crash;
var field2 = crash();
We want something like
#0 crash (whatnot/file1.dart:11:5)
#1 field2 (whatnot/file2.dart:3:14) <-- good line
#2 field2 (whatnot/file2.dart:3:5)
#3 main (whatnot/file1.dart:6:9)
and not like
#0 crash (whatnot/file1.dart:11:5)
#1 field2 (whatnot/file1.dart:3:14) <-- bad line
#2 field2 (whatnot/file2.dart:3:5)
#3 main (whatnot/file1.dart:6:9)
R=kmillikin@google.com
Review URL: https://codereview.chromium.org/2519133004 .
Fix a trio of issues in type finalization.
1. We were using is_type_finalized to detect classes that had already been
initialized by DilReader::ReadPreliminaryClass. This state is not
guaranteed by this function, however is_cycle_free is.
2. In the VM, classes that were created type finalized were not marked as
cycle free because finalization did not consider them so cycle-freeness
didn't matter. We would therefore try to initialize these classes with
DilReader::ReadPreliminaryClass and mutate types in them. This causes
them to have unfinalized types but still have is_type_finalized true.
3. Types in top-level procedures were not necessarily finalized. A simple
way to achieve this is to finalize each library's top-level class.
Review URL: https://chromereviews.googleplex.com/520437013 .
R=kmillikin@google.com
Review URL: https://codereview.chromium.org/2514373002 .