Commit Graph

84 Commits

Author SHA1 Message Date
Brian Wilkerson 5f0de26d48 Clean up the remaining copyright notices
Change-Id: If099be4f71ba551df0dc3d69815ae6a9f55d1eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97781
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-24 20:11:28 +00:00
Brian Wilkerson 9d7e35b417 Unmake some breaking changes made in previous CLs
Change-Id: I4c28418f8e5a3c9af7b37f44d7ebd3cd2d818c16
Reviewed-on: https://dart-review.googlesource.com/52160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 16:16:09 +00:00
Brian Wilkerson dd897d35a2 Move the task API out of the public API
Change-Id: I0fbafb4965ced89fb9a063edb773c3f1cb3a39fa
Reviewed-on: https://dart-review.googlesource.com/51242
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-16 18:18:08 +00:00
Brian Wilkerson 1560f19844 Fixes to make analyzer preview-dart-2 safe, part 1 of many
Change-Id: I8f88168a1fab61b3d0d808b5d9e09e6391325302
Reviewed-on: https://dart-review.googlesource.com/46953
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-19 13:15:46 +00:00
Brian Wilkerson f1586f3bca Remove the unused type parameter from ResultCachingPolicy
Change-Id: I858eaf7365d668bcb19ea35f6d0bbdee4b42897c
Reviewed-on: https://dart-review.googlesource.com/46160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-13 15:30:09 +00:00
Konstantin Shcheglov ec4ffb99f5 Use one large AST cache with task model.
I found that the issue with Dart indexer is related to flushing
partially resolved ASTs from the cache, which we don't handle correctly.
Instead of trying to fix the issue, we can just increase the cache
size and make indexer work for now. Eventually we should migrate to
AnalysisDriver, which does not have this problem.

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

Bug:
Change-Id: I7515fd132245c361e030ddf1bfa7e06f11b6f3a4
Reviewed-on: https://dart-review.googlesource.com/18422
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-02 21:22:39 +00:00
Brian Wilkerson 01b024c006 Replace comment style generic method syntax with real syntax
Review-Url: https://codereview.chromium.org/2997593002 .
2017-08-08 10:34:09 -07:00
Paul Berry 4cd9b28eb6 Create pkg/front_end/src/base and begin populating with general use classes.
In the long run, pkg/front_end/src/base is intended to contain code
that is useful to many components of the front end.

In this initial implementation, it contains:
- Source and the classes it references
- ErrorCode, ErrorSeverity, and ErrorType
- SyntacticEntity

Note that AnalysisTarget is included (even though strictly speaking it
is part of the analyzer task model) because it was too hard to
disentangle from Source.

Note that Token classes remain in pkg/front_end/src/scanner for now; I
plan to reorganize them at the time the parser is moved into the front
end.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2486923007 .
2016-11-14 09:20:18 -08:00
Brian Wilkerson ecc84b26a4 Break up another large file
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2342733002 .
2016-09-15 07:49:27 -07:00
Brian Wilkerson 6c448b6938 Move exception support to its own library
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2328043002 .
2016-09-10 11:04:19 -07:00
Konstantin Shcheglov f096f7b985 Flush results when contexts are made idle.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2297343002 .
2016-08-31 14:03:25 -07:00
Konstantin Shcheglov 6df5ea27a5 Revert 6ad38498c8 (PARSED_UNIT).
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2231473002 .
2016-08-09 10:14:18 -07:00
Konstantin Shcheglov 6ad38498c8 Extract unresolved AST parsing (PARSED_UNIT1) from full parsing, which includes UriBasedDirective(s) resolution.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2229603003 .
2016-08-08 14:45:27 -07:00
Paul Berry 21fb12105a Fix ResynthesizerResultProvider's handling of parts.
When attempting to resynthesize a library containing parts from a
summary, ResynthesizerResultProvider needs to check whether an
analysis target comes from a summary by looking at the analysis
target's library source--this is different from AnalysisTarget.source
in the case of parts.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2093033003 .
2016-06-24 15:17:08 -07:00
Konstantin Shcheglov 979543e3a8 Issue 26629. Detect cache inconsistency in GetContentTask.
When it is detected, invalidate the outputs and throw an exception to
let Driver know that it should to recover.

R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/26629

Review URL: https://codereview.chromium.org/2050573003 .
2016-06-09 08:31:04 -07:00
Brian Wilkerson 08ce826f3b Gather and report stats on the number of times flushed results are recomputed
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2005403005 .
2016-05-26 10:58:32 -07:00
Brian Wilkerson 166f23e13f Code clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1907323002 .
2016-04-22 09:05:01 -07:00
Brian Wilkerson bf1fa31c90 Make analyzer more strong mode compliant
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1897713002 .
2016-04-16 12:28:44 -07:00
Brian Wilkerson 6dae827b70 More strong mode fixes for analyzer
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1842363004 .
2016-04-01 09:35:22 -07:00
Brian Wilkerson 5309d86424 First batch of changes to make analyzer package strong mode error free
Review URL: https://codereview.chromium.org/1808123005 .
2016-03-18 07:47:58 -07:00
Brian Wilkerson bfacd1878c Tolerate SDKs that do not include dart:async (issue 25520)
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1715563002 .
2016-02-19 07:45:54 -08:00
Brian Wilkerson 71e7ed86c0 Move scanner out of generated and clean up imports
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1693083004 .
2016-02-14 07:48:44 -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 Wilkerson 5a07d5c559 Add support for tasks to determine whether they are appropriate for a given target
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1633823002 .
2016-01-25 12:28:41 -08:00
Brian Wilkerson 032aa11711 Add minimal yaml support to the engine
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1622313003 .
2016-01-25 09:00:56 -08:00
Brian Wilkerson 21ecb14548 Clean-up imports
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1602803002 .
2016-01-18 15:42:16 -08:00
Brian Wilkerson 2a190aa11a Fix imports within the analyzer package
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1524893002 .
2015-12-14 12:25:41 -08:00
Konstantin Shcheglov 2f0f398c73 Fix lints: unnecessary_brace_in_string_interp
Also fixes two cases of empty_constructor_bodies.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1521883002 .
2015-12-13 13:05:00 -08:00
Brian Wilkerson 1a5a9a7247 Clean up syntax in generic method comments
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1515533004 .
2015-12-10 10:19:15 -08:00
Brian Wilkerson 86216e5154 Consistently use implements when one interface inherits from another interface
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1481273002 .
2015-11-30 07:58:10 -08:00
Konstantin Shcheglov 5b61845221 Send any logError() information to the IDE.
I have not seen any errors sent so far after several minutes of playing with it.
Adding and removing files does not cause any errors.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1432423004 .
2015-11-12 08:16:24 -08:00
Konstantin Shcheglov c43f292dd9 Remove IMPORT_EXPORT_SOURCE_CLOSURE and IS_CLIENT results.
This improves warm VM analysis time (i.e. 99% of all analyzis that happens in IDEs) from 7200 ms to 6600 ms.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1417143003 .
2015-10-24 08:35:26 -07:00
pq d12abed5d7 Last performed task diagnostics.
Adds a new block of status that reports the last 10 performed tasks.

For example:

<p>Recent Tasks</p>
GatherUsedLocalElementsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GatherUsedImportedElementsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GenerateHintsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GenerateLintsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

VerifyUnitTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

LibraryUnitErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

DartErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

LibraryErrorsReadyTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GetContentTask for source /Users/pquitslund/src/git/clones/analyzer_cli/.analysis_options

GenerateOptionsErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/.analysis_options

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

Review URL: https://codereview.chromium.org/1420783004 .
2015-10-23 10:31:26 -07:00
Konstantin Shcheglov f09778528a Use LIBRARY_SPECIFIC_UNITS instead of UNITS.
This reduces number of LibrarySpecificUnit instances from 10,000,000 to about 6,000.
Also this slightly improves the code of corresponding 'buildInputs' methods.

This saves some memory, but unfortunately does not win any performance.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1422793002 .
2015-10-23 08:31:59 -07:00
Leaf Petersen 10915a849b Library Cycle invalidation. Library cycle information on the element model was not being correctly invalidated on incremental updates to source files, since the appropriate dependencies cannot be surfaced in the task model directly. This CL adds logic to conservatively invalidate the element model information as needed.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1413273002 .
2015-10-19 17:08:07 -07:00
Brian Wilkerson 27eb09033f Clean up wording of client usage expectations
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1409353002 .
2015-10-19 07:46:49 -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 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
Brian Wilkerson 24b24a3569 Reformat code to reduce churn
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1322513004 .
2015-09-09 08:19:41 -07:00
Konstantin Shcheglov 597f189eb4 Extension point for WorkManagerFactory(s).
I'm not quite happy that internal classes get into the extension point declaration.
But I guess that because of the nature of the work WorkManager(s) are doing, we have to have significant exposure to internals.

Also, onAnalysisOptionsChanged() and onSourceFactoryChanged()... these probably are better to implement as streams in InternalAnalysisContext.
Thoughts?

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

Review URL: https://codereview.chromium.org//1311773005 .
2015-08-26 09:45:19 -07:00
Brian Wilkerson cb8b774fef Re-enable and add new HTML support
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1182303006.
2015-06-16 09:52:18 -07:00
Brian Wilkerson 585402d77f Attempt to fix the build by backing out HTML support
Review URL: https://codereview.chromium.org//1177983003.
2015-06-11 14:44:00 -07:00
Brian Wilkerson 980978c967 Support for parsing HTML in the new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1185443002.
2015-06-11 13:24:20 -07:00
Brian Wilkerson db0b64475d Include more errors when computing complete list
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1171893007.
2015-06-09 13:14:17 -07:00
Brian Wilkerson 2980c8839d Improve logging performance
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1152923002
2015-05-23 09:14:31 -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
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
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
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