Commit graph

16414 commits

Author SHA1 Message Date
Konstantin Shcheglov 2289ce12ae Add import dependencies to Kernel libraries and use them to resynthesize ImportElement(s) in Analyzer.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2987553002 .
2017-07-21 09:21:57 -07:00
Siva Annamalai 000bec45ac Account for kernel files being passed in directly on the command line this fixes issue 30212 (https://github.com/dart-lang/sdk/issues/30212)
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2985563003 .
2017-07-21 08:27:39 -07:00
Brian Wilkerson 8a275e6df8 Add utility method to SubscriptionManager
R=mfairhurst@google.com

Review-Url: https://codereview.chromium.org/2983913002 .
2017-07-21 07:24:55 -07:00
Zhivka Gucevska 3e563c6e9e Modify class definition in interpreter according to spec:
- Populate implicit getters and setters.
 - Populate instance methods, getters and setters.

BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2987573002 .
2017-07-21 12:37:11 +02:00
Dmitry Stefantsov 5475240725 Add support for converted closures with explicit contexts to VM
The closure-conversion transformation is not enabled yet.  This commit
only adds the support for it to FlowGraphBuilder and
StreamingFlowGraphBuilder.  More work should be done before enabling the
transformation; most mportantly, the 'platform.dill' file that is used
in the Kernel isolate and is loaded by VM for linking with executed
programs should be separated.  The former should receive a file not
touched by the transformation, and the latter should receive a
transformed one.

BUG=
R=jensj@google.com, karlklose@google.com, kustermann@google.com

Review-Url: https://codereview.chromium.org/2891053003 .
2017-07-21 11:45:15 +02:00
Johnni Winther b5ec1dd2b8 Add Class/MemberDefinition to handle synthesized classes/members
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2984643002 .
2017-07-21 10:09:55 +02:00
Leaf Petersen 1eb480d266 Add --no-declaration-casts option to analyzer.
Adds a flag to disable and enable declaration casts independently
from other casts.

Fixes #29546

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

Review-Url: https://codereview.chromium.org/2976963002 .
2017-07-20 15:55:07 -07:00
Paul Berry cc97126aed Implement AstBuilder integration for parenthesized expressions.
The type inference engine doesn't even see parenthesized expressions
as a separate entity, since parentheses don't have any semantics.  So
we just copy the static type from the enclosed expression.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2982323003 .
2017-07-20 13:49:20 -07:00
Konstantin Shcheglov 70933930cb Resynthesize instance creation expressions from Kernel.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2986593002 .
2017-07-20 12:57:27 -07:00
Paul Berry f1efb202d1 Implement AstBuilder integration for instance creation expressions.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2982323002 .
2017-07-20 12:52:10 -07:00
Bob Nystrom 012774c78e Remove Dartium support from test.dart.
R=whesse@google.com

Review-Url: https://codereview.chromium.org/2981223002 .
2017-07-20 12:46:50 -07:00
Emily Fortuna 306453d91d Reapply "Add nonboxed closure class fields."
Last time I submitted it I was unable to test my adjustments from sra's suggestions becuase of build permissions (and failed motherboard). It has been tested on my laptop now.

This reverts commit bff25c89fe.

BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2986583002 .
2017-07-20 12:15:08 -07:00
Konstantin Shcheglov 25e695a71a Resynthesize field formal parameters from Kernel.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2978353002 .
2017-07-20 10:59:54 -07:00
Konstantin Shcheglov 1170b117c9 Remember isFieldFormal informative flag in VariableDeclaration(s).
It is informative in the same way as documentation.

Yesterday I tried to make Analyzer and Analysis Server stop using
FieldFormalParameterElement(s) and found one important use case requested
by the Flutter team. We need to show documentation of a field when
user requests documentation on the corresponding field formal named
parameter. This happens outside of the file that declares the parameter
and the field, so we don't have AST available. Of course we could
resolve the unit, but it would cost us something. And if we decide
that it is OK, then maybe we don't need to have documenation comments
in elements at all.

This is of course more convenience, and we could store documentation
and parameter to field mappings outside, like we store index. Just a
compromise - convenience vs. purity.

R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2983173002 .
2017-07-20 09:53:04 -07:00
Samir Jindel 239e044874 Remove dead code for closure-converting tearoffs.
This review scraps the (currently disabled) code for converting tearoffs in the
closure conversion pass.

The closure conversion pass can only ever do a partial job with tearoffs, due to
the possibility of an unconverted library tearing off a method from any object
it likes. Partially converting [PropertyGet]s makes the closure conversion pass
slower and introduces a new method for any field or method anywhere with a name
used in any [PropertyGet], inflating code size and potentially regressing
performance. As it provides no concrete value in return we've decided to scrap
this aspect of the transformation. Anyway, creating closures for tearoffs is
much easier for a backend than converting anonymous or nested functions, since
there is only one object ("this") captured. Thus ignoring tear-offs does not
undermine the value of the transformation.

BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2986553002 .
2017-07-20 16:47:09 +02:00
Dan Rubel 3b2625ccde rename test methods and format
* rename usingFasta --> usingFastaParser
* add usingFastaScanner
* apply dartfmt

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2981283002 .
2017-07-20 09:51:43 -04:00
Zhivka Gucevska 0e07361eb5 Store field locations instead of values in objects
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2979293002 .
2017-07-20 10:35:26 +02:00
Paul Berry a93aee1a08 Further integration of front end type inference into analyzer.
This CL propagates types from top level variable declarations into
analyzer ASTs.

This required adding a finishFields method to parser listeners (and a
corresponding method DietListener.listenerFinishFields which calls
it); this allows AnalyzerDietListener to thread the types through from
the BodyBuilder to the AstBuilder.  This is similar to what we were
already doing for methods.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2987503003 .
2017-07-19 23:00:52 -07:00
Bob Nystrom 0947675d6d Migrate the language tests up to arithmetic_test.
This technically steals a few tests from the previous batch that spans
corelib and language, but I wanted to start from the top of the language
tests.

Removed application_test and application_negative_test because they are
useless and the latter has never actually worked correctly since the day
it was transliterated from the long-defunct application file syntax.

R=bkonyi@google.com, whesse@google.com

Review-Url: https://codereview.chromium.org/2984443003 .
2017-07-19 20:30:21 -07:00
Siva Annamalai 23e3f55188 Adjust status file for some fasta front end test which are failing (see issue 30212).
Review-Url: https://codereview.chromium.org/2984663002 .
2017-07-19 19:21:41 -07:00
Jennifer Messerly 132067f685 ignore @proxy in strong mode
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2980383002 .
2017-07-19 18:17:01 -07:00
Siva Chandra bff25c89fe Revert "Add nonboxed closure class fields."
This is to get the vm-kernel bots go green.
Test failing on the bot: pkg/front_end/test/fasta/analyze_test

This reverts commit dc99692b41.

TBR=efortuna

Review-Url: https://codereview.chromium.org/2983933002 .
2017-07-19 17:23:37 -07:00
Emily Fortuna dc99692b41 Add nonboxed closure class fields.
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2978263003 .
2017-07-19 15:30:07 -07:00
Konstantin Shcheglov 607445ae9b Delay finishing dart:core and dart:async libraries until after TypeProvider is set for the context.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2986493002 .
2017-07-19 14:55:49 -07:00
pq 70869b61f4 Update meta version pre-publish.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2981313002 .
2017-07-19 14:30:47 -07:00
Vijay Menon 87ee6cc0d6 Polyfill only once
Avoid dcall on polyfill.

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2983903002 .
2017-07-19 13:42:23 -07:00
Vijay Menon 99e672d1cb Registration-based approach to cross frame support.
This approach installs all Dart extension types onto a window whenever
that window is accessed.

See #28326

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2980853002 .
2017-07-19 12:53:43 -07:00
Konstantin Shcheglov 94815c7bdb Include default values for default field formal parameters into text dump.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2981303002 .
2017-07-19 12:42:14 -07:00
Konstantin Shcheglov 3a4c33cc93 Resynthesize binary, prefix, and conditional expressions from Kernel.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2979303002 .
2017-07-19 12:36:49 -07:00
pq d5539d7d32 Update meta SDK constraint to be 2.0.0 dev friendly.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2983853003 .
2017-07-19 12:31:08 -07:00
Konstantin Shcheglov f04aa833c1 Parenthesize expressions as needed in elements text dump.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2985503002 .
2017-07-19 12:29:38 -07:00
Sigmund Cherem 84828cff89 Random improvements in error reporting.
R=ahe@google.com

This mainly addresses comments and suggestions from
https://codereview.chromium.org/2979623002/
Review-Url: https://codereview.chromium.org/2980273002 .
2017-07-19 10:45:31 -07:00
Stephen Adams a433bfd3b3 Default value constants are created only call uses them
Currently this fails with:

Unhandled exception:
Expect.fail('Instantiated types mismatch:
 Unfound:
  _Marker')

The generated code also contains the class and the (unused) constant.

BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2980973003 .
2017-07-19 10:35:33 -07:00
Konstantin Shcheglov a295f782c0 Include TypeEnvironment into KernelResult.
We need it to use kernel.Expression.getStaticType().

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2978333002 .
2017-07-19 09:40:33 -07:00
Konstantin Shcheglov bdd69ccd6c Remove UriReferencedElement with its uri/uriOffset/uriEnd properties.
The 'Move File' refactoring does not work, so I comment out most
of its code.

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

Review-Url: https://codereview.chromium.org/2982993003 .
2017-07-19 09:31:03 -07:00
Vijay Menon 12e32e230d Add hook to register global object
DDC will use this in a later CL.

R=alanknight@google.com, sra@google.com

Stephen: I assume this will get compiled out be dart2js.
Review-Url: https://codereview.chromium.org/2983813002 .
2017-07-19 05:46:07 -07:00
Johnni Winther 27a4cbeef9 Implement optimized mixin application in dart2js
This prepares for equivalence testing of shared mixins.

Review-Url: https://codereview.chromium.org/2983013002 .
2017-07-19 13:13:49 +02:00
Sigmund Cherem 2628d75c4b Fix bots, address duplicate error reporting later.
My CL broke dartk/vm tests because I stopped reporting some errors accidentaly.
I thought I was duplicating all error messages, but turns out that recoverable
errors were only reported in the line fixed here.

This reverts to the old behavior so we can address the reporting issues
separately. Added details to: https://github.com/dart-lang/sdk/issues/30194

BUG=

Review-Url: https://codereview.chromium.org/2977423002 .
2017-07-18 19:42:28 -07:00
Konstantin Shcheglov 90121b528a Remove the 'Move File' refactoring.
It has been broken since we switched to Analysis Driver.
Given that IDEA does not use it, there is little incentive to fix it.

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

Review-Url: https://codereview.chromium.org/2983783003 .
2017-07-18 17:59:20 -07:00
Sigmund Cherem 1aa139bc94 Unifying compiler context
Changes in this CL:
 - Updated CompilerContext:
    - it now contains a ProcessedOptions object

    - it no longer depends on CompilerCommandLine/CommandLine

    - it delegates to ProcessedOptions.report so all error reporting
      goes to one single place.

    - use "withContext" term instead of "withGlobalOptions" to be
      more clear about the intent

 - Changes in public API
    - added more options that correspond to flags in command-line
      fasta tools

    - default onError is different: we now use the
      command_line_reporting report, which prints and throws
      on fatal messages, but doesn't throw eagerly on all messages
      as before.

    - introduced "printMessages" option: make it easy to have
      both onError + command_line_reporting  (kernel-service.dart
      is the main use case at this time, other ideas welcome!)

    - renamed CompilationError to CompilationMessage

 - Other changes

    - set exit code is done on report, not on format
    - fixed corner cases not covered in previous CL
        - error reporting with missing-main needs to happen with
          a context
        - missing error cases when inferring .packages and input
          URIs are not file:* URIs

Ideas for follow up after this CL:
 - combine ProcessedOptions and CompilerContext into a single class
   (or extend one from the other)
 - switch onError to a stream

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2982093003 .
2017-07-18 17:02:59 -07:00
Konstantin Shcheglov 749b61f8ec Resynthesize List/Map literals from Kernel.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2984583002 .
2017-07-18 16:39:16 -07:00
Bob Nystrom 1d8c3af663 Delete old tests that aren't used and/or useful any more.
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2976313002 .
2017-07-18 14:12:57 -07:00
Vijay Menon 7365a24d98 Fix DDC status
TBR=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2981213002 .
2017-07-18 13:59:57 -07:00
Konstantin Shcheglov 9d5a249ed3 Resynthesize expressions for Kernel's StaticGet and PropertyGet.
Note, that we don't restore the original AST for StaticGet(s).
The original AST is not available in Kernel.
Instead we generate simple identifiers with correct elements.
It should be enough to compute constant values, although some clients
might have to adapt to the change.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2983773002 .
2017-07-18 13:09:16 -07:00
Vijay Menon ab39958ac5 Dummy DDC implementation of MirrorSystem
It's a bit absurd that a bunch of tests are passing with this.

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2978223002 .
2017-07-18 13:00:23 -07:00
Peter von der Ahé 4565719783 Remove number from operator mismatch message.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2978903002 .
2017-07-18 14:43:11 +02:00
Peter von der Ahé 3709ff5150 Add closeBraceTokenFor and use it instead of BeginToken.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2978073002 .
2017-07-18 13:57:10 +02:00
Zhivka Gucevska cbafc38513 Remove unused private methods in interpreter
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2978193002 .
2017-07-18 13:48:09 +02:00
Zhivka Gucevska d62ff42f0e Add support for binding 'this'
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2978893002 .
2017-07-18 13:18:54 +02:00
Zhivka Gucevska 1288ece5c8 Introduce statement continuations following the specification
The next statement to be executed is captured by a statement
continuation.

BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2975173002 .
2017-07-18 13:03:39 +02:00
Peter von der Ahé 3216bda008 Move parser helper classes to own files and clean them up.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2978063002 .
2017-07-18 13:02:41 +02:00
Peter von der Ahé c348f019ec Rename FunctionDeclaration to LocalFunctionDeclaration.
R=danrubel@google.com, johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2982033002 .
2017-07-18 12:35:41 +02:00
Johnni Winther c4c09b91bd Use entities in constant_emitter
R=sra@google.com

Review-Url: https://codereview.chromium.org/2981113002 .
2017-07-18 10:01:32 +02:00
Konstantin Shcheglov e77482de7e Resynthesize literal expressions from Kernel.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2978113002 .
2017-07-17 16:58:22 -07:00
Konstantin Shcheglov 32dd753aab Resynthesize class fields and accessors from Kernel.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2977263002 .
2017-07-17 16:43:20 -07:00
Konstantin Shcheglov 58b3421f5c Issue 30179. Infer return type of static setters to 'void'.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG= https://github.com/dart-lang/sdk/issues/30179

Review-Url: https://codereview.chromium.org/2977303002 .
2017-07-17 16:24:21 -07:00
Jennifer Messerly 34361bb02a fix #30138, reland with windows fix
Revert "Revert "fix #30138, synethic nodes causing crash generating source maps""

This reverts commit b7e3d9185d.

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2977183002 .
2017-07-17 15:58:24 -07:00
Paul Berry 554c908082 Mark ast_builder_test as slow.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2978133002 .
2017-07-17 15:41:52 -07:00
Jennifer Messerly 87c0b757cb fix #27320, better DDC temp generation
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2980113002 .
2017-07-17 14:33:30 -07:00
Sigmund Cherem 45d2358fee Fix analyzer test after making CompilerContext mandatory
(Note: the use of "CompilerCommandLine" will go away in another CL this week)

TBR=paulberry@google.com,ahe@google.com

Review-Url: https://codereview.chromium.org/2983703002 .
2017-07-17 14:07:49 -07:00
Sigmund Cherem 8ecb50d0de Throw if there is no compiler context available
BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2980033004 .
2017-07-17 13:16:18 -07:00
Vijay Menon 8913dd97df Update ddc dart:html
This is just a straight copy of the dart2js version to pick up sra's range fix.

TBR=sra@google.com,alanknight@google.com

Review-Url: https://codereview.chromium.org/2983693002 .
2017-07-17 12:14:30 -07:00
Vyacheslav Egorov c6815e8522 Reapply 0489249d29 with a fix for front_end tests.
Proper sequencing of _asyncStackTraceHelper in Kernel

This helper function was being called before its argument was
initialized so it was passing null.  Instead, it should be called
after its argument is initialized.

Because the initialization happens in Kernel code, it is simplest to
insert the call explicitly in Kernel code as well as part of the async
transformation.  This has the consequence that we now call the helper
function even when the flag causal_async_stacks is false.

Fixes issue #29771.
Fixes issue #30178
Fixes issue #30058

BUG=
R=aam@google.com, asiva@google.com

Review-Url: https://codereview.chromium.org/2936793003 .
Review-Url: https://codereview.chromium.org/2982943002 .
2017-07-17 20:56:28 +02:00
Konstantin Shcheglov 0c7e36bbfa Resynthesize top-level functions from Kernel.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2978093002 .
2017-07-17 10:16:41 -07:00
Konstantin Shcheglov ea40294eb3 Resynthesize parameters from Kernel.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2979133002 .
2017-07-17 10:11:53 -07:00
Devon Carew 8b7e3ef7e4 add env var info to the diagnostics page
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2981123002 .
2017-07-17 09:22:23 -07:00
Konstantin Shcheglov 892d7caab3 Resynthesize methods from Kernel.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2976263002 .
2017-07-17 08:37:32 -07:00
Peter von der Ahé efccdf7b1b Update expectations.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2976283002 .
2017-07-17 14:00:17 +02:00
Peter von der Ahé c50abfb1c4 Revert unrelated expectation changes.
This reverts a small fraction of ebb3dea075.

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

Review-Url: https://codereview.chromium.org/2981873002 .
2017-07-17 12:11:05 +02:00
Johnni Winther 94405484b4 Use entities in most of MirrorsData (part 2)
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2980953002 .
2017-07-17 11:29:31 +02:00
Johnni Winther 76fe8099d6 Use more entities in InferrerEngineImpl
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2983553002 .
2017-07-17 09:59:31 +02:00
Johnni Winther d8fcadbce9 Use entities in the InferrerEngine interface
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2977963002 .
2017-07-17 09:53:40 +02:00
Johnni Winther d57c11ed38 Remove unneeded methods from InferrerEngine.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2980073002 .
2017-07-17 09:45:25 +02:00
Konstantin Shcheglov 8a98f240a9 Resynthesize top-level variables from Kernel.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2981943002 .
2017-07-15 10:06:46 -07:00
Konstantin Shcheglov d31fe5225d Resynthesize interfaces from Kernel.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2981063002 .
2017-07-15 10:01:57 -07:00
Konstantin Shcheglov a9fbe224bc Add documentationComment for Class to Kernel. Parse it. Resynthesize in Analyzer.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2977133002 .
2017-07-15 09:53:48 -07:00
Emily Fortuna 45c57c8859 Renamed some scoping classes to make their usage clearer.
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2975323002 .
2017-07-14 17:03:35 -07:00
Leaf Petersen 9f059e58b4 Move null check out of getExtensionType
BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2980133002 .
2017-07-14 17:02:09 -07:00
Jennifer Messerly b7e3d9185d Revert "fix #30138, synethic nodes causing crash generating source maps"
This reverts commit 52880e9c4c.

Review-Url: https://codereview.chromium.org/2977163002 .
2017-07-14 15:54:23 -07:00
Sigmund Cherem 98d057075a Add missing import: fix warning introduced in last CL
TBR=paulberry@google.com

Review-Url: https://codereview.chromium.org/2979093002 .
2017-07-14 15:42:11 -07:00
Konstantin Shcheglov 41e1087dcc Resynthesize InterfaceType, class type parameters and supertype.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2977983002 .
2017-07-14 15:08:28 -07:00
Sigmund Cherem 4ad4f985af Move reify to use fasta instead of dartk
Note the suite seemed to have a lot of tests crashing in verification.

With my change I'm noting other crashes, but I haven't investigated where they are from.

Also, to run the suite, before it used to be run as:

  dart pkg/kernel/test/reify/suite.dart

Now it needs to be run as:
  DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart pkg/kernel/test/reify/suite.dart

BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2981813002 .
2017-07-14 15:04:43 -07:00
Konstantin Shcheglov d0e3893d02 Include LibraryElement documentation comment into text dump.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2980123002 .
2017-07-14 14:58:23 -07:00
Konstantin Shcheglov 592357028e Resynthesize factory constructors from Kernel.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2977963003 .
2017-07-14 14:04:25 -07:00
Emily Fortuna f8e80ea0a6 Reapply "Distinguish between actual closure scopes and non-closure scopes."
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2982843003 .
2017-07-14 14:00:28 -07:00
Sigmund Cherem ebd9440b18 support resolving .packages in FE
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2979003002 .
2017-07-14 12:54:35 -07:00
Jennifer Messerly 52880e9c4c fix #30138, synethic nodes causing crash generating source maps
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2977943002 .
2017-07-14 12:46:22 -07:00
Jennifer Messerly cc167f5901 fix #30108, mock support for callable classes
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2975273002 .
2017-07-14 12:42:16 -07:00
Stephen Adams f4946f54e8 Use failedAt in more places
I saw some inconsistency in one file so I did a global cleanup.

BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2982783003 .
2017-07-14 12:10:31 -07:00
Paul Berry 368055944c Reenable commented-out test.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2977973002 .
2017-07-14 10:11:09 -07:00
Paul Berry 582e512051 Mark resynthesize_kernel_test as slow.
This should fix the Windows analyzer bots.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2975293002 .
2017-07-14 10:05:17 -07:00
Sigmund Cherem 66b4efaa30 Disable printing in kernel-driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2980093002 .
2017-07-14 09:47:08 -07:00
Dan Rubel bb9ba11c6c translate more fasta error codes to analyzer error codes
R=ahe@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2978993002 .
2017-07-14 12:31:13 -04:00
Dan Rubel f12be9d64d more fasta event cleanup and testing
* make _end(optional: false) which uncovered unbalanced begin/end pairs
* update and document top level member events
* rename handleSwitchCase to endSwitchCase to better align with beginSwitchCase
* update and document begin/endFor/endForIn events
* cleanup test listener

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

Review-Url: https://codereview.chromium.org/2980043003 .
2017-07-14 12:28:09 -04:00
Konstantin Shcheglov 5f545f1305 Resynthesize constructor properties.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2980963002 .
2017-07-14 08:58:09 -07:00
Dan Rubel 14b76d6b22 cleanup fasta parser send and expression events
* remove unused beginSend
* rename endSend to handleSend

* remove unused beginThrowExpression
* remove unused beginExpression event
* rename endThrowExpression to handleThrowExpression

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

Review-Url: https://codereview.chromium.org/2976103002 .
2017-07-14 10:20:01 -04:00
Peter von der Ahé c94f8ef9ec Remove deprecated_wrapInCompileTimeError.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2983463002 .
2017-07-14 14:29:59 +02:00
Peter von der Ahé 18a41eba08 Report messages instead of just printing.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2977013002 .
2017-07-14 14:07:44 +02:00
Johnni Winther 5c46d9a243 Tag default constructors in rasta
Adjusted according to https://codereview.chromium.org/2981783002/

Review-Url: https://codereview.chromium.org/2981843002 .
2017-07-14 11:43:57 +02:00
Peter von der Ahé 5b38490530 Undeprecate buildCompileTimeError.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2975183002 .
2017-07-14 11:43:05 +02:00
Johnni Winther 996f8ecb57 Use entities in most of MirrorsData
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2982733002 .
2017-07-14 11:37:36 +02:00
Samir Jindel a459f73fac Convert closures in all initializers, and share the context between them.
Summary:

Previously, we only handled `FieldInitializer` and `LocalInitializer`.

Now we handle all initializers.

Previously, we would create separate contexts for each initializers, which was
incorrect because it changes made to an argument from a closure within one
initializer would not be seen by a closure within another.

Now, we create the context in a `LocalInitializer` so all initializers will see
the same copy of the argument variables.

There is still an outstanding issue where variables introduced as local
initializers and later captured by closures in subsequent initializers are not
placed into the context. However, this will at least trigger an assert in the closure conversion pass.

Test Plan:

'closures_initializers/initializers.dart(.expect)' has been updated with very
simple test cases for super and redirecting initializers. The second bug
mentioned (captured local initializers) has not been reproduced yet.

BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2981603002 .
2017-07-14 10:59:17 +02:00
Johnni Winther a4dfcb3e46 Check function type equivalence
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2983483002 .
2017-07-14 10:50:21 +02:00
Johnni Winther 08f5335473 Extract interface of InferrerEngine and move implemation to InferrerEngineImpl
This prepares for parameterizing InferrerEngine and reusing parts for a kernel based inference.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2982713002 .
2017-07-14 10:40:11 +02:00
Jennifer Messerly 418d11fbd6 fix #30094, assert should work with a function
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2971243003 .
2017-07-13 22:51:45 -07:00
Konstantin Shcheglov 0d9357431d The very first bits of resynthesizing elements from kernels.
Just parts of library, defining unit and class for now.
This is enough to pass 15 tests out of 522 :-)
Although some of them are passing accidentally.

Only strong mode tests for now.

We don't compare with Analyzer elements created using Analyzer builders,
because these builders will go away. But we miss testing for things
like name offsets.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2980863003 .
2017-07-13 22:20:55 -07:00
Emily Fortuna 58e5a23937 Revert "Distinguish between actual closure scopes and non-closure scopes."
This reverts commit 6264923aa1.

This reverts commit b5ded27c32.

This reverts commit 23faeddbef.

BUG=

Review-Url: https://codereview.chromium.org/2982713003 .
2017-07-13 17:25:25 -07:00
Leaf Petersen 4f7fa8a930 Check for null when getting the extension type.
isJsInterop can call this with null.

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2983523002 .
2017-07-13 16:48:25 -07:00
Konstantin Shcheglov 00d5012906 Format analyzer, analysis_server, analyzer_plugin, front_end and kernel with the latest dartfmt.
...instead of mixing formatting with actual changes in many CLs.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975253002 .
2017-07-13 16:28:18 -07:00
Emily Fortuna 23faeddbef Make fasta analyzer happy with dart2js method type change.
BUG=

Review-Url: https://codereview.chromium.org/2982803002 .
2017-07-13 15:56:55 -07:00
Paul Berry df91c79078 Further integration of front end type inference into analyzer.
This CL propagates types for simple variable declarations into analyzer ASTs.

Note that for a variable declaration like `int x` we need to store two
pieces of information: the element pointed to by `int`, and the type
of `x`.  This CL handles the latter.  The former will wait until we
have enough of the element model built that we have an element to
point to.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2980053002 .
2017-07-13 14:42:05 -07:00
Leaf Petersen 4a87156b13 Move NullError into interceptors
Put the NullError class into interceptors so that it will be picked
up as a native type.

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2976173002 .
2017-07-13 14:38:39 -07:00
Mike Fairhurst 2eb0017013 Add angular to analyzer plugin whitelist
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2982773002 .
2017-07-13 14:36:14 -07:00
Emily Fortuna b5ded27c32 Clean up code comments based on the changes in response to sra and johnniwinther's CL comments. (oops)
BUG=

Review-Url: https://codereview.chromium.org/2980913002 .
2017-07-13 14:11:43 -07:00
Konstantin Shcheglov ebb3dea075 Set 'isSyntheticDefault' for default constructors.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2981783002 .
2017-07-13 14:06:11 -07:00
Emily Fortuna 6264923aa1 Distinguish between actual closure scopes and non-closure scopes.
BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2981723002 .
2017-07-13 14:06:02 -07:00
Vijay Menon d952055a7e Support ClassMirror.newInstance on factory constructors
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2976133002 .
2017-07-13 13:07:37 -07:00
Paul Berry 04ad043f49 Remove code associated with the old "kompile" functionality.
This code is no longer needed because we no longer run the front end
in "kompile" mode.

Also remove the old expectations files used by the "kompile" tests.

I will remove more code in future CLs.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2980883003 .
2017-07-13 12:18:44 -07:00
Paul Berry c9b42f6a41 Remove the "kompile" mode of running the front end.
This mode was needed in the early days of the front end when we were
contemplating the idea of building the analyzer AST representation of
code first, and then converting it to kernel.  Now that we build
kernel directly, it is no longer needed.

Further CLs will follow to remove code that is no longer used after
this change.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2980013002 .
2017-07-13 10:52:55 -07:00
Stephen Adams 39034d29e0 Revert "dart2ks-kernel: constant types and constant lists with type parameters"
This reverts commit ac6d0b524e.

TBR=johnniwinther@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975203002 .
2017-07-13 10:30:34 -07:00
Konstantin Shcheglov 6e0a5305a0 Make tests in resynthesize_common asynchronous.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2980873002 .
2017-07-13 10:14:11 -07:00
Stephen Adams ac6d0b524e dart2ks-kernel: constant types and constant lists with type parameters
This CL is relative to https://codereview.chromium.org/2981543002/

BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2976973002 .
2017-07-13 10:08:08 -07:00
Konstantin Shcheglov 125bd4cfed Fix MockSdk in analyzer for problems that cause exceptions in Fasta.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2980863002 .
2017-07-13 09:18:07 -07:00
Konstantin Shcheglov bead5672c6 Pass backend Target into Kernel driver.
Mock SDK in analyzer does not include all the internal libraries that
VM requires, and probably does not have to for analysis. So, we might
use NoneTarget to avoid requiring extra libraries and transformations.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2980813002 .
2017-07-13 09:13:37 -07:00
Paul Berry b87556e00d Start copying resolution/inference data from front end to analyzer ASTs.
This CL lays the groundwork for integrating the front end with
analyzer by creating a mechanism to copy resolution and type inference
information (produced by the front end's type inference engine) into
analyzer ASTs (produced by AstBuilder).

The general technique is to parse each function twice: once with
BodyBuilder as a listener and once with AstBuilder as a listener.  The
BodyBuilder generates a kernel representation of the function, but
this isn't used; instead, type inference and resolution information is
captured using ResolutionStorer (which is a TypeInferenceListener).
Later, this information is applied to the analyzer AST generated by
AstBuilder using ResolutionApplier (which is an analyzer AST visitor).

At the moment the intermediate data exchanged between ResolutionStorer
and ResolutionApplier is simply a list of types (one for each
subexpression, in a post-order traversal of the program syntax).  For
debugging and validation purposes, this is augmented with a list of
file offsets, so that if the ResolutionStorer and ResolutionApplier
get out of sync we can diagnose the problem easily.

In later CLs, more data will need to be exchanged between
ResolutionStorer and ResolutionApplier (e.g. a list of elements to
which identifiers are resolved).

This CL doesn't tackle the problem of translating between the kernel
and analyzer representation of types; for now we simply map each type
to `dynamic`.  This is sufficient for early development, since it is
still enough to let us verify that ResolutionStorer and
ResolutionApplier stay in sync.

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

Review-Url: https://codereview.chromium.org/2981693002 .
2017-07-13 08:55:29 -07:00
Dan Rubel 6e87f881cf track fasta parser begin/end event pairs
This is a first cut at tracking fasta parser events
to ensure that I don't break them when improving parser recovery
and integrating the fasta parser into analyzer.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2975123002 .
2017-07-13 11:49:08 -04:00
Peter von der Ahé 6dbcd67e01 Remove deprecated API from scope.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2975163002 .
2017-07-13 16:52:07 +02:00
Peter von der Ahé 8a6cf606ed Remove deprecated_memberError
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2983443003 .
2017-07-13 15:42:21 +02:00
Peter von der Ahé 579a23d8ef Remove deprecated_addError.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2982673002 .
2017-07-13 14:52:23 +02:00
Peter von der Ahé 959470b6e6 Remove deprecated_warning.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2980823002 .
2017-07-13 14:11:40 +02:00
Peter von der Ahé 17dc720681 Remove deprecated_warningNotError.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2977903002 .
2017-07-13 13:51:43 +02:00
Johnni Winther 66f19e6764 More equivalence testing
- including a fix in checkLists!

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2979783003 .
2017-07-13 13:23:58 +02:00
Peter von der Ahé c894d8b62c Undeprecate IncompleteError.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2977893002 .
2017-07-13 13:09:30 +02:00
Johnni Winther 90a9a5aada Use TypeSystemStrategy to separate Element/Ast from TypeSystem
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2981643002 .
2017-07-13 12:07:48 +02:00
Johnni Winther ac39f0dd2b Parameterize TypeSystem by its node kind
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2981613002 .
2017-07-13 11:43:49 +02:00
Johnni Winther 2e21637f86 Encapsulate use of ast.Node in type_graph_nodes
- remove use of ast.Send

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2975053002 .
2017-07-13 11:28:50 +02:00
Johnni Winther 34f124df98 Use entities in the TypeSystem interface.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2979813002 .
2017-07-13 11:18:34 +02:00
Johnni Winther cb6bef3cb4 Introduce TypedefEntity
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2981633002 .
2017-07-13 11:14:04 +02:00
Johnni Winther f644cffa33 Handle type variable test and typed list literal.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2981543002 .
2017-07-13 11:05:04 +02:00
Zhivka Gucevska 77ae919a46 Rename continuations according to Kernel semantics specification
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2979843002 .
2017-07-13 10:48:08 +02:00
Zhivka Gucevska 76ff97880b Rename configurations according to specification
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2975893002 .
2017-07-13 10:09:35 +02:00
Zhivka Gucevska 8e52eea681 Modify environment binding to bind variable declarations to locations
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2980483002 .
2017-07-13 09:54:43 +02:00
Konstantin Shcheglov e08b72cab9 Remove KernelDriver/IKG.invalidateAll().
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975143002 .
2017-07-12 21:59:04 -07:00
Emily Fortuna e0ad5d0c0a Register created closure class with the world.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2981673002 .
2017-07-12 15:06:40 -07:00
Natalie Weizenbaum 5a74d8ab09 Properly handle Windows file: URLs on Node.js (#30098)
This adds logic to the JS implementation of URI to determine whether
the code is running on Windows under Node.js.
2017-07-12 14:57:01 -07:00
Sigmund Cherem a7865761d4 Use messages for (some) public API errors
not entirely ready - looking for comments.

BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2979623002 .
2017-07-12 14:55:17 -07:00
Sigmund Cherem 03bc29f24c Remove uses of internal API in closures_initializers suite.
I had removed the uses in other suites, but this suite got added while my CL was
being reviewed. I didn't notice this new case until today.

R=paulberry@google.com
CC=ahe@google.com,dmitryas@google.com

Review-Url: https://codereview.chromium.org/2981663002 .
2017-07-12 13:46:30 -07:00
Peter von der Ahé 83e4138cd4 Remove deprecated api from LibraryBuilder.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2977713002 .
2017-07-12 22:31:13 +02:00
Konstantin Shcheglov a77f6adca7 Add tests for KernelDriver.
Partically move and adapt corresponding tests from IKG.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975093002 .
2017-07-12 13:22:19 -07:00
Peter von der Ahé 59e9638232 Remove deprecated methods from ClassBuilder.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2977693002 .
2017-07-12 21:59:46 +02:00
Stephen Adams 0c69c06a87 Changes to compile compound constructor types
BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2976013002 .
2017-07-12 12:38:30 -07:00
Paul Berry 285a18dd23 Rename most "debug" methods in TypeInferenceListener classes to "generic".
In a future CL I'm going to start taking advantage of the fact that
these methods provide a fallback behavior when the listener doesn't
override a more specific method, so to avoid confusion I'm renaming
the methods to reflect that use case.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2981653002 .
2017-07-12 12:29:34 -07:00
Konstantin Shcheglov b985f3c000 Rename TranslateUri to UriTranslator, rename files, extract Impl.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2982593002 .
2017-07-12 11:56:14 -07:00
Konstantin Shcheglov a9a926a197 Implement IncrementalKernelGeneratorImpl using KernelDriver.
What is not done, and I'd like to do in following CLs.

1. Write documentation for KernelDriver.
2. Add separate tests for KernelDriver.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2976003002 .
2017-07-12 11:24:45 -07:00
Peter von der Ahé ca4ad3e65d Remove deprecated_addNit.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2976753002 .
2017-07-12 18:44:52 +02:00
Konstantin Shcheglov cb3a79f883 Refactorings for TranslateUri and its tests.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2977703002 .
2017-07-12 09:22:17 -07:00
Peter von der Ahé 619006eac3 Sort generated messages.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2976743002 .
2017-07-12 17:43:22 +02:00
Peter von der Ahé 20ffc179b7 Remove prefixes from messages and document why.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2974203002 .
2017-07-12 17:18:05 +02:00
Peter von der Ahé de891789da Remove deprecated_internalProblem.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2974933002 .
2017-07-12 16:27:52 +02:00
Peter von der Ahé a66d0c797a Implement more message argument kinds.
R=johnniwinther@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2977653003 .
2017-07-12 15:03:53 +02:00
Peter von der Ahé 8a1600b12e Add --set-exit-code-on-problem option.
Fixes https://github.com/dart-lang/sdk/issues/30127

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2979713002 .
2017-07-12 14:29:17 +02:00
Peter von der Ahé 42bcc10aa8 Correctly pass options to CompilerCommandLine.withGlobalOptions.
See #30127.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2982443002 .
2017-07-12 12:26:04 +02:00
Johnni Winther 15e981d88e Convert data objects eagerly from K to J
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2978613002 .
2017-07-12 10:58:08 +02:00
Johnni Winther 72e8925206 Check emitter constants and fix tearOffName for JConstructorBody
R=sigmund@google.com, sra@google.com

Review-Url: https://codereview.chromium.org/2975933002 .
2017-07-12 10:37:21 +02:00
Johnni Winther aa014f3b28 Fix crash in inference
Closes #30121

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2977683002 .
2017-07-12 10:18:19 +02:00
Johnni Winther cca9a1573b Support is tests
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2974223002 .
2017-07-12 09:58:54 +02:00
Konstantin Shcheglov fe0dfe4b0f Deprecate UnlinkedVariable.visibleOffset/Length.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2982463002 .
2017-07-11 14:57:16 -07:00
Konstantin Shcheglov 78f78feaf8 Don't include *.yaml files in 'analysis.analyzedFiles' notification.
R=brianwilkerson@google.com, jwren@google.com
BUG=

Review-Url: https://codereview.chromium.org/2980653002 .
2017-07-11 14:19:15 -07:00
Konstantin Shcheglov 5cd77dda37 AnalysisOptionsProvider.getOptionsFile() should return only existing files.
R=brianwilkerson@google.com, jwren@google.com
BUG=

Review-Url: https://codereview.chromium.org/2981553002 .
2017-07-11 13:38:08 -07:00
Konstantin Shcheglov fac4d2d603 Fix incremental_reload example after VmReloader -> RemoteVm rename.
TBR

There were 2 compilation errors and 1 hint.
I prefer when my workspace is error free :-)

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975793005 .
2017-07-11 12:11:58 -07:00
Konstantin Shcheglov c393e9bbbd Store FunctionType(s) of local functions by value.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2974803002 .
2017-07-11 11:36:20 -07:00
Konstantin Shcheglov 0827191d87 Refactor creating AnalysisOptionsImpl and declared variables.
We need to separate declared variables from AnalysisContext because
we're going to replace AnalysisContext with AnalysisDriver.

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

Review-Url: https://codereview.chromium.org/2976683002 .
2017-07-11 11:29:35 -07:00
Vijay Menon d7544d2452 Fix bad merge
R=leafp@google.com

Undo this:
90380dfdfa (diff-faec4ab5f53e175ed283041f1fe3c0bf)
Review-Url: https://codereview.chromium.org/2980623002 .
2017-07-11 11:23:33 -07:00
Konstantin Shcheglov 3965995169 Remove references to not-exiting-anymore FrozenHashCodeException.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2979583002 .
2017-07-11 10:40:09 -07:00
Konstantin Shcheglov 53d23afd23 Use precomputed uriBytes while computing cycle signature.
This makes the "perfect" incremental case (when every library has its
kernel ready in the byte store) about 5% faster.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2980523003 .
2017-07-11 10:37:01 -07:00
Vijay Menon 5b742853c7 Treat JS TypeError as Dart NSM
Fixes #30134

R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2979613002 .
2017-07-11 05:44:22 -07:00
danrubel b47bfa88be remove unused analysis server flag
R=pquitslund@google.com

Review-Url: https://codereview.chromium.org/2974013002 .
2017-07-11 08:10:42 -04:00
Peter von der Ahé 99d637f581 Improve parsing of function expressions.
Fixes #29937
Fixes #29978
Fixes #29979

R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2968093003 .
2017-07-11 10:35:59 +02:00
Johnni Winther ddad7cc116 Compute source spans for IR nodes and J/K-elements
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2974663002 .
2017-07-11 10:34:47 +02:00
Johnni Winther ea7b7f3e57 Add ConstructorBodyEntity
+ remove KernelSsaGraphBuilder.astAdapter.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2968383002 .
2017-07-11 10:20:09 +02:00
Peter von der Ahé 2baaf0be13 Rename special dart2js error codes.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2973053002 .
2017-07-11 10:00:16 +02:00
Peter von der Ahé 710ddf02ff Remove all deprecated fasta message methods from analyzer.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2975823002 .
2017-07-11 09:26:27 +02:00
Sam Rawlins c9c5767630 Bump meta to 1.1.0
BUG=
R=nweiz@google.com

Review-Url: https://codereview.chromium.org/2973383002 .
2017-07-10 14:58:14 -07:00
danrubel def1ee6604 add analysis server --flutter-repo startup flag
This adds a new flag used by `flutter analyze --watch` when analyzing
the flutter repository. When specified, this flag causes analysis server
to enable the public_member_api_docs lint even though it is not enabled
in the analysis_options file. `flutter analyze --watch` needs the results
of this lint to summarize the number of public members missing dartdoc,
but enabling it in the analysis_options causes too much noise in the IDE.

See https://github.com/flutter/flutter/issues/10721 for more background

R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2976473003 .
2017-07-10 16:50:04 -04:00
Sigmund Cherem d60fe4de18 Document dart2js flags in dartjs -h
R=kathyw@google.com, sra@google.com

Review-Url: https://codereview.chromium.org/2974133002 .
2017-07-10 12:58:14 -07:00
Sigmund Cherem 2b8ced2132 Fix hot reload test
The test is currently skipped because of some flaky issue (issue #29819). I
noticed the test got broken while it's been disabled. This makes the test be in
working condition, even though it can't be enabled until we fix the underlying
flakiness in the VM.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2976553002 .
2017-07-10 12:52:28 -07:00
Sigmund Cherem f422249fcd Add support for multi-roots
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2964323002 .
2017-07-10 11:48:54 -07:00
Konstantin Shcheglov 51b50f7710 Restore visitLabelElement() and visitLocalVariableElement().
Revert "Remove visitLabelElement() and visitLocalVariableElement()."

This reverts commit 2c064df145.

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

Review-Url: https://codereview.chromium.org/2977623002 .
2017-07-10 11:00:27 -07:00
Sigmund Cherem c720c776e0 Add native extension to flutter targets (this was removed accidentally in an
earlier CL, I had assumed flutter targets simply extended the VM targets).

Fixes #30118

R=ahe@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2980513002 .
2017-07-10 10:55:34 -07:00
Peter von der Ahé b023d925ea Use FastaMessage instead of String. Part 1.
See #30080.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2965393002 .
2017-07-10 19:50:14 +02:00
Johnni Winther 6ed6ac9fb9 Fix handling of async patches.
- and rewrite the only use to avoid async rewrite.

Review-Url: https://codereview.chromium.org/2977583002 .
2017-07-10 16:08:08 +02:00
Florian Loitsch 5d4a786f44 Revert "Don't use LinkedList in the core libraries anymore."
This reverts commit fe17b5b2bc.

Review-Url: https://codereview.chromium.org/2974073002 .
2017-07-10 14:58:04 +02:00
Lasse R.H. Nielsen 807a1fb294 Add more status files for assert-in-initializer tests, remove mistype.
Review-Url: https://codereview.chromium.org/2975773002 .
2017-07-10 14:25:28 +02:00
Florian Loitsch fe17b5b2bc Don't use LinkedList in the core libraries anymore.
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2975443002 .
2017-07-10 14:09:24 +02:00
Lasse R.H. Nielsen 609d26a227 Add assert-in-initializer-list to formal specification.
Add tests for new syntax.
Not dart-formatted yet since the formatter doesn't accept the new syntax.

R=eernst@google.com, floitsch@google.com

Review-Url: https://codereview.chromium.org/2962153002 .
2017-07-10 13:59:38 +02:00
Johnni Winther 3bd55a5024 Further cleanup of element use in type_graph_nodes
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2976483002 .
2017-07-10 13:05:02 +02:00
Johnni Winther 5dbd50204e Lookup getClosureScope by member instead of node
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2975573002 .
2017-07-10 12:58:24 +02:00
Johnni Winther 3fab16c169 Use JsStrategy, remove KernelBackendStrategy
R=efortuna@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2974633002 .
2017-07-10 12:49:33 +02:00
Peter von der Ahé 9236a3445e Deprecate all diagnostics methods that use strings.
See #30080.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2970273004 .
2017-07-10 11:23:09 +02:00
Samir Jindel 4df146dd9a Revert "Fix closure conversion in field and local initializers."
This reverts commit a49dcb6bb1.

Committed: a7d1837d3d
Review-Url: https://codereview.chromium.org/2974673002 .
2017-07-10 10:12:45 +02:00
Sigmund Cherem d844dc8226 Move forward rolling FE public APIS (make bots green)
There were a couple issues found in the bots:
 - dart2js unit tests I accidentally missed earlier.
 - vmservice issues only show up in the debug-vm, I was testing locally with the
   release vm.
 - a small regression in detecting invalid .packages files. I marked the test
 failing for now and plan to follow up on this on Monday.

TBR=ahe@google.com,paulberry@google.com

Review-Url: https://codereview.chromium.org/2974703002 .
2017-07-07 21:15:07 -07:00
Bob Nystrom 7b17a3dd01 Use "|" as the separator between module path and name. (#30106)
* Use "|" as the separator between module path and name.

":" is already a path character in Windows. This is why the
dartdevc tests aren't working on Windows. Because they try to do:

-sC:/some/path/blah.dart:blah

And it splits at the first ":". Oops.

* Switch to "=" for separating module path from name.

It looks a little funny when used with "--summary=", but it works fine
and is very unlikely to be used for anything else on any platform
(since we already use it as the separator between arg name and value).
2017-07-07 17:13:43 -07:00
Sigmund Cherem b71bd543a9 Reapply "Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service.""
Original CL had a bug that wasn't visible unless you delete your
out/ReleaseX64/patched_sdk folder.

Patchset #1 is the original CL, patchset #2 shows the fix.

This reverts commit 4aadfe09df.

BUG=

Review-Url: https://codereview.chromium.org/2976543002 .
2017-07-07 15:32:24 -07:00
Sigmund Cherem 4aadfe09df Revert "Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service."
Reason: broke VM bots, still investigating.

This reverts commit 610d081947.

TBR= paulberry@google.com

Review-Url: https://codereview.chromium.org/2979463002 .
2017-07-07 15:21:37 -07:00
Sigmund Cherem 610d081947 Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service.
This CL tweaks the public APIs in package:front_end, and
starts using those APIs outside the package. For example, this
removes 9 uses of DillTarget, so it is not longer mentioned
outside pkg/front_end and the analyzer_target.

Actual changes:
 - in package:front_end

   * added kernel_generator_impl: new file contains code that
     used to be in kernel_generator. Code has some modifications:
     it uses a single canonical-root when loading summaries, and
     it supports generating both outlines and kernel in one go.

   * removed code that didn't belong here:
     a. most of calculating deps for .GN moved to patch_sdk
     b. vm-specific outcomes moved to kernel-service

   * updated how `native` is implemented, so we can more easily
     support dart2js and ddc

   * updated how we check where `int`, `bool`, etc can be implemented.

   * added support "hermetic mode" in modular builds
     ('chaseDependencies = false' option)

   * moved `trim` step out of fasta, and for now call it only within
     the public API. This is not yet exposed, and I stopped covering it in
     most tests (now only covered in shaker tests). The plan is to add
     tests for the public API covering this in the future.

   * removed `uriToSource` when serializing outlines

   * added unit tests for public APIs

 - patch_sdk
   * use the public API to craete platform.dill, outline.dill (now
     500K insted of 3Mb because it excludes sources), and vmservice_io.dill
   * moved here logic internal to .GN

 - kernel service
   * use the public API
   * moved here logic that depends on VM internals (e.g. status enum,
     compilation results)

 - package:compiler
   * use the public API in tools and unit tests
   * simplified patched-sdk generation: no more extending fasta's internals

 - package:kernel
   * fix bug in deserialization: initializers and other lists were
     overwritten accidentally with external definitions.
   * updated unit tests, moved shared logic to frontend/src/fasta/testing

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

Review-Url: https://codereview.chromium.org/2953703002 .
2017-07-07 15:14:22 -07:00
Konstantin Shcheglov 824a62ba3c More tests for build mode.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2971373002 .
2017-07-07 14:33:09 -07:00
Konstantin Shcheglov 4323722416 Stop using ExecutableElement.functions in tests.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2965423002 .
2017-07-07 13:05:38 -07:00
Konstantin Shcheglov a673395664 Don't depend on visiting local functions.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2970403002 .
2017-07-07 13:01:23 -07:00
Paul Berry 7c94f00d24 Fix spelling errors in telemetry README.
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2972203003 .
2017-07-07 10:57:58 -07:00
Konstantin Shcheglov a092694280 Don't summarize labels, remove resynthesis code for labels.
This removes UnlinkedLabel altogether, because it is not used anywhere
else. We need to keep the corresponding field, so I changed its type
to String.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2972233002 .
2017-07-07 10:22:18 -07:00
Konstantin Shcheglov 671bedc8f6 Fix strong_mode_test after moving driver_test fields into class.
TBR

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2971343002 .
2017-07-07 10:01:47 -07:00
Samir Jindel a7d1837d3d Revert "Fix closure conversion in field and local initializers."
This reverts commit a49dcb6bb1.

Review-Url: https://codereview.chromium.org/2974673002 .
2017-07-07 18:42:51 +02:00
Konstantin Shcheglov 73ec7f0a79 Convert driver_test.dart to reflective tests.
It was hard to keep track of defined tests, and to run individual tests.

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

Review-Url: https://codereview.chromium.org/2976493002 .
2017-07-07 09:38:49 -07:00
Dan Rubel db02df3d3f update strong mode test for fasta scanner
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2973963002 .
2017-07-07 12:27:48 -04:00
Konstantin Shcheglov 711e37295a Remove the --build-summary-only-diet option.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2968403002 .
2017-07-07 09:15:48 -07:00
Samir Jindel a49dcb6bb1 Fix closure conversion in field and local initializers.
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2971293002 .
2017-07-07 17:48:38 +02:00
Konstantin Shcheglov 2c064df145 Remove visitLabelElement() and visitLocalVariableElement().
These elements are not parts of the bigger element model, so it
does not make sense to implement these visit methods.

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

Review-Url: https://codereview.chromium.org/2971253002 .
2017-07-07 08:04:59 -07:00
Erik Ernst 5c213ab929 Changed expect.dart typeAssertionsEnabled to pass strong mode tests.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2973933002 .
2017-07-07 14:24:26 +02:00
Johnni Winther e560e90f24 Fix dart2js-with-kernel test crashes
Review-Url: https://codereview.chromium.org/2970283003 .
2017-07-07 12:01:51 +02:00
Erik Ernst 3b05eb9553 Add support to dart2js for option --enable-asserts.
R=johnniwinther@google.com, sigmund@google.com, sra@google.com

Review-Url: https://codereview.chromium.org/2879153005 .
2017-07-07 10:59:09 +02:00
Johnni Winther 1c8cb51132 Assert that we don't mix K and J elements
- we did for BackendImpact, RuntimeTypesNeed, native classes.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2975433002 .
2017-07-07 10:58:59 +02:00
Johnni Winther edbc13bac6 Use index in J/KTypeVariable and fix remaining inequivalence
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2970943002 .
2017-07-07 10:30:25 +02:00
Dmitry Stefantsov e429520d05 Add timeout to possible outcomes of pkg/analyzer_cli/test/driver_test
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2965313002 .
2017-07-07 10:28:42 +02:00
Johnni Winther 2c671d6a1b Add most equivalence tests to js_model/model_test
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2969073002 .
2017-07-07 10:23:28 +02:00
Johnni Winther 78e82212bc Fix js_model/model_test
- by adding a JLocalFunction

Review-Url: https://codereview.chromium.org/2975513003 .
2017-07-07 10:15:13 +02:00
Johnni Winther 29df2fbb4f Change inference element invariants
- members must be declarations
- parameters must be implementations

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2965223002 .
2017-07-07 09:22:12 +02:00
Konstantin Shcheglov 0699a72344 Additional tests for build mode.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2968303002 .
2017-07-06 15:02:28 -07:00
Jacob MacDonald 666b8713d4 fix libraries getter
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2965283002 .
2017-07-06 14:38:28 -07:00
Konstantin Shcheglov 49da688b0b Remove ExecutableElement.labels altogether.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2972103002 .
2017-07-06 14:32:07 -07:00
Jennifer Messerly 90380dfdfa fix #27259, implement covariance checking for strong mode and DDC
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2954523002 .
2017-07-06 14:31:35 -07:00
Konstantin Shcheglov 956b9ce96b Split driver_test main() into 4 tests methods.
This is not how I would ideally prefer to write tests, but a bit better.

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

Review-Url: https://codereview.chromium.org/2967413002 .
2017-07-06 14:12:45 -07:00
Emily Fortuna f934f93758 Reapply "Added for-loop variable tracking and regular closures/initializers captured variable tracking."
This reverts commit b6671a0e3f.

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2964783002 .
2017-07-06 14:09:54 -07:00
Paul Berry b38e4d9a70 Create more synthetic kernel objects.
This CL creates synthetic kernel objects for two additional
BodyBuilder corner cases:

- The synthetic "throw" expression created when code attempts to
  construct an abstract class.

- The "throw" expression created when code attempts to assign to a
  read-only expression.

With this change, we now create a KernelComplexAssignment object for
all assignments; this has allowed me to streamline the code for
creating assignments slightly.

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

Review-Url: https://codereview.chromium.org/2972873002 .
2017-07-06 13:51:36 -07:00
Paul Berry 9a669557d7 Remove code for computing summaries based on the Fasta parser.
This code was never completed, and since then we've decided to do
something different: summaries for the new front end will be based on
kernel format rather than analyzer summary format.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2972093002 .
2017-07-06 13:42:54 -07:00
Devon Carew a2e9519279 Make exception reporting best effort.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2965263002 .
2017-07-06 13:36:28 -07:00
Jennifer Messerly 79cace0848 fix #29028, understand promoted type parameters
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2969373002 .
2017-07-06 13:16:23 -07:00
Jacob MacDonald 7c1e0bea36 add reload to dart_library
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2970283002 .
2017-07-06 13:16:14 -07:00
Brian Wilkerson 0c775ae412 Guard against an AST node with no end token (issue 30089)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2974533002 .
2017-07-06 12:51:23 -07:00
Konstantin Shcheglov ee4a09faea Fix for element_search.dart import in analysis_server.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975473002 .
2017-07-06 12:38:56 -07:00
Brian Wilkerson e454986288 Add code to run more tests from test_all
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2968233002 .
2017-07-06 12:24:01 -07:00
Paul Berry d8a6cfa4c1 Fix greatest/least closure computation when there are multiple ?s.
Also add both a unit test and a strong mode inference test case.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2965123002 .
2017-07-06 12:13:07 -07:00
danrubel 76779e720d fix fasta scanner comment processing
fixes python tools/test.py -m release -c dart2analyzer -r none -a x64 --host-checked language/illegal_declaration_test/01

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2973073003 .
2017-07-06 15:08:08 -04:00
Konstantin Shcheglov 19265a82b4 Move findElementsByName() into shared analyzer/element_search.dart file.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2965133003 .
2017-07-06 11:51:17 -07:00
Devon Carew ba625804b7 Tweaks to the profiling diagnostics page.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2966383002 .
2017-07-06 11:47:26 -07:00
Konstantin Shcheglov 4f7a4f443d Remove ExecutableElement.labels usages in tests.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2974513002 .
2017-07-06 11:44:32 -07:00
Brian Wilkerson 0484f28335 Initial documentation for the plugin package
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2973753003 .
2017-07-06 11:37:52 -07:00
Konstantin Shcheglov 6323bedc58 Stop depending on LabelElement(s) to be reported in visitChildren().
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2973093002 .
2017-07-06 11:28:06 -07:00
danrubel 8cca317118 fix completion test expectation for fasta scanner
Review-Url: https://codereview.chromium.org/2972063002 .
2017-07-06 14:07:49 -04:00
danrubel 4da09b06d0 enable fasta scanner in analyzer by default
* update test because fasta scanner correctly warns on 1.e+2
* fasta scanner correctly produces compile time error
    see dartbug.com/28664
    fix dartbug.com/28680
* update fasta AsciiControlCharacter error code
* enable fasta scanner in analyzer by default

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

Review-Url: https://codereview.chromium.org/2967363003 .
2017-07-06 13:35:50 -04:00
Konstantin Shcheglov 09a5d31ec4 Add fileEndOffset to Class.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2971903006 .
2017-07-06 10:28:07 -07:00