Commit Graph

195 Commits

Author SHA1 Message Date
Konstantin Shcheglov 3ba8c2df3d Regenerate the task graph.
TBR

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2698703002 .
2017-02-15 10:46:04 -08:00
Konstantin Shcheglov ea72cbf830 Don't use Element.computeNode() in tasks graph generator.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2678693002 .
2017-02-06 06:53:01 -08:00
Paul Berry ab6e74cb1c Regenerate task_dependency_graph after 914a117649
TBR=scheglov@google.com

Review-Url: https://codereview.chromium.org/2631683002 .
2017-01-13 04:17:32 -08:00
Brian Wilkerson 22f561e914 Reapply "Add support for generic function type syntax, part 1"
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2622303006 .
2017-01-11 14:10:05 -08:00
Brian Wilkerson 85b1e7abbe Revert "Add support for generic function type syntax, part 1"
Review-Url: https://codereview.chromium.org/2624283003 .
2017-01-11 13:30:52 -08:00
Brian Wilkerson 1cd918533d Add support for generic function type syntax, part 1
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2613383003 .
2017-01-11 13:12:10 -08:00
Brian Wilkerson 96750cd5cb Split out options from ContextBuilder
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2425423009 .
2016-10-20 11:03:11 -07:00
William Hesse 92cd3e10f5 Fix test.py and tests to use an explicit --packages flag.
BUG=https://github.com/dart-lang/sdk/issues/27412
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2361813003 .
2016-09-22 17:51:09 +02:00
Paul Berry e77187ff6d Fix pkg/analyzer/tool/task_dependency_graph/check_test.
This was broken by the move to ".packages" files.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2351833002 .
2016-09-19 12:07:54 -07:00
Konstantin Shcheglov fa24d1caaa Stop generating index information for SDK and simplify summary generation.
The implementation is still element model based, I will switch it to
the AST based approach in a following CL.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2345793002 .
2016-09-15 16:15:20 -07:00
Brian Wilkerson ecc84b26a4 Break up another large file
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2342733002 .
2016-09-15 07:49:27 -07:00
Konstantin Shcheglov 35bf41691e Change summaries setter generation to allow properties named 'value'.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2339053002 .
2016-09-15 07:08:38 -07:00
Konstantin Shcheglov 663a3e810c Reapply abc5051854: Remove 'Element.docRange'.
I also marked the corresponding information in summaries as @deprecated
and made a small tweak to the generator so that it knows that the ids
of deprecated fields are still used.

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

Review URL: https://codereview.chromium.org/2330813002 .
2016-09-11 09:41:53 -07:00
Brian Wilkerson fa1b80fd82 Remove references to deprecated code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2331743002 .
2016-09-10 11:28:43 -07:00
Brian Wilkerson 5bd4de469e Clean up warnings and hints
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2324463006 .
2016-09-09 09:09:59 -07:00
Brian Wilkerson e5d10ceed6 Roll back changes that broke the bots (TBR)
Review URL: https://codereview.chromium.org/2319143003 .
2016-09-07 14:07:54 -07:00
Brian Wilkerson 771d296a6c Remove final references to PackageUriResolver
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2320733003 .
2016-09-07 13:03:19 -07:00
pq b7f0ce083b Revert "Remove 'Element.docRange'."
This reverts commit abc5051854.

Background: required to keep `analyzer` version-compatible with `test`.

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

Review URL: https://codereview.chromium.org/2293143003 .
2016-08-30 13:10:15 -07:00
Konstantin Shcheglov 09b851c97f Don't perform final fields and top-level variables type propagation.
A similar feature is now implemented in strong mode, and users who
need it, should switch to strong mode.

When we are ready to drop propagated types altogethoer, we could
deprecate or remove UnlinkedVariable.propagatedTypeSlot in IDL.

R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/26794

Review URL: https://codereview.chromium.org/2288223003 .
2016-08-29 15:18:12 -07:00
Konstantin Shcheglov abc5051854 Remove 'Element.docRange'.
I also marked the corresponding information in summaries as @deprecated
and made a small tweak to the generator so that it knows that the ids
of deprecated fields are still used.

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

Review URL: https://codereview.chromium.org/2270903002 .
2016-08-24 09:40:23 -07:00
Paul Berry e31e7757d5 Move summary inspection code out of pkg/analyzer/lib.
It depends on mirrors, which aren't supported by Flutter.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2257563002 .
2016-08-17 12:15:16 -07:00
Paul Berry 052a6c867d Fix summary handling of unresolved imports, exports, and parts.
Previously this was working for a few use cases by dumb luck, but it
wasn't well tested and became broken by
b29c6bf330.  This CL fixes it for real
and adds tests to verify the fix.

Note that there is a change to how we represent an unresolved
import/export: instead of storing a URI_EXISTS modifier in the element
model, we simply mark the imported library element as synthetic.
(This library element existed anyway; we just weren't marking it as
synthetic).  This makes it easy to tie in with summaries, since it is
easy for the resynthesizer to detect that the library doesn't exist at
the time the library handle is resolved.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2235373003 .
2016-08-12 13:59:51 -07:00
Brian Wilkerson c41427383b Deprecate DirectoryBasedDartSdk and transition existing uses to the new API
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2242853002 .
2016-08-12 09:18:12 -07:00
Konstantin Shcheglov 296d81f60a Issue 27053. Record errors in InferStaticVariableTypeTask and include them into unit errors.
R=brianwilkerson@google.com, jmesserly@google.com
BUG=

Review URL: https://codereview.chromium.org/2239613002 .
2016-08-11 09:10:31 -07:00
Konstantin Shcheglov 6df5ea27a5 Revert 6ad38498c8 (PARSED_UNIT).
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2231473002 .
2016-08-09 10:14:18 -07:00
Konstantin Shcheglov 6ad38498c8 Extract unresolved AST parsing (PARSED_UNIT1) from full parsing, which includes UriBasedDirective(s) resolution.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2229603003 .
2016-08-08 14:45:27 -07:00
Paul Berry 70bd623f36 Add an "api signature" to summaries.
The API signature of a summary is an MD5 hash of the API of the code
being summarized.  This will be used by analysis server to detect when
a summary needs to be relinked (because it was built with reference to
another summary whose API has since changed).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2216873003 .
2016-08-04 16:12:49 -07:00
Konstantin Shcheglov fa854d41f6 Fix for limited invalidation in the middle, and the unlimited invalidation for an exported library.
Consider libraries `A`, `B`, and `C`, where `C` imports `B`, and `B`
exports `A`. [RESOLVED_UNIT4] of `C` depends on [LIBRARY_ELEMENT4] of
[IMPORTED_LIBRARIES], i.e. `B`. Even though [LIBRARY_ELEMENT4] of `B`
depends on [LIBRARY_ELEMENT3]s of its [EXPORT_SOURCE_CLOSURE] (i.e. `A`
and `B`), [RESOLVED_UNIT4] of `C` sees only [LIBRARY_ELEMENT4] of `B`.

When invalidate results of `B` (but keep results of `C`), we will
invalidate and remove [LIBRARY_ELEMENT4] of `B`, so we lose knowledge
that [RESOLVED_UNIT4] of `C` indirectly depends on `A`.

The solution is do depend on [EXPORT_SOURCE_CLOSURE] of all
[IMPORTED_LIBRARIES] in [RESOLVED_UNIT4] of `C`.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2171673002 .
2016-07-21 07:26:47 -07:00
William Hesse 60db3bd080 Update task_dependency_graph after analyzer change
BUG=

Review URL: https://codereview.chromium.org/2136543002 .
2016-07-08 15:36:31 +02:00
Paul Berry efe5a31421 Remove "_finished" assertion checks from summary codegen.
These assertions were helpful back when the client manually managed
offsets.  Now that offsets are managed automatically by the toBuffer()
logic, they don't carry any benefit.

Removing these assertions will pave the way for allowing a summary to be
created, serialized, modified, and then serialized again, which we will
need to do to efficiently generate both "full" and "semantic" summaries.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2110693002 .
2016-06-28 16:22:57 -07:00
Konstantin Shcheglov 4bae18ae3b Regenerate tasks graph.
TBR

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2106483002 .
2016-06-27 12:09:00 -07:00
pq 9a75f18e47 Introduce build configuration to summary building.
Options are largely unused but are in line with what is specified in CLI to support `build_mode` bringing us a step closer to a unified summary builder and in the short term to a provisional API that should work for Flutter SDK generation experiments in the next alpha release.

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

Review URL: https://codereview.chromium.org/2078033002 .
2016-06-17 13:37:29 -07:00
Jaime Wren f4ff1edcef Provide direction to users of the now deprecated class FileUriResolver
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2078703002 .
2016-06-16 15:24:17 -07:00
pq 772972ad32 Make SDK summary writing available to analyzer clients.
Not API (in `lib/src`) but available nonethess to clients such as flutter who need to be able to write their own SDK summaries (and ideally not duplicate low-level flat_buffer interactions).

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

Review URL: https://codereview.chromium.org/2077583002 .
2016-06-16 15:09:42 -07:00
pq ed4dc77436 Switch statement cleanups.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2067973002 .
2016-06-14 12:34:08 -07:00
pq 1eefb68c25 SDK summary creation generalization (pt 1).
Steps towards generalizing summary creation bits (to allow for, among other things, flutter SDK summary creation).  API is provisional (note still in `lib/src`).

Next up:
* move result writing out of `tool/` to allow for reuse
* `SummaryBuilder.forPackageMap(..)` factory (or similar) for use in the flutter SDK case

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

Review URL: https://codereview.chromium.org/2055543002 .
2016-06-09 12:06:36 -07:00
pq ae9a984057 Regen task graph.
BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2023543002 .
2016-05-27 15:02:56 -07:00
Konstantin Shcheglov 0f441fa3ea Use BufferContext + offset instead of BufferPointer.
This lets us avoid creating tens of millions of BufferPointer instances
and makes DDC compilation about 6% faster.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1998833002 .
2016-05-19 20:08:26 -07:00
Paul Berry 6090636607 Improve dumping of inferred types.
We now disambiguate all types by their full library
URI (e.g. "dart:core.Map" instead of "Map").  In addition, we now expand
function types based on local functions into their arguments and return
types (e.g. "() -> dynamic" rather than
"typeof(....localFunction[0].localFunction[0])".

This allows more accurate comparison of AST-based and element-based
summaries.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1997753002 .
2016-05-19 11:04:49 -07:00
Paul Berry 655e9155a8 Add a strong-outputs mode to build_sdk_summaries.dart.
This is needed by dev_compiler, which currently has its own fork of the
SDK that can only be summarized successfully in strong mode.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1979333002 .
2016-05-16 11:29:46 -07:00
Brian Wilkerson 23b02bc351 Add support to the task model for the @required annotation
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1977903002 .
2016-05-13 11:11:48 -07:00
Paul Berry a407f6ad37 Modify dump_inferred_types to use SummaryDataStore.
This paves the way for further improvements to dump_inferred_types to
allow it to make use of linker data structures.  That will in turn make
it easier to validate the linker code by exercising more of it.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1969313006 .
2016-05-12 10:35:44 -07:00
Paul Berry abd7a34476 Update dump_inferred_types to show an index of libraries and parts.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1962813002 .
2016-05-09 12:38:33 -07:00
Paul Berry f10f138cd1 Drop trailing dynamic when dumping inferred types.
This makes it easier to compare the output of AST-based and
element-based summaries, since element-based summaries cannot
distinguish between implicit type arguments and explicitly-specified
type arguments that happen to match the default (usually `dynamic`).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1957133002 .
2016-05-08 11:36:22 -07:00
Paul Berry 5f3481e811 Skip local variables when dumping inferred types.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1956433002 .
2016-05-05 09:14:16 -07:00
Paul Berry fca48b75de Skip local functions when dumping inferred types.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1948103002 .
2016-05-04 11:29:38 -07:00
Paul Berry c351cb3c37 Skip more initializers when dumping inferred types.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1939973002 .
2016-05-02 14:55:27 -07:00
Konstantin Shcheglov 0f0b38dab3 Implement stable resolution of generic types without type arguments to their bounds.
R=brianwilkerson@google.com, leafp@google.com
BUG= https://github.com/dart-lang/sdk/issues/26265

Review URL: https://codereview.chromium.org/1927323002 .
2016-04-29 08:25:55 -07:00
Paul Berry 09c98dc456 Modify dump_inferred_types.dart to handle missing unlinked units.
In rare cases a summary package bundle may contain a LinkedLibrary
object but not its corresponding UnlinkedUnits.  (This could happen, for
instance, if both a package and one of its dependencies contain
libraries that reference the same file as a "part"--in this case, the
UnlinkedUnit for the part might only be included in one of the package
bundles, because it is redundant in the other).

This CL modifies dump_inferred_types.dart so that it doesn't crash in
this rare corner case.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1930663003 .
2016-04-27 14:22:30 -07:00
Paul Berry f821542305 Build strong mode SDK summary with dart2js paths
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1922233002 .
2016-04-26 15:06:48 -07:00