commit | 54dbb4224424686b378a1036abe4b8e75ea881df | [log] [tgz] |
---|---|---|
author | Ömer Sinan Ağacan <omersa@google.com> | Tue Oct 18 07:06:46 2022 +0000 |
committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Oct 18 07:06:46 2022 +0000 |
tree | 194d66c1a6109d080c9e6ac40488219fac54f4c6 | |
parent | 770c9d77c59fec5c538387901d9884f0fd45fda5 [diff] |
[dart2wasm] Fix truncating int div code gen Wasm `i64.div_s` result[1] is undefined when the division result is 2^63, and v8 traps with "divide result unrepresentable". This change follows the checks in native runtime (in `Integer::ArithmeticOp`) to handle overflowing in `-9223372036854775808 ~/ -1`: case Token::kTRUNCDIV: if ((left_value == Mint::kMinValue) && (right_value == -1)) { return Integer::New(Mint::kMinValue, space); } return Integer::New(left_value / right_value, space); These tests now pass: - corelib/integer_parsed_div_rem_vm_test/01 - language/operator/left_shift_test language/operator/arithmetic_test used to fail with the same trap, but it now fails because of #50228. [1]: https://webassembly.github.io/spec/core/exec/numerics.html#op-idiv-s Change-Id: Ib43ac7a53d5cf96c01b016f73240da533ef84516 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264460 Commit-Queue: Ömer Ağacan <omersa@google.com> Reviewed-by: Joshua Litt <joshualitt@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.