Commit Graph

4835 Commits

Author SHA1 Message Date
Johnni Winther cdb0a6a84c Remove KernelScopeInfo.localsMap
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2985683002 .
2017-07-28 14:35:24 +02:00
Johnni Winther 6292f410d1 Move .getLocalFunction from KernelToElementMap to KernelToLocalsMap
- and to KernelToElementMapForImpact
+ Remove CapturedScopeBuilder._kernelToElementMap
+ Remove JLocalFunction

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2981423003 .
2017-07-28 14:13:29 +02:00
Johnni Winther 049019bc03 Remove _nodeToEntity and _nodeToThisLocal from CapturedScopeBuilder
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2985663002 .
2017-07-28 13:48:46 +02:00
Johnni Winther e5f5b95961 Fix and assert getLocalFunction invariant
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2984783002 .
2017-07-28 13:36:52 +02:00
Stephen Adams 0ca1d23eb0 Remove assert that prevents nested scopes closing over save variable
R=efortuna@google.com

BUG=

Review-Url: https://codereview.chromium.org/2989043002 .
2017-07-27 15:48:05 -07:00
Emily Fortuna 4bcde03ed9 Fix analyzer error in dart2js modelx. We will need to watch for perf regressions.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2984253002 .
2017-07-26 12:51:55 -07:00
Stephen Adams af56ba7b19 dart2js-kernel: Recognize some List constructors.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2984183002 .
2017-07-25 16:31:19 -07:00
Sigmund Cherem 09009ad6e9 Fix bots: partial support for --use-sdk (assumes
out/ReleaseX64/patched_dart2js_sdk exists), add .status entries for 'minified'

R=sra@google.com

Review-Url: https://codereview.chromium.org/2991683002 .
2017-07-25 09:13:19 -07:00
Sigmund Cherem 09ff1b56f7 Add support for compiling Dart via the FE in dart2js.
This also:
 - replaces --use-kernel with --use-kernel-in-ssa
 - replaces --load-dill with --use-kernel
 - makes --use-kernel support both: compiling from .dill or from .dart
 - change the default of other options that are currently disabled when --use-kernel is on.
 - adds .status lines for all tests in language/corelib/dart2js_extra/dart2js_native

R=efortuna@google.com

 Note: this CL is built on top of another change
 (https://codereview.chromium.org/2981403002/) that adds preview_dart_2 to
 test.dart
Review-Url: https://codereview.chromium.org/2989453002 .
2017-07-24 17:10:11 -07:00
Sigmund Cherem 86e18de920 Additional fixes for invalid overrides in dart2js
Together with Jen's fix for checking mixin, these are the remaining cases in
dart2js that we need to silence strong mode errors.

For modelz - the plan is to eventually delete this code, so ignoring makes sense
here. For the namer, Stephen believes we should get rid of the special
subclasses, for now I'm just supressing the error.

R=johhniwinther@google.com, sra@google.com
CC=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2987783002 .
2017-07-24 16:25:28 -07: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
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 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
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
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
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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