If you compile it with #define PERL_NO_GET_CONTEXT at the top of the file, you'll find that all those calls to Perl_get_context() are avoided. Similarly, using perl 5.14.0 or later removes all those Perl_Istack_base_ptr()-style function calls.
All those checks on stack size could be replaced by using a single EXTEND(24) at the start of the function.
All those calls to create mortals could be removed by returning an array rather than a list. Etc.
A lot of the macros designed for use by XS are less efficient (depending on circumstances) than the macros use in the perl core, due to the need to ensure backwards compatibility, or to insulate the XS code from the internal details of the core etc.
If you look at the actual code in the hot pp ops, you'll find its hardly unoptimised. And if a modern C compiler can't cope with a a few extra no-op {} scopes added by perl's macros, there's something wrong with it. Show me some actual assembly of a function in pp_hot.c that's being significantly crippled by the design of perl's macros, and I'll start to take it seriously.
Other than that, everything you've talked about is wild speculation so far.
Dave.
In reply to Re^6: Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
by dave_the_m
in thread Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
by Will_the_Chill
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |