perl5
perl5 copied to clipboard
factor out 3 high usage COND_*() API croak() messages on Win32
- high usage in perl5xx.dll and because these are macros, high usage in both P5P/.git and CPAN XS .dll of a certain category.
- pthreads variants of COND_*(), have error messages that are too long and too detailed for me to think its worth it in this commit. They pass a minimum of 2 arguments best case scenario, __ FILE ___ and __ LINE __. In addition, it isn't my native OS. Changing the pthread variants is best for another day.
- C sym names are spelled as short as possible to not waste space in each .dll file's Import table. Embedding C literal "COND_WAIT" in each XS .dll vs importing const global data var "PL_COND_WAIT" through the PE symbol table, for such a short string, starts to have a trade off debate. See PR associated with this commit for details & rejected optimizations.
"COND_WAIT"10+6_pading_to_eight+7_load_eff_addr_PIC_U32+5_call_fn_PIC_U32
is very close in size to
"Perl_die_cwait"15+4_PIC_RVA+4_PIC_RVA+5_call_PIC_U32
but
5_call_PIC_U32 x 5 call_sites_per_dll
is smaller vs
(7_load_eff_addr_PIC_U32 + 5_call_fn_PIC_U32 ) x 5 call_sites_per_dll
I also considered a PL_die_cond[3] array of 3 function pointers for a short time, but IIRC some permutation of (MSVC || GCC || Both) && (C89_C99 || C++ || Both) prohibits declspec noreturn or attribute noreturn on a function pointer [data] type. No return vtable methods are plain illegal or longer version "this TC ballot proposal was already rejected 10x, you are now rejected" [that dev is an idiot].
Even if I know how to get MSVC or GCC to break its own C/C++ grammar and machine code generate rules, to truly eliminate the stack cleanup epilog after each no return function pointer call. That war crime I did doesn't look like best-in-class production quality C code, so I'm not putting what I did in a PR intended for widespread use FOSS SW.
- This set of changes does not require a perldelta entry.