Commit Graph

23 Commits

Author SHA1 Message Date
Dmitry Olshansky a8bc1de524 VM [KERNEL] Fix performance issue in KernelReader
Original code is constructing Class fields
and functions incrementally going through
poorly scalable AddFunction and AddField
reallocating the whole array on each call.

Instead accumulate things in GrowableArrays
and insert in one go.

BUG= https://github.com/dart-lang/sdk/issues/28312
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2777963002 .
2017-03-27 20:24:15 +02:00
Kevin Millikin d715611c03 Use canonical names for some name-based lookup.
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=jensj@google.com, kustermann@google.com

Committed: https://github.com/dart-lang/sdk/commit/a15b8c49ea195345f542d4efbe8d6dd29268d030
Review-Url: https://codereview.chromium.org/2762213002 .
2017-03-27 12:14:50 +02:00
Kevin Millikin 91bc604415 Revert "Use canonical names for some name-based lookup."
This reverts commit a15b8c49ea.

BUG=

Review-Url: https://codereview.chromium.org/2772803002 .
2017-03-23 14:21:06 +01:00
Kevin Millikin a15b8c49ea Use canonical names for some name-based lookup.
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 .
2017-03-23 12:24:05 +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 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
Martin Kustermann e97bcc5475 VM: [Kernel] Partial support for metadata annotations
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 .
2017-01-18 10:51:24 +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 1aff626804 VM: [Kernel] Split kernel API into 3 steps: ([read binary], parse-binary, bootstrap, load program)
This avoids reading and parsing the kernel binary multiple times and avois
having it multiple times in memory (we don't free the 'kernel::Program*' object
ATM).

R=kmillikin@google.com

Review URL: https://codereview.chromium.org/2525623002 .
2016-11-23 09:26:15 +01:00
Martin Kustermann 63af3f56ee VM: [Kernel] Cherry-pick from dart-lang/kernel_sdk
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 .
2016-11-21 16:38:30 +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
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -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