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 .
Optimize parser and make it recognize a class of URIs that don't need extra
handling: no escapes, no funny characters, already (nearly or completely)
normalized.
Have a class specifically for those URIs which retains the original
input string without having allocate any further strings.
R=floitsch@google.com
Committed: 00090a0c72
Review URL: https://codereview.chromium.org/2086613003 .
Optimize parser and make it recognize a class of URIs that don't need extra
handling: no escapes, no funny characters, already (nearly or completely)
normalized.
Have a class specifically for those URIs which retains the original
input string without having allocate any further strings.
R=floitsch@google.com
Review URL: https://codereview.chromium.org/2086613003.
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 .
The test is attempting to bind 2 different sockets to the *same* port:
* socket 1: (IPv4, port)
* socket 2: (IPv6, port)
Between making socket 1 and socket 2 there can be other processes on the host
grabbing a (IPvX, port) combination thereby making the binding of socket 2 fail.
We will now retry the test a few times which will hopefully make the flakiness
go away.
BUG=https://github.com/dart-lang/sdk/issues/26716R=whesse@google.com
Review URL: https://codereview.chromium.org/2105553003 .
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 .
When parsing a field initializer expression or mixin fields,
the current_class must be the mixin application class, not the
mixin class. This is necessary so that type arguments are
resolved in the correct scope class.
Dart2js fails the new regression test language/regress_18713.
Filed issue #26743.
BUG=18713
R=regis@google.com
Review URL: https://codereview.chromium.org/2085003002 .
- 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 .
This reverts commit 199806da03.
That commit failed because tools/bots/compiler.py is being ignored, and test.py is invoked based on recipes not included in this repository.
TBR
Review URL: https://codereview.chromium.org/2065053003 .
On Windows, the OS provides a full name for the time zone
rather than an abbreviation. Further the string may
contain non-ASCII characters, so a conversion is
necessary. This CL updates the API docs to match the
actual behavior, and fixes the string conversion problem.
fixes#17085R=asiva@google.com
Review URL: https://codereview.chromium.org/2069783002 .
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 .
When optimistically inlining is-checks and as-casts, we have to guard
again repeated speculative attempts.
Also, add result cid information for recognized factories.
BUG=#26607
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2035073002 .
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 .
Adds Dart_DefaultCanonicalizeUrl() to the dart embedding api.
Motivation:
As we try to get source reloading working for the standalone embedder, things get simpler if an isolate doesn't run Dart code while it is loading Dart code. We intend to solve this by moving the embedder tag handler calls to the service isolate. But making a blocking rpc into the service isolate whenever a url needs to be canonicalized during parsing seems like it would slow things down and make things complicated. By moving canonicalization into C++, we avoid this.
R=ahe@google.com, fschneider@google.com, johnmccutchan@google.com
Review URL: https://codereview.chromium.org/2011543002 .
In switch statements, ‘continue L’ jumps can refer to a label
that the compiler hasn’t seen yet. The label is tentatively
to be in the innermost switch statement, but may later
be moved to an outer switch statement. The compiler must
make sure that the correct finally blocks are inlined in front
of these jumps.
BUG=26577, 25310
R=regis@google.com
Review URL: https://codereview.chromium.org/2030763002 .
This reinserts the native spec-string interpretation.
The CL https://codereview.chromium.org/2004833003/ changed the interpretation of `List` from `List<E>` to `List<dynamic>` causing these native classes to be added through subtyping:
NativeUint8List <: List
NativeUint8ClampedList <: List
NativeUint32List <: List
NativeUint16List <: List
NativeInt8List <: List
NativeInt32List <: List
NativeInt16List <: List
NativeFloat64List <: List
NativeFloat32List <: List
NativeTypedArrayOfInt <: List
NativeTypedArrayOfDouble <: List
R=sra@google.com
Committed: 565b30123c
Reverted: fa5b98126c
Review URL: https://codereview.chromium.org/2021723003 .
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 .
This reinserts the native spec-string interpretation.
The CL https://codereview.chromium.org/2004833003/ changed the interpretation of `List` from `List<E>` to `List<dynamic>` causing these native classes to be added through subtyping:
NativeUint8List <: List
NativeUint8ClampedList <: List
NativeUint32List <: List
NativeUint16List <: List
NativeInt8List <: List
NativeInt32List <: List
NativeInt16List <: List
NativeFloat64List <: List
NativeFloat32List <: List
NativeTypedArrayOfInt <: List
NativeTypedArrayOfDouble <: List
R=sra@google.com
Review URL: https://codereview.chromium.org/2021723003 .
In f54e667773 I attempted to work around
analyzer flakiness in
co19/Language/Libraries_and_Scripts/Scripts/syntax_t11, but I
accidentally applied the change to
Language/Mixins/Mixin_Application/syntax_t11 instead.
This CL applies the workaround to the correct instance of syntax_t11.
TBR=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/2022343002 .
These tests assert that 'yield*' expressions in non-generator functions
should be a compile-time error. But the spec does not have yield as a
reserved word, so a statement like 'yield* e;' can be interpreted as an
expression statement multiplying the variable 'yield' by e. This is how
dart2js and the VM interpret yield outside of generator functions.
See the discussion in issue #25495R=sigmund@google.com
Review URL: https://codereview.chromium.org/2024203002 .
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/2025853002 .
Fourth(!) attempt. This CL fixes another instance where parsing a nested function modifies the parser state of the function that is being compiled.
When a local function gets compiled the second time, constant
expressions may not be parsed again, since the constant value
is found in the cache. If the expression refers to an outer
variable, it does not get captured correctly.
Fix: instead of parsing a local function repeatedly to capture
outer variables, use the local function’s context scope to mark
outer variables as captured. This fixes the bug, and makes the
compiler more efficient as well.
BUG= 26453
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2010283004 .
Also exclude more environments from running the test, restricting it to *only* the stand-alone VM and the analyzer.
Review URL: https://codereview.chromium.org/2015193002 .