| commit | 6ac8ad9881a3128972c6c94557543b09de0166e4 | [log] [tgz] |
|---|---|---|
| author | Martin Kustermann <kustermann@google.com> | Tue Sep 07 14:16:52 2021 +0000 |
| committer | commit-bot@chromium.org <commit-bot@chromium.org> | Tue Sep 07 14:16:52 2021 +0000 |
| tree | 9043328dcf8d49a77d8815be5fe114b62a35ae32 | |
| parent | 258487cafdfee1ef9d04ca8caf0fc3c09ef6dda4 [diff] |
[vm/concurrency] Ensure unreachable new space objects use `null` filler objects instead of 0 Smis The new space allocated objects created by transitive object copy are themselves always GC safe. If an invalid object is encountered and the copy is aborted, there will be unreachable, allocated new space objects left, that the next scavenge will reclaim. If an object in the heap is unreachable it shouldn't really be touched (not even by GC). Only heap iterations can possibly look at them. Turns out that hot reload performs heap iterations without collecting all garbage first. That means it can encounter such an unreachable object. Hot reload assumes that it can (for instances of generic classes) always get a valid TypeArguments vector (or null) - though it encountered 0 instead. So there's several solutions: * Make Hot-Reload only work on actually alive objects. * Make the unreachable objects have null instead of 0 in them We'll choose the latter and use the existing Object::InitializeObject() helper method (although it will be slower than the existing implementation). Fixes https://github.com/dart-lang/sdk/issues/47131 TEST=Fixes vm/dart_2/isolates/closures_without_captured_variables_test in hot-reload test mode. Change-Id: I15d48473f0ce4a856316fe24166e81ebc87ccdbd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212585 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Martin Kustermann <kustermann@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.