mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-09 05:10:23 +00:00
These are the first of a generic family for calling C functions. CCALL_M_N calls a function with M word-sized arguments and N word-sized return values (N == 0 or 1, of course). All stack management is done automatically -- register saving, argument pushing, register restoring. Rough timings show it's marginally faster (~3%), probably because the instrumentation phase is slightly simpler and translations are slighly more compact. It was introduced because the way Cachegrind was calling its helper functions was not really legitimate -- it involved pushing RealRegs at a point where RealRegs shouldn't have been used. This flukily worked for Cachegrind, but caused obscure seg faults when I tried using the same technique for the DIDUCE stuff. Hence this more general approach. CCALL_M_N where M+N <= 3 are easy. More args might be done by abusing spare fields in the UInstr struct, if really necessary. But it's not, yet. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@546