commit | 7247a1b3b7166c828a0c2e00259ec03fd737d455 | [log] [tgz] |
---|---|---|
author | Alexander Markov <alexmarkov@google.com> | Wed Apr 19 17:25:31 2023 +0000 |
committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Apr 19 17:25:31 2023 +0000 |
tree | 9746a6c37059a608c48b9c2a824809dc02474439 | |
parent | ac1bdebff74cec52ebdce08534daa08e1da503f6 [diff] |
Reland "[vm] Avoid expanding/flattening type arguments vectors in Type objects" This is a reland of commit 135443706b6d8d3d076cea99219fab569a0fc1b3 Original change's description: > [vm] Avoid expanding/flattening type arguments vectors in Type objects > > Previously, vectors of type arguments were expanded to include type > arguments corresponding to superclasses both in the instances of > generic classes and in Type objects (after type finalization). > As a result, Type objects after finalization could be recursive and > need to use extra TypeRef objects to break loops. The finalization of > types was very complex and sometimes slow. > > This change simplifies the representation of Type objects: now they > always have short type argument vectors, corresponding only to > the type parameters of their own classes (both before and after > finalization). Vectors of type arguments in the instances of generic > classes are still expanded/flattened. > > This greatly simplifies type finalization, makes Type objects > non-recursive and removes the need to create and handle excessive > TypeRefs for type arguments corresponding to superclasses, > as those type arguments are no longer included into types. > The only remaining use of TypeRefs is for bounds of type parameters. > > In order to expand/flatten type arguments, new methods Type::GetInstanceTypeArguments / Class::GetInstanceTypeArguments > are introduced. They build canonical declaration type arguments > once (for each class), and then instantiate them as needed. > > There are also simple helper methods to shrink type arguments (TypeArguments::FromInstanceTypeArguments) and expand type arguments without filling type arguments corresponding to superclasses (TypeArguments::ToInstantiatorTypeArguments). > > Time of edge case 'regress_51960_test' 15min -> 300ms. > > TEST=ci, runtime/tests/vm/dart/regress_51960_test.dart > > Fixes https://github.com/dart-lang/sdk/issues/52022 > Fixes https://github.com/dart-lang/sdk/issues/51960 > > Change-Id: I75b466b74698a33c0bb5e1dcbd29542e413812a1 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295060 > Reviewed-by: Ryan Macnak <rmacnak@google.com> > Commit-Queue: Alexander Markov <alexmarkov@google.com> TEST=runtime/tests/vm/dart/regress_b_278841863_test.dart Fixes b/278841863. Change-Id: Ib1e20055bfb26e1df0a077300c69f0bec7152480 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296300 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
Dart is:
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app.
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web.
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, and to find codelabs.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.