Skip to content
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

Optimize Enum.HasFlags (). #1269

Merged
merged 1 commit into from
Mar 12, 2020
Merged

Optimize Enum.HasFlags (). #1269

merged 1 commit into from
Mar 12, 2020

Conversation

joncham
Copy link
Member

@joncham joncham commented Mar 11, 2020

Manually applied cherry-pick of mono#8428

Unity:
Release Notes:
Fixed case 1211643:
Scripting: Avoid allocation in Enum.HasFlags.

Backporting:
2020.1, 2019.4, and perhaps 2018.4

  • [jit] Decompose some CEE_BOX opcodes later to allow more optimizations.

Optimize a code sequence emitted for Enum.HasFlag () by newer csc versions.
Also mark the temporary bblocks used by decompose_vtypes () as out-of-line if
the bblock under processing is out-of-line. Mark the domainvar as volatile to avoid
optimizing it away since references to it can now be generated later from the
decomposition of OP_BOX.

  • [jit] Check that the enum types are the same.

  • [jit] Fix support for generic enums.

  • [jit] Disable the optimization with 64 bit enums on 32 bit platforms.

@joncham joncham self-assigned this Mar 11, 2020
@joshpeterson
Copy link

It looks like the the upstream changes are applied correctly.

Can you add release notes to the PR?

Should we back port this?

Manually applied cherry-pick of mono#8428

Unity: Avoid allocation in Enum.HasFlags (case 1211643)

* [jit] Decompose some CEE_BOX opcodes later to allow more optimizations.

Optimize a code sequence emitted for Enum.HasFlag () by newer csc versions.
Also mark the temporary bblocks used by decompose_vtypes () as out-of-line if
the bblock under processing is out-of-line. Mark the domainvar as volatile to avoid
optimizing it away since references to it can now be generated later from the
decomposition of OP_BOX.

* [jit] Check that the enum types are the same.

* [jit] Fix support for generic enums.

* [jit] Disable the optimization with 64 bit enums on 32 bit platforms.
@joncham joncham merged commit a68d8e7 into unity-master Mar 12, 2020
@joncham joncham deleted the unity-master-fix-1211643 branch March 12, 2020 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants