Konstantin Shcheglov
6826e267b9
Integration of the new analysis driver, behind a flag.
...
The flag is --enable-new-analysis-driver, disabled by default.
WIP, only error notifications for now.
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2465923002 .
2016-10-31 09:54:31 -07:00
Konstantin Shcheglov
1bdee25bdf
Revert "Do nothing if [changeFile] reported, but the file content is the same."
...
This reverts commit 1ffda5601b .
There is a bug with reporting changeFile() twice, first time the change
be noticed and the file content hash updated. But the second time the
content hash is the same, and we unschedule the file from analysis :-(
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2462743003 .
2016-10-28 18:06:46 -07:00
Konstantin Shcheglov
1ffda5601b
Do nothing if [changeFile] reported, but the file content is the same.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2458853003 .
2016-10-28 14:08:50 -07:00
Konstantin Shcheglov
5ad24d5185
Clone SourceFactory to ensure that it does not bring a ContentAnalysis reference.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2453773006 .
2016-10-28 10:23:55 -07:00
Konstantin Shcheglov
2625d6af37
More tests and a few fixed for the driver.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2450183004 .
2016-10-27 10:52:12 -07:00
Konstantin Shcheglov
0fcf8924d5
Several tests for AnalysisDriver and an elements.dart tweak.
...
I will not land this without review.
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2455843002 .
2016-10-27 09:24:31 -07:00
Konstantin Shcheglov
9190ad6b6f
Add the 'status' stream and transitions.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2450143003 .
2016-10-26 13:36:24 -07:00
Konstantin Shcheglov
755e26c4d9
Analyze requested files.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2453913002 .
2016-10-26 13:16:42 -07:00
Konstantin Shcheglov
6be23afcf2
Try to load the existing unlinked bundle by the content hash.
...
So that we don't create _File.forResolution() when we could use only
the content hash and the existing unlinked bundle. This makes loading
cached analysis results cheaper - no need to parse the unit.
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2450283003 .
2016-10-26 13:06:03 -07:00
Konstantin Shcheglov
bd594d453f
Put fully resolved analysis results (just errors now) into the byte cache.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2455573003 .
2016-10-26 11:48:49 -07:00
Konstantin Shcheglov
9b68e89be1
Tweaks for documentation.
...
TBR
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org/2451093003 .
2016-10-26 09:53:20 -07:00
Konstantin Shcheglov
f797154673
Fix for LibraryDirective annotations while applying resynthesized element model.
...
This allows us to clean up the analysis driver.
I will NOT land this without your review.
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2445193003 .
2016-10-26 07:40:07 -07:00
Lasse R.H. Nielsen
1f7d8924c6
Adapt analyzer to new warnings around switch-case fallthrough.
...
Fixes issue #27664 .
BUG= http://dartbug.com/27664
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/2446093003 .
Committed: https://github.com/dart-lang/sdk/commit/1322877f5b3a8c741d73df861169c494311073e8
2016-10-26 11:30:55 +02:00
Lasse R.H. Nielsen
1322877f5b
Adapt analyzer to new warnings around switch-case fallthrough.
...
Fixes issue #27664 .
BUG= http://dartbug.com/27664
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/2446093003 .
2016-10-26 10:51:50 +02:00
Konstantin Shcheglov
fcce68e2df
Analyze priority files first.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2453693002 .
2016-10-25 21:44:48 -07:00
Konstantin Shcheglov
d59c39fee5
Verify one changed file at a time.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2446083003 .
2016-10-25 21:16:56 -07:00
Konstantin Shcheglov
d1636b38b3
Replace Stream with monitor.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2450053003 .
2016-10-25 20:00:20 -07:00
Konstantin Shcheglov
3d730e3735
Fix and simplify _File creation.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2451973002 .
2016-10-25 18:34:19 -07:00
Konstantin Shcheglov
b363f00d64
Move unlinked bundle access to _File itself.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2451733003 .
2016-10-25 11:21:40 -07:00
Konstantin Shcheglov
4a5d98fa37
Actually compute AnalysisResult(s).
...
For now we don't have state transitioning and perform all work in a
single loop. Later we will break the loop and wait for the "has work"
stream after each operation. BTW, I don't like this stream approach,
but I don't know yet anything better.
The promise to produce the resolved CompilationUnit for every added
file does not scale well for initial results. I want to weaken it to the
promise that only priority and getResult() results get full content/unit.
For all other files we need only errors, which can be cached.
For index we need to use another apporach. I have a plan :-)
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2446803003 .
2016-10-25 09:49:13 -07:00
Konstantin Shcheglov
581e6bc6e1
Extract _ReferencedUris information from UnlinkedUnit.
...
I considered removing it altogether, but reading unlinked bundles costs
something. So, we might consider caching this graph information.
OTOH, I agree that we might want to delay adding caching until we solve
the extra invalidation problem in _verifyUnlinkedSignatureOfChangedFiles.
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2447903002 .
2016-10-24 14:05:45 -07:00
Konstantin Shcheglov
d2347b6903
Exclude the file URI from _ReferencedUris.
...
Also fix a bug with adding bundles with the same content hash, but
different URIs. Add directly into the corresponding Map(s) for now.
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2447873002 .
2016-10-24 13:13:43 -07:00
Konstantin Shcheglov
a42e0e94d8
Delay invalidating linked hashes until after checking the API signature of the changed file.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2443083002 .
2016-10-24 12:16:07 -07:00
Konstantin Shcheglov
b7c412c672
Apply tweaks to address other review comments.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2444993003 .
2016-10-24 10:55:46 -07:00
Konstantin Shcheglov
795be1983a
Fixes for review comments.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2450483002 .
2016-10-24 10:23:11 -07:00
Konstantin Shcheglov
e0563e7dbd
Remove unused code.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2440363002 .
2016-10-23 23:48:01 -07:00
Konstantin Shcheglov
6ca7d24211
Cache URIs resolution.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2440343002 .
2016-10-23 21:34:20 -07:00
Konstantin Shcheglov
64c776d30d
Include linked hashes into the current file state.
...
Also put the file content into the AnalysisContext to avoid race
condition if the file content is being changed.
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2447603002 .
2016-10-23 20:59:38 -07:00
Konstantin Shcheglov
e7b596ce5b
Initial implementation of AnalysisDriver.
...
I will need to add more documentation, implement state transitions,
actually implement computing analysis results, add optimizations, etc.
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2439343002 .
2016-10-23 20:08:04 -07:00
Konstantin Shcheglov
f275b096c2
Update ByteStore documentation.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2445623002 .
2016-10-23 15:30:32 -07:00
Konstantin Shcheglov
46aa3ced6f
Update the API documentations with Paul review comments.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2443013002 .
2016-10-23 13:55:54 -07:00
Konstantin Shcheglov
c3e7be4f12
API for the new AnalysisDriver.
...
TBR
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2442993002 .
2016-10-22 20:12:29 -07:00
Brian Wilkerson
b719474fd9
Intial support for unifying command-line handling
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/2441053003 .
2016-10-21 13:16:25 -07:00
Brian Wilkerson
785b949894
Improve error recovery (issue 27646)
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/2444453002 .
2016-10-21 12:36:01 -07:00
Paul Berry
396d7862b4
More improvements to DeclarationResolver.
...
This CL makes the following improvements:
- When visiting an executable element, local variables and labels are
rebuilt rather than matching them up to the old element model. This
ensures that if the element model was resynthesized from an API
summary (which doesn't contain local variables or labels), these
elements are not lost.
- When matching up existing elements, if the elements did not
previously contain offsets, offsets are recorded. If they did
previously contain offsets, the offsets are compared to verify that
they match. This ensures that if the element model was
resynthesized from an API summary (which doesn't contain offsets),
the offsets will be correct.
R=brianwilkerson@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org/2435313002 .
2016-10-21 11:13:55 -07:00
Paul Berry
f1aee7cf68
Fix static modifier for synthetic fields coming from summaries.
...
R=jmesserly@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org/2439023002 .
2016-10-21 11:09:11 -07:00
Paul Berry
74d8298777
Fix handling of default formal parameters in DeclarationResolver.
...
When visiting a DefaultFormalParameter, we can't call
super.visitDefaultFormalParameter, because that would cause the
default value to be visited twice.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/2438113002 .
2016-10-20 12:34:16 -07:00
Vyacheslav Egorov
1f6e03883e
Teach analyzer parser to handle native const factories/const constructors.
...
This is needed to parse VM patch files, which contain things like:
@patch const factory String.fromEnvironment(String name,
{String defaultValue})
native "String_fromEnvironment";
Currently analyzer would throw "Only redirecting factory constructors can be
declared to be 'const'." error when it sees this code.
BUG=
R=paulberry@google.com
Review URL: https://codereview.chromium.org/2435013003 .
2016-10-20 20:09:07 +02:00
Brian Wilkerson
96750cd5cb
Split out options from ContextBuilder
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/2425423009 .
2016-10-20 11:03:11 -07:00
Jennifer Messerly
dfac88ec18
fix typo in future union inference code
...
R=leafp@google.com
Review URL: https://codereview.chromium.org/2431313005 .
2016-10-20 10:22:23 -07:00
Paul Berry
105f568452
Mark some other instances of visibleLength/visibleOffset as informative.
...
These were inadvertenly left out of 84ec7f01c0 .
R=scheglov@google.com
Review URL: https://codereview.chromium.org/2428413003 .
2016-10-20 09:09:07 -07:00
Brian Wilkerson
9f0e4e1162
Split out error codes into separate files
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/2442463002 .
2016-10-20 08:40:36 -07:00
Brian Wilkerson
d42a22bb1d
Deprecate ToSourceVisitor
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/2439773002 .
2016-10-20 08:38:22 -07:00
Brian Wilkerson
b3f66b03a1
Provide an extensible form of ToSourceVisitor (issue 27169)
...
R=matan@lurey.org
Review URL: https://codereview.chromium.org/2429243003 .
2016-10-19 14:31:21 -07:00
Paul Berry
84ec7f01c0
Make visibleLength/visibleOffset informative.
...
These summary fields are related to source offsets, so they are
affected by minute changes to the source code that don't affect its
API; therefore they should be marked as "@informative" so that they
don't appear in API summaries.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/2432183003 .
2016-10-19 14:24:42 -07:00
Paul Berry
4729ba0055
In DeclarationResolver, handle generic function-typed parameters.
...
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/2441483002 .
2016-10-19 14:21:52 -07:00
Konstantin Shcheglov
bf43e4b43e
Validate local resolution scope, and compute initial name scope.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2439583003 .
2016-10-19 14:08:46 -07:00
Paul Berry
148af481ff
Fix DeclarationResolver handling of annotations containing closures.
...
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/2436733004 .
2016-10-19 13:23:11 -07:00
Paul Berry
4054d93fc9
Handle default formal parameters in LocalElementBuilder
...
Fixes #27615 .
R=scheglov@google.com
Review URL: https://codereview.chromium.org/2437793002 .
2016-10-19 11:17:43 -07:00
Konstantin Shcheglov
38e2b55fff
Implement 'local' mode in TypeResolverVisitor.
...
If we start resolution not from CompilationUnit, we need to put type
parameters into scopes. This is not implemented yet.
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2432273003 .
2016-10-19 09:47:40 -07:00