Commit Graph

19 Commits

Author SHA1 Message Date
Asger Feldthaus a91cae8bb4 [kernel] Remove the ?? operator from the IR and desugar it in the frontend.
Note that this affects the binary format, since a type is no longer
stored on LogicalExpression.

R=kmillikin@google.com

Review URL: https://chromereviews.googleplex.com/502297014 .
2016-09-23 12:52:00 +02:00
Peter von der Ahé 2aa32c7c54 [kernel] Allow null in super accesses.
R=asgerf@google.com

Review URL: https://chromereviews.googleplex.com/502937013 .
2016-09-07 11:40:20 +02:00
Asger Feldthaus 062cb17ec4 [kernel] Strong mode: add interface targets and resynthesis of expression types.
The interface target can now be stored on PropertyGet, PropertySet, and
MethodInvocation  If set, we know the concrete target overrides or
implements that member.

All expressions have a method getStaticType for computing its type,
which relies on interface targets for the expressions that have one.

Expressions whose type is a least upper bound have the type stored
explicitly, so the definition of least upper bounds is contained only
in the frontend.

This is a work in progress towards strong mode support, it is still
not complete.

Still missing in the frontend:
- checks from implicit downcasts
- parameter checks from covariant override or covariant generics

Implemented but not part of this CL:
- subtype tests
- IR type checker (for debugging)

BUG=
R=kmillikin@google.com

Review URL: https://chromereviews.googleplex.com/496717014 .
2016-09-06 11:40:13 +02:00
Asger Feldthaus 760baa3b55 [kernel] Make mixin and super resolution a transformation.
This makes super calls name-based (no target) and add direct calls with
both receiver and explicit target.

Super call resolution translates the name-based super calls into direct
calls after they have been cloned into the mixin application.

For JS backends, it should suffice to clone mixed-in methods that
contain super calls, but that transformation is not part of this CL.

This also adds a --target option to dartk designating the target to
which the kernel IR should be specialized.  The new transformation
is run when --target=vm.

BUG=
R=kmillikin@google.com

Review URL: https://chromereviews.googleplex.com/486537013 .
2016-08-24 16:46:50 +02:00
Asger Feldthaus 551889c3fb [kernel] Remove NormalClass, MixinClass and use just Class.
We need the ability to efficiently transform a mixin application class
into a regular class, and the separation was obstructing it.  It also
simplifies the IR a bit, although it no longer enforces the invariant
that mixin applications cannot contain fields and procedures.

The binary format is unchanged, so the separation still shows up in
there.  This ensures the CL can land without any changes to the SDK.

BUG=
R=vegorov@google.com

Review URL: https://chromereviews.googleplex.com/488407013 .
2016-08-22 12:35:18 +02:00
Asger Feldthaus 8f3c6994ef [kernel] More error handling and a bunch of fixes in the frontend.
BUG=
R=kustermann@google.com

Review URL: https://chromereviews.googleplex.com/485377014 .
2016-08-17 13:51:33 +02:00
Asger Feldthaus 4c82d6853e [kernel] Support metadata annotations on classes and members.
BUG=
R=jensj@google.com, kustermann@google.com, vegorov@google.com

Review URL: https://chromereviews.googleplex.com/481447014 .
2016-08-09 16:32:23 +02:00
Martin Kustermann c7fa95d117 [kernel] Add new [InferredValue] ast node, annotate return types, variables, fields
R=asgerf@google.com

Review URL: https://chromereviews.googleplex.com/485197013 .
2016-08-09 12:53:42 +02:00
Martin Kustermann 43116be5c5 [kernel] Implement binary format implementation for BlockExpression
R=vegorov@google.com

Review URL: https://chromereviews.googleplex.com/462427014 .
2016-08-02 12:14:50 +02:00
Asger Feldthaus 0228e8c29e [kernel] Fix deserialization of labels in nested functions.
BUG=
R=kustermann@google.com

Review URL: https://chromereviews.googleplex.com/472867013 .
2016-07-20 14:12:07 +02:00
Asger Feldthaus 241a79e11b [kernel] Preserve leading BOMs during deserialization.
BUG=#21
R=kustermann@google.com

Review URL: https://chromereviews.googleplex.com/467567013 .
2016-07-20 14:10:22 +02:00
Asger Feldthaus 10d54d7a61 [kernel] Change the default binary file extension to .dill
BUG=
R=kustermann@google.com

Review URL: https://chromereviews.googleplex.com/475637013 .
2016-07-19 17:52:33 +02:00
Martin Kustermann 1d0f534832 [kernel] Revert "Implement binary format implementation for BlockExpression"
This accidentally landed on master branch.
2016-07-08 09:22:36 +02:00
Martin Kustermann 4acb4446fd [kernel] Implement binary format implementation for BlockExpression
R=vegorov@google.com

Review URL: https://chromereviews.googleplex.com/462427014 .
2016-07-08 09:18:01 +02:00
Asger Feldthaus f13be3e4bc [kernel] Add LocalInitializer and move super calls last in initializer lists.
LocalInitializer lets us to bind temporaries to variables in the
initializer list.  We use it to ensure the arguments to super() are
evaluated at the right time.

accessors.dart and the new file super_calls.dart have been moved into
a folder "frontend" for frontend helpers that operate on Kernel IR.

BUG=
R=kustermann@google.com

Review URL: https://chromereviews.googleplex.com/457457013 .
2016-06-28 14:27:01 +02:00
Asger Feldthaus 638b4bfaff [kernel] Normalize DartTypes to 'dynamic' instead of 'null' when omitted.
For constructor bodies, we arbitrarily set the return type to 'void'.

Although there is hardly any legitimate use for the "return type" of
a constructor, this doesn't have any overhead and it simplifies the
restriction on FunctionNode.

BUG=
R=kmillikin@google.com

Review URL: https://chromereviews.googleplex.com/446827013 .
2016-06-06 15:01:51 +02:00
Asger Feldthaus 9e4e37a4ae [kernel] Add more convenience methods and tweak the behavior of toString().
Also contains a bugfix for a missing visitor call.

BUG=
R=ahe@google.com

Review URL: https://chromereviews.googleplex.com/438627013 .
2016-05-25 13:56:43 +02:00
Asger Feldthaus a117d3f8f7 [kernel] Add 'const' modifier to StaticInvocation.
This is to distinguish constant calls to an external constant factory.

This changes the binary format.
2016-04-28 12:58:42 +02:00
Asger Feldthaus 811a47d430 [kernel] Initial implementation of Dart Kernel.
Contains:
- Command-line tool
- Kernel AST
- Binary serialization
- Printing as text
- Frontend based on analyzer
- Class hierarchy and type algebra
2016-04-26 10:39:15 +02:00