Commit Graph

121 Commits

Author SHA1 Message Date
Emily Fortuna c7dadec876 Capture this and type variables in closures in checked mode when needed.
Bug:
Change-Id: I9e3bbc658590bcb6ec04cff4323cc2a97c20fc6b
Reviewed-on: https://dart-review.googlesource.com/21321
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-11-16 21:22:41 +00:00
Emily Fortuna bf94e73568 Fix up type inference to run in checked mode and enable checked mode tests running with kernel script.
Bug:
Change-Id: If720b6868fbdf010f4aac614ceea1ddea533c277
Reviewed-on: https://dart-review.googlesource.com/21222
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-15 22:34:51 +00:00
Emily Fortuna 035c85580b Make fast-startup work with kernel!
Bug:
Change-Id: I88bf7fd7609bc816cc6d50daaa7e3a0ec5dc1934
Reviewed-on: https://dart-review.googlesource.com/19403
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-09 01:37:25 +00:00
Leaf Petersen 4270b99d75 Fix dynamic as bottom uses in front end and dart2js.
Re-enable the dynamic as bottom hint in analysis_options.yaml and fix
the code to be hint clean again.

Fixes #30589
Fixes #30590

Bug:
Change-Id: Idb7910b3ab1c6d931a3ead3eed885d8bd172e621
Reviewed-on: https://dart-review.googlesource.com/17062
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-30 19:54:26 +00:00
Harry Terkelsen c9aa3a688b Add custom element support to the kernel ssa builder
Change-Id: I06ec8bc2f53dd88116abb11655c83783de1d48cd
Reviewed-on: https://dart-review.googlesource.com/16328
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-10-25 16:36:29 +00:00
Emily Fortuna af3bbc194b Fix up dart2js argument passing of 'platform-binaries' so that it actually recognizes the flag.
Bug:
Change-Id: I632dc8ea1e1c145cbb93a8cb7ba061c0d2ebc948
Reviewed-on: https://dart-review.googlesource.com/14508
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-10-17 21:02:31 +00:00
Peter von der Ahé 6cc2014b3d Fix computePlatformBinariesLocation for Windows.
Change-Id: Ic64e9c7a10923fe2e3f99ef708c2f19bb9ae802e
Reviewed-on: https://dart-review.googlesource.com/14420
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-10-17 12:46:10 +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é 2080faff8c Remove stale references to patched_dart2js_sdk/platform.dill.
Change-Id: I8b7b4274ef64f0b6f6c5a31ba654e8fb44843161
Reviewed-on: https://dart-review.googlesource.com/12283
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-09 14:36:55 +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
Sigmund Cherem d96b29378a Delete use of rasta and dartk from perf.dart scripts.
Change-Id: Id8cd7f01c68dbcb6f814ef51627a2f4b377f6819
Reviewed-on: https://dart-review.googlesource.com/9790
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-10-03 23:12:21 +00:00
Dan Rubel 9527f37146 refactor parse import
* `as` clause and `deferred as` clause processing pushed
     into a new processImportPrefixOpt method.
* New handleImportPrefix event for communicating 
    `as` clause and `deferred as` clause to the listeners.
* Several new more detailed error messages for out of order
    clauses and keywords in the import directive.

Change-Id: I133842c7225403fa000ca1cf0e49af9f8a011386
Reviewed-on: https://dart-review.googlesource.com/8580
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-29 14:39:01 +00:00
Emily Fortuna 8bd22ffd28 Fix log parsing script to handle group names with spaces in them.
Bug:
Change-Id: If538d7e18af850e973ce0236e6949b7dbe36ba09
Reviewed-on: https://dart-review.googlesource.com/8733
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-27 18:13:54 +00:00
Emily Fortuna fe9d02855b Add html tests for dart2js kernel testing.
Bug:
Change-Id: I4d28af58a655f76ea639c8f048e86738afb2e108
Reviewed-on: https://dart-review.googlesource.com/8720
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-26 21:19:57 +00:00
Stephen Adams f065e8a4ee Add corelib to update_all.sh suites
TBR=sigmund@google.com

Bug:
Change-Id: I49293d88f1828cb5b661295d538ab67e327787ce
Reviewed-on: https://dart-review.googlesource.com/7638
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-21 21:47:06 +00:00
Stephen Adams 899e2eab15 update rank_stacks comment
TBR=sigmund@google.com

Bug:
Change-Id: I5acdcdc7573106c0eea51447862bce3a0f381c6f
Reviewed-on: https://dart-review.googlesource.com/7020
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-19 16:36:12 +00:00
Stephen Adams f6c50ca219 Allow update_all to take multiple named suites
Bug:
Change-Id: I568502690d8691d90e3ee8fbff3c2a0d0736f978
Reviewed-on: https://dart-review.googlesource.com/6341
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-15 21:55:47 +00:00
Stephen Adams dbcc7835a7 rank_stacks tweaks
- Cluster stacks on printed prefix instead of entire stack.
- Print records with a stack that is a prefix of another stack (this happens for d8 errors where there is no dart2js stack)

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/3007023002 .
2017-09-01 10:26:10 -07:00
Janice Collins 51cc9689b3 Remove corelib and corelib_strong and migrate last two remaining tests.
This includes a migration of linked_hash_map_from_iterable_test and
stacktrace_current_test, which were migrated without changes.

BUG=
R=rnystrom@google.com, whesse@google.com

Review-Url: https://codereview.chromium.org/3004073002 .
2017-09-01 08:11:15 -07:00
Stephen Adams c65d94d440 Add command line options to rank_stacks
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/3005683002 .
2017-08-29 12:56:09 -07:00
Stephen Adams 2c6ae26aba update_all: remove user-dependent part of assertion file path
TBR=sigmund@google.com

Review-Url: https://codereview.chromium.org/3003273002 .
2017-08-23 16:02:55 -07:00
Sigmund Cherem 4af181dfd8 Allow passing a suite argument to the update script
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2996893002 .
2017-08-11 13:42:58 -07:00
Stephen Adams 5597188067 Collate stacks in test output
Usage:

$ tools/test.py -m release \
       -c dart2js -r d8 --dart2js-batch --report \
       --host-checked \
       --dart2js_options="--library-root=out/ReleaseX64/dart-sdk/ --use-kernel" \
       language corelib library_2 corelib_2 \
       dart2js_native dart2js_extra \
  2>&1 > LOG

$ dart pkg/compiler/tool/status_files/stacks.dart LOG > STACKS.txt

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2999753002 .
2017-08-09 13:46:24 -07:00
Sigmund Cherem bcaff5e269 Filter unreachable libraries in kernel loader
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2990233003 .
2017-08-09 11:01:02 -07:00
Sigmund Cherem 907fbcd694 Fix compile_from_dill test.
I recently changed the FE in how it loads sdk files. That internally fixed the
meaning of this flag and made it unnecessary for our script.

TBR=efortuna@google.com

Review-Url: https://codereview.chromium.org/2999553002 .
2017-08-07 11:13:51 -07:00
Sigmund Cherem 352dc54191 Update status files to make bots green, minor changes to the script
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2990303002 .
2017-08-04 14:04:37 -07:00
Sigmund Cherem 0e2a6bdef3 Add batch flag to update script
I don't believe it helps with --use-sdk, but why not.

Review-Url: https://codereview.chromium.org/2993733002 .
2017-08-04 13:41:36 -07:00
Sigmund Cherem 06a929434e add error message as a comment on the logs
BUG=

Review-Url: https://codereview.chromium.org/2996543002 .
2017-08-04 13:21:37 -07:00
Sigmund Cherem 78dc28606c Add utility tool to update .status files automatically
Usage: from the Dart repo run:

  ./pkg/compiler/tool/status_files/update_all.sh

Caveat: the bash script has only been tested in linux.

BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2996533002 .
2017-08-04 12:26:52 -07:00
Sigmund Cherem 09ff1b56f7 Add support for compiling Dart via the FE in dart2js.
This also:
 - replaces --use-kernel with --use-kernel-in-ssa
 - replaces --load-dill with --use-kernel
 - makes --use-kernel support both: compiling from .dill or from .dart
 - change the default of other options that are currently disabled when --use-kernel is on.
 - adds .status lines for all tests in language/corelib/dart2js_extra/dart2js_native

R=efortuna@google.com

 Note: this CL is built on top of another change
 (https://codereview.chromium.org/2981403002/) that adds preview_dart_2 to
 test.dart
Review-Url: https://codereview.chromium.org/2989453002 .
2017-07-24 17:10:11 -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 d844dc8226 Move forward rolling FE public APIS (make bots green)
There were a couple issues found in the bots:
 - dart2js unit tests I accidentally missed earlier.
 - vmservice issues only show up in the debug-vm, I was testing locally with the
   release vm.
 - a small regression in detecting invalid .packages files. I marked the test
 failing for now and plan to follow up on this on Monday.

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

Review-Url: https://codereview.chromium.org/2974703002 .
2017-07-07 21:15:07 -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
Peter von der Ahé 69d6e8e55a All strong mode cleaning of dart2js.
Fixes https://github.com/dart-lang/sdk/issues/29886

Supersedes CLs 2939193003, 2950433002, and 2947583002.

R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2944843002 .
2017-06-19 14:06:38 +02:00
Johnni Winther 795e078f21 Remove Compiler.mainApp and Compiler.mainFunction
This prepares for switching between K and J elements between resolution and codegen.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2936233003 .
2017-06-16 13:00:21 +02:00
Johnni Winther ea070c7264 Add ClosedWorld.elementEnvironment and remove Compiler.elementEnvironment
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2935063002 .
2017-06-14 10:27:38 +02:00
Johnni Winther 5afe65e891 Remove Compiler.commonElements
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2935663002 .
2017-06-14 10:18:42 +02:00
Johnni Winther 61c100da49 Rename FrontEndStrategy to FrontendStrategy
It hurts my eyes to see

  FrontEndStrategy frontEndStrategy ...
  BackendStrategy backendStrategy ...

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2932793005 .
2017-06-12 09:30:18 +02:00
Johnni Winther 3aad4a9cd8 Fix perf_test.
Review-Url: https://codereview.chromium.org/2903543002 .
2017-05-23 15:39:18 +02:00
Sigmund Cherem dae30fe286 Remove one more use of DillTarget.read that broke compiler/tool/generate_kernel.
Also adds a test for that script.

BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2880443005 .
2017-05-12 10:37:17 -07:00
Sigmund Cherem c911f44c3f fix checked-mode failure in perf_test
TBR=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2868393002 .
2017-05-10 11:37:19 -07:00
Sigmund Cherem 5366a1f76c Fix compiler.perf script
TBR=johnniwinther@google.com,vegorov@google.com

Review-Url: https://codereview.chromium.org/2875703002 .
2017-05-10 11:15:08 -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
Johnni Winther a4960a1507 Run closed_world2_test using the normal compiler pipeline.
This is a step towards running the front end of the compiler from
'.dill' files.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2846433003 .
2017-04-27 08:55:38 +02:00
Johnni Winther 76737bb8ea Register deferred load impact through ResolutionEnqueuerListener
This is a part of the work to decouple the backend from the used element model.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2800643002 .
2017-04-07 09:26:25 +02:00
Emily Fortuna b7b3714086 Reapply "Add "load from .dill" file capability and run a white-box test.""
This reverts commit 8febfff784.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2797443008 .
2017-04-05 11:40:52 -07:00