Making debug disassembly look a bit better.

This commit is contained in:
Ben Vanik 2014-01-26 03:24:55 -08:00
parent cb352c6c86
commit 20c8eb1561
2 changed files with 16 additions and 2 deletions

View File

@ -520,8 +520,14 @@ void alloy::backend::x64::lowering::RegisterSequences(LoweringTable* table) {
// --------------------------------------------------------------------------
table->AddSequence(OPCODE_SOURCE_OFFSET, [](X64Emitter& e, Instr*& i) {
// TODO(benvanik): translate source offsets for mapping? We're just passing
// down the original offset - it may be nice to have two.
#if XE_DEBUG
e.nop();
e.nop();
e.mov(e.eax, (uint32_t)i->src1.offset);
e.nop();
e.nop();
#endif // XE_DEBUG
e.MarkSourceOffset(i);
i = e.Advance(i);
return true;

View File

@ -162,6 +162,14 @@ int X64Emitter::Emit(HIRBuilder* builder) {
}
ret();
#if XE_DEBUG
nop();
nop();
nop();
nop();
nop();
#endif // XE_DEBUG
return 0;
}