зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1361383 - Enable x86/x64 asm spew only in JS_JITSPEW builds. r=nbp
This commit is contained in:
Родитель
fe93c0fe8f
Коммит
72890d1b86
|
@ -10,7 +10,9 @@
|
||||||
|
|
||||||
#include "jsopcode.h"
|
#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
|
// Buffer to hold the formatted string. Note that this may contain
|
||||||
// '%' characters, so do not pass it directly to printf functions.
|
// '%' 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);
|
js::jit::JitSpew(js::jit::JitSpew_Codegen, "%s", buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -192,28 +192,39 @@ namespace jit {
|
||||||
|
|
||||||
class GenericAssembler
|
class GenericAssembler
|
||||||
{
|
{
|
||||||
|
#ifdef JS_JITSPEW
|
||||||
Sprinter* printer;
|
Sprinter* printer;
|
||||||
|
#endif
|
||||||
public:
|
public:
|
||||||
|
|
||||||
GenericAssembler() : printer(nullptr) {}
|
GenericAssembler()
|
||||||
|
#ifdef JS_JITSPEW
|
||||||
|
: printer(nullptr)
|
||||||
|
#endif
|
||||||
|
{}
|
||||||
|
|
||||||
void setPrinter(Sprinter* sp)
|
void setPrinter(Sprinter* sp)
|
||||||
{
|
{
|
||||||
|
#ifdef JS_JITSPEW
|
||||||
printer = sp;
|
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))) {
|
if (MOZ_UNLIKELY(printer || JitSpewEnabled(JitSpew_Codegen))) {
|
||||||
va_list va;
|
va_list va;
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
spew(fmt, va);
|
spew(fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef JS_JITSPEW
|
||||||
MOZ_COLD void spew(const char* fmt, va_list va);
|
MOZ_COLD void spew(const char* fmt, va_list va);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace jit
|
} // namespace jit
|
||||||
|
|
Загрузка…
Ссылка в новой задаче