function cloning for mixins, signature building, etc...).
Rename --generic-method-semantics flag to --reify-generic-functions (still not
working and disabled by default).
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2835513002 .
Add function_type_arguments field in closure instances.
Lots of other smaller changes, also related to generic function semantics.
This is still work in progress, with a change of direction in the design:
The type argument vector of a generic function will be prepended with the type
arguments of enclosing generic functions. The re-allocation and concatenation
will be done in nested generic function's prolog. This will greatly simplify
instantiation of types at run time without having to search the context for
parent function's type arguments. However, a closure instance now requires an
additional field. On the other hand, type parameters do not require a
parent_level field anymore.
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2818273002 .
With generic methods, uninstantiated types will require 2 instantiators, one
reflecting the class type arguments (as of today) and one reflecting the
function type arguments (new).
This is work in progress and the second instantiator is always null for now.
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2799373002 .
Related to #29145.
Fixes#29199.
1. Missing source positions in async and async* functions (synthetic code)
2. Added unit tests for issues #28980 and added asyns stack trace testing flags to existing test.
3. Handle uninitialized Completer object when collecting async stack traces.
Still missing is the correct calculation of context levels in ActivationFrame::ContextLevel. This is planned for a separate CL.
R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2786503003 .
AssertAssignableInstr::Canonicalize was too restrictive: it can instantiate the
type even if the instantiator is null.
Do not allocate empty TypeArguments handles, but use the common one instead.
R=fschneider@google.com
Review-Url: https://codereview.chromium.org/2759393005 .
in bound checkings of its owner class (fixes#29025).
Add regression test and mark as failing for the analyzer (issue filed).
Add missing trail argument in 2 locations (not related to the fixed issue).
Cleanup: Remove ClassFinalizer::kCanonicalizeWellFormed which is not treated
differently than ClassFinalizer::kCanonicalize anymore after earlier changes in
the spec on how to handle malformed types.
R=asiva@google.com, hausner@google.com
Review-Url: https://codereview.chromium.org/2755723003 .
Original CL: https://codereview.chromium.org/2692803006/
Original commit message:
Tracking the awaiter return call stack:
- [x] Each async function closure now knows who is awaiting on their
return. This is effectively the asynchronous equivalent of the 'frame pointer'.
- [x] Each async* function closure now knows how is listening on their
stream. This is effectively the asynchronous equivalent of the 'frame pointer'.
Detecting uncaught exceptions in async functions:
- [x] Code object keeps a map from :await_jump_var to token position
- [x] Exception Handlers keep track if they are generated (as part of compilation) or directly from user code
- [x] Debugger maps :await_jump_var to a specific try index
R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2725623003 .
Tracking the awaiter return call stack:
- [x] Each async function closure now knows who is awaiting on their
return. This is effectively the asynchronous equivalent of the 'frame pointer'.
- [x] Each async* function closure now knows how is listening on their
stream. This is effectively the asynchronous equivalent of the 'frame pointer'.
Detecting uncaught exceptions in async functions:
- [x] Code object keeps a map from :await_jump_var to token position
- [x] Exception Handlers keep track if they are generated (as part of compilation) or directly from user code
- [x] Debugger maps :await_jump_var to a specific try index
Fixes#27242R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2692803006 .
Simplify handling of closures as deferred objects.
The name "type_arguments_" is confusing, because class Closure is not generic.
Class Closure was forcefully made (kinda) generic by setting its
type_arguments_field_offset_in_words_ field to a valid value, so that the
type_arguments_ field in closure instances could be accessed similarly as in
generic instances. With generic functions, closures will potentially have more
than one instantiator and the name type_arguments_ becomes nonsensical.
R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2719603002 .
This CL improves the stack traces that accompany exceptions. Whenever an
async function is entered, we remember how we got there. This is similar
in spirit to package:stack_trace but the implementation is more efficient
and memory usage can be more easily reasoned about.
Tracking causal stack traces:
- [x] Upon entry to an async function, capture the synchronous stack trace prefix and store it into the closure.
- [x] Upon entry to an async* function, capture the synchronous stack trace prefix and store it into the closure.
- [x] Before returning from an async function, clear the Thread's asynchronous stack trace.
- [x] After resuming an async function, load the sychronous stack trace prefix into the Thread.
- [x] Filter stack traces to remove async machinery.
Service protocol changes:
- [x] Send causal async stack trace.
Observatory changes:
- [x] Display causal async stack trace below async functions.
Fixes https://github.com/dart-lang/sdk/issues/27661R=asiva@google.com, rmacnak@google.com
Comparisons: https://docs.google.com/a/google.com/document/d/10r6jEqr8OCiDZ4y9SYU_uOimcHiOGAZMly2ghTErALI/edit?usp=sharing
Review-Url: https://codereview.chromium.org/2646443005 .
When referring to constants via a deferred prefix in an await expression
the transformation must make sure that the generated code before and after
the deferred load agree on the number of captured variables. (i.e. the number
of await-temp variables introduced by the await-transformer is the same)
This CL uses a temporary in the case of compile-time constants, because before
the deferred load, a reference lib.C is translated into a static getter which
also requires a temporary.
Fixes#28678R=hausner@google.com
Review-Url: https://codereview.chromium.org/2683973002 .
Instead of “unresolved call to super constructor”, adapt error
message if the super class contains a factory constructor with
the same name.
Also add this error message clarification to constructor redirection
clauses.
BUG=#11202
R=fschneider@google.com
Review-Url: https://codereview.chromium.org/2673423003 .
parameters, whereas the class finalizer resolves all other type names and
performs finalization and canonicalization. This allows to remove a lot of
duplicated code between parser and class finalizer.
R=hausner@google.com
Review-Url: https://codereview.chromium.org/2673093003 .
The call in _evaluationAssertion becomes megamorphic and this is
showing up on Flutter's profile. Avoid the call becoming megamorphic
by inlining the body at the AST level.
BUG=
R=hausner@google.com
Review-Url: https://codereview.chromium.org/2655803007 .
For Dart 1.5, the VM ignores the annotation. It is just consumed by the parser, but has otherwise no effect. Errors are reported on illegal covariant declarations.
BUG=#28166
R=regis@google.com
Review-Url: https://codereview.chromium.org/2625823004 .
In some cases when loading a deferred library twice, the VM would crash/throw.
Make sure we generate the correct static NoSuchMethod error when referring to
a deferred library that is not loaded yet.
Fixes#28278.
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2618823002 .