Bug 827995. Avoid spending a lot of time in sprintf while assembling for ARM. r=bhackett

During a profile of JS execution on B@G we're spending 10% of the time in
__vfprintf.  At least some of this is in the arm assembler. Since we're not
actually using the strings we're printing we'd be better off not printing them.

--HG--
extra : rebase_source : e92e54fced0ba662a44de5524621cbfeb69bc8f9
This commit is contained in:
Jeff Muizelaar 2013-01-08 16:52:53 -05:00
parent d4488d3043
commit a9533cede6

View File

@ -532,16 +532,20 @@ namespace JSC {
// pc relative loads (useful for loading from pools).
void ldr_imm(int rd, ARMWord imm, Condition cc = AL)
{
#if defined(JS_METHODJIT_SPEW)
char mnemonic[16];
snprintf(mnemonic, 16, "ldr%s", nameCC(cc));
#endif
spew("%-15s %s, =0x%x @ (%d) (reusable pool entry)", mnemonic, nameGpReg(rd), imm, static_cast<int32_t>(imm));
m_buffer.putIntWithConstantInt(static_cast<ARMWord>(cc) | DTR | DT_LOAD | DT_UP | RN(ARMRegisters::pc) | RD(rd), imm, true);
}
void ldr_un_imm(int rd, ARMWord imm, Condition cc = AL)
{
#if defined(JS_METHODJIT_SPEW)
char mnemonic[16];
snprintf(mnemonic, 16, "ldr%s", nameCC(cc));
#endif
spew("%-15s %s, =0x%x @ (%d)", mnemonic, nameGpReg(rd), imm, static_cast<int32_t>(imm));
m_buffer.putIntWithConstantInt(static_cast<ARMWord>(cc) | DTR | DT_LOAD | DT_UP | RN(ARMRegisters::pc) | RD(rd), imm);
}
@ -1335,6 +1339,7 @@ namespace JSC {
void spewInsWithOp2(char const * ins, Condition cc, int rd, int rn, ARMWord op2)
{
#if defined(JS_METHODJIT_SPEW)
char mnemonic[16];
snprintf(mnemonic, 16, "%s%s", ins, nameCC(cc));
@ -1342,10 +1347,12 @@ namespace JSC {
fmtOp2(op2_fmt, op2);
spew("%-15s %s, %s, %s", mnemonic, nameGpReg(rd), nameGpReg(rn), op2_fmt);
#endif
}
void spewInsWithOp2(char const * ins, Condition cc, int r, ARMWord op2)
{
#if defined(JS_METHODJIT_SPEW)
char mnemonic[16];
snprintf(mnemonic, 16, "%s%s", ins, nameCC(cc));
@ -1353,6 +1360,7 @@ namespace JSC {
fmtOp2(op2_fmt, op2);
spew("%-15s %s, %s", mnemonic, nameGpReg(r), op2_fmt);
#endif
}
ARMWord RM(int reg)