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

Delay conversion of Truffle function body nodes until the function is invoked #3429

Merged
merged 13 commits into from
May 5, 2022

Conversation

JaroslavTulach
Copy link
Member

Pull Request Description

Most of the functions in the standard library aren't gonna be invoked during particular program execution. It makes no sense to build their Truffle AST for the functions that are not executing. Let's delay the construction of the tree until a function is first executed.

Checklist

Please include the following checklist in your PR:

  • [ x ] All code conforms to the Scala, Java, and Rust style guides.
  • All code has been tested:
    • [ x ] Unit tests have been written where possible.

@JaroslavTulach JaroslavTulach self-assigned this May 4, 2022
@JaroslavTulach JaroslavTulach requested a review from 4e6 as a code owner May 4, 2022 10:09
Copy link
Contributor

@kustosz kustosz left a comment

Choose a reason for hiding this comment

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

I like this! Some suggestions left inline :)

@@ -30,6 +30,10 @@ public static BlockNode build(ExpressionNode[] expressions, ExpressionNode retur
return new BlockNode(expressions, returnExpr);
}

public static BlockNode buildSilent(ExpressionNode[] expressions, ExpressionNode returnExpr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this exist?

Copy link
Member Author

Choose a reason for hiding this comment

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

This one is used from AtomConstructor.buildConstructorFunction. Those functions are usually quite small - not sure it makes sense to make them lazy.

@mwu-tow mwu-tow merged commit 3ab2c8f into develop May 5, 2022
@mwu-tow mwu-tow deleted the wip/jtulach/DelayTruffleNodes-182024911 branch May 5, 2022 10:53
hubertp added a commit that referenced this pull request May 9, 2022
hubertp added a commit that referenced this pull request May 9, 2022
@hubertp hubertp mentioned this pull request May 9, 2022
6 tasks
hubertp added a commit that referenced this pull request May 9, 2022
Patch provided by Jaroslav, appears to fix local issues with inifite loop
introduced in #3429.
This renders #3439 obsolete.
mwu-tow pushed a commit that referenced this pull request May 9, 2022
Patch provided by Jaroslav, appears to fix local issues with inifite loop
introduced in #3429.

### Important Notes

This renders #3439 obsolete. Related to https://www.pivotaltracker.com/n/projects/2539304/stories/182024911
@JaroslavTulach JaroslavTulach mentioned this pull request Aug 23, 2022
4 tasks
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.

None yet

4 participants