diff --git a/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp b/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp index 6dec02a31455..4c99a6a14a8c 100644 --- a/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp +++ b/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp @@ -10,7 +10,9 @@ #include "jsopcode.h" -void js::jit::GenericAssembler::spew(const char* fmt, va_list va) +#ifdef JS_JITSPEW +void +js::jit::GenericAssembler::spew(const char* fmt, va_list va) { // Buffer to hold the formatted string. Note that this may contain // '%' characters, so do not pass it directly to printf functions. @@ -23,3 +25,4 @@ void js::jit::GenericAssembler::spew(const char* fmt, va_list va) js::jit::JitSpew(js::jit::JitSpew_Codegen, "%s", buf); } } +#endif diff --git a/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.h b/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.h index 102cc74b8465..214351ebcbb8 100644 --- a/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.h +++ b/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.h @@ -192,28 +192,39 @@ namespace jit { class GenericAssembler { +#ifdef JS_JITSPEW Sprinter* printer; - +#endif public: - GenericAssembler() : printer(nullptr) {} + GenericAssembler() +#ifdef JS_JITSPEW + : printer(nullptr) +#endif + {} void setPrinter(Sprinter* sp) { +#ifdef JS_JITSPEW printer = sp; +#endif } - void spew(const char* fmt, ...) MOZ_FORMAT_PRINTF(2, 3) + MOZ_ALWAYS_INLINE void spew(const char* fmt, ...) MOZ_FORMAT_PRINTF(2, 3) { +#ifdef JS_JITSPEW if (MOZ_UNLIKELY(printer || JitSpewEnabled(JitSpew_Codegen))) { va_list va; va_start(va, fmt); spew(fmt, va); va_end(va); } +#endif } +#ifdef JS_JITSPEW MOZ_COLD void spew(const char* fmt, va_list va); +#endif }; } // namespace jit