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 .
Make sure the 'index' field we generate corresponds to the Element
from the analyzer's model.
As it is now, this does not cause any reproducible errors since the
Element for the 'index' field is never referenced, but this will change
as we introduce interface targets in strong mode.
BUG=
R=kasperl@google.com
Review URL: https://chromereviews.googleplex.com/497607013 .
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 .
There is a new lattice point for each class, representing the values
that are subclasses of it.
To ensure that subclassing information is valued higher than subtype
information, we exploit that the ordering of lattice points determines
how the join operation chooses between ambiguous upper bounds.
BUG=
R=kustermann@google.com
Review URL: https://chromereviews.googleplex.com/488627013 .
There is a new 'call handler' meta field in the constraint system,
unfolding any number of 'call' properties on the callee until a
function value is found.
Every method invocation must now load this field to ensure the actual
function is invoked. This adds quite a bit of overhead, but in strong
mode we should be able to avoid the extra load in practice.
BUG=
R=vegorov@google.com
Review URL: https://chromereviews.googleplex.com/485117015 .
Allocation of a value and bitmask input are two different constraints
in the constraint system. However, for all values other than 'null',
there should be exactly one bitmask input and one allocation constraint.
The bitmask input was omitted in some cases in the handling of
externals, which is fixed in this CL.
BUG=
R=kustermann@google.com
Review URL: https://chromereviews.googleplex.com/481187013 .
This adds a notion of bitmasks to the constraint system,
which will be propagated by the solver, and joined using
bitwise OR. The solver does not care what the bits mean.
These bits propagate nullability and other values that we
care to preserve when a good base class could not be found.
This also adds an interface in front of type propagation
that exposes the inferred types in an accessible manner.
BUG=
R=kustermann@google.com
Review URL: https://chromereviews.googleplex.com/483887013 .
Instance members are now cloned for every class that inherits it.
The constraint system now explicitly requires all values to be
created using `newValue()`.
There is now a notion of "unions" for representing sets of values.
For class values, unions correspond to types. For function values,
unions are based on overriding and method names.
The solver's internal map of type (Value,Field) -> Value denoting
the value of a given field has been removed.
The builder must instead register store and load locations for
every valid (Value,Field) pair. Dynamic stores assign into the
store location, and dynamic loads take the value from the load
location.
Final fields have no store location, so they cannot be polluted
by dynamic stores.
R=vegorov@google.com
Review URL: https://chromereviews.googleplex.com/455987013 .
Transformer lifts try/catch auxiliary variables that need to survive across
yield points into the context.
Drive by fix: we were calling asyncThenWrapper to create an :async_op_error
callback by mistake.
R=kustermann@google.com
BUG=
Review URL: https://chromereviews.googleplex.com/466247013 .
- Rewrite all expressions in functions, not only expression-statements.
- Inject :await_ctx_var and :await_jump_var into the wrapper.
- Don't use transformed expression directly as part of completer.complete call.
BUG=
R=kustermann@google.com
Review URL: https://chromereviews.googleplex.com/468717014 .
This transformer is responsible for lifting subexpression into temporary variables preserved across yield points.
To maintain AST validity I introduced an expression that can contain a block of statements inside called BlockExpression.
BUG=
R=kustermann@google.com
Review URL: https://chromereviews.googleplex.com/458577014 .