From a17ec0f3aa955d08c0b121b6abde8270610bed33 Mon Sep 17 00:00:00 2001 From: Brendan Eich Date: Mon, 11 Jan 2010 18:48:08 -0800 Subject: [PATCH] Bug 538593 - guardClass always does a JS_snprintf even though it usually doesn't use the result (r=dvander). --- js/src/jstracer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index afff698a305..3e87a1af3c1 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -9751,8 +9751,12 @@ TraceRecorder::guardClass(JSObject* obj, LIns* obj_ins, JSClass* clasp, VMSideEx LIns* class_ins = lir->insLoad(LIR_ldp, obj_ins, offsetof(JSObject, classword)); class_ins = lir->ins2(LIR_piand, class_ins, INS_CONSTWORD(~JSSLOT_CLASS_MASK_BITS)); +#ifdef JS_JIT_SPEW char namebuf[32]; JS_snprintf(namebuf, sizeof namebuf, "guard(class is %s)", clasp->name); +#else + static const char namebuf[] = ""; +#endif guard(cond, addName(lir->ins2(LIR_peq, class_ins, INS_CONSTPTR(clasp)), namebuf), exit); return cond; }