Commit Graph

8489 Commits

Author SHA1 Message Date
Brian Wilkerson 04c5a5f199 Clean up hints
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1382403002 .
2015-10-05 09:20:44 -07:00
Konstantin Shcheglov 0ff03b00b8 Add the 'docRange' property and use it to compute documentation comment.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1376473007 .
2015-10-02 15:13:30 -07:00
Brian Wilkerson 66a122a9db Stop defensively copying AST structures before resolution
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1383043002 .
2015-10-02 12:38:18 -07:00
Konstantin Shcheglov 28e7dbf876 Don't make defensive copies of 'definedNames'.
This change reduces total analysis time by 13%.
For analyzer + analysis_server.
For the third full analysis, i.e. not cold VM.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1370993009 .
2015-10-02 10:15:24 -07:00
John Messerly a8570d9e7c fixes strong mode assignability
this fixes https://github.com/dart-lang/dev_compiler/issues/356

The issue here is that StrongTypeSystemImpl has toType and fromType backwards from how they are defined on the base class.
The way it works is to read it as "is the first type assignable to the second type"?

(I can see how this may have happened: the base class uses "leftType" and "rightType", which refers to the parameter order, not the order they would appear in an assignment expression.)

R=leafp@google.com

Review URL: https://codereview.chromium.org//1380963004 .
2015-10-01 15:40:50 -07:00
Brian Wilkerson 0f30af628a Fix computation of errors to not run extra tasks
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1370323003 .
2015-09-30 11:55:17 -07:00
Konstantin Shcheglov 1d28f99524 Fix for 'implemented' notification after an incremental change.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org//1374943005 .
2015-09-30 11:08:41 -07:00
John Messerly 20e1f91fbb fix inference of hashCode with library prefix
fixes https://github.com/dart-lang/dev_compiler/issues/349

R=leafp@google.com

Review URL: https://codereview.chromium.org//1374813002 .
2015-09-28 16:02:10 -07:00
John Messerly 253fc292cb fix inference of object members on library prefix
See https://github.com/dart-lang/dev_compiler/issues/349 for context.

The prefix fix handled `toString()` but not `library_prefix.toString()`

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

Review URL: https://codereview.chromium.org//1374773003 .
2015-09-28 14:40:20 -07:00
Konstantin Shcheglov ac282f8a1d Fix for the libraries to parts map.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1377613002 .
2015-09-28 13:21:41 -07:00
Leaf Petersen 9be2107f39 Improve the handling of inference for instance fields in the task model
strong mode inference.  This CL adds instance fields to the set of variables
for which dependencies are computed, and re-resolves each instance field
initializer using type information inferred for the static variables upon
which it depends.

This CL also stops static variables with existing type information from having
their types overwritten.

This CL ports over a number of the DDC inference tests, more remain to be ported.

There is still at least one outstanding issue with instance variable inference,
see #354 (and the two tests marked fail added in this CL).

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1370793002 .
2015-09-28 10:57:04 -07:00
John Messerly 9ac032d545 infer field formal parameter types
this fixes https://github.com/dart-lang/dev_compiler/issues/346

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1371813002 .
2015-09-28 09:20:20 -07:00
John Messerly 7bd3db6d74 analyzer strong mode: infer final field from initializer if super getters are dynamic
fixes https://github.com/dart-lang/dev_compiler/issues/348

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

Review URL: https://codereview.chromium.org//1367183004 .
2015-09-25 17:49:55 -07:00
John Messerly c09b338e25 fix inference of object members when a method has no target
we incorrectly thought `toString()` was a call to `Object.toString()`

See https://github.com/dart-lang/dev_compiler/issues/349 for more context

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1368793004 .
2015-09-25 17:22:56 -07:00
Konstantin Shcheglov 6bab7d9cbc Use Element.nameLength where possible.
...or don't use it when there is a better alternative.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1372673003 .
2015-09-25 15:03:46 -07:00
Konstantin Shcheglov 3924b15d85 Remove ElementLocator.locateWithOffset altogether.
It was needed only for the old Angular implementation support, which
overlayed its own Element subclasses into normal Dart AST, for example
for string literals - names of components.

As we don't support this anymore, there is no need for the method.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1370833002 .
2015-09-25 14:57:15 -07:00
Konstantin Shcheglov 6c029f9cb1 Issue 24440. Fix for renaming libraries using 'part of' directives.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24440

Review URL: https://codereview.chromium.org//1364853007 .
2015-09-25 14:24:05 -07:00
Konstantin Shcheglov 4f8649f1b3 Issue 24442. Fix for renaming library names with spaces.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24442

Review URL: https://codereview.chromium.org//1370793003 .
2015-09-25 13:55:13 -07:00
Konstantin Shcheglov 327412cbad Add Element.nameLength getter and specialize it for LibraryElement.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24442

Review URL: https://codereview.chromium.org//1364583006 .
2015-09-25 13:35:49 -07:00
John Messerly 59eb287389 [analyzer] copy generic type args when inferring a new function type for an ExecutableElement
This matches what resolver.dart visitMethodDeclaration does when it creats the FunctionTypeImpl for the method. So we want to preserve these generic type args when we're building the new inferred function type, otherwise we'll fail to substitute them later on.

Context: https://github.com/dart-lang/dev_compiler/issues/342#issuecomment-142748853

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1364353003 .
2015-09-25 10:03:10 -07:00
Brian Wilkerson 2b84d9ada6 Merge pull request #24341 from srawlins/patch-1
Fix ConstantEvaluator's doc comment
2015-09-25 09:54:51 -07:00
Vijay Menon cac248765b Remove CompilationUnit name requirement
Some of our language tests have '.lib' extensions for dart files that are imported.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1372433003 .
2015-09-24 15:51:08 -07:00
pq 5dd6a543e7 Plugin manifest parsing.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1366023002 .
2015-09-24 14:53:15 -07:00
John Messerly 83a2449062 Infer setter parameter types in strong mode
This change also decouples setters and getters, which matches what DDC currently does. The benefit is they're inferred as independent methods, which allows code reuse between method/getter/setters. It also prevents ordering issues that might occur otherwise (i.e. if getter inference considers setter's type, and setter inference considers the getter's type).

More context: https://github.com/dart-lang/dev_compiler/issues/342#issuecomment-142713453

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1359243003 .
2015-09-24 13:21:04 -07:00
John McCutchan 9535715f92 Fix handling of empty .analysis_options files and test this case
Fixes #24431

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1369573003 .
2015-09-24 12:38:53 -07:00
pq 72ee80467a ErrorHandler typedef fix.
Lo and behold this harkens back to lint request #1 (https://github.com/dart-lang/linter/issues/1). Could have saved me a headache!

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1367723003 .
2015-09-23 14:39:07 -07:00
pq 7ff04709e7 Plugin config cleanup.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1366663002 .
2015-09-23 10:44:02 -07:00
pq e2ec118554 Plugin config format validation (and tests).
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1362033002 .
2015-09-23 09:51:29 -07:00
Leaf Petersen ff86501c85 This adds support for a DDC special case of inline JS. It also addresses an issue from an earlier CL, makes some readability improvements, and eliminates some now-redundant TODOs.
BUG=
R=scheglov@google.com, vsm@google.com

Review URL: https://codereview.chromium.org//1355393003 .
2015-09-23 08:58:04 -07:00
Konstantin Shcheglov 27a8bbd415 Reset Source modification stamp to -1 if it does not exist.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1361003002 .
2015-09-23 08:20:12 -07:00
Brian Wilkerson 45a81cbab4 Fix a repeated spelling error
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1361833003 .
2015-09-23 07:44:05 -07:00
pq f4c3b30d8a Basic plugin config parsing.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1364493004 .
2015-09-22 17:06:14 -07:00
Leaf Petersen 4fe661995d Add additional strong mode inference. This adds in all the remaining inference cases from the strong mode RestrictedStaticTypeAnalyzer.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1352763004 .
2015-09-22 14:03:08 -07:00
Brian Wilkerson 163ad75127 Fix status pages when running new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1351243003 .
2015-09-22 11:03:56 -07:00
Konstantin Shcheglov 3aabaa96e6 Fix for a stupid copy/paste bug in the incremental resolver.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1360583003 .
2015-09-21 09:17:35 -07:00
Konstantin Shcheglov a25cc8129a Limit cache invalidation by the updated source bounds.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1355853005 .
2015-09-18 18:11:54 -07:00
Konstantin Shcheglov fcb0c319da Fix for updating HINTS during incremental resolution with TM.
The key change is not updating LIBRARY_UNIT_ERRORS in IncrementalResolver.
Otherwise it becomes VALID and we don't recompute it, so don't recompute HINTS.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1355503004 .
2015-09-18 13:41:09 -07:00
Konstantin Shcheglov 14b726f3e6 Partially fix the cache invalidation problem during incremental resolution.
It still takes 90% of total incremental resolution time.
But at least it's not 10 seconds anymore, just 300ms in Analyzer + Server, or 80ms in pure Analyzer.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1350423002 .
2015-09-18 12:02:30 -07:00
Leaf Petersen f912eabcbf Make type system changes backwards compatible
This CL eliminates the additional typeSystem arguments added to the API by https://codereview.chromium.org/1329743005/  wherever possible, instead projecting out the typeSystem from the context as available.  Where not possible, the additional argument is made optional, defaulting to the standard TypeSystemImpl.  I believe that the result of this should be backwards compatible for clients (but not implementors) of the API.

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

Review URL: https://codereview.chromium.org//1355773002 .
2015-09-18 09:59:12 -07:00
John Messerly d7cd11f86a allow dart:* libs to implement otherwise disallowed types (e.g. int)
all current and experimental Dart implementations (dart2js, vm, fletch, ddc) get an error in their SDK from this. The CL fixes it by allowing dart:* libraries to implement the disallowed types, like int/double/String/bool.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1346923007 .
2015-09-18 07:11:44 -07:00
Konstantin Shcheglov 594fe93422 Support for NAVIGATION/OCCURRENCES notifications for any source (such as HTML).
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1343283004 .
2015-09-17 12:37:36 -07:00
Harry Terkelsen f4426b109b Do not emit semicolons for await expressions in ToSourceVisitor
Closes #24364

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

Review URL: https://codereview.chromium.org//1345403002 .
2015-09-17 11:20:45 -07:00
Konstantin Shcheglov ff95a65900 Reset AnalysisDriver on priority sources changes.
It turned out that our WorkManager(s) don't have the problem we discussed.
We remove targeted results from queues only when they are VALID or ERROR.
So, reset is safe to do.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1350993002 .
2015-09-17 07:57:51 -07:00
Leaf Petersen a19bd39da8 First cut at abstracting over the type system. This factors out uses of isAssignableTo and isSubtypeOf into calls through a type system object. Currently there is only one kind of type system, which just falls over to the existing implementations.
BUG=
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1329743005 .
2015-09-16 14:55:59 -07:00
Konstantin Shcheglov aab6cf0b35 Produce LINE_INFO for HTML files.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1347223002 .
2015-09-16 13:28:16 -07:00
Konstantin Shcheglov 4e18780ded Tweak for incremental result updates.
The result itself is not invalidated, but everything dependent on it is.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1339603004 .
2015-09-14 13:21:16 -07:00
Brian Wilkerson 004839fc86 Fixes for the new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1342903002 .
2015-09-14 13:16:08 -07:00
Konstantin Shcheglov e878562d35 Add an extension point for contributing to HTML_ERRORS.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1341723003 .
2015-09-14 12:00:39 -07:00
Konstantin Shcheglov 3ac37fd7ea Add ReentrantSynchronousStream and use it for cache invalidation events.
Also include the (just invalidated) value into InvalidatedResult.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1342543007 .
2015-09-14 11:23:16 -07:00
Sam Rawlins e3aca49123 Fix ConstantEvaluator's doc comment
ConstantEvalulator's doc comment, when parsed as Markdown and rendered at [dartdocs.org](http://www.dartdocs.org/documentation/analyzer/0.26.1%2B3/index.html#analyzer/analyzer.ConstantEvaluator), looks terrible.

I think there was a valiant effort to make it render ok, what with the <blockquote>, but in any case, it was just a blob. This fixes a few things:

* One summary sentence first paragraph.
* Make the blockquote and list into an actual blockquote and an actual list.
* Fix some un-subscripted subscripts.
* Render the HTML that was attempted by making certain list items _blocks_, by starting out with the span tags.
2015-09-13 15:05:20 -07:00