Commit Graph

7128 Commits

Author SHA1 Message Date
Konstantin Shcheglov 23e9fbcf30 Issue 25514. Harden parents validation in incremental resolver.
R=brianwilkerson@google.com, skybrian@google.com
BUG= https://github.com/dart-lang/sdk/issues/25514

Review URL: https://codereview.chromium.org/1605263002 .
2016-01-20 08:02:07 -08:00
Paul Berry c6dd4a3967 Add propagated types to summary files.
Note: the prelinker doesn't support type propagation, since type
propagation may require looking at files beyond direct imports and the
transitive closure of exports.  However, to pave the way for a future
implementation of a full linker, we still maintain the distinction
between linked and unlinked data.  The unlinked data for a propagated
type is simply a unique "slot id" for each type in the compilation
unit which may be propagated.  The linked data is the propagated type
to fill into each slot, if any.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1610043002 .
2016-01-20 06:36:04 -08:00
Paul Berry 738b835b0b Split _LibrarySerializer into two classes.
The new class, _CompilationUnitSerializer, is responsible for
serializing a single compilation unit.  In a future CL, this will allow
us to serialize all the compilation units for a given library in phases,
retaining state information in each of the _CompilationUnitSerializers.

Also, this fixes a previously undiscovered bug where we were trying to
use the same reference index to represent unresolved references across
compilation units; the correct behavior is for each compilation unit to
have its own index for unresolved references.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1601973006 .
2016-01-19 21:09:53 -08:00
Paul Berry 547df40502 Fix the return type of _TypeRefValidator.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1608123002 .
2016-01-19 19:04:58 -08:00
Paul Berry 1db9d760fc Rename UnlinkedTypeRef to TypeRef.
This data structure is going to be re-used in the "linked" section of
summaries to refer to propagated and inferred types.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1610003002 .
2016-01-19 18:52:05 -08:00
Konstantin Shcheglov 633b09698d Enable most of the constant AST serialization for AST-based summaries.
Class member references - constructors (both ambigue and not) and static
methods.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1606113002 .
2016-01-19 16:14:59 -08:00
Konstantin Shcheglov 07f8831bc2 Serialize constant initializers.
No implementation for element references in this CL.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1602203004 .
2016-01-19 13:42:51 -08:00
Paul Berry cbe4248f4e Fix summarization of trailing dynamic type arguments.
Serialization code now matches the comments in the IDL, which say that
trailing `dynamic` type arguments (e.g. `Map<int, dynamic>`) are omitted
from the summary.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1602263002 .
2016-01-19 13:34:41 -08:00
danrubel b37e3b7ec1 (TBR) fix embedder tests on Windows
Review URL: https://codereview.chromium.org/1609003003 .
2016-01-19 16:24:01 -05:00
danrubel 97273b2658 (TBR) make test pass on Windows
see https://github.com/dart-lang/sdk/issues/25498

Review URL: https://codereview.chromium.org/1603973002 .
2016-01-19 13:33:34 -05:00
Paul Berry 1cbf8cfd5f Introduce code for computing an unlinked summary directly from an AST.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1602883003 .
2016-01-19 10:25:49 -08:00
Paul Berry 832512a2d0 Properly resynthesize field formal parameter elements.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1603643007 .
2016-01-19 10:15:12 -08:00
Brian Wilkerson 21ecb14548 Clean-up imports
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1602803002 .
2016-01-18 15:42:16 -08:00
Konstantin Shcheglov 78aad4c282 Fix the build - add the new field.
TBR

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1598183003 .
2016-01-17 09:41:21 -08:00
Konstantin Shcheglov 37c2eca20d Prepare for chaining resynthesizers from AC to SDK AC.
AboutToComputeResultHelper for each AnalysisContext should be set
externally, because analysis engine does not know where summaries are
stored.

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

Review URL: https://codereview.chromium.org/1591483002 .
2016-01-17 09:25:24 -08:00
Paul Berry 2f99679042 Don't include implicit initializing formal types in summaries.
These can be easily inferred at resynthesis time.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1597893003 .
2016-01-17 09:12:07 -08:00
Brian Wilkerson d116322f7d Do not produce hint on constructor when class is deprectated (issue 25503)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1598773004 .
2016-01-16 15:09:56 -08:00
Dan Rubel 1ef8fc8cec simplify EmbedderUrlResolver
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1596693002 .
2016-01-15 21:21:11 -05:00
Konstantin Shcheglov 21d0fb26c9 Write and read support for Float64 lists in FlatBuffers.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1588043006 .
2016-01-15 14:40:48 -08:00
Konstantin Shcheglov 6b56451788 Issue 25504. Fix for ignoring expression bodies in incremental resolver.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25504

Review URL: https://codereview.chromium.org/1584653007 .
2016-01-15 12:20:49 -08:00
Dan Rubel b7303a3409 plumb through enableAsync
and mock async library elements if enableAsync is false

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1591653003 .
2016-01-15 14:15:02 -05:00
Konstantin Shcheglov 183144562d Chaining not just element requests but also summaries access.
We need to do this when during resynthesizing a package library we
need to create a Location referencing something in the Dart SDK.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1585843009 .
2016-01-15 09:06:56 -08:00
Paul Berry a07b997e63 Downplay the distinction between linked and prelinked summaries.
Following a discussion on Tuesday, we've decided to only deal with the
distinction between linked and unlinked information in the summary
definition for now.  This should allow fully-linked information (such as
constant evaluation, propagated types, and inferred types) to be added
to summaries without much trouble.

The distinction is preserved in the prelinker (which can't currently
handle fully-linked information), and to some degree it will be
preserved in unit tests (to minimize future churn).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1584313005 .
2016-01-14 16:58:03 -08:00
John Messerly 9da8970cdf fix #25486, promote from dynamic in strong mode
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1585323003 .
2016-01-14 16:19:27 -08:00
Konstantin Shcheglov ca5bf28fa5 Chain SummaryResynthesizer(s).
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1585093003 .
2016-01-14 14:43:29 -08:00
John Messerly 9098ae50ae fix #25425, more inference of generic methods
this adds support for function expr invocation, as well as other element types besides executable elements

R=brianwilkerson@google.com, leafp@google.com

Review URL: https://codereview.chromium.org/1586813002 .
2016-01-14 13:27:34 -08:00
John Messerly 724492ca82 fixes #25340, propagatedType now finds the instantiated generic method's return type
R=brianwilkerson@google.com, leafp@google.com

Review URL: https://codereview.chromium.org/1582863003 .
2016-01-14 13:20:13 -08:00
John Messerly 154959c762 fixes #25407, generic list and map literal type comments
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1589663002 .
2016-01-14 13:18:59 -08:00
danrubel 559fb01244 assert isAsynchronous and isGenerator false if parseAsync is false
and fix ASYNC_NOT_SUPPORTED error code

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

Review URL: https://codereview.chromium.org/1584823003 .
2016-01-14 14:52:23 -05:00
danrubel ebd1736c58 Add EmbedderSdk to EmbedderUriResolver
R=brianwilkerson@google.com, johnmccutchan@google.com, pquitslund@google.com

Review URL: https://codereview.chromium.org/1584663006 .
2016-01-14 14:51:43 -05:00
Brian Wilkerson 1e9326d13f Add tests for computation of constant expressions involving ??
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1589043002 .
2016-01-14 10:55:21 -08:00
Paul Berry ba31abe429 Use constructor args in favor of summary "encode" functions.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1585973004 .
2016-01-14 09:30:04 -08:00
Konstantin Shcheglov 9484bfe1c9 Issue 25064. Incrementally resolve comments only if both are documentation.
R=brianwilkerson@google.com, skybrian@google.com
BUG= https://github.com/dart-lang/sdk/issues/25064

Review URL: https://codereview.chromium.org/1581293002 .
2016-01-14 08:38:37 -08:00
Paul Berry 834263789f Include the export namespace in the prelinked summary.
This prevents having to traverse the transitive closure of exports
when resynthesizing a library from its summary.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1589573003 .
2016-01-13 13:16:23 -08:00
John Messerly f114dc1073 fix #25409, error if a generic method argument did not have a corresponding parameter
R=leafp@google.com

Review URL: https://codereview.chromium.org/1579503005 .
2016-01-13 11:20:13 -08:00
John Messerly 5947a2047f associate a staticInvokeType with loadLibrary
I missed this early-exit code path. This was caught by DDC's tests.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1577143002 .
2016-01-13 10:40:03 -08:00
Konstantin Shcheglov 0d8a31e0a6 Create LibraryElement.loadLibrary during resynth.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1583613002 .
2016-01-13 09:35:37 -08:00
John Messerly 3aa98fa335 fixes #24711, allow factory constructors to be downcast
R=leafp@google.com

Review URL: https://codereview.chromium.org/1578863004 .
2016-01-13 09:04:21 -08:00
Paul Berry c1642e9d9f Make summary builder classes implement summary interfaces.
This allows for easier unit testing, since we can use a builder class
directly rather than having to serialize and deserialize it.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1581993002 .
2016-01-13 08:54:48 -08:00
Konstantin Shcheglov 2f57161e74 Patch together getters/setters in different parts.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1577413002 .
2016-01-13 08:26:29 -08:00
Konstantin Shcheglov c474538e77 Resynth LibraryElement.deferred.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1580173002 .
2016-01-13 08:18:57 -08:00
Paul Berry 35f3961ea6 Test dependency tracking of unused imports/exports.
If library A imports or exports library B (either directly or via an
export), library B needs to be included in the dependency list for
library A's prelinked summary, since a change to library B might change
the meaning of a name which *is* used by library A.

Note that two of the new tests are currently failing, due to the fact
that we aren't tracking dependencies that only affect the export
namespace.  That will be fixed in a future CL.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1580013003 .
2016-01-13 08:17:49 -08:00
Konstantin Shcheglov 9f6612d68c Resynth importElement.prefixOffset.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1581803002 .
2016-01-13 08:14:49 -08:00
Konstantin Shcheglov c09b9025d7 Tests for propagated type of final/const fields/top-levels.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1586493002 .
2016-01-13 07:54:34 -08:00
Konstantin Shcheglov f4c4b27d3f Resynth the 'final' property of top-level variables.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1575323003 .
2016-01-13 07:52:35 -08:00
John Messerly 351ccc586f fix generic function expressions, part of #25175
R=leafp@google.com

Review URL: https://codereview.chromium.org/1579303002 .
2016-01-12 16:04:57 -08:00
John Messerly 0549def77d checking and inference of null coalescing operator, fixes #24564 and fixes #25387
R=leafp@google.com

Review URL: https://codereview.chromium.org/1575173005 .
2016-01-12 15:50:18 -08:00
Konstantin Shcheglov 5815e34221 Test for LibraryElement.hasExtUri resynth.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1578263003 .
2016-01-12 12:55:42 -08:00
Paul Berry 85a7affb7c Record information about parts of dependent libraries in summaries.
This information will be necessary in order to determine whether a
summary needs to be re-linked, since a change to a part of library A may
affect any other library that depends on library A, even if the defining
compilation unit of library A is unaffected.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1574113002 .
2016-01-12 12:02:47 -08:00
Konstantin Shcheglov b9ff7c4860 Compute exportNamespace during resynthesizing.
Also use it to find the entry point.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1576213002 .
2016-01-11 16:37:43 -08:00