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 Slang to not generate functions with no senders *after* doing the inlinings #786

Closed
jordanmontt opened this issue Apr 30, 2024 · 0 comments · Fixed by #798
Closed
Labels

Comments

@jordanmontt
Copy link
Member

jordanmontt commented Apr 30, 2024

Slang translates all methods that have at least one sender to C. But there is a problem. Let's illustrate it in the following scenario:

  • Slang detects all Pharo methods that have at least one sender. Those methods will be translated to C. (no problem until here)
  • After, Slangs inlines several methods according to an heuristic.
  • Now, after the inlining there are methods that no longer have any senders (because they were inlined). Those methods will be generated as well (here is the problem because slang is generating dead code).

Here there is a concrete example:

The Pharo method CogAbstractInstruction>>#availableFloatRegisterOrNoneFor: has only one sender. When Slang start the generation process it inlines this method to its sender. SoCogAbstractInstruction>>#availableFloatRegisterOrNoneFor: gets inlined and then it has NO senders. But, Slang translates that method to C. This is wrong as the method became with no senders.

Possible solution
One solution can be to improve the slang algorithm to detect the methods without senders AFTER the inlining happens, not before.

This issue correlates with #784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant