Bug 1199171 part 0 - Add spewInst function for debugging Jit code. r=lth

This commit is contained in:
Nicolas B. Pierron 2015-09-16 20:10:57 +02:00
parent ebdcf9fc9e
commit a61fb2159f
2 changed files with 12 additions and 0 deletions

View File

@ -1410,6 +1410,17 @@ Assembler::bytesNeeded() const
#ifdef JS_DISASM_ARM
void
Assembler::spewInst(Instruction* i)
{
disasm::NameConverter converter;
disasm::Disassembler dasm(converter);
disasm::EmbeddedVector<char, disasm::ReasonableBufferSize> buffer;
uint8_t* loc = reinterpret_cast<uint8_t*>(const_cast<uint32_t*>(i->raw()));
dasm.InstructionDecode(buffer, loc);
printf(" %08x %s\n", reinterpret_cast<uint32_t>(loc), buffer.start());
}
// Labels are named as they are encountered by adding names to a
// table, using the Label address as the key. This is made tricky by
// the (memory for) Label objects being reused, but reused label

View File

@ -1260,6 +1260,7 @@ class Assembler : public AssemblerShared
}
#ifdef JS_DISASM_ARM
static void spewInst(Instruction* i);
void spew(Instruction* i);
void spewBranch(Instruction* i, Label* target);
void spewData(BufferOffset addr, size_t numInstr, bool loadToPC);