Commit Graph

1740 Commits

Author SHA1 Message Date
Paul Berry b3e588e640 Check proper resynthesis of type parameters of generic methods.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1656033002 .
2016-02-01 13:10:48 -08:00
Konstantin Shcheglov eff97b738e Resynthesize static method references.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1658723005 .
2016-02-01 12:58:01 -08:00
Paul Berry bfa85298e2 Document that LinkedExportName.name includes trailing '=' for setters.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1658773004 .
2016-02-01 12:49:29 -08:00
Konstantin Shcheglov 402ff37f16 Don't use 'info.type', always set 'element'.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1654983002 .
2016-02-01 12:41:31 -08:00
Konstantin Shcheglov a568af080e Resynthesize top-level and class static property access references.
Class static methods have some complications related to propagated
types, so I will do it after this CL.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1652183002 .
2016-02-01 11:43:17 -08:00
Konstantin Shcheglov a4711db5f4 Resynthesize type references.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1650833002 .
2016-02-01 09:18:00 -08:00
Brian Wilkerson 5b95009a6b Move ResolverProvider to analyzer so that it can be shared
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1658663002 .
2016-02-01 08:12:29 -08:00
Paul Berry 87c6790bb9 Add tests demonstrating bug #25605.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1650783002 .
2016-01-31 05:43:02 -08:00
Konstantin Shcheglov eb4a056948 Verify AST instead of constant values.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1651653002 .
2016-01-29 14:55:56 -08:00
Paul Berry 8da962e6a3 Test and fix a few more corner cases of summarizing type inference.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1643403002 .
2016-01-29 13:47:01 -08:00
Paul Berry 9e7b8daf83 Add the ability to summarize inferred types based on function-typed parameters.
There may still be bugs related to generic types.  I will follow up
with more tests (and fixes if necessary) in further CLs.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1647253002 .
2016-01-29 13:12:15 -08:00
Bob Nystrom 434f5bc922 Implement the spec's notion of LUB for function types.
Fixes #23381.

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

Review URL: https://codereview.chromium.org/1648063002 .
2016-01-29 10:37:58 -08:00
Paul Berry db4acee8c3 Rename ReferenceKind.constField and referenceKind.staticMethod.
These will be re-used when summarizing inferred types, and they won't
necessarily refer to things that are const/static.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1646363002 .
2016-01-29 10:34:12 -08:00
Konstantin Shcheglov a110b6c691 Resynthesize typed constant lists and maps.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1643283002 .
2016-01-29 10:28:05 -08:00
Brian Wilkerson 18482981d3 Fix an exception caused by malformed code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1648923003 .
2016-01-29 10:26:30 -08:00
pq 9b1fa223a8 Embedded libs key rename to defuse server landmine.
1.13 stable builds of the SDK contain a version of server that fails catastrophically when analyzing source that imports packages that define embedded libraries. Since we can't pragmatically require more recent SDKs for flutter development we have been prevented from landing embedded libs in the flutter engine.  By renaming the key we use to identify contributed libraries, this change avoids the issue.  Old versions of server will simply ignore the new key and new ones will process it properly.  Win-win!

BUG=
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1643023002 .
2016-01-29 09:52:04 -08:00
Konstantin Shcheglov 371922dc67 Resynthesize untyped List / Map.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1642993003 .
2016-01-29 09:39:17 -08:00
Konstantin Shcheglov 2546e179a9 Make constant map literal ordered.
Plus couple fixes for spelling problems.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1643253002 .
2016-01-29 09:31:03 -08:00
Konstantin Shcheglov df5d6bd6e1 Move more constant tests to constant_test.dart file.
I found out that we use HashMap for constant map literals.
But then I realized that I we could move more tests into the right
place.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1647183002 .
2016-01-29 08:58:41 -08:00
Paul Berry a456e97d9e Refactor _LibraryResynthesizer.getReferencedLocation.
The new implementation now handles locations both inside and outside the
current library.  Also it returns the components of the location rather
than the location object itself; in a future CL this will allow us to
append additional components to the location.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1645613005 .
2016-01-29 05:33:19 -08:00
John Messerly ee1b557fd9 fix unused import hints in src/generated/source.dart
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1641083004 .
2016-01-28 15:58:45 -08:00
Paul Berry e9a86b2555 Refactor code for resynthesizing references in summaries.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1649893002 .
2016-01-28 15:12:52 -08:00
Brian Wilkerson 8c83752ee9 Prepare to publish another version for DDC
R=vsm@google.com

Review URL: https://codereview.chromium.org/1640823005 .
2016-01-28 15:02:06 -08:00
Konstantin Shcheglov a3b870d8ec Resynthesize binary and prefix expressions.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1649873002 .
2016-01-28 14:40:02 -08:00
Konstantin Shcheglov 581c2b71c4 Repalce shiftOr with pushLongInt, tweak makeSymbol.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1648783002 .
2016-01-28 14:34:13 -08:00
John Messerly 9733a88c9f fixes #25610, infer JS builtin in strong mode like we used to
R=vsm@google.com

Review URL: https://codereview.chromium.org/1643033002 .
2016-01-28 14:18:25 -08:00
pq e902b07ed4 Engine test fix to keep up with SourceFactory changes.
BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1645173002 .
2016-01-28 12:57:45 -08:00
Konstantin Shcheglov 425cd5444e Compute literal constant values.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1649533005 .
2016-01-28 11:33:04 -08:00
Bob Nystrom 4af641864f A missing enum case in a switch is a warning, not a compile-time error.
Fixes #25576.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1644683002 .
2016-01-28 11:12:25 -08:00
Konstantin Shcheglov d77be7a1af Update ConstTopLevelVariableElementImpl constructors.
We need a non-AST constructor for using in it the resynthesizer.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1644043002 .
2016-01-28 10:58:58 -08:00
pq ce0c3343a7 SourceFactory interface extraction.
Prerequisite to accessing resolvers to handle embedder analysis changes.

See: https://github.com/dart-lang/sdk/issues/25606

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1642973002 .
2016-01-28 10:57:30 -08:00
danrubel d486870787 * fixes embedder bugs on Windows
* updates embedder tests to properly test Windows

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1612393002 .
2016-01-28 10:50:57 -05:00
Brian Wilkerson b33f1380d0 Add tests, including test for issue
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1647613002 .
2016-01-27 12:44:14 -08:00
Paul Berry d24548220a Add the ability to resynthesize class members from summaries.
This is needed to support type inference, since an inferred type may
point to a parameter of a class member.

I believe it will also be useful for reserializing constant ASTs.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1647553002 .
2016-01-27 12:35:12 -08:00
danrubel 296c99c004 (TBR) fix embedder windows test
See https://github.com/dart-lang/sdk/issues/25498

Review URL: https://codereview.chromium.org/1643643002 .
2016-01-27 13:44:41 -05:00
Konstantin Shcheglov 2456628501 Fix build: Add 'ReferenceKind.length' to the switch.
TBR

The analysis error was not visible until after I forced reanalyzing.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1640383002 .
2016-01-27 10:21:54 -08:00
Konstantin Shcheglov 59925f9f4a Support for static method references in constants.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1640813002 .
2016-01-27 10:16:33 -08:00
Konstantin Shcheglov e4ab45aa65 Improve 'length' instance property reference encoding.
UnlinkedConstOperation.length is used not only if we can prove that
the target is a StringLiteral (and actually we cannot encode it as a
reference).

The new ReferenceKind.length was added - it is used to encode reference
to the the only instance property we support - 'length'.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1642483002 .
2016-01-27 09:55:36 -08:00
Brian Wilkerson a1feb55137 Replace isAppropriateFor with suitabilityFor and start using it
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1645643002 .
2016-01-27 09:26:13 -08:00
Brian Slesinsky 0f6bd54d8d deprecate deletedSource and deletedSources in ChangeSet
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1635253002 .
2016-01-26 14:31:47 -08:00
Brian Wilkerson 9c56d05746 Stop creating duplicate enum members when the element model has already been built
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1633233002 .
2016-01-26 14:00:02 -08:00
Paul Berry 70cb431737 Test some additional corner cases of type inference for summaries.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1635213003 .
2016-01-26 13:42:07 -08:00
Konstantin Shcheglov 43621246eb Serialize static constant field references.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1636113002 .
2016-01-26 13:01:40 -08:00
Konstantin Shcheglov 1e4930c9a5 Fix for build: include ReferenceKind.constField case.
TBR

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1629403005 .
2016-01-26 12:30:17 -08:00
Paul Berry f93e2d3212 Remove some summary TODOs that have already been addressed.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1636893003 .
2016-01-26 11:13:10 -08:00
Konstantin Shcheglov 8485e42a27 Record static constant public fields.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1639533003 .
2016-01-26 10:44:21 -08:00
Brian Wilkerson 82de52aae3 Prepare to publish analyzer for DDC
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1633173002 .
2016-01-26 09:47:40 -08:00
Brian Wilkerson 5d9274bd79 Move Modifier out of the public API
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1633823003 .
2016-01-26 09:27:44 -08:00
Konstantin Shcheglov b0836ee7b9 Support for constructor references in constant serializer and prelinker.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1633863002 .
2016-01-26 08:23:12 -08:00
Paul Berry 4e86a006db Stop precomputing ClassElement.isValidMixin.
Previously, we would precompute the value of ClassElement.isValidMixin
and store it in the Modifier.MIXIN.  But this didn't really save any
time, because (a) isValidMixin isn't used inside analyzer, and (b) it
is easily derivable from other information already present in the
element model.

Also, we were computing it incorrectly when the `--supermixin` flag
was present.

This CL replaces the precomputation logic with a direct implementation
in ClassElement.isValidMixin which is correct regardless of the
presence of the `--supermixin` flag.  The tests are beefed up so that
(a) they validate correct behavior for both states of the flag, (b)
they validate correct behavior in the presence of factory
constructors, and (c) they validate that the behavior of
`isValidMixin` is consistent with the error messages produced by the
analyzer.

In addition to fixing bugs, the removal of Modifier.MIXIN means we
have one less piece of information to store in summaries.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1635063003 .
2016-01-26 07:29:48 -08:00