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

Improve inlining of <| on (GraalVM EE) #6384

Merged
merged 6 commits into from
Apr 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clone each builtin before use to speed cascade of <| up
JaroslavTulach committed Apr 24, 2023
commit 150cc85cc797f1c1d2a38eaf0f2d1e1bda77ed0c
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ protected BuiltinRootNode(EnsoLanguage language) {
* @return new node to use to call this builtin
*/
public DirectCallNode createDirectCallNode() {
return DirectCallNode.create(getCallTarget());
return DirectCallNode.create(cloneUninitialized().getCallTarget());
Copy link
Member Author

Choose a reason for hiding this comment

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

Cloning each BuiltinRootNode before use - builtins are lightweight and cloning helps to overcome Truffle recursive inlining limit.

Builtins that don't require VirtualFrame in their method signature are explicitly inlined by #6255 (comment) - those that require VirtualFrame are "cloned" before each use. That makes Truffle believe that each call into the builtin is a call the different function.

Such a cloning is not as effective direct inlining, but certainly more effective than giving up on inlining completely due to recursive limit for inlining.

}

/**