Commit Graph

28 Commits

Author SHA1 Message Date
Asger Feldthaus 8bfc4b47c0 Implement canonical name scheme in kernel.
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 .
2017-02-23 14:12:10 +01:00
Jens Johansen 86d788e699 [Kernel] replace function debuggable originalAsyncMarker
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 .
2017-02-22 12:12:54 +01:00
Asger Feldthaus fd6018d2ab Add IR nodes needed for deferred loading.
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2659343002 .
2017-02-13 14:31:24 +01:00
Jens Johansen e7766c950e Debugging in kernel shaping up.
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 .
2017-01-31 11:59:06 +01:00
Jens Johansen d0e0ef52ef Revert "Debugging in kernel shaping up."
This reverts commit 2d5147be9d.

INTPTR_MAX doesn't exist on all builders.

BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2664143002 .
2017-01-31 11:26:46 +01:00
Jens Johansen 2d5147be9d Debugging in kernel shaping up.
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 .
2017-01-31 11:01:29 +01:00
Ben Konyi 0d9a7970f5 Removed usage of std::map and std::vector from kernel code. Issue #28064.
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2658693002 .
2017-01-25 14:53:33 -08:00
Ben Konyi 6c2e67e764 Revert "Switched from GrowableArray to MallocGrowableArray to fix crash caused"
This reverts commit ac2b995a9296a100b0385fe7f262ebefa1da30d8.

BUG=

Review-Url: https://codereview.chromium.org/2656693006 .
2017-01-25 13:59:46 -08:00
Ben Konyi 9956256223 Switched from GrowableArray to MallocGrowableArray to fix crash caused by no isolate/thread existing when called. Also created MallocMap for the same reason.
BUG=
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2655463005 .
2017-01-25 13:55:45 -08:00
Ben Konyi 57ff20f49e Revert "Revert "Revert "Removed usage of std::map and std::vector from kernel code. Issue #28064."""
This reverts commit e2bb8409ab.

BUG=

Review-Url: https://codereview.chromium.org/2654983002 .
2017-01-24 19:29:06 -08:00
Ben Konyi e2bb8409ab Revert "Revert "Removed usage of std::map and std::vector from kernel code. Issue #28064.""
This reverts commit ddc24380b1.

BUG=

Review-Url: https://codereview.chromium.org/2648233005 .
2017-01-24 15:58:59 -08:00
Ben Konyi ddc24380b1 Revert "Removed usage of std::map and std::vector from kernel code. Issue #28064."
This reverts commit b9035d949f.

BUG=

Review-Url: https://codereview.chromium.org/2650333002 .
2017-01-24 15:18:27 -08:00
Ben Konyi b9035d949f Removed usage of std::map and std::vector from kernel code. Issue #28064.
Added fix to hopefully fix build error.

BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2647633003 .
Review-Url: https://codereview.chromium.org/2641243002 .
2017-01-24 14:25:55 -08:00
Ben Konyi 536a177728 Revert "Removed usage of std::map and std::vector from kernel code. Issue #28064."
This reverts commit c49eaa19dc.

TBR=zra@google.com

BUG=

Review-Url: https://codereview.chromium.org/2644183002 .
2017-01-19 12:23:24 -08:00
Ben Konyi c49eaa19dc Removed usage of std::map and std::vector from kernel code. Issue #28064.
BUG=
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2647633003 .
2017-01-19 12:11:26 -08:00
Jens Johansen b2b00e8909 TokenPositions on more nodes when running from Kernel
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 .
2017-01-13 13:10:20 +01:00
Jens Johansen 81821ce9b4 Remove kernel write code.
It is not used, we cannot test if it would even produce
a valid file (hint: it would not, see closed https://codereview.chromium.org/2621383005/ for a fix though).

R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2629123002 .
2017-01-13 10:35:35 +01:00
Jens Johansen 414d66dce6 More offsets in kernel
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 .
2017-01-11 09:59:52 +01:00
Kevin Millikin a39234eede Small cleanups in the Kernel FlowGraphBuilder
- 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 .
2017-01-10 10:50:56 +01:00
Jens Johansen aecb572d76 Include source in kernel.
- 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 .
2017-01-03 14:33:16 +01:00
Martin Kustermann c3895181a7 VM: [Kernel] Cherry-pick from dart-lang/kernel_sdk
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 .
2016-11-21 16:49:40 +01:00
Jens Johansen 63e9c7641b Merge of source position information from kernel-sdk.
I.e. use offsets (on some nodes) in the dill file to
get stacktraces with line- and column numbers.

"sdk" version of "kernel-sdk"s
https://chromereviews.googleplex.com/520617013/

R=kmillikin@google.com

Review URL: https://codereview.chromium.org/2512653002 .

Committed: https://github.com/dart-lang/sdk/commit/6fd3a42edb4c7902a49811318de6bb6b18dbd829
2016-11-21 14:13:46 +01:00
Jens Johansen 1056c562aa Revert "Merge of source position information from kernel-sdk."
The commit broke 2 tests:
vm/cc/IsolateReload_TypeIdentityGeneric
vm/cc/SourceReport_Coverage_AllFunctions_ForceCompile

This reverts commit 6fd3a42edb.

BUG=

Review URL: https://codereview.chromium.org/2517953002 .
2016-11-21 11:16:29 +01:00
Jens Johansen 6fd3a42edb Merge of source position information from kernel-sdk.
I.e. use offsets (on some nodes) in the dill file to
get stacktraces with line- and column numbers.

"sdk" version of "kernel-sdk"s
https://chromereviews.googleplex.com/520617013/

R=kmillikin@google.com

Review URL: https://codereview.chromium.org/2512653002 .
2016-11-21 10:19:31 +01:00
Vyacheslav Egorov 23fd1a184b VM: Support bootstrapping core libraries from Kernel binaries instead of source.
BUG=http://dartbug.com/27590
R=asiva@google.com

Review URL: https://codereview.chromium.org/2485993002 .
2016-11-16 13:56:20 +01:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Zach Anderson 71a84cfed6 GN: Fix Debug flags. Fix Windows build.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2425043002 .
2016-10-17 12:58:24 -07:00
Vyacheslav Egorov f67ce21068 VM support for running Kernel binaries.
BUG=
R=asiva@google.com, fschneider@google.com

Review URL: https://codereview.chromium.org/2411823003 .
2016-10-15 22:48:46 +02:00