Commit Graph

20 Commits

Author SHA1 Message Date
Peter von der Ahé b4dcb76518 Read patch files directly when building legacy platform files.
Change-Id: Ib2e614b676021660c6a053dfc59f639c004279b9
Reviewed-on: https://dart-review.googlesource.com/18520
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-11-03 12:43:50 +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
Paul Berry 291b83b345 Move reload.dart to test directory.
This will allow us to run hot_reload_e2e_test.dart internally.

Change-Id: Ia44b086683ea629a0af15addd652543daa1700ce
Reviewed-on: https://dart-review.googlesource.com/7450
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-09-21 13:43:02 +00:00
Konstantin Shcheglov 1b4239d2e4 Export ByteStore and its implementations from front_end.
R=ahe@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: Ie2e3413a7f143e270cec2bd3ae4564ad7cc315b1
Reviewed-on: https://dart-review.googlesource.com/3840
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-09-07 19:23:21 +00:00
Alexander Aprelev 69d9c26416 Update incremental load example so you can point it at different(flutter) sdk.
This allows to run flutter gallery example through incremental compiler(it assumes you built android_debug flutter/engine and have fetched flutter/flutter):

$HOME/p/d/dart-sdk/sdk/out/DebugX64/dart --packages=$HOME/p/d/dart-sdk/sdk/.packages $HOME/p/d/dart-sdk/sdk/pkg/front_end/example/incremental_reload/run.dart  --sdk-root=$HOME/p/f/t11/flutter/engine/src/out/android_debug/flutter_patched_sdk --input $HOME/p/f/t11/flutter/flutter/examples/flutter_gallery/lib/main.dart

which crashes with

R=sigmund@google.com

  error: compilation error: dart:_builtin: Internal problem: Unhandled null in builder.library., #0      internalProblem (package:front_end/src/fasta/problems.dart:29:3)
#1      unhandled (package:front_end/src/fasta/problems.dart:41:10)
#2      DillLoader.buildOutline (package:front_end/src/fasta/dill/dill_loader.dart:47:7)
<asynchronous suspension>
...
Review-Url: https://codereview.chromium.org/2995913002 .
2017-08-14 21:04:29 -07:00
Konstantin Shcheglov 222ce73a49 Add IncrementalKernelGenerator.acceptLastDelta()/rejectLastDelta().
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG= https://github.com/dart-lang/sdk/issues/30377

Review-Url: https://codereview.chromium.org/2996843002 .
2017-08-10 12:28:14 -07:00
Paul Berry 89c910b9c1 Move byte_store.dart and file_byte_store.dart to their own subdirectory.
This allows us to use the subpackage relationships test to verify that
they don't import any other parts of front_end, which paves the way
for the possibility of moving them to their own package in the future.

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

Review-Url: https://codereview.chromium.org/2990323002 .
2017-08-07 11:04:48 -07:00
Sigmund Cherem b48584d3d0 Switch FE to use the libraries.json format.
This CL:
  * introduces the Dart API to operate over libraries specifications and describes
    the format we intend to use (see libraries_spec.dart)

  * implements serialization/deserialization for this API

  * switches over the front_end to use these APIs
    * public options accept a URI to the JSON file and no longer
       accept a `dartLibraries` map
    * internal code uses the LibrariesSpecification API

  * switches other dependencies on these APIs (resynthesizer_test and patch_sdk.dart)

This is the first step in migrating over to use the libraries.json format and
eventually remove the patched_sdk step. In particular, some of the next steps
include:
  * add a build step to generate .json files from .yaml files
  * add a libraries.yaml file for the sdk
  * split the patched_sdk step in two:
     * patching files
     * generating .dill files
  * add any missing support for patch-files in fasta
  * finally remove the patching files step, and only have a build step for generating
   .dill files

BUG=
R=ahe@google.com, paulberry@google.com, scheglov@google.com

Committed: https://github.com/dart-lang/sdk/commit/abf2d23af2315fae6dc688741147ef677ec34835
Review-Url: https://codereview.chromium.org/2986303003 .
2017-08-07 08:41:28 -07:00
Sigmund Cherem b6d08264a3 Revert "Switch FE to use the libraries.json format."
This reverts commit abf2d23af2.

Reason for revert:
 - win build failed in patched_sdk (likely storing paths and not uris)
 - dart2js bots failed (missing flag)

Will fix the issues and reland shortly.

Review-Url: https://codereview.chromium.org/2993113003 .
2017-08-04 19:46:17 -07:00
Sigmund Cherem abf2d23af2 Switch FE to use the libraries.json format.
This CL:
  * introduces the Dart API to operate over libraries specifications and describes
    the format we intend to use (see libraries_spec.dart)

  * implements serialization/deserialization for this API

  * switches over the front_end to use these APIs
    * public options accept a URI to the JSON file and no longer
       accept a `dartLibraries` map
    * internal code uses the LibrariesSpecification API

  * switches other dependencies on these APIs (resynthesizer_test and patch_sdk.dart)

This is the first step in migrating over to use the libraries.json format and
eventually remove the patched_sdk step. In particular, some of the next steps
include:
  * add a build step to generate .json files from .yaml files
  * add a libraries.yaml file for the sdk
  * split the patched_sdk step in two:
     * patching files
     * generating .dill files
  * add any missing support for patch-files in fasta
  * finally remove the patching files step, and only have a build step for generating
   .dill files

BUG=
R=ahe@google.com, paulberry@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2986303003 .
2017-08-04 17:41:27 -07:00
Sigmund Cherem 13a4906be9 Kernel driver: pass options and use it for its compiler context
This ensures we don't accidentally override options (e.g. strongMode was being
overriden accidentally as a result).

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2992773002 .
2017-07-31 13:22:50 -07:00
Konstantin Shcheglov fac4d2d603 Fix incremental_reload example after VmReloader -> RemoteVm rename.
TBR

There were 2 compilation errors and 1 hint.
I prefer when my workspace is error free :-)

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975793005 .
2017-07-11 12:11:58 -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
Sigmund Cherem 5e5e62f9d8 Remove deps from reloader
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2937983002 .
2017-06-14 10:57:25 -07:00
Konstantin Shcheglov c2f18fc930 Implement promised watch behaviour.
1. There are no reasons to use different watch function between
   computeDelta() invocations, so I moved it to the constructor.

2. We need to call it, and await, before reading files, not after.

3. Added tests.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2931183003 .
2017-06-09 15:04:30 -07:00
Sigmund Cherem cb5f3842c4 Skip directly to the last library to set the entry point and check importUri
instead of fileUri.

On some scenarios fileUri is relative and entryUri was absolute, but importUri
should match for the entry library.

BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2926933002 .
2017-06-07 14:50:01 -07:00
Sigmund Cherem aecfab68aa Add an incremental reloader example and a utility tool to trigger a reload by
hand.

The example includes:
 - an interactive UI that lets you trigger reloads without typing commands
 - a wrapper of the incremental kernel generator that invalidates files based on
 modification time stamps

BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2928483005 .
2017-06-07 13:44:56 -07:00