/* Evaluate the CfiExpr rooted at ix in exprs given the context eec.
*ok is set to False on failure, but not to True on success. The
caller must set it to True before calling. */
-static
+__attribute__((noinline))
+static
UWord evalCfiExpr ( XArray* exprs, Int ix,
CfiExprEvalContext* eec, Bool* ok )
{
}
-static CFSICacheEnt* cfsi_cache__find ( Addr ip )
+static inline CFSICacheEnt* cfsi_cache__find ( Addr ip )
{
UWord hash = ip % N_CFSI_CACHE;
CFSICacheEnt* ce = &cfsi_cache[hash];
}
+inline
static Addr compute_cfa ( D3UnwindRegs* uregs,
Addr min_accessible, Addr max_accessible,
DebugInfo* di, DiCfSI* cfsi )
ML_(ppDiCfSI)(di->cfsi_exprs, cfsi);
}
- VG_(memset)(&uregsPrev, 0, sizeof(uregsPrev));
+ VG_(bzero_inline)(&uregsPrev, sizeof(uregsPrev));
/* First compute the CFA. */
cfa = compute_cfa(uregsHere,
extern void* VG_(memset) ( void *s, Int c, SizeT sz );
extern Int VG_(memcmp) ( const void* s1, const void* s2, SizeT n );
+/* Zero out up to 8 words quickly in-line. Do not use this for blocks
+ of size which are unknown at compile time, since the whole point is
+ for it to be inlined, and then for gcc to remove all code except
+ for the relevant 'sz' case. */
+inline __attribute__((always_inline))
+static void VG_(bzero_inline) ( void* s, SizeT sz )
+{
+ if (LIKELY(0 == (((Addr)sz) & (Addr)(sizeof(UWord)-1)))
+ && LIKELY(0 == (((Addr)s) & (Addr)(sizeof(UWord)-1)))) {
+ UWord* p = (UWord*)s;
+ switch (sz / (SizeT)sizeof(UWord)) {
+ case 8: p[0] = p[1] = p[2] = p[3]
+ = p[4] = p[5] = p[6] = p[7] = 0UL; return;
+ case 7: p[0] = p[1] = p[2] = p[3]
+ = p[4] = p[5] = p[6] = 0UL; return;
+ case 6: p[0] = p[1] = p[2] = p[3]
+ = p[4] = p[5] = 0UL; return;
+ case 5: p[0] = p[1] = p[2] = p[3] = p[4] = 0UL; return;
+ case 4: p[0] = p[1] = p[2] = p[3] = 0UL; return;
+ case 3: p[0] = p[1] = p[2] = 0UL; return;
+ case 2: p[0] = p[1] = 0UL; return;
+ case 1: p[0] = 1; return;
+ case 0: return;
+ default: break;
+ }
+ }
+ VG_(memset)(s, 0, sz);
+}
+
+
/* ---------------------------------------------------------------------
Address computation helpers
------------------------------------------------------------------ */