Skip to content
New issue

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

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

Already on GitHub? # to your account

Add runtime.TupleMirror to avoid anonymous classes for mirrors of tuples #15404

Merged
merged 4 commits into from
Jun 9, 2022

Conversation

bishabosha
Copy link
Member

@bishabosha bishabosha commented Jun 8, 2022

adds the runtime.TupleMirror class as a way to decrease bytecode generation for mirrors of Tuples. Also adapts mirror synthesis to use TupleMirror for mirrors of tuples.

Follow up work is to enable Synthesizer to accept tuples of arity > 22

fixes #15399

bishabosha and others added 2 commits June 8, 2022 19:44
Co-authored-by: Jamie Thompson <bishbashboshjt@gmail.com>
Co-authored-by: Nicolas Stucki <nicolas.stucki@gmail.com>
@bishabosha bishabosha added the needs-minor-release This PR cannot be merged until the next minor release label Jun 8, 2022
@bishabosha bishabosha requested a review from nicolasstucki June 8, 2022 17:52
@nicolasstucki nicolasstucki self-requested a review June 8, 2022 18:29
Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise looks good.

Nice simplifications in the Synthesizer logic.

@bishabosha bishabosha force-pushed the add-runtime-tuplemirror branch from 136dcc4 to a2c15a3 Compare June 9, 2022 12:03
@bishabosha bishabosha requested a review from nicolasstucki June 9, 2022 12:04
Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

@bishabosha bishabosha force-pushed the add-runtime-tuplemirror branch from a2c15a3 to 368673d Compare June 9, 2022 13:19
@bishabosha bishabosha added this to the 3.2.0-RC1 milestone Jun 9, 2022
@bishabosha bishabosha enabled auto-merge June 9, 2022 14:08
@bishabosha bishabosha added the release-notes Should be mentioned in the release notes label Jun 9, 2022
@bishabosha bishabosha merged commit 47fa175 into scala:main Jun 9, 2022
@bishabosha bishabosha deleted the add-runtime-tuplemirror branch June 9, 2022 14:49
@michelou
Copy link
Contributor

michelou commented Jun 9, 2022

@bishabosha 👍

@joroKr21
Copy link
Member

What do you think about adding a runtime constructor for anonymous mirrors that takes a function? Then we could reduce the amount of generated code to a single lambda which doesn't need an anonymous class.

@Kordyjan Kordyjan modified the milestones: 3.2.0-RC1, 3.2.0 Aug 1, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area:typeclass-derivation needs-minor-release This PR cannot be merged until the next minor release release-notes Should be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing arity check in fromProduct for Tuples
5 participants