Commit Graph

8693 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
Brian Wilkerson 3ef79232ad Add indication of resolver provider to the status page
R=jwren@google.com

Review URL: https://codereview.chromium.org/1653093002 .
2016-02-01 11:36:07 -08:00
Konstantin Shcheglov 86106d7a6d Issue 25623. When adding the 'async' modifier, change the return type.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25623

Review URL: https://codereview.chromium.org/1652963003 .
2016-02-01 10:35:47 -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
Konstantin Shcheglov bb73ff38bc Fix build: _addFix_addAsync_asyncFor() does not return.
TBR

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1656693003 .
2016-02-01 08:49:25 -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
Konstantin Shcheglov 3f7a21bc0e Issue 25622. Quick fix for 'async-for'.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25622

Review URL: https://codereview.chromium.org/1650853002 .
2016-02-01 08:03:55 -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
Brian Wilkerson 3fa4b0fadb Add hook to command-line analyzer similar to server
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1646413003 .
2016-01-29 13:31:25 -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
Florian Loitsch 2232803eae Don't use "var" to introduce the deferred_initializer.
R=het@google.com

Review URL: https://codereview.chromium.org/1653453002 .
2016-01-29 21:52:52 +01: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
Brian Wilkerson 348b79b8ec Set the SDK analysis options in analyzer_cli
R=jmesserly@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1644093002 .
2016-01-29 07:42:31 -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
Paul Berry ff15ce7a9e Mark new test utilities_test as slow due to bug #24914
TBR=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1640403003 .
2016-01-28 09:45:54 -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
Kevin Millikin b76ffa9505 dart2js CPS: Remove an invalid assertion in shrinking reductions.
Because we search for new redexes while performing reductions, we can't
always assert that a term is well-formed.

In this case, it's not true that all invocations of a continuation will have
the same number of arguments while we are in the middle of performing a dead
parameter reduction.

BUG=
R=asgerf@google.com

Review URL: https://codereview.chromium.org/1641073003 .
2016-01-28 12:56:01 +01:00
Kevin Millikin 7db0c89e49 dart2js CPS: During shrinking reductions, mark deleted branches as deleted.
Shrinking reductions uses a null parent of a potential redex to detect that
the redex occurs in an already-deleted subterm, to avoid performing such
reductions.  (They are not safe because the term structure of deleted
subterms, e.g., use lists, might not be consistent.)

R=asgerf@google.com
BUG=

Review URL: https://codereview.chromium.org/1645933002 .
2016-01-28 09:59:59 +01:00
Kevin Millikin fd9603d1d2 dart2js CPS: implement special handling of the Symbol constructor.
There is a 'const' Symbol constructor that is not expressible as a Dart
const constructor because it performs validation of its input.  This is
implemented in the libraries by using a dummy const constructor definition
that does not validate its input and replacing calls to 'new Symbol' with
calls to 'new Symbol.validated' in the compiler.

Without replacing calls to 'new Symbol', the non-validating dummy
implementation will be used, which is not correct.

Closes #24878.

R=asgerf@google.com
BUG=https://github.com/dart-lang/sdk/issues/24878

Review URL: https://codereview.chromium.org/1639313002 .
2016-01-28 08:55:35 +01:00
Stephen Adams e1386ce210 Store-forwarding for ReadTypeVariable
Example 1:

    var v0 = H.setRuntimeTypeInfo(new P.ListQueue(null, 0, 0, 0), [$E]);
    v0._table = J.JSArray_JSArray$list(8, H.getTypeArgumentByIndex(v0, 0));
-->
    var v0 = H.setRuntimeTypeInfo(new P.ListQueue(null, 0, 0, 0), [$E]);
    v0._table = J.JSArray_JSArray$list(8, $E);

Example 2 (enabling scalar replacement):

    this._historyTracking = W._EventStreamSubscription$(
        (v0 = H.setRuntimeTypeInfo(
              new W._EventStream(window, "popstate", false), [null]))._target,
        v0._eventType,
        handler,
        v0._useCapture,
        H.getTypeArgumentByIndex(v0, 0));
-->
    this._historyTracking = W._EventStreamSubscription$(
        window,
        "popstate",
        handler,
        false,
        null);

R=asgerf@google.com

Review URL: https://codereview.chromium.org/1636193002 .
2016-01-27 15:46:34 -08:00
Stephen Adams 6a4903f201 Fix analyzer warnings for https://codereview.chromium.org/1642493002
TBR=asgerf@google.com

Review URL: https://codereview.chromium.org/1643783002 .
2016-01-27 15:07:20 -08:00
Stephen Adams 1673a64849 Add type info to JSArray.
JSArray<E>.typed has a specially generated body. We should be able to inline this. This makes all of the "new List.xxx()" paths work.

Literal lists are treated like maps - we generate a call to JSArray<E>.typed.  I need to change that to JSArray<E>.markGrowable.

R=asgerf@google.com

Review URL: https://codereview.chromium.org/1642493002 .
2016-01-27 13:47:12 -08: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
Stephen Adams 30f90c3dcd Fix analyzer warnings in assertions of the TypeExpression CL
TBR=asgerf@google.com

Review URL: https://codereview.chromium.org/1641883002 .
2016-01-27 12:38:22 -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
Stephen Adams 27b7999463 typeInformation in CreateInstance is a kind of TypeExpression
Use TypeExpression to create the 'headless flat' type term that is used for the instance's reified type.
This is a step towards placing the type term on JSArray.

There is also some modest GVN benefits where repeated terms are shared.

R=asgerf@google.com

Review URL: https://codereview.chromium.org/1637843002 .
2016-01-27 11:26:31 -08:00