New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unary minus as literal instead of instance call #35316

Open
dcharkes opened this Issue Dec 4, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@dcharkes
Contributor

dcharkes commented Dec 4, 2018

Code with many unary minuses takes very long to compile #35297.

And these unary minuses as instance calls also creates problems with encoding offsets in ICData #35242.

The frontend should regards these minuses as part of the integer literal, rather than a unary operation.

@lrhn

This comment has been minimized.

Member

lrhn commented Dec 4, 2018

The back-ends should be able to recognize the pattern unary minus on integer literal and make it a compile-time constant themselves, it's basic constant folding. That should at least avoid the calls, without needing to change the input representation (which reflects the source code, so removing it would be throwing away information).

@dcharkes

This comment has been minimized.

Contributor

dcharkes commented Dec 4, 2018

dart-bot pushed a commit that referenced this issue Dec 4, 2018

[gardening] Mark LibTest/collection/ListMixin/ListMixin_class_A01_t02…
… as ExtraSlow

Issue #35316

Change-Id: Iac3c038f9f447e52dd420ad1158cdf153aa99f3e
Reviewed-on: https://dart-review.googlesource.com/c/85943
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment