Commit Graph

210 Commits

Author SHA1 Message Date
Teagan Strickland 709b2aa33d Adding a tool for using DWARF information to convert stack traces.
Also fixes the low and high PC information in the DWARF output of
inlining nodes.

Bug: https://github.com/dart-lang/sdk/issues/35851
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-mac-release-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I11c3577bdc5c12abdc88aa799c1aae3f505294df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123734
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-25 09:21:24 +00:00
Jens Johansen 2e32972929 [pkg/vm] Remove usage of Library.isExternal
Change-Id: I014184e2324ab0379653cb8c23cb7eed52677aeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124985
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-21 08:36:54 +00:00
Sigurd Meldgaard 9ddad67f73 [vm] Add aot option to protobuf_aware_treeshaker.
Change-Id: Iebc82edda2d727c9ec6a7dbc52dc04013bd505eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123581
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-05 14:14:51 +00:00
Jens Johansen f91ef3afd7 [kernel] Deprecate Library.isExternal
We're deprecating kernels Library.isExternal as it wasn't used for
what it was originally intended. It will hopefully go away entirely
soon.

Change-Id: If363c50af5607febae68865875af452c106fff85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123721
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-04 09:24:02 +00:00
Johnni Winther 9276d50fdc [cfe] Remove Severity.errorLegacyWarning
Change-Id: I1cc7a34af307b9edee4c92e43e8607a450cf471d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120585
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-08 09:16:47 +00:00
jonahwilliams 13fbf569f6 [flutter] split frontend_server from vm package
To support JavaScript compilation, the frontend_server will require a dependency on the dev_compiler. To avoid conflating this with the vm specific functionality, the frontend server will be split from its current location.

This change will require a small corresponding update in flutter/engine, documented in the patches directory
Change-Id: I47923765546f7f6fa43e36ef38f8f466d3a7b2fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120321
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-10-08 05:32:59 +00:00
Ryan Macnak 836d9bf168 Reapply "[vm, bytecode] Fix missing dependencies in --snapshot-deps output."
Avoid Windows path differences. Skip for simulators (i.e., running from kernel file instead of source).

Change-Id: I7045591f026c392d92f2ec3247ed5b6e1b5e25df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120023
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-04 19:30:06 +00:00
Ryan Macnak 1d5bdb2cee Revert "[vm, bytecode] Fix missing dependencies in --snapshot-deps output."
This reverts commit f2e32b5e65.

Reason for revert: Simulators and Windows

Original change's description:
> [vm, bytecode] Fix missing dependencies in --snapshot-deps output.
> 
> Change-Id: Ib0bcb43f52e0a086174f508222d60b894a5855f8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120004
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=rmacnak@google.com

Change-Id: I0848e2fc5dd4623b2e9d2913ed211cc1da5b73e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120022
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-04 00:21:17 +00:00
Ryan Macnak f2e32b5e65 [vm, bytecode] Fix missing dependencies in --snapshot-deps output.
Change-Id: Ib0bcb43f52e0a086174f508222d60b894a5855f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120004
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-03 22:59:02 +00:00
Ryan Macnak 14983a2941 [vm/bytecode] Add timeline events for major compilation phases.
Change-Id: Ie2a1f8a5979bb58133535b7698c5137d4ab2b046
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118648
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-30 16:36:09 +00:00
Jens Johansen dd1969a43a [pkg/vm] Train kernel service differently
When the kernel service is asked to train ("--train") one gives it a script
to train on (by compiling the script).
In our build scripts that is dart2js - a relatively big application that
exercise many parts of the compilation pipeline. That is all fine and good,
but some parts are only executed once (e.g. creating the UriTranslator etc).
In an attempt to train these parts more this change additionally
compiles a simple hello world script 10 times whenever it's asked to
train on anything.

On my desktop there is no statistical significant change in runtime of
a hello world script, but on a ODROID-C2 system where I trained it
manually on dart2js before and after this change I get these runtime
changes:

        -0.0269167 +/- 0.00493467
        -3.65054% +/- 0.669259%

i.e. ~26 ms faster (from a median of 0.735 seconds to 0.708 seconds).

This CL furthermore changes the way we print via the kernel service in
verbose mode, as the current way generally prints ~5M integers to a
text buffer, then uses the first 256 characters of that and prints it to
terminal. This is here changed to only print the first ~256 characters
thus making the verbose enabled runtime more similar to the verbose
disabled runtime.

Change-Id: Id53b059025adc3517e99e56eaef438a6093b674a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117300
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-16 13:41:59 +00:00
Alexander Markov 9fda4c1101 [vm/bytecode] Avoid using closure call instructions if code coverage may be needed
This is a workaround to https://github.com/dart-lang/sdk/issues/37944.
Closure call instructions are not tracked by code coverage, so this change
avoids generating them in bytecode if incremental kernel compiler is used -
when vm-service is enabled with command-line option and code coverage
may be needed.

Change-Id: Ifb3bc5e90a9f8ccb04073994d761bc301bc274ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114045
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-22 00:28:34 +00:00
Alexander Markov 5e5313c8d6 [vm/bytecode] Keep unreachable code for code coverage
This change adds a bytecode generation option 'keep-unreachable-code' to
avoid eliminating unreachable code from constant conditions.
This option is enabled in kernel service.

If unreachable code is eliminated, then call instructions are not generated
and ICData objects are not created. Source code report is collected
using created ICData objects and will not flag the unreachable code as
not executed.

Change-Id: Ic73e19c653505e0dfab4648ab65ef6b90370e0b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113960
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-21 02:28:44 +00:00
Alexander Markov 1644d4b178 [vm/bytecode] Train kernel service with bytecode generation
If Dart SDK is built with --bytecode, kernel service will generate
bytecode, so it should be trained with bytecode generation as well.

Change-Id: I1a7914c78dfcbd51425585b5600b299fee4c6506
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113381
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-16 19:31:00 +00:00
Johnni Winther 19654f30d0 [cfe+vm+ddc] Return ClassHierarchy and CoreTypes together with Component
Users of the CFE often need the ClassHierarchy and may CoreTypes after
invoking the CFE. This CL extends the result of `kernelForProgram` and
`kernelForComponent` to a `CompilerResult` that includes these objects.

Change-Id: I08491198fe876b6514e49993ad794388d6662c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112259
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-09 13:02:12 +00:00
Johnni Winther 3312fe3d26 [cfe] Fully support expired flags in CFE
This ensures that we can prohibit the disabling of an enabled and
expired flag while still support the use of enum value in
implementation code.

Change-Id: Ib92c506365bb61853d6ff791461c5065acabcd4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99173
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-08-09 09:23:01 +00:00
Alexander Markov 9b3c693335 [vm/bytecode] Drop ASTs in kernel service if generating bytecode
Change-Id: I2ddf85b4004e0bc4d1da15a5967144d9890acba5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112301
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-08 16:44:51 +00:00
Alexander Markov 16f7076547 [vm/bytecode] Generate bytecode for expression evaluation
Issue: https://github.com/dart-lang/sdk/issues/36427

Change-Id: I0a07bd8ff1be357d2962e6745c8ef1e500d45477
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109984
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-26 18:22:51 +00:00
Ryan Macnak c6bc0031f3 [vm, bytecode] Field initializer for schema changes.
Bug: https://github.com/dart-lang/sdk/issues/32299
Change-Id: Id6359ad36db183f4cdd091e7fd778c879e868d99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108901
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-07-15 22:58:16 +00:00
Alexander Markov 78a8f670eb [vm/bytecode] Initial support for bytecode generation in incremental compiler
This change adds support for bytecode generation in incremental compiler in
kernel service. Bytecode generation is performed as a post-processing step,
after delta components are merged.

Bytecode generation requires CoreTypes and ClassHierarchy, which cannot be
constructed using delta component from incremental compilation (as it doesn't
contain platform or previously compiled libraries). The solution is to obtain
CoreTypes and ClassHierarchy directly from incremental compiler.

Now the following tests work:
vm/cc/IsolateReload_KernelIncrementalCompile
vm/cc/IsolateReload_KernelIncrementalCompileAppAndLib

Change-Id: I34c5870b01850c057ace71a63f8effa5b010cfcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108682
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-07-12 20:45:26 +00:00
Vyacheslav Egorov e82ca2f366 [fasta] Unconditionally enable asserts in const constructors
Based on feedback from the language team (https://github.com/dart-lang/language/issues/447).

Removal of CompilerOptions.enableAsserts is pending cleanup in DDK.

Change-Id: Id515e91da3e31647941ce893b2cffc58894a1b1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108813
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-12 15:42:43 +00:00
Vyacheslav Egorov cb93b8d813 [vm] Plumb enable_asserts to CFE through VM and kernel_front_end
When constant-update-2018 is enable it would be CFE's responsibility
to report compile time errors when assert in a constant fails.

Change-Id: Icfa5e9c1756439cdd46bdbaf5c7fb8124c24becf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108723
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
2019-07-11 11:32:13 +00:00
Alexander Markov 9503969664 [vm/bytecode] Add DebugCheck bytecode instruction
DebugCheck bytecode instruction is generated after parameter variables
are declared and copied into their locations in the prologue.
It helps debugger to stop in the beginning of a function at the point
where parameters can be inspected. It is generated only if
'--bytecode-options=debugger-stops' is specified.

Change-Id: I0f3b1ea8dc45d762a5dcee75b5d3a4ffc0b2a1b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108371
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-07-09 19:14:53 +00:00
Todd Volkert ddfde57069 Update File.openRead to return Stream<Uint8List>
Bug: https://github.com/dart-lang/sdk/issues/36900
Change-Id: Ib2e417f4baa0048e2d4c2156c250d0cf454fdf87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104523
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-27 00:22:17 +00:00
Ryan Macnak 91c2c3537b [vm, bytecode] Plumb bytecode mode flags to VM unit tests.
- Make tests using eval fail instead of timing out.
 - Collect allocation stats in the interpreter.
 - And various EnsureDeclarationLoaded.

Change-Id: I17377216cd6dde2615b205f1b28071e12e50e252
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107442
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-06-26 23:47:07 +00:00
Ryan Macnak 5c1d5444d6 [vm, bytecode] Fix some source position discrepancies.
Fix most cases of accessing metadata; parameter annotations still missing.

Change-Id: Ie78c3d817a86a656548cdc5775f837250a710095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106967
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-06-25 00:57:26 +00:00
Alexander Markov f6af8ccba8 [vm/bytecode] Consolidate bytecode generation options
As number of bytecode generation options grows, it becomes cumbersome
to add them and propagate from the place where they are parsed to
the place where they are used. In order to make it easier to
change and add new bytecode generation options, this CL introduces
BytecodeOptions class which consolidates all options for bytecode
generation. Also, command line options --emit-bytecode-*** are gathered
into a single multi-option --bytecode-options=opt1,opt2,...

Also, unused --use-future-bytecode-format option is cleaned up. If needed,
it could be easily re-introduced in the new BytecodeOptions.

Change-Id: I637bf28ceb4233ead2562afe7ad51c69a99f2d60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106965
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-21 20:31:38 +00:00
Alexander Markov da8cb470cc [vm/bytecode] Represent classes, libraries, scripts and recursive types in bytecode
Size of a large application:
Before: 26628600
After: 21480120 (-19.3%)

Size of snapshots:

isolate_snapshot_framework.bin
Before: 9322496
After: 6782976 (-27.2%)

isolate_snapshot_product_framework.bin
Before: 9166848
After: 6602752 (-27.9%)

Regressions in tests:

1) Test language_2/type_alias_equality_test/04 fails similarly to default mode, as VM
does not implement comparison of function types according to the specification.
Previously this test was passing as function types were canonicalized in bytecode,
which was not always correct. This CL fixes the problem with canonicalization of
function types in bytecode and the test starts failing again.

2) Tests standalone_2/entrypoints_verification_test, standalone_2/io/test_extension_test,
standalone_2/io/test_extension_fail_test fail as native extensions are not supported
in bytecode yet. These tests start passing after df5e7aac17,
which switched bytecode tests to kernel service (on x64), because kernel service doesn't
drop ASTs. This CL switches from reading AST library declarations to bytecode even if
AST is not removed, so tests fail again.

Change-Id: I8b7ba44bfa49d0b1599b2509553ff7c831a4e244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104700
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-20 18:27:21 +00:00
Régis Crelier df5e7aac17 [vm/bytecode] Intermediate out.dill not needed anymore when testing bytecode.
Change-Id: I213e023b8b6ba15fcd723c0a49a0b5d7ec471e15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106420
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-06-17 21:24:21 +00:00
Alexander Markov 372b02d97f [vm/bytecode] Add information about local variables to bytecode
Change-Id: I22bbd3b7ea0cccc0a8d721c3766a80ae1c72060d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/87701
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-30 21:21:44 +00:00
Alexander Markov e88363cffd [vm] Fix formatting and analyzer hints in pkg/vm
The following analyzer hints are fixed:

  hint • This function has a return type of 'String', but doesn't end with a return statement at pkg/vm/bin/compare_sizes.dart:140:3 • missing_return
  hint • This function has a return type of 'String', but doesn't end with a return statement at pkg/vm/bin/compare_sizes.dart:198:3 • missing_return

Change-Id: Ia34006eb023c0b3f9b60f8f38dc248cfa1c87a30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98983
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-09 22:38:27 +00:00
Sigurd Meldgaard 9d3988eb67 [vm] First stab at a protobuf aware treeshaker
Relies on https://dart-review.googlesource.com/c/sdk/+/96782
Change-Id: I820e884f96923f9eb9a856faef6442f6ed645fe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96162
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-03-18 13:07:44 +00:00
Jens Johansen e4d1b28698 Incremental compiler should respect omitPlatform setting
Change-Id: Id842db646ba95945c8fadce0626cb8cbee2812ad
Reviewed-on: https://dart-review.googlesource.com/c/93433
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-02-22 11:44:45 +00:00
Ryan Macnak 5d71308b78 [vm/tools] Don't duplicate "problems" metadata into split package files.
Add utility for enumerating libraries in a kernel binary.

Bug: MI4-1794
Change-Id: Iad65f236ef9d0d184323ffd2af92d311a97e525c
Reviewed-on: https://dart-review.googlesource.com/c/92865
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-02-13 19:16:36 +00:00
Aart Bik dbf4900c99 [vm/tools] Fix issues with snapshot size reporting
Rationale:
This fixes the following three issues to get byte-exact
snapshot size difference reporting, which makes optimizing
for code size a lot easier.

Issues:
(1) reports the slightly more accurate raw size
(2) accumulates dups in the json
    (before we only did bookkeeping for one)
(3) avoid non-deterministic parts in names
    (this resulted in reporting baffling method size
     differences against the same layout, even though
     the aggregate difference added up to 0).

https://github.com/dart-lang/sdk/issues/35323

Change-Id: Ia6abe50ab8694fe54906e28a3b3375ed99ace9df
Reviewed-on: https://dart-review.googlesource.com/c/92320
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-02-07 19:42:26 +00:00
Aske Simon Christensen ac95355fdb Compiler option for environment defines
Change-Id: I50f0085ebbc2c9a3af26769a0004bfb8361d85f2
Reviewed-on: https://dart-review.googlesource.com/c/91340
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-02-07 16:15:52 +00:00
Aart Bik a851d4c370 [dart/tools] Option to limit column widths in code size tool
Rationale:
Ensures that copy-paste into gerrit yields readable code.

https://github.com/dart-lang/sdk/issues/35323

Change-Id: I3df2ed7712216bd67ed092ff62524785ac47ca52
Reviewed-on: https://dart-review.googlesource.com/c/90862
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-01-25 02:28:53 +00:00
Vyacheslav Egorov 6dfb3e9f60 [vm/tools] Add pkg/vm/bin/compare_sizes.dart
This script can be used to compare two outputs of --print-instructions-sizes-to
and render a table that highlights symbols that became bigger or smaller
between two compilations.

Change-Id: I011584a370d8c94061da42e8e4f253c84d870bc3
Reviewed-on: https://dart-review.googlesource.com/c/89643
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-01-17 11:52:14 +00:00
Liam Appelbe df0671d664 [VM] Experimental flags in the dart CLI
Blocked on https://dart-review.googlesource.com/c/sdk/+/88840

Bug: https://github.com/dart-lang/sdk/issues/35602
Change-Id: I72b1cf574c9cb3d1dac2fbd8dfeb0f3fd80e330e
Reviewed-on: https://dart-review.googlesource.com/c/89042
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-01-15 01:02:07 +00:00
Alexander Markov 16b51c3dc1 [vm/bytecode] Disable incremental compilation if bytecode is used
Bytecode generation doesn't work on incremental components as they
omit core libraries. As a temporary workaround, this CL disables
incremental compilation in bytecode mode in order to be able to run VM
with '--use-bytecode-compiler --observe' and get profiles.

Change-Id: Id843a03871d959e11acfb8f046019aa756ee7c65
Reviewed-on: https://dart-review.googlesource.com/c/88233
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-01-03 00:05:30 +00:00
Alexander Aprelev 7d14785115 This relands "Load isolate from parent's kernel in Isolate.spawn calls.".
Original PR was reverted because it broke hot-reload bots. This CL adds steps to initialize kernel_service compiler for child isolate. Compiler is needed to support hot-reload request. Child isolate's compiler is created from full kernel file produced by main isolate's compiler. Changes since original PR are pkg/vm/bin/kernel_service.dart in pkg/vm/lib/incremental_compiler.dart.

Further this CL changes kernel fingerprint calculation for interface types so it calculates the hash of the canonical names themselves, rather than indices(that might change from one compilation to another).

This reverts commit 63fd8f63e6.

Change-Id: I6fe5b2ef99f209b32cd4087dfd1c8cac229c2d8b
Reviewed-on: https://dart-review.googlesource.com/c/87265
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2018-12-14 23:45:57 +00:00
Alexander Aprelev fc3153a4f0 [vm] Unskip isolate tests on sim* architecture.
Also make kernel-service verbose output friendlier(so it doesn't dump platform.dill on console).

Change-Id: Ibed494f324cd574e05b701f7d56b18c0fb1b451f
Reviewed-on: https://dart-review.googlesource.com/c/86784
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-12-13 03:07:06 +00:00
Kevin Millikin a8493e1b50 Flip the default value of the Kernel syncAsync flag
In Kernel's TargetFlags, this flag still defaulted to false.  Flip the
default to true and update all client code in the SDK.  The
expectation is that many of the places that now pass false explicitly
really just want the default, but that will be verified separately and
then the flag will be removed.

Change-Id: I2a38eb53f280f21f59bb1d2e88c42516f827fd39
Reviewed-on: https://dart-review.googlesource.com/c/85448
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-12 14:23:54 +00:00
Alexander Markov 170d5578c7 [vm/kernel] Move functionality of Fuchsia's compiler.dart into pkg/vm
This includes:
* Selecting front-end target.
* Support for multi-root virtual file system.
* Not linking platform into resulting kernel file.
* Specifying input as URI (instead of file path) on command line.
* Automatically converting input script URI to package URI.
* Writing ninja dependencies file.
* Writing package-split kernel binaries.

After this change Fuchsia's compiler.dart will become a small wrapper
over pkg/vm, sharing most logic and even most command line options
with pkg/vm gen_kernel tool.

Also, this CL attempts to share some pieces of code between frontend
server and gen_kernel.

In addition, seperate bytecode generation for package-split binaries
is implemented (needed for https://dart-review.googlesource.com/c/sdk/+/85469).

Corresponding Fuchsia CL: https://fuchsia-review.googlesource.com/c/topaz/+/229964

Change-Id: I12d7b2f6401357b3c9df2e31bc736af5a9dc5fd2
Reviewed-on: https://dart-review.googlesource.com/c/85721
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-12-04 01:08:03 +00:00
Alexander Markov e6800d9589 [vm] Disable bytecode generation while training kernel service
Change-Id: Ibfdc9379965bda99f63250b880b46fbdeb384248
Reviewed-on: https://dart-review.googlesource.com/c/85120
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-11-21 18:05:08 +00:00
Zach Anderson b981cbfff8 [vm] Adds a flag to dump dynamic bytecode traces in a debug build.
Also adds a program in pkg/vm/bin/dump_bytecode_ngrams.dart that
analyzes the traces.

Change-Id: I39c9645ca858195a41e001dab47a7b1398f4b15e
Reviewed-on: https://dart-review.googlesource.com/c/83340
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-11-16 06:24:02 +00:00
Alexander Markov 8f7a0f400b [vm/bytecode] Emit source positions for bytecode instructions
Change-Id: I83963771db301089317823f6bf14eb4a2728dbfb
Reviewed-on: https://dart-review.googlesource.com/c/81740
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-11-14 00:27:45 +00:00
Jens Johansen 3e56b7ec3a Exercise loadComponent of sdk more when training kernel_service
By exercising loadComponent more we speedup the loading of the sdk.
This is going to be noticable when executing small scripts.
On my machine execution of a hello-world script is speed up by ~15-20%.

More data from local experiments:

Before:

$ perf stat -r 25 -d out/ReleaseX64/dart hello.dart

 Performance counter stats for 'out/ReleaseX64/dart hello.dart' (25 runs):

        389.268166      task-clock:u (msec)       #    2.035 CPUs utilized            ( +-  0.91% )
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
            19,278      page-faults:u             #    0.050 M/sec                    ( +-  0.65% )
       979,345,922      cycles:u                  #    2.516 GHz                      ( +-  1.31% )  (48.75%)
     1,120,493,995      instructions:u            #    1.14  insn per cycle           ( +-  0.73% )  (61.28%)
       207,470,248      branches:u                #  532.975 M/sec                    ( +-  0.84% )  (60.76%)
         4,439,025      branch-misses:u           #    2.14% of all branches          ( +-  1.00% )  (61.00%)
       387,461,284      L1-dcache-loads:u         #  995.358 M/sec                    ( +-  1.38% )  (49.12%)
        18,764,375      L1-dcache-load-misses:u   #    4.84% of all L1-dcache hits    ( +-  2.94% )  (26.43%)
         5,713,192      LLC-loads:u               #   14.677 M/sec                    ( +-  2.13% )  (25.71%)
         1,266,848      LLC-load-misses:u         #   22.17% of all LL-cache hits     ( +-  3.74% )  (37.01%)

       0.191278504 seconds time elapsed                                          ( +-  1.10% )


$ runxtimes 25 sudo chrt -f 99 /usr/bin/time -f "%e" out/ReleaseX64/dart hello.dart > /dev/null 2>> before.txt

After:

$ perf stat -r 25 -d out/ReleaseX64/dart hello.dart

 Performance counter stats for 'out/ReleaseX64/dart hello.dart' (25 runs):

        311.248543      task-clock:u (msec)       #    1.981 CPUs utilized            ( +-  0.91% )
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
            18,055      page-faults:u             #    0.058 M/sec                    ( +-  0.84% )
       727,169,504      cycles:u                  #    2.336 GHz                      ( +-  1.66% )  (48.89%)
       875,097,166      instructions:u            #    1.20  insn per cycle           ( +-  0.74% )  (60.69%)
       164,966,288      branches:u                #  530.015 M/sec                    ( +-  0.82% )  (59.50%)
         3,403,794      branch-misses:u           #    2.06% of all branches          ( +-  0.93% )  (59.61%)
       272,404,305      L1-dcache-loads:u         #  875.199 M/sec                    ( +-  1.53% )  (47.62%)
        11,115,851      L1-dcache-load-misses:u   #    4.08% of all L1-dcache hits    ( +-  1.70% )  (27.55%)
         4,154,542      LLC-loads:u               #   13.348 M/sec                    ( +-  2.22% )  (26.40%)
         1,225,723      LLC-load-misses:u         #   29.50% of all LL-cache hits     ( +-  2.75% )  (37.49%)

       0.157151348 seconds time elapsed                                          ( +-  1.12% )



$ runxtimes 25 sudo chrt -f 99 /usr/bin/time -f "%e" out/ReleaseX64/dart hello.dart > /dev/null 2>> after.txt

$ ministat -A before.txt after.txt
x before.txt
+ after.txt
    N           Min           Max        Median           Avg        Stddev
x  25          0.17           0.2          0.18        0.1816         0.008
+  25          0.13          0.19          0.15         0.152   0.013844373
Difference at 95.0% confidence
        -0.0296 +/- 0.00643101
        -16.2996% +/- 3.5413%
        (Student's t, pooled s = 0.0113063)



Notes:

$ type runxtimes
runxtimes is a function
runxtimes ()
{
    number=$1;
    shift;
    for i in `seq $number`;
    do
        $@;
    done
}

Change-Id: I760759976136195da00e3719663bdadbfe962e70
Reviewed-on: https://dart-review.googlesource.com/c/82581
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-11-06 10:59:27 +00:00
Peter von der Ahé 3a1e32a3e7 Remove superfluous print
Change-Id: I2060f269408d87af15935ba5a437cc7d9407d314
Reviewed-on: https://dart-review.googlesource.com/c/82043
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-10-30 16:16:36 +00:00
Samir Jindel e23acaaf90 [vm/aot] Fix obfuscation.
Test Plan:

Make vm-kernel-precomp-obfuscate-linux-release-x64-try green, ensuring status file changes
reflect design gaps and not bugs.

Tested locally that obfuscated Flutter Gallery runs.

Change-Id: Ifcdc334de58f43c310e15b58dbcf6fe1597206f2
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-obfuscate-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/81009
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-26 13:00:33 +00:00