Commit Graph

435 Commits

Author SHA1 Message Date
Peter von der Ahé 0087af4e3c Report compile-time errors on cyclic hierarchies.
R=karlklose@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2767633004 .
2017-03-23 12:41:04 +01:00
Peter von der Ahé 2562ed28cb Generate methods for reporting problems.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2754383002 .
2017-03-22 12:30:51 +01:00
Peter von der Ahé 0526f5b150 Add testing subcommand to fasta tool.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2757303002 .
2017-03-20 17:55:00 +01:00
Paul Berry 685045d619 Start unraveling circularities between analyzer and front_end/kernel.
This CL moves many of the files from
pkg/front_end/lib/src/fasta/analyzer/ to pkg/analyzer/lib/src/fasta/.
It also moves two files from pkg/kernel/lib/analyzer/ to
pkg/analyzer/lib/src/kernel/.

This reduces the amount of circularity between analyzer and
front_end/kernel so that there are no files in front_end or kernel
which are both dependend upon by analyzer and depend upon analyzer.  I
will clean up the remaining circularities in future CLs.

There should be no functional change.

R=ahe@google.com, asgerf@google.com, kmillikin@google.com, scheglov@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2756593004 .
2017-03-17 05:56:06 -07:00
Konstantin Shcheglov fcfe68f057 Allow AstBuilder to report parse errors.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2752093002 .
2017-03-16 13:52:16 -07:00
danrubel 42f6586f36 rename fasta.Token.value --> lexeme
This renames the fasta.Token.value field to .lexeme so that
it will not collide with an already existing analyzer.Token accessor.

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

Review-Url: https://codereview.chromium.org/2738313002 .
2017-03-12 13:16:14 -04:00
Peter von der Ahé 9514a2c231 Shell script to ease running fasta tools.
Fixes https://github.com/dart-lang/sdk/issues/29000

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2740323002 .
2017-03-10 17:19:08 +01:00
Peter von der Ahé d1bdc9596d Improve detection of compile-time errors.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2739213004 .
2017-03-10 14:14:49 +01:00
danrubel 516646735d cleanup and improve A/B fasta test harness
* Update harness to show 99.9% best and worst case

* Moved compile summary functionality
  from pkg/front_end/tool/fasta/compile.dart
  into pkg/front_end/lib/src/fasta/outline.dart

* Modified outline.dart to output a JSON summary
  containing elapse execution times if -Dsummary=true

* Moved all statistical calculations into abcompile.dart

* Adjusted pkg/front_end/tool/fasta/abcompile.dart so that
  --verbose is not needed to capture numbers and progress

* Updated the A/B summary section to paste more easily
  into Google Sheets

* Address comments in
  https://codereview.chromium.org/2734863003/

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2739963002 .
2017-03-09 14:07:43 -05:00
danrubel dd3ab83eee add previous token field
This adds fasta Token.previous and sets that field to point
to the previous token in the fasta token stream.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2739583002 .
2017-03-07 13:03:52 -05:00
danrubel c354e26fb6 A/B fasta performance measurement harness
Tweak and reapply https://codereview.chromium.org/2731703003/

Review-Url: https://codereview.chromium.org/2734863003 .
2017-03-06 14:30:47 -05:00
danrubel 8552edb9b3 Revert "A/B fasta performance measurement harness"
This reverts commit 82685eacbf.

Review-Url: https://codereview.chromium.org/2733033002 .
2017-03-06 10:59:51 -05:00
danrubel 82685eacbf A/B fasta performance measurement harness
Given two separate Dart SDK repo clones, A and B,
this pkg/front_end/tool/fasta/abcompile.dart harness
alternately runs

<A>/pkg/front_end/tool/fasta/compile.dart
then
<B>/pkg/front_end/tool/fasta/compile.dart

so that a performance comparison can be made of the difference
between fasta in A vs B.
For example, from the <A> root directory:

xcodebuild/ReleaseX64/dart
  -DbRoot=/path/to/2nd/dart/sdk/repo
  -Diterations=15
  pkg/front_end/tool/fasta/abcompile.dart
  --compile-sdk=xcodebuild/ReleaseX64/patched_sdk/
  pkg/compiler/lib/src/dart2js.dart
  --verbose

The output contains the raw data along with a summary
of the average difference, and is formatted in a way
that can be easily pasted into Google Sheets
for further analysis.

Future improvements to this include:

* Add JSON output to pkg/front_end/tool/fasta/compile.dart
  so that abcompile.dart is not text scraping the numbers

* Adjust pkg/front_end/tool/fasta/compile.dart so that --verbose
  is not needed to capture the needed numbers and progress

* tweak the A/B summary section to paste more easily
  into Google Sheets

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2731703003 .
2017-03-06 10:09:45 -05:00
Peter von der Ahé 88a92f805a Move all main methods to tool/.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2722223006 .
2017-03-02 14:41:06 +01:00
Peter von der Ahé 6176847e36 Consolidate analyzer dependencies.
This allows us to create a smaller .dill file for Fasta.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2723113002 .
2017-03-02 12:59:47 +01:00
Florian Loitsch 58550a2efc Fix fasta strong mode errors (and a lint).
Review-Url: https://codereview.chromium.org/2711053004 .
2017-02-24 14:01:36 +01:00
Sigmund Cherem 04cf44d89c Add script to run fasta as a benchmark
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2697403005 .
2017-02-17 14:33:56 -08:00
Paul Berry 9a82ada085 Remove hardcoded paths from perf.dart.
This lets perf.dart find the SDK and the .packages file regardless of
the architecture that's being tested and the working directory in
which the script is started.

Fixes #28676.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2687723002 .
2017-02-08 16:48:20 -08:00
Sigmund Cherem 25e94e2e0b Small fix to perf.dart.
This also makes perf_test.dart do something useful. It now executes perf.dart on
a small file from pkg/front_end. This may help to detect early when the
peformance bots will see a failure. I've only tested this in linux, but given
that's the OS of the perf bots, I'm ok skipping this in other OSs.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2677423002 .
2017-02-07 15:07:57 -08:00
Paul Berry ba241c0c8d Use URIs rather than paths in front end API.
This carries a number of benefits:

- It allows the front end to trivially support schemes other than
  "file:" (e.g. "http:") by allowing the client to supply a FileSystem
  implementation that handles them.

- It is more consistent with the functionality of the ".packages" file
  (which allows packages to map to any kind of URI).

- It allows the "bazel root" feature to be rewritten to use a magic
  scheme rather than a magic path.  (This eliminates concerns about
  the magic path overlapping with a user's use case).  Note that this
  feature has been renamed to "multi root" since it is sufficiently
  generic to be applicable to build systems other than Bazel.

- It reduces the risk of forgetting to use the front end's FileSystem
  abstraction to access the file system, since the native file system
  interfaces do not accept URIs.

R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2614063007 .
2017-01-09 11:19:38 -08:00
Sigmund Cherem 313190029a Fix perf.dart test.
These tests didn't cover much, but I still managed to break them...
TBR=paulberry@google.com

Review-Url: https://codereview.chromium.org/2613113002 .
2017-01-05 12:17:06 -08:00
Sigmund Cherem cc3682f134 fe: minor change to benchmarks to match what the runners expect and some minor refactoring.
I'm happy to split the style/refactorings as separate CLs if you prefer. Here is a summary of the changes:
  - update the reported strings to match the names expected by our benchmark runners ("unlinked summaize + parse" => "unlinked_summarize")
  - invert the benchmark results (like Paul did in 2551533003)
  - stop counting input-size while scanning, count that separately once
  - combine the multiple summarization steps into a single function
  - clean up the logic that dispatches into each benchmark

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2602003002 .
2017-01-05 11:31:35 -08:00
Paul Berry 62edaa7a63 Fix front end perf after addition of Source to kernel.
Commit aecb572d76 introduced errors into
the front end perf script by making it ambiguous whether "Source"
refers to the kernel's "Source" or the front end's.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2610753002 .
2017-01-03 13:25:54 -08:00
Paul Berry 0c81fbc411 Fix "unused import" warnings and sort declarations.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2562643006 .
2016-12-12 11:02:22 -08:00
Sigmund Cherem 02d557d134 Use sdk summaries in front_end/kernel_generator.
This CL adds support for using sdk summaries when building kernel using the
front_end entrypoint. I didn't expose this functionality in the dartk binary,
I'm hoping we can delay doing so until we integrate dartk and front_end.

I also switched front_end/tool/perf.dart to use kernel_generator directly.

This makes some observable difference for small scripts, but not so much with large apps like dart2js. Makes sense considering that the sdk is about 2Mb, and dart2js is 6Mb of sources.

The most interesting number I got is building the a library kernel file (not the whole program) for a small hello-world script on a warmed up vm:
no summaries: 500ms
with summaries: 30ms

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

Review-Url: https://codereview.chromium.org/2562923002 .
2016-12-09 13:29:41 -08:00
Paul Berry 926dfb751e Add a perf test for generating linked summaries.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2556723005 .
2016-12-07 16:27:27 -08:00
Paul Berry b8b68f5a5e Add a benchmark for summary prelinking.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2554573006 .
2016-12-06 13:18:51 -08:00
Sigmund Cherem d79ef86af7 Implement the generate-kernel api by invoking dartk. Add example that uses this API to generate a byte buffer with the results.
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2508933003 .
2016-12-05 13:02:24 -08:00
Paul Berry fe1a684789 Subtract scan/parse time from unlinked summary perf statistic.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2545073004 .
2016-12-05 11:50:24 -08:00
Paul Berry cb2fef0c45 Add a front end perf test that computes unlinked summaries.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2544643002 .
2016-12-01 05:46:47 -08:00
Asger Feldthaus 709c1e0b75 Store library paths relative to a given application root folder.
In kernel, library import URIs now support an "app" scheme as an
alternative to the "file" scheme, representing a path relative to
the application root.

dartk takes an --app-root flag giving the application root. If none
is given, file URIs are used instead.

The intention is that kernel binaries should not carry irrelevant
path information, such as the path to the home directory of the
user who compiled a given file.

It is not the intention that end-users should see an app URI.
Import paths are currently not shown to users at all, and if we need
to do this, they should be translated to file paths first.

In theory we could stick to file URIs with relative paths, but the Uri
class from dart:core makes this difficult, as certain operations on it
assume that file paths should be absolute.

Source mapping URIs are not yet affected by this change.

R=kmillikin@google.com

Committed: https://github.com/dart-lang/sdk/commit/60adb852ad706ecf9424c77d47fa05583d543def

Review URL: https://codereview.chromium.org/2532053005 .

Reverted: https://github.com/dart-lang/sdk/commit/bb540416f27c39d75ee7f243899939fc37a2cd03
2016-11-30 10:39:48 +01:00
Sigmund Cherem 618cbad43a switch perf tool to use scanner in front_end
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2507093003 .
2016-11-16 11:13:20 -08:00
Paul Berry 72fc9805d9 Add analysis options for front end, and fix a bug discovered by strong mode.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2489573002 .
2016-11-08 10:39:48 -08:00
Sigmund Cherem 2bcd189f2d add kernel generation to the front_end/tool/perf script
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2439053003 .
2016-10-21 09:10:19 -07:00
Sigmund Cherem 5964bdfa0b Copy perf.dart into front_end/tool.
This keeps analyzer_cli/perf.dart for now: I need to make the change in two
parts so I can update the benchmark runners after I submit this.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2432043008 .
2016-10-21 09:07:48 -07:00