pharo-project / pharo-vm

This is the VM used by Pharo
http://pharo.org
Other
110 stars 67 forks source link

Improve Slang to not generate functions with no senders *after* doing the inlinings #786

Closed jordanmontt closed 1 month ago

jordanmontt commented 2 months ago

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:

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 https://github.com/pharo-project/pharo-vm/issues/784