You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Time::HiRes::stat() cleanup and optimize fake OP struct construction
-XPUSHs() requires saving the SV* retval of sv_2mortal(newSVsv()) around
a possible Perl_stack_grow(), split the EXTEND from the PUSH, so SV*
is held only in volatile registers (liveness).
-over EXTEND to 13 elements instead of 1 element.
Why not? pp_stat()/pp_lstat() have to do the Perl_stack_grow() call if we
don't do it.
-remove Zero() macro and use a function call free struct initializer.
Just b/c GCC and its offshoot Clang will inline a fixed length memset()
doesn't make it part of ISO C. MSVC compiler never inlines memset() calls
on WinPerl (b/c P5P never added the magic sauce to ask for that feature).
More portably, P5P has never verified the machine code output of all
known commercial Unix CCs on all CPU archs regarding inlining memset().
-when filling out the fake OP, do some instruction level parallelism like
filling in fakeop with 0s, while digging through my_perl->Iop->op_flags,
my_perl->Icurstackinfo->si_cxsubix, my_perl->Icurstackinfo->si_cxstack,
and etc, as part of GIMME_V macro, which used to be a libperl.so exported
function call a very long time ago IIRC.
Another example, translate ix?OP_LSTAT:OP_STAT while translating
gm==G_LIST?OPf_WANT_LIST:gm==G_SCALAR?OPf_WANT_SCALAR:OPf_WANT_VOID.
Dig through PLT/GOT/PE sym table as part of PL_ppaddr[op_type]
while writing to C stk mem as part of fakeop.op_type = op_type
-change fakeop.op_ppaddr(aTHX); to ppaddr(aTHX); b/c some CCs have a low
IQ and can't prove statement "PL_op = &fakeop;" won't modify field
fakeop.op_ppaddr in our C auto storage OP struct var.
-don't execute the Perl_sv_2uv_flags() getter method pointlessly inside
UV atime = SvUV(ST( 8)); if static function hrstatns() is a NOOP and
is inlined and totally optimized away since in some build configs,
hrstatns() only does atime_nsec = 0; mtime_nsec = 0; ctime_nsec = 0;
Windows is an example.
-change SvUV(ST( 8)); to SvUV(SPBASE[ 8]); don't deref my_perl->Istack_base
over and over
0 commit comments