Commit Graph

8489 Commits

Author SHA1 Message Date
Brian Wilkerson 650ac5458d Add plugin support for command-line access
R=pquitslund@google.com

Review URL: https://codereview.chromium.org//1136633007
2015-05-19 14:27:54 -07:00
Brian Wilkerson 0e8520eaa9 Create default tasks if plugins are not being used
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1140313003
2015-05-19 14:12:13 -07:00
Paul Berry a9982b0e02 Properly handle circular references among constants in the task model.
Tasks may now override the getter "handlesDependencyCycles" to return
true to indicate that they can deal with circular dependencies.  Most
tasks will not have to do this, since outside of constant evaluation
circular dependencies among tasks should only be possible due to an
analyzer bug.

Any task that handles dependency cycles can detect that a cycle has
occurred by consulting AnalysisTask.dependencyCycle inside its
internalPerform() method.  The ComputeConstantValueTask uses this to
determine which constants are involved in the cycle.

This required modifying the TaskInputBuilder classes so that if the
current input can't be evaluated due to a circularity, they can
continue on to evaluate other inputs.  This allows the circularity to
be reported on the whole strongly connected component, rather than
just the firs cycle that was noticed (which would be
nondeterministic).

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

Review URL: https://codereview.chromium.org//1147853002
2015-05-19 12:43:28 -07:00
Paul Berry eb6d1e2579 Fix constant evaluation dependency analysis for const external factories.
With the current constant evaluator, the bug is benign because we only
do dependency analysis within a library cycle, and the library cycle
containing dart:core (which is the only library cycle with const
external factories) contains no invocations of those const external
factories.

But in the new task model we do full dependency analysis across
library cycles, so the dependency analysis needs to be correct in
order for the const external factory to be safely invoked.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1134343003
2015-05-18 13:18:24 -07:00
Konstantin Shcheglov 7e8f650d35 Use short names in 'Create File' Quick Fix messages.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1147733002
2015-05-18 12:47:40 -07:00
Konstantin Shcheglov 4936eb8d5d Fix for 'Create part' Quick Fix.
1. NonExistingSource.modificationStamp should return -1.
2. NonExistingSource.fullName should be always an absolute path, not a URI.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1135073004
2015-05-18 11:55:23 -07:00
Brian Wilkerson c4a723465b Stop reporting error when not parsing function bodies (issue 23460)
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1145733002
2015-05-18 10:43:53 -07:00
Brian Wilkerson 1a3e349409 Handle type parameters correctly when generating hints (issue 23243)
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1142853002
2015-05-18 10:41:11 -07:00
scheglov@google.com a9d194d049 Always send errors/lines with parsed/resolved units.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1141953002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45812 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 15:44:29 +00:00
scheglov@google.com f058a6ad33 Tweaks for using task model in Editor.
It works in general, bug currently it is buggy and slow.

Notes:

1. Implicit dependencies backfire.
   If the cache size is not big enough and we end up flushing some CU, then recreating it, it looses its LibraryElement.
   We need an explicit dependency on it.

2. If the cache size is not big enough, this still may cause an infinite analysis cycle.

3. We need to implement activating / deactivating cache partitions to change cache size.

4. Probably we need to set LineInfo into ChangeNotice always.

5. There are bugs in type hierarchy.

6. Semantic highlighting takes too long to display.

7. Overlay changes are not used.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1125303008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45811 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 15:04:50 +00:00
paulberry@google.com 955a7c53a3 Modify WorkOrder to use a dependency walking algorithm that handles cycles.
There is no functional change in the behavior of the WorkOrder class;
if a cycle is found, we still set the ".exception" field in all the
work items involved in the cycle.

In a follow-up CL I will add the ability to override this behavior
when computing constant values.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1144563003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45800 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 22:38:26 +00:00
scheglov@google.com dd451d1424 Move DartWorkManager notification to _sourceChanged().
This fixes scheduling analysis after overlay changes.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1126233008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45797 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 21:51:38 +00:00
paulberry@google.com 80e7ee46a6 In the new task model, use explicit dependencies on the type provider.
Previously, some of the tasks got the type provider from the context,
which meant we were at risk of invoking the task manager reentrantly
(which might have broken some task manager assumptions and potentially
degraded responsiveness).  With this CL, all tasks that need the type
provider get it using an explicit input.

Assertions are added so that if we accidentally introduce future code
paths that invoke the task manager in a reentrant fashion, we will see
the problem during unit tests.

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

Review URL: https://codereview.chromium.org//1124003007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45794 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 19:49:32 +00:00
scheglov@google.com 4b942318c9 Don't invalidate dependent results when set values.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1133863006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45793 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 19:45:39 +00:00
scheglov@google.com 47534318f6 Fix for invalidating results of a target being removed.
Tweaks for tests.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1140943005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45785 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 14:33:08 +00:00
johnmccutchan@google.com f01c1490f7 Revert 45783
BUG=

Review URL: https://codereview.chromium.org//1138993005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45784 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 00:32:32 +00:00
johnmccutchan@google.com 95515238cc Move 'dart:profiler' contents into 'dart:developer' and remove 'dart:profiler'
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1139503002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45783 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 23:48:04 +00:00
scheglov@google.com 9baa563923 Fix for using the deprecated AnalysisError constructor.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1131383003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45780 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 20:52:33 +00:00
scheglov@google.com 6c66bbac50 Return empty contents for not existing sources.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1127403004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45778 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 20:51:04 +00:00
paulberry@google.com 13af577c37 Rename CONSTANT_RESOLVED_UNIT to RESOLVED_UNIT.
And move the old RESOLVED_UNIT out of the public API and rename it to
RESOLVED_UNIT6.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1138853002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45777 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 20:41:10 +00:00
scheglov@google.com d9555d7005 Fix for creating the correct SdkAnalysisContext.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1139463003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45772 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 19:45:51 +00:00
scheglov@google.com 9741a34885 Move getErrors() to DartWorkManager, report errors in ChangeNotice(s).
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1134873003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45766 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 16:28:20 +00:00
scheglov@google.com 6e25226a0d Issue 23444. Use ConstructorMember(s) for super constructor fixes.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=23444

Review URL: https://codereview.chromium.org//1140963002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45765 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 16:13:09 +00:00
scheglov@google.com dfd26c038b Create ChangeNotice(s) and set parsed/resolved units.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1138853003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45736 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 13:52:20 +00:00
scheglov@google.com e6b4fbd402 Validate modifications times only for sources.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1130423003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45724 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 01:50:13 +00:00
scheglov@google.com 0bb38ab8b9 Prioritize scheduling analysis for priority sources.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1136543006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45722 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 00:29:15 +00:00
paulberry@google.com 130376558f Add a task for computing all constant values in a compilation unit.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//1137873003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45719 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 22:18:02 +00:00
scheglov@google.com 7bcc0c21f9 Remove unused DartWorkManager.librarySources/partSources.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1128853004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45717 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 20:52:26 +00:00
scheglov@google.com f7e242ae1b Remove the 'cache' prefix by hiding the conflicting entities from engine.dart
I think it would be nice to prioritize the new stuff by making it easy to reference :-)

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1133673007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45716 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 20:37:46 +00:00
scheglov@google.com 867bea557a Remove some unused AnalysisContextImpl methods.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1133463004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45714 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 19:42:11 +00:00
paulberry@google.com 0e4d3d0190 Unify evaluation of annotations with evaluation of other constants.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1134133002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45713 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 19:35:26 +00:00
scheglov@google.com 270980e22a Add AnalysisCache.getState() and getValue().
There is a small functionality change, I think a valid one.
We don't check is the value is valid, we ask the CacheEntry, which updates the flush manager.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1139643004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45710 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 19:26:20 +00:00
scheglov@google.com c2de14f6c5 Implement AnalysisContext.ensureResolvedDartUnits().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1132423002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45707 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 18:49:03 +00:00
pquitslund@google.com ade0f154f5 (Was: Linter analysis plugin.)
FWIW: Lint rule plugins are moving to their (rightful) home in the linter proper.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1134823002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45698 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 17:43:44 +00:00
scheglov@google.com 6bc350e543 After every change iterate over the cache to find invalidated libraries and reschedule them.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1133143002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45696 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 16:59:31 +00:00
scheglov@google.com b6bccf200d Use WorkManager(s) in AnalysisDriver.
Install DartWorkManager in AnalysisContextImpl.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1131673004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45690 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 15:16:19 +00:00
scheglov@google.com 88973df145 Add DartWorkManager to manage Dart-specific results computation scheduling.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1132893003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45677 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-09 23:22:21 +00:00
brianwilkerson@google.com 81e474c43e Clean up many generated constructors
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1131423002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45676 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-09 19:06:12 +00:00
paulberry@google.com b901fbcf95 Add a "librarySource" field to CompilationUnitElementImpl.
This fixes a dependency problem in ComputeConstantDependenciesTask.
Prevously it used element.library.source to get access to the library
source, but this created an implicit dependency on LIBRARY_ELEMENT1
(since element.library is null if the library element hasn't been
built yet).  There was no way to make that dependency explicit since
previous to this change, the CompilationUnitElement did not store
enough information to determine what library it was part of until
after the library element had been created.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1125123006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45674 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-09 01:19:17 +00:00
scheglov@google.com 73f176d45e Add LIBRARY_ERRORS result.
This result will work as a top-level target for Dart work manager.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1133703003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45668 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 23:11:13 +00:00
brianwilkerson@google.com d14e5042bb Removed CLASS_ELEMENTS from BuildCompilationUnitElementTask and cleaned up comments
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1139473003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45661 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 21:39:59 +00:00
paulberry@google.com 8dcf63f9b1 Move CONSTANT_DEPENDENCIES out of the analyzer public API.
Exposing this through the public API was a mistake.  There is no
reason why clients (or plug-ins) should need to access this
intermediate result directly.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1127423005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45653 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 20:07:33 +00:00
paulberry@google.com e51ffadb87 Add a task to the new task model for computing constant values.
Not yet implemented: proper handling of circular references.

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

Review URL: https://codereview.chromium.org//1125423004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45651 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 19:44:41 +00:00
scheglov@google.com 262ba21fef When a target is removed, invalidate all dependent results.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1129033003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45650 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 19:27:39 +00:00
scheglov@google.com bd51645937 Automatically remove empty entries from the cache.
Now we use Element(s) and other "big" structures as keys.
So, now we need a mechanism to remove entries with their keys altogether,
not just removing associated data.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1133833002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45648 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 16:59:09 +00:00
scheglov@google.com 2d41ec2079 Remove memento.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1132103002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45645 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 15:11:47 +00:00
paulberry@google.com 728e9b3a9e Create a task in the new task model to compute constant dependencies.
This is the first of several planned tasks for constant evaluation.

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

Review URL: https://codereview.chromium.org//1131953004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45624 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 00:36:45 +00:00
brianwilkerson@google.com ed28cd5969 Progress toward new AnalysisContextImpl
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1136673002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45623 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 23:19:46 +00:00
scheglov@google.com 194d48f9da Set CacheEntry.target in the contructor.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1135613002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45619 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 21:04:51 +00:00
scheglov@google.com 47df8674d1 Remove unused AnalysisContextImpl.findElementById().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1132623002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45618 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 21:02:23 +00:00