Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CFE] Encapsulate int operations in separate classes for VM and JS
This refactoring achieves the following: - Collect the integer operation semantics into one place instead of having it sprinkled all over the constant evaluator with many "if (targetingJavaScript)" tests. - Avoid emitting the internal JavaScriptIntConstant node, which is serialized as normal DoubleConstant nodes, thus achieving parity between direct consumers and consumers seeing output that has been serialized. - Implement the JavaScript semantics for unsigned right shift. - Fix truncating divide with a result outside int64 range incorrectly clamping the result for JS targets. - Fix positive hex constants >= 2^63 through int.fromEnvironment producing negative values in dart2js. - Clarify in Kernel documentation how numeric constants are represented on VM vs JS targets. Change-Id: If30bb2c2c77c54eff120b611b059c2ec726c99a0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116525 Reviewed-by: Mayank Patke <fishythefish@google.com>
- Loading branch information