Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
inline subs #23
perl-5.003_02 added an incomplete op_const_sv to check an optree for a single const or pad, and to mark it as CvCONST then. 760ac83
Splice a OP* into the caller if inlinable, not just a CONSTSUB via the const_sv logic.
we can also use the new :const and :pure attributes to mark functions as inlinable.
Note: inlined subs and methods are a huge performance win in most dynamic languages. esp. with the slow perl function calls, it might be a big win.
Analyze the body and check if a enter/leave is needed, and if the args can be hardcoded into the inlined body (optim_args). this can be done by ref (with consts and with
The inlined body needs to be copied, as the nextstate and args needs to be changed. We can do this on the fly, or 2nd or more generally add a new
See the branch