-
Notifications
You must be signed in to change notification settings - Fork 317
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
Conversation
There was a problem hiding this 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this exist?
There was a problem hiding this comment.
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.
engine/runtime/src/main/scala/org/enso/compiler/codegen/IrToTruffle.scala
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/scala/org/enso/compiler/codegen/IrToTruffle.scala
Show resolved
Hide resolved
engine/runtime/src/main/scala/org/enso/compiler/codegen/IrToTruffle.scala
Show resolved
Hide resolved
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
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: