Commit Graph

6018 Commits

Author SHA1 Message Date
Konstantin Shcheglov fcd5f16d10 Stop using SDK summary bundle. Analyze dart:xxx as any other libraries.
Unfortunately this makes runnings tests about 30% slower :-(

I suspect that's because we have to build unlinked and linked summaries
for SDK libraries again and again for every tiny test.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2653683004 .
2017-01-24 18:32:26 -08:00
Konstantin Shcheglov b206c84210 Reland c9e1b88 and 56726fc with a DDC fix.
Revert "Revert "Use single InputPackagesResultProvider, without SdkSummaryResultProvider.""

This reverts commit b701ad6453.

R=brianwilkerson@google.com, vsm@google.com
BUG=

Review-Url: https://codereview.chromium.org/2647323006 .
2017-01-24 09:13:26 -08:00
Vijay Menon b701ad6453 Revert "Use single InputPackagesResultProvider, without SdkSummaryResultProvider."
This reverts commit c9e1b888a3.

Revert "Remove parent from SummaryResynthesizer."

This reverts commit 56726fcce0.

TBR=scheglov@google.com

Review-Url: https://codereview.chromium.org/2648213007 .
2017-01-24 06:21:38 -08:00
Konstantin Shcheglov c9e1b888a3 Use single InputPackagesResultProvider, without SdkSummaryResultProvider.
Each SummaryResynthesizer is now responsible for creating its TypeProvider.
And with the new AnalysisDriver we stop using SDK CachePartition.

For now we add SDK's summary bundle into SummaryDataStore.
Eventually we will get rid of it and add individual SDK libraries.

R=brianwilkerson@google.com, paulberry@google.com, vsm@google.com
BUG=

Review-Url: https://codereview.chromium.org/2652823002 .
2017-01-23 16:54:17 -08:00
Paul Berry 7bfc3ced58 Clean up hacky handling of "dart:" URIs in incremental resolved AST generator.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2643033003 .
2017-01-20 08:54:01 -08:00
Paul Berry 6acc2c2611 Store a file state in the incremental resolved AST generator.
This is necessary to make invalidation work properly.  It also ensures
that we don't do redundant reads from the filesystem.

R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2644953002 .
2017-01-19 13:58:57 -08:00
Paul Berry c04ba40745 Add initial support for parts to the incremental kernel generator.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2642083003 .
2017-01-19 12:32:27 -08:00
Paul Berry 28bfd11a70 Create a "file repository" data structure to help interface analyzer and front_end code.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2645923002 .
2017-01-19 10:55:50 -08:00
Brian Wilkerson d06a2326f1 Add parser support for covariant parameters
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2639883005 .
2017-01-19 09:38:35 -08:00
Paul Berry 2adae270d6 Fix incremental kernel builder to handle multiple calls to computeDelta.
Note that the invalidate() method is not supported yet; you must use
invalidateAll().

R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2638423002 .
2017-01-18 14:43:06 -08:00
Konstantin Shcheglov 8d326e9a14 Report StateError if the DartSDK for an AnalysisDriver does not have summary.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2639743002 .
2017-01-17 20:46:00 -08:00
Paul Berry 05a417034a Initial implementation of front_end hot reload API.
This implementation is based on the existing kernel and analysis
driver logic, using proxy classes to account for interface
incompatibilities between those components.  In future CLs, I
hope we can (a) move the necessary analysis driver logic into
front_end, and (b) reduce or eliminate the number of proxy
classes needed.

This CL represents the very first inklings of functionality; all that
is confirmed to work at this point is compilation of a single source
file containing an empty `main` method.

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

Review-Url: https://codereview.chromium.org/2624193003 .
2017-01-17 06:10:02 -08:00
Paul Berry 577c91ba27 Fix physical_file_system_test.dart on Windows.
With the simplification to PhysicalFileSystem introduced in
fef4569eb5, the URI "/foo.dart" is now
uniformly treated as equivalent to "file:///foo.dart", even on
Windows.  (At the time the file is read, the file will be located on
the current drive).  This is consistent with what we do for relative
paths.

TBR=sigmund@google.com

Review-Url: https://codereview.chromium.org/2634543003 .
2017-01-13 05:51:00 -08:00
Paul Berry 561dacdad5 Simplify finding of .dart files in subpackage_relationships_test.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2627143004 .
2017-01-12 16:07:20 -08:00
Paul Berry fef4569eb5 Simplify PhysicalFileSystem implementation.
- Use Uri.base.resolveUri() to do all necessary normalization and
  conversion to absolute paths.

- Store a URI in _PhysicalFileSystemEntity rather than a path.

- Use `new io.File.fromUri(...)` to access the physical files.

- Fix some minor bugs in physical_file_system_test.dart.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2622423003 .
2017-01-12 15:48:48 -08:00
Paul Berry 9e49451643 Test that subpackages of front_end don't have undesired dependencies.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2624913004 .
2017-01-12 14:33:42 -08:00
Paul Berry fdbdd8a4d8 Add code to ProcessedOptions to fetch the SDK summary bundle.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2625533002 .
2017-01-11 06:19:40 -08:00
Paul Berry 9d5c3a9917 Fix Windows path handling in uri_resolver_test.
Fixes #28309

R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2628653002 .
2017-01-10 15:09:17 -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
Paul Berry 1d57e1b096 Extract code from dependency_grapher.dart for easier re-use elsewhere in the front end.
In the process I've made the constructors for Graph, LibraryCycleNode,
and LibraryNode public.  I don't think this should be a problem, since
these are simple data structures, so there is no harm in allowing
clients to create them.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2617483007 .
2017-01-06 11:37:12 -08:00
Paul Berry ca271d003e Create a wrapper class to handle CompilerOptions in a uniform way.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2618633006 .
2017-01-06 10:40:45 -08:00
Paul Berry 848d059581 Add a missing copyright notice.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2611183004 .
2017-01-06 10:03:35 -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 0d1703309a dependency_grapher: handle dependencies on SDK.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2581263002 .
2016-12-16 13:23:41 -08:00
Paul Berry 519f7d4025 Add preliminary packages file support to dependency_grapher.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2572383004 .
2016-12-16 10:07:29 -08:00
Paul Berry ede20b6558 Implement a front end API for querying the dependency structure of a project.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2575403005 .
2016-12-15 18:47:20 -08:00
Paul Berry 4e33530fbf Add front end code for reading the SDK's "libraries.dart" file.
R=danrubel@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2578693002 .
2016-12-14 15:23:31 -08:00
Paul Berry b29fa08444 Implement URI resolution in the front end.
R=danrubel@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2577503002 .
2016-12-13 13:21:14 -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
Paul Berry d70184abd8 Create a default error handler to avoid the need for null checks.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2568583002 .
2016-12-12 10:54:38 -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
Paul Berry 4ee949c154 Add an async version of dependency_walker.dart.
This is intended to be used in situations where computing dependencies
and/or evaluating nodes is an asynchronous operation.  (For example,
when performing a compilation, computing dependencies of a library
requires file I/O to read the files constituting the library;
evaluating a library cycle might potentially be performed
asynchronously by a separate isolate).

At the moment the implementation is nearly the same as that of
dependency_walker.dart, except asynchronous.  In future CLs I will
look into allowing computeDependencies(), evaluate(), and
evaluateScc() to operate in parallel.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2552383002 .
2016-12-06 12:29:07 -08:00
Paul Berry 11d43180af Add missing copyrights
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2550323003 .
2016-12-06 11:20:05 -08:00
Paul Berry 2bf75c0550 Move dependency walker logic to front end.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2554973002 .
2016-12-06 10:18:24 -08:00
Paul Berry 4e530c1203 Make PhysicalFileSystem the default
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2554933002 .
2016-12-06 10:09:35 -08:00
Paul Berry eb9f3ba931 Fix incorrect type in override of CompilationError.span.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2550283002 .
2016-12-05 14:35:56 -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
Asger Feldthaus ce428a1f20 Complete merge of kernel repo into SDK.
This removes third_party/pkg/kernel and changes dependencies to
refer to pkg/kernel instead.

Some status files are updated to reflect new test outcomes.
2016-11-23 12:46:29 +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 1c2268b13e Move scanner tests into the front_end package.
This required moving the following classes into front_end as well:
- CharSequenceReader
- SubSequenceReader
- JenkinsSmiHash

A small amount of the functionality of GatheringErrorListener and
AnalysisError had to be replicated, to avoid a dependency on the
analyzer package.  In a future CL I will either refactor this code to
make it available to the rest of the front end, or, if
GatheringErrorListener and AnalysisError wind up getting moved into
the front end, I will un-do the replication.

I also took the liberty of addition functionality to JenkinsSmiHash to
make it easier to use.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2508483002 .
2016-11-15 14:53:49 -08:00
Paul Berry da70cf3be2 Rename CompilationError.location to CompilationError.span
This should avoid some confusion since its type is SourceSpan, not
SourceLocation.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2503853003 .
2016-11-15 10:36:51 -08:00
Paul Berry 0c928771fc Revert "Connect analyzer's AnalysisError object to front_end's CompilationError."
This reverts commit fc5270df72.

TBR=scheglov@google.com, brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2503803003 .
2016-11-15 10:00:34 -08:00
Paul Berry fc5270df72 Connect analyzer's AnalysisError object to front_end's CompilationError.
AnalysisError implements CompilationError but provides additional
services, such as extensibility via the `getProperty` method.

Note: CompilationError.location has been renamed to
CompilationError.span to avoid confusion (since its type is
`SourceSpan`, not `SourceLocation`).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2498133002 .
2016-11-14 15:30:10 -08:00