Commit Graph

4276 Commits

Author SHA1 Message Date
Brian Wilkerson 4c2c18e49f fix resolution of URIs
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1205993002.
2015-06-24 13:09:57 -07:00
Paul Berry 19d0ea816b Remove BuildFunctionTypeAliasesTask.
There seems to be no reason to do this as a separate step from
ResolveUnitTypeNamesTask.

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

Review URL: https://codereview.chromium.org//1211523003.
2015-06-24 08:08:05 -07:00
Brian Wilkerson 098950256c Mark more code as deprecated
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1199303002.
2015-06-23 14:30:16 -07:00
Brian Wilkerson 563127941e Initial HTML work manager
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1200313002.
2015-06-23 13:48:08 -07:00
Konstantin Shcheglov 5cf6c26ecd Use List instead of Set for library sources.
This slightly improves WorkOrder.moveNext tag performance.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1193033003.
2015-06-22 12:00:09 -07:00
Brian Wilkerson a087d36d78 Deprecate old HTML support
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1200913002.
2015-06-22 09:32:18 -07:00
Konstantin Shcheglov e9c3b2d7b1 Move cache consistency validation into Analysis Server.
This speeds up the add/analyze/remove/analyze cycle from 1600 ms to
1300 ms, i.e. on about 20%.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1195183002.
2015-06-22 08:19:44 -07:00
Brian Wilkerson c891a348ab Next steps toward HTML support
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1193143002.
2015-06-21 09:21:42 -07:00
Konstantin Shcheglov 12d4759685 Add AnalysisCache.onResultInvalidated, use in DartWorkManager.
It helps to reduce add/analyze/remove cycle from 1850 ms to 1650 ms, i.e. on about 11%.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1193993003.
2015-06-19 10:45:49 -07:00
Konstantin Shcheglov 636618f290 Tweak for FunctionTypeImpl.==.
This helps to reduce analisys time of the analyzer + analysis_server workspace
from 27961 ms to 26773 ms, i.e. about 4% down.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1190253002.
2015-06-18 21:37:19 -07:00
Paul Berry 9c90a66d0d Update analyzer to reflect new rules for prefixes.
As of commit 67b99e4b33, it is now
consistently a compile error for a prefix not to be followed by '.'.
(Previously, there were two exceptions in which a prefix not followed
by '.' was treated as though it was preceded by "this.")

This CL updates analyzer to be consistent with the new spec langauge,
and modifies the tests in tests/language accordingly.

Dart2js and the VM do not yet produce the correct compile-time error
in all circumstances.  See issues #23611 and #23612.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1186033004.
2015-06-18 10:03:07 -07:00
Paul Berry 13c3c10f22 Refactor least upper bound computation; support bottom correctly.
Previously, the least upper bound code was only half-written--it
computed correct results if both types were interface types, and
otherwise returned null.  Now we always return a non-null type.

Unfortunately, the full least upper bound algorithm in the spec
requires referencing types not reachable from the types being
compared; thus in order to execute it we need access to the
TypeProvider.  We can't do this with the existing API.  So that API
has been deprecated.  The new API uses a class TypeSystem which
contains a pointer to the TypeProvider.  This new class should also be
a useful starting point in case we need to make the type system more
pluggable in the future.

Clients that use the old API will see no change in behavior--they will
still get the half-written algorithm.

Still to be addressed in future CL's:
- Deprecate getSmartLeastUpperBound.
- Fix calls to getLeastUpperBound and getSmartLeastUpperBound in analysis
  server.
- Implement least upper bound computation for function types.
- Make sure type parameters function correctly in the presence of F-bounded
  polymorphism.
- Implement shared tests.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1179343004.
2015-06-17 10:10:38 -07:00
Dan Rubel 1c1a87e820 associate @deprecated with enum element
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1162013007
2015-06-17 10:44:53 -04: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
Konstantin Shcheglov 96670b0e97 Fix for explicit dart:core import.
This fixes the rest of the co19/ tests.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1181663004.
2015-06-12 13:26:12 -07:00
Konstantin Shcheglov a16ec77494 Mix VARIABLE_REFERENCE_ERRORS into the full errors list on ChangeNotice.
This fixes 11 tests in language/ and co19/.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1179253002.
2015-06-12 12:52:15 -07:00
Konstantin Shcheglov 5538e1f105 Add self-reference sources into INCLUDED_PARTS.
It's an error of course, but unless we add it in the first place, we
cannot detect this error in the library element building task.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1183773002.
2015-06-12 12:30:09 -07:00
Konstantin Shcheglov 9634a03393 Explicitly compute library errors in tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1183723002.
2015-06-12 12:28:24 -07:00
Konstantin Shcheglov 61c01b2231 Fix for computeResolvedCompilationUnitAsync().
This fixes the last Analysis Server unit tests.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1181223002.
2015-06-12 10:27:02 -07:00
Konstantin Shcheglov b7b087cecd Schedule unknown priority source analysis.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1179173005.
2015-06-12 09:12:45 -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
Konstantin Shcheglov f3c28ef449 Don't create navigation regions for not existing sources.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1180883003.
2015-06-11 13:21:12 -07:00
Konstantin Shcheglov c2cc0387a8 Create LibraryElement with SDK context for SDK sources.
This fixes 3 or 6 failing Analysis Server tests.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1180673008.
2015-06-11 11:57:23 -07:00
pq c23a060539 Supported plugin access.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1179743003.
2015-06-11 11:34:24 -07:00
Konstantin Shcheglov b8067b5fb9 Compute RESOLVED_UNIT for all units in all of the libraries of the closure before verifying.
This fixes many co19 tests, so I guess it might solve the problems with constants you mentioned.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1183533002.
2015-06-11 10:47:26 -07:00
Konstantin Shcheglov cdced40bd5 Add AnalysisContext.onResultComputed().
Add RESOLVED_UNIT_NO_CONSTANTS as a public result.

Document results that are computed with the task model.
We need this to be able to use onResultComputed() in Analysis Server and
know that we will get enough information.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1181603004.
2015-06-11 10:44:11 -07:00
pq 230f594328 Options plugin API.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1175253005.
2015-06-11 10:42:21 -07:00
pq 829f2da883 Type fix.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1181723002.
2015-06-11 10:40:01 -07:00
Paul Berry b715b97147 Don't visit named argument labels when computing constant dependencies.
This fixes some crashes with the new task model.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1178203002.
2015-06-11 10:36:36 -07:00
Konstantin Shcheglov 99ce0f107f Remove dead code.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1182443005.
2015-06-11 10:04:56 -07:00
Konstantin Shcheglov ad2ac9f1fe Add AnalysisDriver.onResultComputed().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1179753002.
2015-06-11 08:12:31 -07:00
Konstantin Shcheglov f584413999 Build LIBRARY_ELEMENT after RESOLVED_UNIT6 for all units in the closure of a library.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1177963002.
2015-06-11 08:05:59 -07:00
Brian Wilkerson caa03b0b9f Capture more errors and improve duplicate error removal
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1176983002.
2015-06-10 16:32:45 -07:00
Paul Berry c03b8fe451 Ensure that prefix?.loadLibrary() generates the proper compile-time error.
loadLibrary() is special-cased in analyzer, so we need special-case
code to make sure that it can't be invoked using "?.".

Fixes #23463.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1177833002.
2015-06-10 14:43:46 -07:00
Paul Berry 2f610a3ff5 Report a compile-time error if a const field is multiply initialized.
This CL makes analyzer consistent with the VM and the spec, by
producing a compile-time error for code such as:

    class C {
      final x = 1;
      const C() : x = 2;
    }
    main() {
      const C();
    }

Note that Dart2js also produces an error in this circumstance, but its
error is too general (the error should only be produced if the const
constructor is invoked using "const"; if the const constructor is
invoked using "new", or is not invoked at all, it should only be a
warning).  See #23618.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1175073002.
2015-06-10 14:02:43 -07:00
Brian Wilkerson e1ba93c4f1 Filter additional error codes
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1169833007.
2015-06-10 13:27:03 -07:00
Konstantin Shcheglov c5c4d5e788 Use ConstantVerifier in VerifyUnitTask.
Number of failing tests: 126 -> 30.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1174763002.
2015-06-09 15:26:19 -07:00
Brian Wilkerson f4f1ee35a4 Remove additional duplicate errors
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1172093003.
2015-06-09 14:23:33 -07:00
Brian Wilkerson b0ae5820d0 Attempt to fix the build
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1173723003.
2015-06-09 14:08:05 -07:00
Konstantin Shcheglov a2e4e671e9 Build full LIBRARY_ELEMENT for every library source in the import/export closure, when resolve a unit.
This fixed 8 Analysis Server tests.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1165283006.
2015-06-09 14:02:43 -07:00
Paul Berry 4e36247eea In constant evaluation, consistently handle const depending on non-const.
It is a compile-time error for a constant value to depend on a
non-constant value (or a non-constant constructor), however the
analyzer still needs to be able to handle it.

This CL adjusts the ConstantEvaluationEngine so that it consistently
reports all the dependencies of a given constant (whether those
dependencies are constant are not), but which is tolerant of being
asked to compute a constant value of a non-constant.

Fixes test failures with the new task model enabled.  No behavioral
change with the new task model disabled.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1167413005.
2015-06-09 13:48:43 -07:00
Paul Berry fc83ce5ba9 Fix analyzer's handling of import prefixes not followed by '.'.
If 'p' is an import prefix, then 'p = ...' is treated as synonymous
with 'this.p = ...', and 'p()' is treated as synonymous with
'this.p()'.  In all other circumstances where 'p' is not followed by
'.', the spec calls for a compile time error.

Previous to this CL, 'p' not followed by '.' was being treated as
synonymous with 'this.p' under all circumstances.  This CL brings
analyzer in line with the spec, and updates the tests in
tests/language accordingly.

The VM and Dart2js currently fail to implement the compile-time error
properly.  See issues #23611 and #23612.

Fixes issue #23461.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1173523002.
2015-06-09 13:38:53 -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
Konstantin Shcheglov d2f80cfaec Fix the test to remove extra hint.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1174563003.
2015-06-09 10:49:33 -07:00
Konstantin Shcheglov 25620e2e59 Remove extra CompileTimeErrorCode.DUPLICATE_DEFINITION.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1170863002
2015-06-08 22:58:32 -07:00
Brian Wilkerson c60c313f59 Fix incremental resolver to work with new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1169803003
2015-06-08 12:56:58 -07:00
Paul Berry 2c533ac971 Create a TypeDefiningElement interface.
This interface is common to ClassElement, FunctionTypeAliasElement,
and the element for the pseudo-type "dynamic".  This should allow us
to avoid some unnecessary casting in the dev_compiler (see
https://codereview.chromium.org/1160223006/#msg11).

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1165213002
2015-06-08 11:29:02 -07:00
Paul Berry 12696cafe9 Fix a corner case of constant constructor dependency computation.
If a constant constructor does not contain an explicit call to
super(), and the base class lacks an explicit constructor, we need to
avoid marking the implicit base class constructor as a dependency,
since it is non-const.  (Note: this shouldn't occur very often in
real-world usage since is a compile-time error, but we still need to
be able to analyze it without throwing an exception).

Fixes the following test when the new task model is switched on:
co19/Language/07_Classes/6_Constructors/3_Constant_Constructors_A03_t02

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1168563004
2015-06-08 11:23:32 -07:00
Brian Wilkerson 7230007d52 Fix several tests when the new task model is enabled
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1164223002
2015-06-07 19:31:04 -07:00