Commit graph

6435 commits

Author SHA1 Message Date
scheglov@google.com 7344dcc35c [WEB-16445] When create a missing imported library/part, add the edit once.
R=brianwilkerson@google.com
BUG= https://youtrack.jetbrains.com/issue/WEB-16445

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45813 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 16:22:01 +00: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
danrubel@google.com ee3263c22c reduce rethrow keyword relevance
so that return is prioritized over rethrow

BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45809 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 02:35:23 +00:00
brianwilkerson@google.com 0bf3812043 Fix exception in code completion (issue 23439)
R=danrubel@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45805 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 00:00:59 +00:00
scheglov@google.com 3ffb42cd22 Sort enum declarations.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45801 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 22:42:16 +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
brianwilkerson@google.com e73c0efc45 Fix server error messages
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45775 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 20:05:45 +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
karlklose@google.com 9b32c9e673 Implement raw list checks.
R=asgerf@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45762 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 11:58:45 +00:00
karlklose@google.com 898138ad0a Remove return that was reported as a dead-code when running build.py.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45759 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 08:09:53 +00:00
sra@google.com afbb537add Better toString and Error.toSafeString output for closures for dart2js.
Closures that appear in error messages, especially NoSuchMethodError, need to identify the function so that captured error messages and stack traces are useful.

Old:
  1. Instance of 'Object'
  2. Instance of 'Object'
  3. Instance of 'anonymous'
  4. Instance of 'anonymous'
  5. Instance of 'main_localFunction'

New:
  1. Closure 'print'
  2. Closure 'Widget_staticMethod'
  3. Closure 'foo' of Instance of 'Widget'
  4. Closure 'remainder' of 1234
  5. Closure 'main_localFunction'

In minified code the names are (usually) minified. Being able to unminify them later is separate issue.
This CL makes NoSuchMethodError variants more uniform in quoting of method to assist unminifying the message.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45753 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 23:47:23 +00:00
floitsch@google.com d22c29b57b dart2js: keep track of non-final static fields.
Dart2js used to just emit static non-final fields, even if they were not referenced.
This is bad, because in some cases it referenced a constant that didn't exist (was tree-shaken away). In the old emitter this just became a reference to a non-existing property, but in the new emitter it crashed.

This CL also fixes (partially) static non-final fields for the lazy emitter.

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45752 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 23:34:42 +00:00
asgerf@google.com f5f1eb643d dart2js cps: Introduce GetStatic/SetStatic.
The GetStatic is used for reading static fields and tearing off
static methods.

Invoking a static getter/setter (not from a field) is still an
InvokeStatic, which IMO is the way it should remain.

BUG=
R=karlklose@google.com

Committed: https://code.google.com/p/dart/source/detail?r=45735

Reverted: https://code.google.com/p/dart/source/detail?r=45737

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45738 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 14:19:40 +00:00
asgerf@google.com 961c805398 Revert "dart2js cps: Introduce GetStatic/SetStatic."
This reverts commit 28e4518df87c72cb8e23fe6d73b7750ad0f2183a.

TBR=karlklose@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45737 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 13:53:15 +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
asgerf@google.com 2c90643171 dart2js cps: Introduce GetStatic/SetStatic.
The GetStatic is used for reading static fields and tearing off
static methods.

Invoking a static getter/setter (not from a field) is still an
InvokeStatic, which IMO is the way it should remain.

BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45735 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 13:35:49 +00:00
floitsch@google.com ac5e4d906c dart2js: compile metadata lazily in the lazy emitter.
In the lazy emitter evaluates the metadata lazily at first access.
Does this by keeping two arrays. The first one containing the unparsed expressions. The second one containing the evaluated expressions.

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45726 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 03:13:02 +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
floitsch@google.com a66524586f dart2js: build metadata-types lazily in the new emitter.
Instead of building all types in the TYPES table eagerly, evaluate them lazily at first access.

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45723 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 00:39:00 +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
danrubel@google.com a0099fc922 suggest async for closures
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45711 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 19:30:35 +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
brianwilkerson@google.com e114ef8457 Fix context tests
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45709 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 19:23:32 +00:00
danrubel@google.com 4e3e55276a suggest keywords for more expressions
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45708 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 19:17:44 +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
danrubel@google.com d2164273da check for package lib exist before making package suggestions
BUG=dartbug.com/23428
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45706 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 18:48:15 +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
johnniwinther@google.com 95e30b7b3c Fix test for TypeImpl.==
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45694 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 15:52:51 +00:00
johnniwinther@google.com 0f75f9272d Forward instantiation type to LocalsHandler.
BUG=
R=zarah@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45693 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 15:45:22 +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
johnniwinther@google.com 4103f9d13e Add Accessor, Getter, and Setter elements.
+ a bit of model polishing

BUG=
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45689 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 15:09:49 +00:00
johnniwinther@google.com 0d4ab12dcf Add ConstantExpression.evaluate.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45687 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 14:34:01 +00:00