| 82 | |
| 83 | #ifdef _DEBUG |
| 84 | static void logBlock(CPU* cpu, U32 address, DecodedOp* op, U32 len) { |
| 85 | static BWriteFile file; |
| 86 | static int count; |
| 87 | |
| 88 | count++; |
| 89 | if (!file.isOpen()) { |
| 90 | file.createNew("jit.txt"); |
| 91 | } |
| 92 | BString name = cpu->thread->process->getModuleName(address); |
| 93 | U32 offset = cpu->thread->process->getModuleEip(address); |
| 94 | file.writeFormat("Block %d in %s(%x)\n", count, name.c_str(), offset); |
| 95 | while (op && len) { |
| 96 | if (op->isDirectBranch()) { |
| 97 | file.writeFormat("%x %x %s -> %x\n", cpu->thread->process->id, address, op->toString().c_str(), (address + op->len + op->imm)); |
| 98 | } else { |
| 99 | file.writeFormat("%x %x %s\n", cpu->thread->process->id, address, op->toString().c_str()); |
| 100 | } |
| 101 | address += op->len; |
| 102 | len -= op->len; |
| 103 | op = op->next; |
| 104 | } |
| 105 | file.write("\n"); |
| 106 | file.flush(); |
| 107 | } |
| 108 | #endif |
| 109 | |
| 110 | bool JitCodeGen::calculateLongestBlock(DecodedOp* op) { |
no test coverage detected