First off, a correction: liz found that the trait_mod:<is> candidate for "inlinable" is actually used internally.
Here's a link to the source to get you started, it's got a good comment at the start about how rakudo's own inliner works: https://github.com/rakudo/rakudo/blob/master/src/Perl6/Actions.nqp#L4193 On top of that, there's MoarVM's spesh, which also does inlining. The profiler can tell you what was inlined and what wasn't, and IIRC the spesh log can give you more specific info on why an inline was not performed in a given case. HTH - Timo On 13/07/2019 12:51, Marcel Timmerman wrote: > On 7/13/19 12:37 PM, Timo Paulssen wrote: >> I wouldn't put "is inlinable" in the docs; it requires the user to put a >> QAST tree in the value, which isn't a thing an end-user would touch, >> IMO. In fact I'm not sure why we have a trait for that at all, since >> it's not used anywhere in rakudo's source. >> >> On 13/07/2019 12:33, Marcel Timmerman wrote: >>> Hi, >>> >>> I found out about a trait 'is inlinable' when I made a typo in using a >>> trait on subs. There is no documentation for it so I thought maybe it >>> is not implemented, experimental or some other reason it is kept out >>> of the docs. Otherwise it should be documented too. >>> >>> Great work on the documentation, still learning a lot from it. >>> Regards, >>> Marcel > Thanks @Timo > > I have used it here and there without any arguments. Can not see if it > helps. > Btw, is rakudo finding out itself if routines are inlinable and what > algorithm is it using? I have this question to see if one can > influence this process and nudge the routine into inlining. >
