Adding a bunch of nops around trace calls.

5 before, 2 after (so it's easy to see what goes with what).
This commit is contained in:
Ben Vanik 2013-05-24 19:59:51 -07:00
parent 1ad0bb7843
commit 5e66f7b04b
1 changed files with 40 additions and 0 deletions

View File

@ -673,6 +673,10 @@ void X64Emitter::TraceKernelCall() {
return;
}
for (int n = 0; n < 5; n++) {
c.nop();
}
if (FLAGS_annotate_disassembly) {
c.comment("XeTraceKernelCall (+spill)");
}
@ -691,6 +695,10 @@ void X64Emitter::TraceKernelCall() {
call->setArgument(1, arg1);
call->setArgument(2, c.getGpArg(1));
call->setArgument(3, arg3);
for (int n = 0; n < 2; n++) {
c.nop();
}
}
void X64Emitter::TraceUserCall() {
@ -700,6 +708,10 @@ void X64Emitter::TraceUserCall() {
return;
}
for (int n = 0; n < 5; n++) {
c.nop();
}
if (FLAGS_annotate_disassembly) {
c.comment("XeTraceUserCall (+spill)");
}
@ -718,6 +730,10 @@ void X64Emitter::TraceUserCall() {
call->setArgument(1, arg1);
call->setArgument(2, c.getGpArg(1));
call->setArgument(3, arg3);
for (int n = 0; n < 2; n++) {
c.nop();
}
}
void X64Emitter::TraceInstruction(InstrData& i) {
@ -727,6 +743,10 @@ void X64Emitter::TraceInstruction(InstrData& i) {
return;
}
for (int n = 0; n < 5; n++) {
c.nop();
}
if (FLAGS_annotate_disassembly) {
c.comment("XeTraceInstruction (+spill)");
}
@ -744,6 +764,10 @@ void X64Emitter::TraceInstruction(InstrData& i) {
call->setArgument(0, c.getGpArg(0));
call->setArgument(1, arg1);
call->setArgument(2, arg2);
for (int n = 0; n < 2; n++) {
c.nop();
}
}
void X64Emitter::TraceInvalidInstruction(InstrData& i) {
@ -753,6 +777,10 @@ void X64Emitter::TraceInvalidInstruction(InstrData& i) {
c.comment("XeInvalidInstruction (+spill)");
}
for (int n = 0; n < 5; n++) {
c.nop();
}
SpillRegisters();
// TODO(benvanik): remove once fixed: https://code.google.com/p/asmjit/issues/detail?id=86
@ -766,6 +794,10 @@ void X64Emitter::TraceInvalidInstruction(InstrData& i) {
call->setArgument(0, c.getGpArg(0));
call->setArgument(1, arg1);
call->setArgument(2, arg2);
for (int n = 0; n < 5; n++) {
c.nop();
}
#endif
}
@ -776,6 +808,10 @@ void X64Emitter::TraceBranch(uint32_t cia) {
return;
}
for (int n = 0; n < 5; n++) {
c.nop();
}
if (FLAGS_annotate_disassembly) {
c.comment("XeTraceBranch (+spill)");
}
@ -815,6 +851,10 @@ void X64Emitter::TraceBranch(uint32_t cia) {
call->setArgument(0, c.getGpArg(0));
call->setArgument(1, arg1);
call->setArgument(2, arg2);
for (int n = 0; n < 2; n++) {
c.nop();
}
}
int X64Emitter::GenerateIndirectionBranch(uint32_t cia, GpVar& target,