commit | a11d9f17fbe38ebed6e9beae370d086c7f1daa14 | [log] [tgz] |
---|---|---|
author | Vyacheslav Egorov <vegorov@google.com> | Mon May 03 11:47:08 2021 +0000 |
committer | commit-bot@chromium.org <commit-bot@chromium.org> | Mon May 03 11:47:08 2021 +0000 |
tree | 77ffb814ca6796c47805194b3956c9c2c432ab39 | |
parent | 9ff5ac12c6efec99b8d6580c7a7154bb5e265add [diff] |
[vm] Fix race when setting identity hash codes. We might interrupt Object._objectHashCode(obj) helper to serve a vm-service request between checking for unset hash code and setting a new hash code. While serving this request we might set the hash code of [obj] (e.g. when generating heap snapshot or in Instance::PrintJSONImpl). Later Object._objectHashCode will call Object_setHash, which (on 64-bit platforms) assumes that hash field in the object header is set to 0 and uses bitwise-or to initialize it. This leads to a mismatch between hash code that the first invocation of _objectHashCode will return and the value stored in the header (because we OR non-zero value set by vm-service with a value which _objectHashCode intended to use as a hash). This CL changes Object_setHash to avoid overwriting or mangling the hash value if it was already set. We also fix hash code generation in vm-service to ensure that we only generate values which are valid Smis because the rest of the code expects that. TEST=pkg/front_end/test/incremental_compiler_leak_test.dart Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm64-try Change-Id: Ica913af8bc1cfef0ad60a9e7504531ee4de53015 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197400 Commit-Queue: Vyacheslav Egorov <vegorov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Ben Konyi <bkonyi@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.