-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dart2js
Description
This is a general tracking issue for new rti implementation tasks.
Testing:
- Run modular and some unit tests with new-rti
Correctness:
- Full function type parsing and subtyping
- Full generic function type parsing
- Full generic function type subtyping
- Full generic function type
toString() - Pass new rti for element type to generator bodies
- Access new rti in forwarding stubs
- Generic function instantiation - creating and calling
- Generic function instantiation - closure type and subtyping
- Reify erased type variables correctly
Basic performance:
- Lower is-tests for simple types
- Lower as-checks for simple types
- Group multiple type parameters into tuples ([dart2js] Pass type arguments as tuples or useful interface type #47484)
- Consistent ordering of environment accesses (becomes trivial when parameters grouped)
- Reduction of class type variables (UnmodifableListBase.E --> ListMixin.E)
- Not worth implementing; see https://dart-review.googlesource.com/c/sdk/+/120745
- Closure type lookup
- Accelerate lookup of closure type by installing property
- Remove closure classes from supertypes data
- Lower
H._instanceType(x)tox.$tiin more cases
Other optimizations:
- Make more classes have their type available through
.$ti. Getter for$tion Object, Closure, BoundClosure, StaticClosure. Object uses dynamic constructor's name, Closure could use cached version. THIS SEEMS TO BE VERY DIFFICULT. Defining a getter forObject.prototype.$tiseems to prevent using$tias a normal property in subclasses. We could work around this by using a different name, but that throws out what we are looking for - a single megamorphic dispatch to most types. The 'different name' is just alternate syntax forH._instanceType(x). - Is there some more direct way to cache the constructor name version?
- Reduce
$ti._eval$1("1")-->$ti._rest[0] - Reduce
$ti._rest[0]-->$ti._precomputed1. - Use
instanceof
The current general-is-test works (and fails) until instances of the class are created, which implies that the constructor is loaded.- Install
instanceofpredicates on Rti objects for types whereinstanceofworks, and type flows to is-check. This should be done in the deferred unit that declares the class constructor.findType("Foo")._is=function(o){return o instanceof X.Foo} - Generate
instanceofdirectly like for old Rti. This would be restricted to code where the constructor is available, e.g. the class constructor is in the same deferred unit as the usage (in old Rti this is OK because the class constructor is the type).
- Install
-
x as T-->xunder branch wherex is Tis true. Old rti does this, relying on GVN ofxandT,
Cleanup:
- Remove recognizing
"dynamic"as a recipe, use only@. - Remove
encodeRecipeWithVariablesReplaceByAny - remove
_Type.==, remove the workaround in kernel_impact.dart#L876 and update CFE missing compile time error: const keys/switch cases should not implement == #32557
JS interop fix:
- Cleanup
JSArray<dynamic>-->JSArray<any>.
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dart2js