Commit graph

12076 commits

Author SHA1 Message Date
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: 1322877f5b
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
Stephen Adams 7eaad70e2f Improve condition strengthening for last test in short-circuit.
This strengthens

   t1 = s == null || t == null;
   if (t1) return;
   known-here:  t != null

There are not many hits since the 'interesting' tests are usually
earlier in the short-circuit expression.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2438543004 .
2016-10-25 04:48:35 -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
William Hesse 057b9ceba7 Update pkgbuild status for analyzer and front-end.
BUG=https://github.com/dart-lang/sdk/issues/27655
BUG=https://github.com/dart-lang/sdk/issues/27654
R=sortie@google.com

Review URL: https://codereview.chromium.org/2440423002 .
2016-10-24 13:37:10 +02:00
vsmenon 2cafc4d044 Update README.md 2016-10-24 09:01:50 +02: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
Jennifer Messerly ce76fc1fe5 fix #27644, allow "dart" and "dartx" to be renamed if needed
R=vsm@google.com

Review URL: https://codereview.chromium.org/2435223002 .
2016-10-21 11:48:19 -07:00
Jennifer Messerly 982f9f46ed fix #27642, static members should now work
R=vsm@google.com

Review URL: https://codereview.chromium.org/2440863002 .
2016-10-21 11:25:47 -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
Sigmund Cherem 02a14cd937 Add kernel generation to the compiler/perf script
R=het@google.com

Review URL: https://codereview.chromium.org/2436333002 .
2016-10-21 10:02:13 -07:00
Sigmund Cherem 2bcd189f2d add kernel generation to the front_end/tool/perf script
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2439053003 .
2016-10-21 09:10:19 -07:00
Sigmund Cherem 5964bdfa0b Copy perf.dart into front_end/tool.
This keeps analyzer_cli/perf.dart for now: I need to make the change in two
parts so I can update the benchmark runners after I submit this.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2432043008 .
2016-10-21 09:07:48 -07:00
Jennifer Messerly 95ef8bb59a fix #27643, failed to virtualize fields if an abstract one is mixed in
R=vsm@google.com

Review URL: https://codereview.chromium.org/2441693003 .
2016-10-20 16:31:06 -07:00
Sigmund Cherem 3c44a09882 make kerneltask an actual task
R=het@google.com

Review URL: https://codereview.chromium.org/2442503004 .
2016-10-20 16:27:33 -07:00
Vijay Menon ce963596f0 Emit API-only summaries
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2435203002 .
2016-10-20 16:21:53 -07:00
Jennifer Messerly cc1ad8cdde fix #27532, implementing a native type with fields
R=vsm@google.com

Review URL: https://codereview.chromium.org/2430953006 .
2016-10-20 15:59:18 -07:00
Jennifer Messerly 5111675810 fix #27631, get/set methods no longer shadow index operator
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/2435163002 .
2016-10-20 15:45:29 -07:00
Brian Wilkerson 36d89f0c38 Prepare to publish
R=keertip@google.com

Review URL: https://codereview.chromium.org/2438653004 .
2016-10-20 14:31:08 -07:00
Sigmund Cherem 61bf1c2dc0 Re-add null check for closure-data (Originally removed in 177dee8f16)
Review URL: https://codereview.chromium.org/2438823002 .
2016-10-20 14:21:00 -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
Paul Berry 78ed4066c8 Add a "correction" field to front end compilation errors.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2429213008 .
2016-10-20 12:33:12 -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
Florian Loitsch 6beb1fdd11 Change Set.difference API to accept Set<Object>.
Fixes #27573
BUG= http://dartbug.com/27573
R=lrn@google.com

Review URL: https://codereview.chromium.org/2413233002 .
2016-10-20 14:37:15 +02:00
Alan Knight 47150f50d5 Use dart:html prefixes (e.g. webkitAudioNode) on other browsers
BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/2431443002 .
2016-10-19 16:43:41 -07:00