Commit Graph

14696 Commits

Author SHA1 Message Date
Erik Corry 4b9bba55b4 Stoppp using trippple consonants
R=ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2833073002 .
2017-04-21 17:50:13 +02:00
Jacob Richman 7149b90c7c Tighten up handling of JS types and add test.
Side effect of this:
Fix bug where helpers in js_mirrors were specifying that name had to have type String when it could really also be a JS Symbol as well.
Fix bug where top level JS interop members using the external keyword but no @JS keyword were not implemented.
Update js_typed_interop_test.dart so it can work in DDC.
Add regression test for jsify call with native function type arguments.

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2827333003 .
2017-04-21 08:44:00 -07:00
Brian Wilkerson 4e3d3bdd9f Add support for converting from server to plugin protocol objects
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2830903004 .
2017-04-21 08:37:12 -07:00
Paul Berry 925a0a5777 Split up TypeInferrer class.
This CL makes four classes:

- TypeInferrer, which is the API for type inference within a method
  body or field initializer, used by BodyBuilder.

- TypeInferrerImpl, which is the generic implementation of
  TypeInferrer.

- TypeInferenceEngine, which is the API for top level type inference
  and for creating TypeInferrers.

- TypeInferenceEngineImpl, which is the generic implementation of
  TypeInferenceEngine.

R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2830313002 .
2017-04-21 05:39:09 -07:00
Paul Berry 77d26a330c Add top level type inference logic for integer literals.
This CL hooks up enough infrastructure for doing simple top level type
inference of variables whose initializer is an int.

Additional type inference rules will be added in follow-up CLs.

R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2828253003 .
2017-04-21 04:38:18 -07:00
Paul Berry 3dbe0099a2 Prepare to publish analyzer, front_end, and kernel.
Due to the tight coupling between analyzer and front_end, they need to
be published atomically.  The last published version of kernel is old
enough that it needs to be published too.

I've bumped the versions to the following, and changed the
dependencies so that this set of versions is mutually compatible:

- analyzer: 0.30.0-alpha.3
- front_end: 0.1.0-alpha.2
- kernel: 0.2.0

(Note that kernel's version didn't need bumping since the most
recently published version of it is 0.1.0)

R=asgerf@google.com

Review-Url: https://codereview.chromium.org/2828273003 .
2017-04-21 01:35:35 -07:00
Kevin Millikin 2e794c4e16 Move Kernel strings into the VM's heap.
- Instead of a pointer to new'd memory, Kernel strings now have an
  offset from the start of the string data.

- When the streaming reader encounters the string data it records the
  offset from the start of the binary.  This offset is stored in the
  Kernel Program and is used to compute the offset for strings.

- When a KernelReader is constructed, the string data is copied into a
  Uint8 array in the VM's heap.

- A pointer to the string data is put into every Kernel script so it
  can be used for constructing VM strings at compile time.

The source table does not use Kernel strings any more because those
strings are not found in the raw string data.  Instead, the source
table uses new'd buffers for strings (but this will be cleaned up
separately).

R=jensj@google.com

Review-Url: https://codereview.chromium.org/2820363002 .
2017-04-21 10:32:48 +02:00
Zhivka Gucevska 4f59c41c5f Remove state for expression evaluation
BUG=
R=dmitryas@google.com, kmillikin@google.com

Review-Url: https://codereview.chromium.org/2833733003 .
2017-04-21 10:11:06 +02:00
Mike Fairhurst 7db51c7624 Remove two more implicit upcasts with angular/dart analysis drivers
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2830153002 .
2017-04-20 17:17:07 -07:00
Sigmund Cherem 4a19708532 Remove use of package:analyzer in dependency_grapher
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2834543002 .
2017-04-20 17:06:04 -07:00
Steve Messick 6407af5dcb Clean up TODOs
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2830793007 .
2017-04-20 15:19:16 -07:00
Brian Wilkerson aa36e43426 Add plugin support for getAssists
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2832643005 .
2017-04-20 13:52:34 -07:00
P.Y. Laligand d7def1271d Scan all packages files found in the output directory to build package mappings. (#29400)
This accounts for the (common) situation where multiple targets (library, binaries, test) are declared inside a single Dart package.
2017-04-20 13:36:38 -07:00
Konstantin Shcheglov ce4d42e37e Include additional boolean flags into AnalysisOptionsImpl signature.
The failure to include 'enableAssertInitializer' could have caused
the problem in #29358. If we don't rebuild unlinked summaries for
packages, we might incorrectly handle asserts.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2828083004 .
2017-04-20 13:18:50 -07:00
Steve Messick b9c214f374 Compete try-statements
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2834513004 .
2017-04-20 13:09:23 -07:00
Konstantin Shcheglov 8f2061e6e3 Issue 29393. Consider 'v ??= doSomething()' as usage of 'v'.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/29393

Review-Url: https://codereview.chromium.org/2832013002 .
2017-04-20 12:43:21 -07:00
Brian Wilkerson e1a2c81d0b Update PluginWatcher to be more efficient
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2830933005 .
2017-04-20 12:39:50 -07:00
Konstantin Shcheglov ddf683c732 Issue 29398. Infer instance members using InheritanceManager of the ClassElement.
One of the other possible solutions is to put InheritanceManager
accessor into LibraryElement, just like LibraryElementInBuildUnit does.
But at the end I decided against it. Libraries are not immutable, we
still have vestiges of incremental analysis in the codebase.

R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/29398

Review-Url: https://codereview.chromium.org/2832893002 .
2017-04-20 12:03:50 -07:00
Devon Carew 3998e35679 Fix two analyzer warnings.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2832873002 .
2017-04-20 11:32:51 -07:00
Vijay Menon 21c38e6c8c Various DDC fixes for windows
This gets most tests compiling and running on Windows.

Fixes #27450
Fixes #27797
Fixes #28752

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2833633002 .
2017-04-20 11:30:57 -07:00
Brian Wilkerson 913560afb1 Enable missed tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2827353002 .
2017-04-20 11:30:36 -07:00
Vijay Menon b98729503c Fix ddc perf issue
This brings compilation time on large_class_declaration_test down from 30s to 4s.  Just analysis is about 3.2s.  (All #s without snapshotted tools.)

Fixes #29234

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2834663002 .
2017-04-20 11:24:35 -07:00
Brian Wilkerson f8e18d0888 Revert "Update PluginWatcher to be more efficient"
Review-Url: https://codereview.chromium.org/2834673002 .
2017-04-20 10:53:03 -07:00
Paul Berry f9189fdfe2 Make AstFactory.variableDeclaration(charOffset) a required parameter.
This prevents bugs where we forget to set the offset.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2829113002 .
2017-04-20 10:31:25 -07:00
Brian Wilkerson a3697af085 Update PluginWatcher to be more efficient
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2830063002 .
2017-04-20 09:25:37 -07:00
Jacob Richman 997b4e62af Run formatter on a few frontend and kernel files that hadn't been formatted.
BUG=
R=asgerf@google.com

Review-Url: https://codereview.chromium.org/2820323005 .
2017-04-20 09:25:13 -07:00
Vijay Menon 1112ad24cc Make conflicting summary check configurable
Not sure this is a great idea.  DDC will go awry if multiple copies of
the same type exist.  Can analysis or any other analyzer-based tool?

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

Review-Url: https://codereview.chromium.org/2829493002 .
2017-04-20 09:20:08 -07:00
Zhivka Gucevska b00a85231e Parametrize over the additional agrument type for StatementVisitor1 and ExpressionVisitor1
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2835453002 .
2017-04-20 18:03:15 +02:00
Zhivka Gucevska feb38e4c8b Implement expression evaluation in Coninuation Passing Style
This enables support for Return statements.

BUG=
R=dmitryas@google.com, kmillikin@google.com

Review-Url: https://codereview.chromium.org/2806483003 .
2017-04-20 15:22:33 +02:00
Paul Berry e3347e03f7 Use a non-null TypeInferrer even in non-strong mode.
This is necessary because some of the TypeInferrer's roles (e.g. type
promotion and determination of the types of constants) are still
needed in non-strong mode.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2829683008 .
2017-04-20 04:11:19 -07:00
Paul Berry e8e8359cdf Add local type inference logic for integer literals.
This CL introduces Fasta's first type inference rule, and hooks it up
to all the necessary testing infrastructure.  The rule is that a local
variable whose initializer is an integer literal should have an
inferred type of int.

Only variables occurring at top level within a method are inferred (we
don't yet recurse inside sub-blocks).

Additional type inference rules will be added in follow-up CLs.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2828693003 .
2017-04-20 03:36:19 -07:00
Peter von der Ahé 9356e3cd61 Check const constructors.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2799973003 .
2017-04-20 10:55:58 +02:00
Paul Berry b5c6053deb Add explicit return types to work around #29398.
In a future CL I need to add an import to this file, and for reasons I
haven't been able to track down, doing so causes type inference
failures.  This CL works around the problem by making the affected
types explicit.

Once the bug is fixed, I hope to be able to revert this.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2833563004 .
2017-04-20 01:29:49 -07:00
Peter von der Ahé e2eee219ac Complain about incorrect this/super constructor initializers.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2800083002 .
2017-04-20 10:04:12 +02:00
Johnni Winther ab195dac63 Remove backend dependency from TypeTestRegistry
- and move RuntimeTypesChecks to TypeTestRegistry.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2826083002 .
2017-04-20 09:32:51 +02:00
Peter von der Ahé cf6b2736ec Wrap VariableDeclarations in Blocks as specified by Kernel.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2801283002 .
2017-04-20 09:31:36 +02:00
Konstantin Shcheglov a73c8d0de1 MethodElementImpl.getReifiedType() should always create new parameter elements.
If we don't, and we transplant any of them into a new detached instance
of synthetic FunctionElementImpl, they are not able to access later
enclosingUnit in order to resynthesize their type.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2829843002 .
2017-04-19 16:36:34 -07:00
Vijay Menon 8a64625d81 Regenerate DDC artifacts
TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2830983002 .
2017-04-19 16:26:22 -07:00
Mike Fairhurst 746fd35307 Now that contextRoot is within the is check, don't need contextRoot at all
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2828103002 .
2017-04-19 15:45:20 -07:00
Sigmund Cherem b57ca9fb55 Fix front-end tests: the original code is correct, this is a workaround for issue #29393
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2834533002 .
2017-04-19 15:37:03 -07:00
Emily Fortuna 6c25a58dab Make backend.setAnnotations (mostly) handle LibraryEntities.
BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2824123003 .
2017-04-19 15:36:33 -07:00
Brian Wilkerson ba3ed4ba37 Initial support for getting fixes from plugins
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2830863002 .
2017-04-19 15:00:00 -07:00
Steve Messick 0829174516 Complete for-each and switch statements
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2826283002 .
2017-04-19 14:44:41 -07:00
Konstantin Shcheglov 7faf4bac93 Add FileSystemState.knownFilesSetChanges stream.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2826243002 .
2017-04-19 13:23:34 -07:00
Brian Wilkerson 653f9defb1 Prepare to publish another alpha
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2834493003 .
2017-04-19 13:01:40 -07:00
Stephen Adams 6c75646b3e Revert "Remove JavaScriptBackend from ClosedWorldBase"
TBR=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2828873002 .
2017-04-19 12:55:14 -07:00
Brian Wilkerson a3102bf441 Add support for reporting plugin data to instrumentation
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2834453002 .
2017-04-19 11:01:24 -07:00
Konstantin Shcheglov 0ce4611fd9 Move 'general function type' unit tests into mixins to run them with Fasta.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2829693002 .
2017-04-19 10:11:21 -07:00
Konstantin Shcheglov 91d6dcf9fb We cannot use relative URIs to reference files outside of a package.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2830733002 .
2017-04-19 10:09:14 -07:00
Jacob Richman 6ac3a24a2e Run formatter on the analyzer.
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2826693004 .
2017-04-19 08:24:09 -07:00