Bug 595975: diagnostic patch to collect Shape contents, r=billm, a=blocker

This commit is contained in:
David Mandelin 2010-12-27 17:36:03 -08:00
parent 6ea548b208
commit 26b39ddcb7

View File

@ -829,6 +829,14 @@ extern JS_FRIEND_DATA(JSScopeStats) js_scope_stats;
namespace js {
inline static volatile int *vcopy(volatile int *dst, int *src, size_t bytes)
{
int *end = src + bytes / sizeof(int);
for (; src < end; ++src, ++dst)
*dst = *src;
return dst;
}
JS_ALWAYS_INLINE js::Shape **
Shape::search(js::Shape **startp, jsid id, bool adding)
{
@ -852,6 +860,13 @@ Shape::search(js::Shape **startp, jsid id, bool adding)
METER(misses);
return spp;
}
{
char blackbox[sizeof(Shape) + 8];
volatile int *p = (int *) blackbox;
*p++ = 0xfcfcfcfc;
p = vcopy(p, (int *) *startp, sizeof(Shape));
*p = 0xfdfdfdfd;
}
return (*startp)->table->search(id, adding);
}