This PR hooks into the existing Truffle pass to provide non-indexed names for Truffle languages that pack their arguments in a consistent format. I've only added a TruffleRuby implementation in this pass, but the machinery is there for other languages.
The graphs are fairly large, so I'm using screenshots rather than mermaid here. All of the translated LoadIndexed nodes that normally get turned into T(<int>) now get turned into T(<packed_arg_name>). If a language doesn't have a translator implementation, the previous T(<int>) format is used.
The mechanism to detect the language is a fuzzy match because the graph data doesn't directly indicate the language. I've used a breadth-first search following out edges from the LoadIndexed node. If there's a more reliable search algorithm, I'm happy to adjust. I'm also not heavily invested in any of the names here, so if "translator" is too broad, please suggest an alternative and I'll update the PR.
This PR hooks into the existing Truffle pass to provide non-indexed names for Truffle languages that pack their arguments in a consistent format. I've only added a TruffleRuby implementation in this pass, but the machinery is there for other languages.
The graphs are fairly large, so I'm using screenshots rather than mermaid here. All of the translated
LoadIndexed
nodes that normally get turned intoT(<int>)
now get turned intoT(<packed_arg_name>)
. If a language doesn't have a translator implementation, the previousT(<int>)
format is used.The mechanism to detect the language is a fuzzy match because the graph data doesn't directly indicate the language. I've used a breadth-first search following out edges from the
LoadIndexed
node. If there's a more reliable search algorithm, I'm happy to adjust. I'm also not heavily invested in any of the names here, so if "translator" is too broad, please suggest an alternative and I'll update the PR.Before
After