Handle serialization of forwarding constructors that are defined by
forwarding constructors:
class A {}
class B {}
class C {}
class D = A with B, C;
The default constructor of D is a forwarding constructor defined by the
default constructor of its super type A+B, which itself is a forwarding
constructor. Thus, the defining constructor might itself be synthesized
and therefore serialized indirectly.
R=het@google.com
Review URL: https://codereview.chromium.org/2105183003 .
In order to make an implementation of initializing formal access in
`dart2js` available as specified in issue #26655 now, this CL changes
the scope management such that initializing formals are not in scope in
the constructor body, only in the initializer list.
This is done by introducing a new notion of scopes implemented
by `ExtensionScope`: Such a scope will extend an existing
`NestedScope` rather than adding a new nested scope to it.
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org/2059883002 .
Deserialized function do not have a [ResolvedAst] if they are not live.
The first stop towards the best solution is to skip unresolved (not live)
method, next step is to avoid registration of these methods in the
first place.
R=het@google.com
Review URL: https://codereview.chromium.org/2092913004 .
- Adds support for serialization/deserialization of ErroneousElement.
- Imports dart:core for serialized libraries.
- Fixes and tests reserialization for ResolvedAst.sourceUri
R=het@google.com
Review URL: https://codereview.chromium.org/2088233003 .
This adds the ability to serialize the whole program and compiling it
purely from serialized data. The features is added to batch-mode under
the environment flag SERIALIZED_COMPILATION.
R=het@google.com
Review URL: https://codereview.chromium.org/2086443002 .
- Serialize nativeMethodBehavior, nativeFieldLoadBehavior and nativeFieldStoreBehavior.
- Add a test for the serialization/deserialization of native data for dart:html.
R=het@google.com
Review URL: https://codereview.chromium.org/2057993003 .
Cache the value of the properties `isFromEnvironmentConstructor`,
`isIntFromEnvironmentConstructor`, `isBoolFromEnvironmentConstructor`,
and `isStringFromEnvironmentConstructor` in ConstructorElementCommon.
R=het@google.com
Review URL: https://codereview.chromium.org/2060143002 .
NativeBehavior for method calls and field load/store are now computed
during resolution and apply as part of the world impact. This prepares
for (full) serialization/deserialization of native elements.
R=het@google.com
Review URL: https://codereview.chromium.org/2045223002 .
This CL should fix the problem that arose with commit
543a51ff3e. Here's the description from
that CL:
This CL adds tests for previously uncovered elements of the semantics
and includes fixes such that the desired behavior is obtained. In
particular, an `isInitializingFormal` element may now occur in contexts
where it wasn't expected until now, and changes were made to handle it.
It is also checked that a capture of an initializing formal (in a
function literal) captures the parameter, not the field.
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org/2042293002 .
This CL adds tests for previously uncovered elements of the semantics
and includes fixes such that the desired behavior is obtained. In
particular, an `isInitializingFormal` element may now occur in contexts
where it wasn't expected until now, and changes were made to handle it.
It is also checked that a capture of an initializing formal (in a
function literal) captures the parameter, not the field.
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org/2039833002 .
The modelx implementation of getDefaultConstructor() (surprisingly)
returned constructors with only optional arguments. This CL aligns the
modelz implementation with this, adding a TODO to figure out what the
best behavior is.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2033893004 .
This CL removes the [intEnvironment], [boolEnvironment] and [stringEnvironment]
from [Compiler] and instead determine .fromEnvironment directly from the
constructor element itself.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2033383002 .
This CL fixes crashes in deferred_load when using serialized dart:core:
- resolution impacts are cached in [Resolution] for both serialized and unserialized elements.
- type variable constants (for mirrors) are computed using [ConstantExpression]s.
- LibraryElementZ.getImportsFor returns the empty list; thus still not valid for deferred access in serialized code.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2034973003 .
Previously the non-final static fields were pulled from the constant compiler.
Now, since all fields have a valid [constant] field, these fields are now computed
directly from the set of all referenced static fields.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2024873002 .
This CL is an adjusted version of CL 2025853002, adding updates to
`InitializingFormalElementZ` to match the updates applied to
`InitializingFormalElementX`, and adding the new option to the
`MessageKind.DUPLICATE_DEFINITION` example.
Description from 2025853002:
This CL adjusts the treatment of initializing formals, such that they
can be used in initializers and in constructor bodies. E.g., `x` can be
used as in `C(this.x) : y = x { var z = x + 2; }`.
It hides the new feature under the option '--initializing-formal-access'
which is used in the test 'initializing_formal_access_test.dart'.
It also adds an `example` test to `MessageKind.DUPLICATE_DEFINITION` to
verify that name clashes among initializing formals and other
parameters are detected (which was previously not the case).
Finally, it fixes a typo in a comment, `InitializingFormalParameter` ->
`InitializingFormalElement`.
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org/2029003002 .
The equivalence of unnamed mixin applications cannot be tested directly since
they are not nominal entities. In the example below two classes by the synthetic
name `S+M` are introduces. This CL adds a reference to the introducing class so
that the unnamed mixin applications can be distinguished as `S+M from C1` and
`S+M from C2`.
class S {}
class M {}
class C1 extends S with M {}
class C2 extends S with M {}
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2017903002 .