Commit Graph

6588 Commits

Author SHA1 Message Date
Karl Klose e9656e8db1 Add type arguments to lists in the code generator and make them fixed length.
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1164563005
2015-06-03 13:49:02 +02:00
Karl Klose 683743c9c5 Change more JS foreign methods to JS_GET_NAME.
R=herhut@google.com

Review URL: https://codereview.chromium.org//1154073004
2015-06-03 11:41:46 +02:00
Konstantin Shcheglov b35d54a8b7 Decide if unit without directives is a part or a library.
1. When there is a library containing it while we are parsing a part.

2. When a part was parsed, but then we found a library containing it.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1167733004
2015-06-02 16:01:01 -07:00
Konstantin Shcheglov a567814119 Replace 'Element.node' with 'Element.computeNode()'.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1164823003
2015-06-02 13:25:04 -07:00
Konstantin Shcheglov 958638ca20 Record SourceKind.UNKNOWN for not existing sources.
So, they are not returned as library sources.
This fixes one of the Quick Fix tests.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1167773002
2015-06-02 13:18:56 -07:00
Konstantin Shcheglov 2888728de0 Remove an unused local variable in the test.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org//1155613010
2015-06-02 13:16:52 -07:00
Konstantin Shcheglov 250992aad8 Ignore not existing parts.
We decided to produce an empty token streams, so empty units for them.
So, we need to have a separate check for not existing Source later.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1160543003
2015-06-02 11:09:27 -07:00
Konstantin Shcheglov b9dbeedb54 Prepare CompilationUnitElementDelta in IncrementalCompilationUnitElementBuilder.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1155543005
2015-06-02 11:03:03 -07:00
Brian Wilkerson d614533a9e Fix NPE in building element model when part URI could not be resolved
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1155693004
2015-06-02 10:40:03 -07:00
Brian Wilkerson a82c880bb1 Fix NPE when computing dependencies of enum constants
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1156893006
2015-06-02 09:46:21 -07:00
Konstantin Shcheglov 8e439849b3 Issue 23573. Catch exception during indexing.
R=paulberry@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=23573

Review URL: https://codereview.chromium.org//1168473003
2015-06-02 09:40:20 -07:00
Brian Wilkerson 06a3fd1984 Fix more tests for the new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1159623013
2015-06-02 09:06:53 -07:00
Johnni Winther 4f969bbc3b Remove ConstantExpression.value
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1148343004
2015-06-02 15:23:16 +02:00
Asger Feldthaus c442bf5697 dart2js cps: Do not propagate impure expressions across null receiver.
If the receiver is null, the arguments are not evaluated.

Example:

Dart:
    var x = null;
    var y = bar();
    x.foo(y);

JS before:
    null.foo$1(bar());

JS after:
    var y = bar();
    null.foo$1(y);

If the receiver is known not be null, we still propagate into the
arguments, and "pure" expressions can always propagate even if the
receiver might be null.

InvokeMethod now has a field isReceiverNotNull, which carries a bit of
static type information. Another field like this is InvokeStatic.isPure.

I intentionally chose to pass along the *least* amount of information
that is sufficient for what we need in the tree optimizations.

That CPS type propagation was not very good at proving when things are
not null, so a couple of things missing from it have been filled in.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1159643005
2015-06-02 15:06:29 +02:00
Karl Klose add53e33e7 Optimize identical based on types.
R=asgerf@google.com

Review URL: https://codereview.chromium.org//1080003004
2015-06-02 13:01:42 +02:00
Johnni Winther 11eab3a917 Fix crash in deferred_constraint_constants_test.
BUG=

Review URL: https://codereview.chromium.org//1167713002
2015-06-02 12:05:54 +02:00
Karl Klose 95a46fb177 Adjust cps_ir test expectations.
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1167673009
2015-06-02 11:26:26 +02:00
Johnni Winther 3250c8fd91 Add StringLengthConstantExpression
... and make .fromEnvironment name a ConstantExpression.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1166723002
2015-06-02 10:52:50 +02:00
Johnni Winther 411246ccc7 Handle .fromEnvironment and incompatible constructor invocations
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1161823004
2015-06-02 10:44:19 +02:00
Brian Wilkerson 40e925078f Bug fixes for the new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1144393006
2015-06-01 16:42:36 -07:00
Konstantin Shcheglov 34ce430b9e Reformat ast.dart with the current formatter.
Otherwise there are more changes than I'd like in the other CL.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1154923005
2015-06-01 15:19:23 -07:00
Konstantin Shcheglov aad76fdcbf Issue 23568. Fix for NPE in index when unresolved field formal parameter.
R=brianwilkerson@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=23568

Review URL: https://codereview.chromium.org//1162853004
2015-06-01 15:08:33 -07:00
Konstantin Shcheglov b9cdbace93 Issue 23545. Replace unaccessible type parameters with 'dynamic'.
R=brianwilkerson@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=23545

Review URL: https://codereview.chromium.org//1147213005
2015-06-01 14:50:39 -07:00
Konstantin Shcheglov a3a40c9ef6 Issue 11200. Quick Fix for adding required/positional parameters.
R=brianwilkerson@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=11200

Review URL: https://codereview.chromium.org//1159273004
2015-06-01 14:48:50 -07:00
Konstantin Shcheglov be9cd1c165 Issue 23551. Fix for using type parameters of the enclosed classes in 'Create Missing Overrides' Quick Fix.
R=brianwilkerson@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=23551

Review URL: https://codereview.chromium.org//1151183003
2015-06-01 14:19:33 -07:00
Paul Berry 717da6731b Eliminate Modifier.TYPEDEF and deprecate ClassElement.isTypedef.
Modifier.TYPEDEF was redundant with Modifier.MIXIN_APPLICATION and
ClassElement.isTypedef was redundant with
ClassElement.isMixinApplication.

Since Modifier.TYPEDEF was private to analyzer, it has been
eliminated.  Since ClassElement.isTypedef is part of the public API to
analyzer, it is retained, but with a "@deprecated" annotation.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1158193008
2015-06-01 14:17:40 -07:00
Paul Berry 62f7ac8c5d Fix handling of nested typedefs (for real this time).
This is a re-fix of dartbug.com/21912, which I previously fixed
incorrectly.  Previously, our approach to avoiding infinite loops when
comparing types was to maintain a set of typedefs being expanded on
the stack, and prune the comparison whenever an attempt was made to
expand a typedef that was already being expanded.  However, this was
too strict, since there are legal (non-circular) types which invole
expanding a given typedef in reentrant fashion; we can't prune these
types without producing incorrect semantics.  An example (from the bug
report) is the type of f in the code below:

    typedef T Function2<S, T>(S z);
    Function2<Function2<A, B>, Function2<B, A>> f;

The solution is to maintain the list of typedefs being expanded inside
each FunctionTypeImpl object (and InterfaceTypeImpl object) rather
than on the stack during the comparison; this allows us to distinguish
the situations where we need to prune (those having to do exclusively
with expansion of a typedef) from the situations where we shouldn't
prune (those having to do with substitution of a type parameter).

A beneficial side effect of this change is that code that interacts
with types no longer needs to worry about typedef circularities, since
the circularities will automatically be pruned while exploring the
type definitions.  This simplifies the implementation of
isAssignableTo, isSubtypeOf, operator==, and hashCode.  (Note,
however, that code still needs to cope with circularities in the
inheritance hierarchy).

BUG=dartbug.com/21912
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1143003007
2015-06-01 12:45:27 -07:00
Konstantin Shcheglov f1d4ef9164 Issue 23409. Don't set 'propagatedType' in (vs. after) 'name is Type'.
This fixes the corresponding 'Extract Method' issue.

R=brianwilkerson@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=23409

Review URL: https://codereview.chromium.org//1161343002
2015-06-01 12:40:30 -07:00
Konstantin Shcheglov c1c0354014 Issue 23239. Fix for 'Create Class' Quick Fix i case of prefixed names.
R=brianwilkerson@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=23239

Review URL: https://codereview.chromium.org//1161333002
2015-06-01 12:26:39 -07:00
Konstantin Shcheglov f118546d06 Issue 23332. Don't compute overrides for static members.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=23332

Review URL: https://codereview.chromium.org//1151573011
2015-06-01 10:42:22 -07:00
Konstantin Shcheglov 5b44136f2a Issue 23389. Report error in the renamed element be invisible after rename.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=23389

Review URL: https://codereview.chromium.org//1153253004
2015-06-01 10:40:59 -07:00
Brian Wilkerson 213f0322f9 Fix missed version number
R=jwren@google.com

Review URL: https://codereview.chromium.org//1165763002
2015-06-01 09:50:57 -07:00
Konstantin Shcheglov 9a70cb5333 Remove AnalysisContext.visibleLibraries getter.
It is not used anymore.
It's functionality is not clear.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1156223005
2015-06-01 09:40:30 -07:00
Brian Wilkerson 07dd6b7649 Add lineLength parameter to edit.format request (issue 23519)
R=jwren@google.com

Review URL: https://codereview.chromium.org//1154303005
2015-06-01 09:39:02 -07:00
Konstantin Shcheglov 9dc5bc79f1 Issue 23518. Match prefixes of prefixed types.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=23518

Review URL: https://codereview.chromium.org//1149953005
2015-06-01 09:27:29 -07:00
danrubel 0e39092fd0 add enum suggestions
and update LocalDeclarationVisitor to visit enum declarations

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1157113004
2015-06-01 12:10:46 -04:00
Paul Berry c9b672a6dd Make analyzer DDC warning clean.
R=brianwilkerson@google.com, vsm@google.com

Review URL: https://codereview.chromium.org//1153503005
2015-06-01 08:54:13 -07:00
Konstantin Shcheglov 4f7799c258 Fix two applyChanges() tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1152553005
2015-06-01 08:30:28 -07:00
Brian Wilkerson 089038b085 Move index closer to the plugin API
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1156493004
2015-06-01 08:25:40 -07:00
Johnni Winther 5252749865 Reinsert registration of dependency.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org//1149743005
2015-06-01 16:34:38 +02:00
Johnni Winther 3b52900308 Element model cleanup + prepare for easier reimplementation.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1162603006
2015-06-01 15:00:48 +02:00
Johnni Winther 96efb7bde8 Introduce WorldImpact
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1146813009
2015-06-01 14:43:30 +02:00
Asger Feldthaus bd4e1d726f dart2js cps: Track underlying value of interceptors in type propagation.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1154173002
2015-06-01 11:19:36 +02:00
Karl Klose 207328a868 Disable failing assertion.
BUG= http://dartbug.com/23555

TBR=sra@google.com

Review URL: https://codereview.chromium.org//1157773009
2015-06-01 10:35:26 +02:00
Karl Klose 44f04fa0f7 Revert "Trust inferred type when propagating types in the SSA backend."
This uncovered a bug in optimizations that would introduce a return into an async* function.

This reverts commit 8a544b0754.

R=sigurdm@google.com

Review URL: https://codereview.chromium.org//1166653002
2015-06-01 10:27:45 +02:00
Natalie Weizenbaum 3d8c06c4e9 Start pulling pub from its own repo.
Pub now lives in third_party/pkg/pub (it's in pkg to make it possible to import
using "package:" imports).

R=ricow@google.com, rnystrom@google.com

Review URL: https://codereview.chromium.org//1165473002
2015-05-29 14:50:18 -07:00
Sigmund Cherem 013897fe29 Add support for null-aware operators to the CPS-IR.
R=johnniwinther@google.com, kmillikin@google.com

Review URL: https://codereview.chromium.org//1160833003
2015-05-29 12:01:42 -07:00
Paul Berry 1017ea0fca Verify that new task manager invalidation code handles cycles.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1165573002
2015-05-29 11:07:33 -07:00
danrubel ecf44e960d remove keyword suggestions in constructor names and prefixed expressions
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1158413003
2015-05-29 13:28:34 -04:00
Sigmund Cherem 7e2dc9eb2a Improve error for non-const implicit super constructor
BUG= http://dartbug.com/23543
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1156923007
2015-05-29 09:24:00 -07:00