Commit Graph

8489 Commits

Author SHA1 Message Date
scheglov@google.com 61a371476b Remove unused InternalAnalysisContext.addSourceInfo().
The analysis cache is now accessible, if we will ever need this feature again.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45616 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 20:17:13 +00:00
scheglov@google.com 1ccf10f617 Some clean ups for cache partitions.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45615 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 20:15:49 +00:00
brianwilkerson@google.com 9414515ba7 Remove CompositeResultDescriptor
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45613 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 20:00:49 +00:00
paulberry@google.com 7040257579 Store elements in the constant eval dependency graph rather than AST nodes.
This paves the way for constant evaluation to be integrated into the
new task model, since the new tasks for constants will use elements as
their targets.

Since the element model makes a distinction between constructor
members and constructor elements, we have to be careful to be
consistent about what kinds of elements are stored in the dependency
graph.  We always store constructor elements in the dependency graph.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45611 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 19:38:37 +00:00
scheglov@google.com 1bc667b086 Flush memento objects.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45610 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 19:36:04 +00:00
scheglov@google.com 9aeccc0d2f Get AnalysisCache from InternalAnalysisContext.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45609 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 19:12:42 +00:00
scheglov@google.com 11f96844dc When invalidate because of the ERROR state, propagate its exception.
I have to move invalidation implementation into CacheEntry, because we need to set the "exception" field value.
Should we also move "setDependedOnResults" and make ResultData a dumb data container?

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45608 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 19:10:27 +00:00
brianwilkerson@google.com 965ac274f6 Clean-up result descriptors
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45607 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 19:10:14 +00:00
scheglov@google.com 4f04a6cf2e Don't update offsets for elements of 'part' and 'part of' directives.
These elements are not defined in the source that references it.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45605 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 18:34:19 +00:00
brianwilkerson@google.com e8c5b87478 Get computeError working
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45604 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 18:30:40 +00:00
scheglov@google.com a3366361de Cache flushing implementation for the task model.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45597 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 15:50:13 +00:00
brianwilkerson@google.com 2a1657d467 Fix methods for getting source kind
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45596 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 15:32:41 +00:00
paulberry@google.com 4bbe16a115 Ensure that nulls aren't added to constant eval dependency graph.
In r45541, I accidentally left out a null check causing nulls to get
inserted into the constant evaluation dependency graph.  This caused a
log message to be printed when running the command-line analyzer, but
no test failures.

I've inserted the proper null check and added an assert statement so
that if the bug recurs it will be caught during testing.

BUG=dartbug.com/23407
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45594 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 14:41:56 +00:00
brianwilkerson@google.com 654c4b4675 More renames
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45592 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 13:19:04 +00:00
brianwilkerson@google.com 1124eaacd8 Rename EMPTY_ARRAY to EMPTY_LIST
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45579 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-06 23:47:59 +00:00
paulberry@google.com 2ade74e561 Clone AST nodes of default formal parameters prior to constant evaluation.
We need to clone these nodes for the same reason we need to clone the
nodes for constant variables--because once constant evaluation is
moved into the new task model, we will not necessarily have access to
the AST at the time we need to evaluate these constants (they may be
depended upon by constant invocation expressions in other libraries).

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45568 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-06 15:51:39 +00:00
paulberry@google.com dc04ae1271 Remove const instance creation expressions from the dependency graph.
Instead of treating them as separate nodes in the dependency graph,
evaluate them directly in the ConstantVisitor at the time they are
needed.  This makes the dependency graph more uniform, since
everything in it is now associated with an element.  This should make
it easier to adapt constant evaluation to the new task model.

In order to avoid introducing regressions with this change, I had to
implement proper reporting of cycles in compile-time constants.
(Previously, this was unimplemented but worked correctly in most cases
by luck.)

Note: technically this constitutes a breaking API change, since it
removes the field constantHandle and the getter evaluationResult from
the InstanceCreationExpression class.  I believe these members are not
used outside of analyzer, so I'm leaving the analyzer version number
as is.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45541 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 21:46:25 +00:00
scheglov@google.com 76c543689d Don't recurse into (external) compilation units.
I forgot to turn on assertions for local tests, so it broke on the bots instead...

TBR

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45538 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 20:54:54 +00:00
scheglov@google.com b1ae4d74c2 Use IncrementalCompilationUnitElementBuilder in BuildCompilationUnitElementTask.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45536 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 19:31:41 +00:00
scheglov@google.com c236100c96 Incrementally build unit member elements.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45534 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 18:36:56 +00:00
paulberry@google.com 3d770ab87a Create a class for evaluating const instance creation expressions.
Previously the methods for evaluating const instance creation
expressions were all in the ConstantValueComputer class.  Moving them
to their own class allows for the possibility of evaluating them in
the ConstantVisitor, which in a future CL should allow us to avoid
making these expressions part of the const dependency graph.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45533 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 17:47:35 +00:00
brianwilkerson@google.com 0305ce28e1 Compute explicit imports
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45531 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 17:09:42 +00:00
scheglov@google.com e5f7e02484 Initial steps for the incremental elements builder.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45528 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 14:54:13 +00:00
paulberry@google.com fe50987b74 Move validation logic for constant evaluation into its own class.
This will help facilitate some refactoring of constant evaluation that
needs to be done in order to prepare it for the new task model.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45527 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 14:22:53 +00:00
paulberry@google.com f2b84f9988 Fix constant evaluation logic for String.length.
Previously, we used static resolution to determine whether
String.length was being referred to, causing incorrect results in the
presence of bad type annotations.  Also, we were missing a null check,
causing constant evaluation to crash if an attempt was made to take
the length of a constant that couldn't be evaluated.

BUG=dartbug.com/23383
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45524 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 13:07:21 +00:00
scheglov@google.com bbde73602d Use memento in ParseDartTask.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45509 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 20:51:12 +00:00
scheglov@google.com 1827a0715d Use memento in ScanDartTask.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45503 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 20:10:49 +00:00
scheglov@google.com e54d46d2d8 Get memento objects from tasks, remember in cache and pass back to tasks.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45496 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 17:13:31 +00:00
paulberry@google.com a924c66fc5 Add a flag to the element model to identify mixin applications.
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45495 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 17:00:34 +00:00
paulberry@google.com 7138d01444 In constant evaluation, handle final vars initialized at declaration site.
Previously final variables initialized at the declaration site
would simply be ignored, causing some checked-mode compile time
errors to be missed, and causing the analyzer to produce
incorrect values for any such constants.

BUG=dartbug.com/23292
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45494 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 16:21:54 +00:00
paulberry@google.com 34d8b562be Make sure to visit function annotations in ElementBuilder.
Since r44861, ElementBuilder is responsible for creating the
ConstantInstanceCreationHandle objects associated with
InstanceCreationExpressions.  Since InstanceCreationExpressions may
appear inside annotations, we must make sure the ElementBuilder visits
all annotations.  Previous to this change, it didn't visit function
annotations.

BUG=dartbug.com/23354
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45489 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 13:25:08 +00:00
scheglov@google.com b909e13241 Ignore synthetic tokens when search for AstNode.
This fixes the exception you saw during 'Extract Local' refactoring.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45481 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-03 20:29:38 +00:00
scheglov@google.com 79aea09150 Record dependencies and invalidate results.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45480 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-03 20:26:51 +00:00
brianwilkerson@google.com bfbaadca44 More fixes to the new analysis context implementation
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45479 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-03 15:06:06 +00:00
brianwilkerson@google.com 55fe371ca0 Fix NPE when analyzing Object
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45478 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-03 15:02:11 +00:00
brianwilkerson@google.com 8a294a09ac Add an option to enable the new task model
R=jwren@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45477 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-02 14:17:17 +00:00
scheglov@google.com f92f340ab8 Remove AnalysisContext.refactoringUnsafeSources.
It is not used anyway.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45474 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-01 20:36:51 +00:00
scheglov@google.com 89514d6799 Finish AnalysisContext.getLaunchableServerLibrarySources implementation.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45473 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-01 20:34:55 +00:00
scheglov@google.com aad45934a4 Fix for computing IS_CLIENT.
Also start using it in AnalysisContextImpl.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45469 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-01 16:06:12 +00:00
brianwilkerson@google.com ac3613e2bb Re-apply change to move to plugin package
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45408 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 18:54:24 +00:00
brianwilkerson@google.com 20a2f86f6b Re-add missed files
Review URL: https://codereview.chromium.org//1102473006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45386 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 22:29:37 +00:00
brianwilkerson@google.com 3d536efcfe Revert breaking change
Review URL: https://codereview.chromium.org//1101213002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45384 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 22:12:20 +00:00
brianwilkerson@google.com 24c853446a Convert analyzer and analysis_server to use the plugin package
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45382 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 20:32:35 +00:00
pquitslund@google.com 49d0f16a2a Analyzer CLI removal.
CLI now lives in dedicated `analyzer_cli` package.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45362 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 20:32:05 +00:00
scheglov@google.com 145cbc3750 Convert EnginePlugin.taskDescriptors into a getter.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45289 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 16:12:43 +00:00
brianwilkerson@google.com 5c5bc38ac3 Initial re-write of analysis context for the new task model
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45284 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 15:00:01 +00:00
brianwilkerson@google.com d1d92d63fc Bug fixes and clean-up
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45244 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 17:03:01 +00:00
brianwilkerson@google.com 9bb1c7ff18 Rename EMPTY_ARRAY to EMPTY_LIST in element model
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45212 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 15:54:10 +00:00
scheglov@google.com 1ea1b3ac49 Move LibraryUnitTarget into API.
We need this Target to use it in the Angular plugin.

Also increment version with the goal to publish the analyzer package and use in the Angular plugin.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45192 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 00:06:20 +00:00
scheglov@google.com 031234d37f Another fix for unused elements.
It turned out that the way I run analyzer tests misses the new task model tests.
And (un)fortunately bots run them correctly, so some of the are red now.

TBR

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45180 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 20:32:15 +00:00