Skip to content

Refactor inliner #15528

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

Merged
merged 1 commit into from
Jun 29, 2022
Merged

Refactor inliner #15528

merged 1 commit into from
Jun 29, 2022

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 26, 2022

Inliner has become a bit of a ball of mud. It was over 2000 lines and handled several aspects that
did not have clear boundaries. This commit refactors Inliner into three units in a new package inlines.
They are:

  • Inlines.scala: The frontend for querying inline methods and issuing inline calls.
  • Inliner.scala: This unit does the main job of inlining. It transforms a call with
    a given right hand side into a list of bindings and an expansion.
  • InlineReducer.scala: A helper class used by Inlner that does rewriting of inlined code
    with the aim of optimizing it.

The three units are joined by PrepareInlineable in package inlines.

@odersky odersky force-pushed the refactor-inliner branch from 52c46d8 to a3f3c28 Compare June 26, 2022 19:20
@odersky odersky marked this pull request as ready for review June 26, 2022 19:31
@odersky odersky requested a review from nicolasstucki June 26, 2022 20:38
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

@nicolasstucki nicolasstucki enabled auto-merge June 28, 2022 15:11
Inliner has become a bit of a ball of mud. It was over 2000 lines and handled several aspects that
did not have clear boundaries. This commit refactors Inliner into three units in a new package `inlines`.
They are:

 - Inlines.scala: The frontend for querying inline methods and issuing inline calls.
 - Inliner.scala: This unit does the main job of inlining. It transforms a call with
   a given right hand side into a list of bindings and an expansion.
 - InlineReducer.scala: A helper class used by Inliner that does rewriting of inlined code
   with the aim of optimizing it.

The three units are joined by `PrepareInlineable` in package `inlines`.
@odersky odersky force-pushed the refactor-inliner branch from db594cb to c6d297b Compare June 29, 2022 10:17
@nicolasstucki nicolasstucki merged commit 6062192 into scala:main Jun 29, 2022
@nicolasstucki nicolasstucki deleted the refactor-inliner branch June 29, 2022 12:56
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.

2 participants