Commit Graph

435 Commits

Author SHA1 Message Date
Peter von der Ahé 83e4138cd4 Remove deprecated api from LibraryBuilder.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2977713002 .
2017-07-12 22:31:13 +02:00
Peter von der Ahé 59e9638232 Remove deprecated methods from ClassBuilder.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2977693002 .
2017-07-12 21:59:46 +02:00
Konstantin Shcheglov b985f3c000 Rename TranslateUri to UriTranslator, rename files, extract Impl.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2982593002 .
2017-07-12 11:56:14 -07:00
Peter von der Ahé ca4ad3e65d Remove deprecated_addNit.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2976753002 .
2017-07-12 18:44:52 +02:00
Peter von der Ahé 619006eac3 Sort generated messages.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2976743002 .
2017-07-12 17:43:22 +02:00
Peter von der Ahé a66d0c797a Implement more message argument kinds.
R=johnniwinther@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2977653003 .
2017-07-12 15:03:53 +02:00
Sigmund Cherem 2b8ced2132 Fix hot reload test
The test is currently skipped because of some flaky issue (issue #29819). I
noticed the test got broken while it's been disabled. This makes the test be in
working condition, even though it can't be enabled until we fix the underlying
flakiness in the VM.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2976553002 .
2017-07-10 12:52:28 -07:00
Peter von der Ahé b023d925ea Use FastaMessage instead of String. Part 1.
See #30080.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2965393002 .
2017-07-10 19:50:14 +02:00
Peter von der Ahé 9236a3445e Deprecate all diagnostics methods that use strings.
See #30080.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2970273004 .
2017-07-10 11:23:09 +02: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
Peter von der Ahé f1b7a97744 Move testing.json and status files to more natural locations.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2957623002 .
2017-06-23 14:27:53 +02:00
Siva Chandra 7087085505 Fix frontend tests after bac83e0973
R=nweiz@google.com

Review-Url: https://codereview.chromium.org/2943173002 .
2017-06-16 14:05:08 -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
Peter von der Ahé 3c17c44d52 Implement metadata on methods and fields.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2935993002 .
2017-06-14 08:25:17 +02: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
Peter von der Ahé 7df768af0d Restore invariant that stack is empty in parseFunctionBody.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2914373002 .
2017-06-06 16:58:31 +02:00
Dmitry Stefantsov 09e755196a Pass a Target instance to DillTarget instead of its name
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2924833002 .
2017-06-06 16:03:49 +02:00
Dmitry Stefantsov 1e2f06f8da Reapply "Use backend targets to run Kernel transformations in Fasta"
This reverts commit 0b424ca5d2

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2919003003 .
2017-06-02 16:10:28 +02:00
Dmitry Stefantsov 0b424ca5d2 Revert "Use backend targets to run Kernel transformations in Fasta"
This reverts commit 8ff762067a.

TBR=ahe@google.com

Review-Url: https://codereview.chromium.org/2918923003 .
2017-06-02 12:45:34 +02:00
Dmitry Stefantsov 8ff762067a Use backend targets to run Kernel transformations in Fasta
R=ahe@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2918623004 .
2017-06-02 10:40:13 +02:00
Peter von der Ahé 27761fd369 Read SDK and patches from a JSON file.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2895983002 .
2017-05-25 15:57:57 +02:00
Peter von der Ahé 9eb265439f Ensure DART_CONFIGURATION is exported and don't run code in checked mode.
R=paulberry@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2903593002 .
2017-05-24 11:20:45 +02:00
Peter von der Ahé e6a7a38022 Support being called as absolute path.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2896033002 .
2017-05-24 11:07:53 +02:00
Peter von der Ahé 4fddc2e4d5 Move code for instantiating Invocation to Target.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2897683002 .
2017-05-22 15:59:06 +02:00
Peter von der Ahé de7edcde74 Fix crash with generalized function types in type tests.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2899693003 .
2017-05-22 14:53:46 +02:00
Peter von der Ahé 547b2cdcce Implement generalized function types.
Fixes https://github.com/dart-lang/sdk/issues/6972

Fixes https://github.com/dart-lang/sdk/issues/26581

R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2876813002 .
2017-05-19 11:03:24 +02:00
Konstantin Shcheglov 06e9b4b503 Rename buildOutline() and separate 'build' and 'writeProgram()'.
Also rename KernelTarget.program to _program to prevent clients from
reaching into internals. I think eventually we want to make more
stuff private. And rationalize errors handling. And... many things :-)

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

Review-Url: https://codereview.chromium.org/2893563003 .
2017-05-17 11:10:06 -07:00
Konstantin Shcheglov 43cea08f6d Fixes for review comments.
R=sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2889463002 .
2017-05-16 17:27:37 -07:00
Konstantin Shcheglov e3f4ed94b1 Rename Target.writeOutline() into computeOutline(), add separate KernelTarget.writeOutline().
For DillTarget write does not make sense, and even for KernelTarget
we usually don't want to write anything.

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

Review-Url: https://codereview.chromium.org/2885923002 .
2017-05-16 14:38:24 -07:00
Konstantin Shcheglov b3837a5e28 Enhance DirectiveListener to collect import/exports with combinators.
We need combinators to build export scopes for DILL libraries.

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

Review-Url: https://codereview.chromium.org/2884783002 .
2017-05-15 13:59:14 -07:00
Konstantin Shcheglov cc91d04514 Use FileSystem to read files in SourceLoader and TranslateUri.
This is a prerequisite for writing fast unit tests, as I would like
to do while working on the incremental kernel driver.

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

Review-Url: https://codereview.chromium.org/2865843002 .
2017-05-06 13:09:28 -07:00
Sigmund Cherem 938d1ba524 Implement the kernel_generator API using fasta
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2856223003 .
2017-05-04 12:02:05 -07:00
Sigmund Cherem de36d11817 Add support for building patched_sdk and platform.dill for dart2js:
- defines a .gn target for patched_dart2js_sdk
 - changes patch_sdk.dart to handle a dart2js target
 - adds support in fasta to understand the `native` clause still used by dart2js
 - add option to fasta to know whether it is generating kernel for the vm or dart2js

I'm not excited about how I added the target distinction in fasta, the reason I
did so is that it affects the behavior in several ways: in how we handle
`native`, in the libraries that are included by default in the platform.dill file,
and in the transformations that need to be done.  I'm happy to change the
approach.

BUG=
R=ahe@google.com, vegorov@google.com, zra@google.com

Committed: https://github.com/dart-lang/sdk/commit/714523b103598d49295fa06b4ad13c6917c50399
Review-Url: https://codereview.chromium.org/2832353002 .
2017-05-01 17:23:02 -07:00
Sigmund Cherem e9cd0b0fa5 Revert "Add support for building patched_sdk and platform.dill for dart2js:"
This reverts commit 714523b103.

TBR=ahe@google.com,vegorov@google.com

Review-Url: https://codereview.chromium.org/2849183002 .
2017-05-01 10:29:26 -07:00
Sigmund Cherem 714523b103 Add support for building patched_sdk and platform.dill for dart2js:
- defines a .gn target for patched_dart2js_sdk
 - changes patch_sdk.dart to handle a dart2js target
 - adds support in fasta to understand the `native` clause still used by dart2js
 - add option to fasta to know whether it is generating kernel for the vm or dart2js

I'm not excited about how I added the target distinction in fasta, the reason I
did so is that it affects the behavior in several ways: in how we handle
`native`, in the libraries that are included by default in the platform.dill file,
and in the transformations that need to be done.  I'm happy to change the
approach.

BUG=
R=ahe@google.com, vegorov@google.com

Review-Url: https://codereview.chromium.org/2832353002 .
2017-05-01 10:11:42 -07:00
Erik Corry aa6353b6da Dart SDK Spelling b, c, and d.
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850783002 .
2017-05-01 08:28:10 +02:00
Sigmund Cherem 06189b271a loader, target, diet_listener moved
from front_end/lib/src/fasta/analyzer/
   to   analyzer/lib/src/fasta/

analyzer_compile and compile_platform_dartk moved
   from front_end/lib/src/fasta/analyzer/
   to   front_end/tool/_fasta/

front_end/src/fasta/testing/* continues to have some shared testing logic,
 - logic to compute the patched sdk is moved up one level
 - TestContext, Run, and suite.dart (which depend on analyzer) moved to pkg/front_end/test/fasta/testing/
 - only a copy of TestContext is duplicated under pkg/kernel/test/closure/.

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

Review-Url: https://codereview.chromium.org/2828583003 .
2017-04-25 13:16:14 -07:00
Sigmund Cherem 4a19708532 Remove use of package:analyzer in dependency_grapher
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2834543002 .
2017-04-20 17:06:04 -07:00
Peter von der Ahé 2d9956a93d Move kernel baseline tests to front_end.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2825063002 .
2017-04-19 10:57:58 +02:00
Peter von der Ahé 68ae077161 Make top-level scope implicit.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2785883005 .
2017-04-04 11:35:16 +02:00
Peter von der Ahé babf66241f Move scope.dart.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2794533002 .
2017-04-04 11:00:43 +02:00
Dan Rubel c22c6bad6c flag to enable fasta scanner in analyzer
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2784363002 .
2017-03-30 14:16:12 -04:00
Peter von der Ahé a62c5631bf Use message.yaml in parser.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2778213002 .
2017-03-29 11:02:23 +02:00
Peter von der Ahé a91ebba200 Complain about assignments to parenthesized expressions.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2780483002 .
2017-03-29 10:28:05 +02:00
Dan Rubel 186c6f23bd fasta scanner recovery and error code translation improvements
* cleanup defaultRecoveryStrategy next/previous and eof

* add SymbolToken.eof() constructor to ensure that EOF tokens
  are correctly self referencing

* add fasta.scanString method to match scan method

* add fasta.ScannerResult.hasErrors field
  so that scan and scanString callers can quickly check for errors

* new scanner replacement test
  which scans using fasta then asserts as if it were from analyzer

* improve SymbolToken.toString() for EOF
* update analyzer test :: fasta scanner considers "<" to be an opener
* extract and move translateErrorToken into front_end
* address comments in https://codereview.chromium.org/2763833002

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

Review-Url: https://codereview.chromium.org/2767083002 .
2017-03-24 11:40:22 -04:00
Peter von der Ahé 9d439605a8 Run dartfmt on generated file.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2769663002 .
2017-03-23 13:09:16 +01:00
Peter von der Ahé 0afdf6b44a Report error on only-try block.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2765253002 .
2017-03-23 13:02:41 +01:00
Peter von der Ahé 347bfbc4b8 Add kernel-service subcommand to fasta script.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2770623003 .
2017-03-23 12:56:47 +01:00