commit | dd602467dd7acc33d0943cabf951f995a3d57b68 | [log] [tgz] |
---|---|---|
author | Aske Simon Christensen <askesc@google.com> | Thu Oct 19 09:45:04 2023 +0000 |
committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Oct 19 09:45:04 2023 +0000 |
tree | 9b066061baf303fe0f4f6ae7be2af5e8d5eed72c | |
parent | e285a5724831d547f03d34764c0c08de998548db [diff] |
Reland "[dart2wasm] Use a separate Wasm struct for every Dart class" This is a reland of commit 2cbb5eabca94ef7a2397bcd7844abad8ba9ca679 This removes the optimization that would reuse the Wasm struct of the superclass if no new fields were added in a class. Such reuse interferes with debugging. Binaryen performs a similar optimization in its TypeMerging pass. It seems to be doing a better job with the more precise type information provided after this change. Benchmarks show a positive trend. The change uncovered a number of latent bugs in the compiler, which are also fixed in this CL: - References to `StackTrace` objects must be typed with the representation type of `StackTrace`, rather than its struct type. - The dynamic call vtable entry and dynamic invocation forwarder functions must use `_ListBase` rather than `_List` for their parameters, since we sometimes pass growable lists to these functions. - Most covariant parameters must use the top type, since any object can be passed into such parameters via class type parameter covariance or tear-offs. The change makes us fail a number of tests with very deep class hierarchies due to the Wasm subtyping depth limit of 63. The optimization did not absolve us from this limitation. It just made us only count classes with newly added fields. The limitation is not expected to cause any problems for real code. The maximum subclassing depth that occurs in the Flute benchmark is 11. FWIW, Java has a limit of 60. The limitation is mentioned along with other limitations in https://github.com/dart-lang/sdk/issues/53703 Change-Id: I9f541049d2020934e98b2042a7d9852305f17ec1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330341 Reviewed-by: Ömer Ağacan <omersa@google.com> Commit-Queue: Ömer Ağacan <omersa@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.