Commit graph

67 commits

Author SHA1 Message Date
Alexander Markov ea7348c5f0 Revert "[vm/bytecode] Switch kernel service dill to bytecode if building Dart SDK with --bytecode"
This reverts commit beee442625.

Reason for revert: StackOverflow on language_2/deep_nesting_expression_test/01 in interpreted mode.

Original change's description:
> [vm/bytecode] Switch kernel service dill to bytecode if building Dart SDK with --bytecode
> 
> Temporary setting of FLAG_enable_interpreter is avoided in the VM unit tests as
> this flag is global and used by kernel service isolate while running tests.
> Flipping this flag causes assertion failures in kernel isolate's background compiler
> or infinite loop between LazyCompile stub and CompileFunction as AttachBytecode
> doesn't set entry point to InterpretCall.
> 
> The less intrusive way to ensure compilation of functions in unit tests is to set
> FLAG_compilation_counter_threshold to 0.
> 
> Change-Id: Ia46ff8d03d66ab8b147b9d89336548c4a9c29f5d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113123
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,regis@google.com

Change-Id: I67cd03a56f9a2d29aa6597d38779e77ca3a16b18
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113480
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-16 22:39:52 +00:00
Alexander Markov beee442625 [vm/bytecode] Switch kernel service dill to bytecode if building Dart SDK with --bytecode
Temporary setting of FLAG_enable_interpreter is avoided in the VM unit tests as
this flag is global and used by kernel service isolate while running tests.
Flipping this flag causes assertion failures in kernel isolate's background compiler
or infinite loop between LazyCompile stub and CompileFunction as AttachBytecode
doesn't set entry point to InterpretCall.

The less intrusive way to ensure compilation of functions in unit tests is to set
FLAG_compilation_counter_threshold to 0.

Change-Id: Ia46ff8d03d66ab8b147b9d89336548c4a9c29f5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113123
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-08-16 20:53:10 +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
Liam Appelbe 89f00ab25f Add a build rule for bytecode version of kernel_service.dill
Bug: https://github.com/dart-lang/sdk/issues/36047
Change-Id: Ifc95ff270c33cce13699bda23c1b7c8fb6139e2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96835
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-19 21:29:29 +00:00
Zach Anderson 8332fb0631 [vm] Adds an API call to dump the CPU profile to the timeline
Used in https://fuchsia-review.googlesource.com/c/topaz/+/258655

Change-Id: I79b102e0d318d7be3bae44fb88f81bb8086a10d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94400
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-03-07 21:28:26 +00:00
Zach Anderson 0bbdd8f7d9 [build] Correctly rebase kernel-service output for depfile
Otherwise ninja thinks kernel-service is always dirty.

Change-Id: I40fdddf25bddeb4546e520e7d8f0137eedf87bfd
Reviewed-on: https://dart-review.googlesource.com/75780
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-20 17:59:50 +00:00
asiva a0776096b9 Cleanup some of the build rules to not use Dart 1 mode.
Change-Id: I799ae7e910b90047a76151e47fc4c46d20f46ff7
Reviewed-on: https://dart-review.googlesource.com/74493
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-09-19 22:23:33 +00:00
Jens Johansen 1e4b3e9754 Train kernel-service on Windows
Now, on Windows:
hello.dart (hello world script): ~0.33s, ~0.33s, ~0.29s, ~0.28s, ~0.29s
pkg\complier\bin\dart2js.dart --help: ~3.37s, ~3.36s, ~3.40s, ~3.50s, ~3.41s

Before, on Windows:
hello.dart (hello world script): ~0.85s, ~0.87s, ~0.86s, ~0.90s, ~0.91s
pkg\complier\bin\dart2js.dart --help: ~6.12s, ~6.20s, ~6.26s, ~6.13s, ~6.04s

So...:
hello.dart (hello world script): -65.3759% +/- 4.15274% at 95.0% confidence
pkg\complier\bin\dart2js.dart --help: -44.5854% +/- 1.68273% at 95.0% confidence

Change-Id: I6679a7fff68c146390ef70832278ece6eb120c7c
Reviewed-on: https://dart-review.googlesource.com/73921
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-09-07 14:31:03 +00:00
asiva d1bd887d03 [VM/SDK] Switch kernel isolate to run in Dart 2 mode
- Switch the kernel isolate to run in Dart2 mode
- Refactor build rules so bootstrapping of the front end happens
  with a prebuilt dart sdk
- Refactor application snapshot build rules so the kernel application
  snapshot rule does not get into a cyclic dependency during the
  bootstrap stage

Change-Id: Iccca3233f6cb8d6b307b4cf1ca3262f293f794a6
Reviewed-on: https://dart-review.googlesource.com/70841
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-08-21 20:28:06 +00:00
Vyacheslav Egorov 032037681e Revert "[VM/SDK] Switch kernel isolate to run in Dart 2 mode"
This reverts commit 499761f0da.

Reason for revert: crashes when building SDK, red bots, broken Flutter 3xHEAD bot

Original change's description:
> [VM/SDK] Switch kernel isolate to run in Dart 2 mode
> 
> - Switch the kernel isolate to run in Dart2 mode
> - Refactor build rules so bootstrapping of the front end happens
>   with a prebuilt dart sdk
> - Refactor application snapshot build rules so the kernel application
>   snapshot rule does not get into a cyclic dependency during the
>   bootstrap stage
> 
> Change-Id: I067c5f1165fb93811dcc8e390a8bf381db721e5b
> Reviewed-on: https://dart-review.googlesource.com/70461
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

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

Change-Id: Ibf6d526fb5132b766f063fcf873cde661ae895d7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/70516
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-08-19 19:58:32 +00:00
asiva 499761f0da [VM/SDK] Switch kernel isolate to run in Dart 2 mode
- Switch the kernel isolate to run in Dart2 mode
- Refactor build rules so bootstrapping of the front end happens
  with a prebuilt dart sdk
- Refactor application snapshot build rules so the kernel application
  snapshot rule does not get into a cyclic dependency during the
  bootstrap stage

Change-Id: I067c5f1165fb93811dcc8e390a8bf381db721e5b
Reviewed-on: https://dart-review.googlesource.com/70461
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-08-18 22:50:09 +00:00
Zach Anderson 00e3109368 [VM] Adjust flags for creating depfiles
Currently, the VM can create depfiles when writing out a snapshot.
The snapshot file is the output file for the depfile. This change
allows creating a depfile when not writing out a snapshot. It
accomplishes this by adding a new flag --depfile_output_filename,
which allows the user to supply the output filename for the depfile,
which would otherwise be ambiguous when we are not creating a snapshot.

This change also adds the flag --depfile, which
--snapshot_depfile is now an alias of.

related #34026

Change-Id: I45eee463c499fc542e577d805b7ef9911ccb72a7
Reviewed-on: https://dart-review.googlesource.com/67420
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-07-31 17:09:31 +00:00
Siva Annamalai 33697f7339 Revert "Reland "[VM/SDK]""
This reverts commit b59583edea.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Reland "[VM/SDK]"
> 
> This is a reland of b4146411d0
> 
> Original change's description:
> > [VM/SDK]
> > 
> > - Switch the kernel isolate to run in Dart2 mode
> > - Refactor build rules so bootstrapping of the front end happens
> >   with a prebuilt dart sdk
> > - Refactor application snapshot build rules so the kernel application
> >   snapshot rule does not get into a cyclic dependency during the
> >   bootstrap stage
> > 
> > Change-Id: Id16b2859e0b299b2d689971d03a247cb94d0aa26
> > Reviewed-on: https://dart-review.googlesource.com/61660
> > Commit-Queue: Siva Annamalai <asiva@google.com>
> > Reviewed-by: Zach Anderson <zra@google.com>
> 
> Change-Id: I2a3fa8ed4f331cf3de89ddff5cf8e478809dae39
> Reviewed-on: https://dart-review.googlesource.com/65841
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=zra@google.com,asiva@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I6077236481bec9089ead881c902036b0817114fc
Reviewed-on: https://dart-review.googlesource.com/66240
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-07-23 18:07:29 +00:00
asiva b59583edea Reland "[VM/SDK]"
This is a reland of b4146411d0

Original change's description:
> [VM/SDK]
> 
> - Switch the kernel isolate to run in Dart2 mode
> - Refactor build rules so bootstrapping of the front end happens
>   with a prebuilt dart sdk
> - Refactor application snapshot build rules so the kernel application
>   snapshot rule does not get into a cyclic dependency during the
>   bootstrap stage
> 
> Change-Id: Id16b2859e0b299b2d689971d03a247cb94d0aa26
> Reviewed-on: https://dart-review.googlesource.com/61660
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

Change-Id: I2a3fa8ed4f331cf3de89ddff5cf8e478809dae39
Reviewed-on: https://dart-review.googlesource.com/65841
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-07-19 22:04:56 +00:00
Siva Annamalai 7f5334480e Revert "[VM/SDK]"
This reverts commit b4146411d0.

Reason for revert: Seems to have build issues on certain bots

Original change's description:
> [VM/SDK]
> 
> - Switch the kernel isolate to run in Dart2 mode
> - Refactor build rules so bootstrapping of the front end happens
>   with a prebuilt dart sdk
> - Refactor application snapshot build rules so the kernel application
>   snapshot rule does not get into a cyclic dependency during the
>   bootstrap stage
> 
> Change-Id: Id16b2859e0b299b2d689971d03a247cb94d0aa26
> Reviewed-on: https://dart-review.googlesource.com/61660
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=zra@google.com,asiva@google.com

Change-Id: I4fc5b81e0a102bde4e8b4f737af3825e9728be3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/65840
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-07-19 21:20:39 +00:00
asiva b4146411d0 [VM/SDK]
- Switch the kernel isolate to run in Dart2 mode
- Refactor build rules so bootstrapping of the front end happens
  with a prebuilt dart sdk
- Refactor application snapshot build rules so the kernel application
  snapshot rule does not get into a cyclic dependency during the
  bootstrap stage

Change-Id: Id16b2859e0b299b2d689971d03a247cb94d0aa26
Reviewed-on: https://dart-review.googlesource.com/61660
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-07-19 20:48:18 +00:00
Zach Anderson 4877587346 [GN] Uses dart_action.gni instead of compiled_action.gni.
This avoids conflicts with client repos that have a file
//build/compiled_action.gni with something different in them.

Change-Id: I133f66b0989bcb547cb8eed8710a88e2c1384bd7
Reviewed-on: https://dart-review.googlesource.com/53440
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-05-03 21:07:13 +00:00
Alexander Aprelev ee15c8eb68 Move frontend_server from flutter to dart sdk.
Change-Id: I7f8b36977b448f08caf58b88b3fda43fab364514
Reviewed-on: https://dart-review.googlesource.com/43888
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-03-01 22:39:39 +00:00
Vyacheslav Egorov 0b5c52456a [testing] Make dartkp configuration work on Windows
Change-Id: I4a09994a1b79a7d857a854e3dcc1fe24068ffdec
Reviewed-on: https://dart-review.googlesource.com/43671
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-02-26 17:31:48 +00:00
Zachary Anderson e842c9b0b5 [infra] Use dart_action() instead of python scripts
This change shifts logic for invoking Dart scripts during the build
from a couple of python scripts to a new template called dart_action().

Change-Id: Ic0818122cd7317cbd22a7255d880fe8f87271b7e
Reviewed-on: https://dart-review.googlesource.com/39260
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-02-06 21:51:13 +00:00
Siva Chandra 4b73d12082 Link kernel service dill with the command line dart executable.
This linked in kernel service dill file will be used to load the kernel
isolate if the attempt to lookup the kernel service snapshot fails. The
kernel service snapshot is looked up in the following order.

1. If the "--dfe" option is specified, the file specified is used.
2. If the kernel service snapshot is found next to the executable,
then it is used.
3. If the kernel service snapshot is found in the "snapshots" directory
next to the executable, then it is used.

Change-Id: I5a0e757eb27b26a274b22b4bc36350fee59a100f
Reviewed-on: https://dart-review.googlesource.com/32446
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Chandra <sivachandra@google.com>
2018-01-12 20:40:41 +00:00
Alexander Markov 58ffdbf5fc [VM] Move kernel service to pkg/vm, populate pkg/vm with necessary files
* kernel-service.dart is moved to pkg/vm/bin and renamed to
  kernel_service.dart

* LICENSE, pubspec.yaml and analysis_options.yaml added to pkg/vm.

* Kernel isolate name is corrected to be independent of URI passed
  in --dfe VM option.

Change-Id: I5b7b860297314e240e557af80913e7ac3e6324ad
Reviewed-on: https://dart-review.googlesource.com/21260
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-17 17:45:03 +00:00
Zachary Anderson a99cdabd00 Reland: [GN] Adds dart_host_sdk_toolchain argument
Setting this build argument to something other than host_toolchain will
cause the build target create_host_sdk to be exposed. That target will
build the Dart SDK with the toolchain specified by
dart_host_sdk_toolchain.

Relanding to fix bad toolchain conditions in dart_os_config and
dart_arch_config.

TO-549

Change-Id: I276f47d9071233acb98f6029a4666da0cee33d7d
Reviewed-on: https://dart-review.googlesource.com/18361
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-02 19:02:18 +00:00
Zach Anderson 8f5d55623e Revert "[GN] Adds dart_host_sdk_toolchain argument"
This reverts commit 8fc90bd3bc.

Broken precomp bots due to wrong toolchain condition in dart_arch_config and dart_os_config.

Change-Id: Ic5c75f9ca3a0d4f316678354da44d1fcca10499d
Reviewed-on: https://dart-review.googlesource.com/18360
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-02 18:03:27 +00:00
Zachary Anderson 8fc90bd3bc [GN] Adds dart_host_sdk_toolchain argument
Setting this build argument to something other than host_toolchain will
cause the build target create_host_sdk to be exposed. That target will
build the Dart SDK with the toolchain specified by
dart_host_sdk_toolchain.

TO-549

Change-Id: Ida92521724cf7af34b34fb8c6d3514a226c48dd4
Reviewed-on: https://dart-review.googlesource.com/18145
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-11-02 17:27:19 +00:00
Zachary Anderson 02eebb0c69 [GN] Remove the dart_host_toolchain arg
This flag can be removed after: https://github.com/flutter/engine/pull/4308
lands.

Change-Id: I4730aaece1e43cf71ea569bda78c2cd546a66358
Reviewed-on: https://dart-review.googlesource.com/18060
Reviewed-by: Alexander Aprelev <aam@google.com>
2017-11-01 21:13:28 +00:00
Vyacheslav Egorov 0fe889dbd7 [VM] Pass --strong down to DFE isolate
Bug: https://github.com/dart-lang/sdk/issues/31147
Change-Id: Id8dbdadc1f69213604572efc815d45675d49734e
Reviewed-on: https://dart-review.googlesource.com/15883
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-10-23 11:27:47 +00:00
Peter von der Ahé b96ac4520a Update most clients to use computePlatformBinariesLocation.
Change-Id: I6e6960c471b2fab3f0cd8a672da05d7699217410
Reviewed-on: https://dart-review.googlesource.com/12291
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-17 10:48:40 +00:00
Peter von der Ahé 3e08354f85 Remove stray reference to :patched_sdk.
Change-Id: If5a1ea7082eae52e109f9b7272b2fcd0a866ba97
Reviewed-on: https://dart-review.googlesource.com/12000
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-10-06 16:19:40 +00:00
Peter von der Ahé 16aa720d27 Remove compiling platform.dill from patch_sdk.dart
This separates compiling platform.dill files from the patch_sdk.dart
script. The motivation for that is that I'm working on reading patch
files directly from Fasta, so we can completely remove the build step
for generating patched_sdk and dart2js_patched_sdk.

Short-term this should allow Paul to add a strong-mode version of
platform.dill without causing to many conflicts with my work on
patches.

Change-Id: I1150845b2986348d4fffe27092701d8a9b57ea54
Reviewed-on: https://dart-review.googlesource.com/11506
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-06 15:34:37 +00:00
Alexander Markov 9ee73fe322 [Kernel] Remove outdated and duplicated front-end Targets
This CL replaces outdated VmTarget and FlutterTarget with VmFastaTarget
and FlutterFastaTarget. 'Fasta' suffix is droped from target names.

The new FlutterTarget extends VmTarget, so they share more code.

Change-Id: Id79956698a889c9a49b8a67914f1f96a731407ab
Reviewed-on: https://dart-review.googlesource.com/9423
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 18:02:49 +00:00
Jens Johansen d854c77e58 [kernel] Only serialize non-external libaries and sources from those.
Previously the VM couldn't handle external libraries, but that was
fixed in 2f49198520.

Part of the CL was reverted though because the compilatin was changed
to using an outline instead of the platform which doesn't work.
What does work though, is not including the external libraries in the
output.

This CL makes the following changes:

* Don't include external libraries in the output (by not setting all
  libraries to be non-external).

* Only writes the sources actually used to the binary (i.e. whatever
  libraries left out because they were external will not contribute
  source code either).

* Cleanup of now unused code.


Timings (only run once though):


Without this CL (but with the CL it's based on):

$ time python tools/test.py -m release -cdartk language -j6
Test configuration: dartk_vm_release_x64
[05:43 | 100% | + 3504 | -    0]

real    5m43.597s
user    33m48.152s
sys     9m34.140s


Only the "utils/kernel-service/kernel-service.dart" part of this CL:

$ time python tools/test.py -m release -cdartk language -j6
Test configuration: dartk_vm_release_x64
[04:55 | 100% | + 3504 | -    0]

real    4m55.684s
user    29m54.360s
sys     8m7.408s


Entire CL:

$ time python tools/test.py -m release -cdartk language -j6
Test configuration: dartk_vm_release_x64
[04:20 | 100% | + 3504 | -    0]

real    4m20.416s
user    27m17.320s
sys     6m53.472s

Change-Id: Ie9c5bfa958e558a5007784e821a0b58d417bae55
Reviewed-on: https://dart-review.googlesource.com/3161
Reviewed-by: Samir Jindel <sjindel@google.com>
2017-09-06 11:56:24 +00:00
Peter von der Ahé a5bcf58b06 Move tools to tool folder.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/3003743002 .
2017-08-29 14:30:51 +02:00
Alexander Aprelev ba543167ec Pass path to platform kernel binary to kernel-service.
Currently kernel-service derives path to platform binary from path to dart executable. It doesn't always work, so dartk tests fail.

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

BUG:http://dartbug.com/30456
Review-Url: https://codereview.chromium.org/3001013002 .
2017-08-17 09:49:48 -07:00
Alexander Aprelev 747348caec Remove unused import statement.
This is a follow-up to a9afb54d6d to fix the tests.

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2999983002 .
2017-08-15 10:06:57 -07:00
Alexander Aprelev a9afb54d6d Revert "Revert "Introduce IKG into kernel-service to support incremental compilation.""
This reverts commit c35510d835
with fix for the build - remove implicit temporary array in TestCase::LoadTestScript.

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2998963002 .
2017-08-15 09:03:48 -07:00
Alexander Aprelev c35510d835 Revert "Introduce IKG into kernel-service to support incremental compilation."
This reverts commit f596d440f5.

BUG=

Review-Url: https://codereview.chromium.org/3002553003 .
2017-08-14 14:15:41 -07:00
Alexander Aprelev f596d440f5 Introduce IKG into kernel-service to support incremental compilation.
This CL also adds few hot-reload incremental kernel files tests(some pass, one is failing), which are useful to track progress of hot reload functionality in Flutter setting.

BUG=
R=asiva@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2993013002 .
2017-08-14 14:06:15 -07:00
Siva Annamalai 33c50e9374 1. Correctly set root_library based on the application script URI instead of looking for the library that has the 'main' method.
2. Adjust the Dart front end to not require a 'main' method when the in memory filesystem is used, this allows execution of VM unit tests which all do not necessarily have a 'main' method (integrated CL from siggi)

3. Change kernel reader to not look for a 'main' methos when Dart_LoadKernel is called.

4. Change Dart_LoadScript to also support loading of dart programs when Dart front end is used

R=aam@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2948273002 .
2017-07-19 18:09:19 -07:00
Sigmund Cherem 1aa139bc94 Unifying compiler context
Changes in this CL:
 - Updated CompilerContext:
    - it now contains a ProcessedOptions object

    - it no longer depends on CompilerCommandLine/CommandLine

    - it delegates to ProcessedOptions.report so all error reporting
      goes to one single place.

    - use "withContext" term instead of "withGlobalOptions" to be
      more clear about the intent

 - Changes in public API
    - added more options that correspond to flags in command-line
      fasta tools

    - default onError is different: we now use the
      command_line_reporting report, which prints and throws
      on fatal messages, but doesn't throw eagerly on all messages
      as before.

    - introduced "printMessages" option: make it easy to have
      both onError + command_line_reporting  (kernel-service.dart
      is the main use case at this time, other ideas welcome!)

    - renamed CompilationError to CompilationMessage

 - Other changes

    - set exit code is done on report, not on format
    - fixed corner cases not covered in previous CL
        - error reporting with missing-main needs to happen with
          a context
        - missing error cases when inferring .packages and input
          URIs are not file:* URIs

Ideas for follow up after this CL:
 - combine ProcessedOptions and CompilerContext into a single class
   (or extend one from the other)
 - switch onError to a stream

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2982093003 .
2017-07-18 17:02:59 -07:00
Sigmund Cherem 2465864241 simplify and remove unnecessary checks in kernel service
Checks here should also be handled internally by the front-end, so no need to do
them twice.

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2979053002 .
2017-07-17 15:31:33 -07:00
Sigmund Cherem ebd9440b18 support resolving .packages in FE
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2979003002 .
2017-07-14 12:54:35 -07:00
Sigmund Cherem cc567226a8 Fix remaining failures from earlier CL (that switched kernel-service and dart2js
to use the public frontend apis.)

 * As part of the refactor I made kernel-service truncate the .dill file it
   sends to the VM so it excludes the SDK code. This works in most cases, but
   caused 26 failures in debug mode. The error matches what I saw in Issue
   #30111.

 * Some Dart2js tests using --use-sdk failed to run because they tried to find
   platform.dill incorrectly. Our bots do have it available, we just have
   to make sure to resolve it based on the build configuraiton and not based on
   the SDK executable.

Review-Url: https://codereview.chromium.org/2974683003 .
2017-07-08 10:26:49 -07:00
Sigmund Cherem b71bd543a9 Reapply "Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service.""
Original CL had a bug that wasn't visible unless you delete your
out/ReleaseX64/patched_sdk folder.

Patchset #1 is the original CL, patchset #2 shows the fix.

This reverts commit 4aadfe09df.

BUG=

Review-Url: https://codereview.chromium.org/2976543002 .
2017-07-07 15:32:24 -07:00
Sigmund Cherem 4aadfe09df Revert "Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service."
Reason: broke VM bots, still investigating.

This reverts commit 610d081947.

TBR= paulberry@google.com

Review-Url: https://codereview.chromium.org/2979463002 .
2017-07-07 15:21:37 -07:00
Sigmund Cherem 610d081947 Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service.
This CL tweaks the public APIs in package:front_end, and
starts using those APIs outside the package. For example, this
removes 9 uses of DillTarget, so it is not longer mentioned
outside pkg/front_end and the analyzer_target.

Actual changes:
 - in package:front_end

   * added kernel_generator_impl: new file contains code that
     used to be in kernel_generator. Code has some modifications:
     it uses a single canonical-root when loading summaries, and
     it supports generating both outlines and kernel in one go.

   * removed code that didn't belong here:
     a. most of calculating deps for .GN moved to patch_sdk
     b. vm-specific outcomes moved to kernel-service

   * updated how `native` is implemented, so we can more easily
     support dart2js and ddc

   * updated how we check where `int`, `bool`, etc can be implemented.

   * added support "hermetic mode" in modular builds
     ('chaseDependencies = false' option)

   * moved `trim` step out of fasta, and for now call it only within
     the public API. This is not yet exposed, and I stopped covering it in
     most tests (now only covered in shaker tests). The plan is to add
     tests for the public API covering this in the future.

   * removed `uriToSource` when serializing outlines

   * added unit tests for public APIs

 - patch_sdk
   * use the public API to craete platform.dill, outline.dill (now
     500K insted of 3Mb because it excludes sources), and vmservice_io.dill
   * moved here logic internal to .GN

 - kernel service
   * use the public API
   * moved here logic that depends on VM internals (e.g. status enum,
     compilation results)

 - package:compiler
   * use the public API in tools and unit tests
   * simplified patched-sdk generation: no more extending fasta's internals

 - package:kernel
   * fix bug in deserialization: initializers and other lists were
     overwritten accidentally with external definitions.
   * updated unit tests, moved shared logic to frontend/src/fasta/testing

R=johnniwinther@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2953703002 .
2017-07-07 15:14:22 -07:00
Alexander Aprelev 8cd713bed3 Introduce dart_host_toolchain argument for generate_patch_sdk.gni. This allows for Flutter build to make sure that host_toolchain used for patched_sdk generation word size matches target platform.
Flutter Dart in product configuration doesn't allow --checked option. So remove '--checked' from invocation.

R=rmacnak@google.com

BUG:https://github.com/flutter/flutter/issues/10841
Review-Url: https://codereview.chromium.org/2944103003 .
2017-06-22 12:41:31 -07:00
Sigmund Cherem ebdb0af64f Add integration test: hot reload + incremental compiler
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2925953002 .
2017-06-07 12:47:27 -07:00
Sigmund Cherem edd835c5bb Fix vm tests: introduce a hybrid file system so that the vm tests can find the
sdk files.

The reason the tests broke is that they use a memory-file-system which only
contains the test file and a mock .packages file.

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

Review-Url: https://codereview.chromium.org/2910473003 .
2017-05-25 12:25:15 -07:00
Alexander Aprelev b0c6a59731 Fix analyzer tests in checked mode.
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2884023002 .
2017-05-15 10:25:59 -07:00