| 169 | } |
| 170 | |
| 171 | DecodedOp* NormalCPU::getOp(U32 startIp, U32 jumpTargetFlags) { |
| 172 | if (!this->thread->process) // exit was called, don't need to pre-cache the next block |
| 173 | return nullptr; |
| 174 | |
| 175 | DecodedOp* op = memory->getDecodedOp(startIp); |
| 176 | |
| 177 | if (!op) { |
| 178 | BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(memory->mutex); |
| 179 | op = memory->getDecodedOp(startIp); |
| 180 | if (!op) { |
| 181 | U32 opCount = 0; |
| 182 | U32 eipLen = 0; |
| 183 | U32 address = startIp; |
| 184 | |
| 185 | op = decodeBlock(this, startIp, this->isBig(), opCount, eipLen); |
| 186 | |
| 187 | DecodedOp* nextOp = op; |
| 188 | |
| 189 | while (nextOp) { |
| 190 | if (!nextOp->pfn) { |
| 191 | nextOp->pfn = getFunctionForOp(nextOp); |
| 192 | } |
| 193 | if (memory->isAddressDynamic(address, nextOp->len)) { |
| 194 | nextOp->flags |= OP_FLAG_NO_JIT; |
| 195 | #ifdef BOXEDWINE_JIT |
| 196 | nextOp->runCount = JIT_RUN_COUNT + 1; |
| 197 | #endif |
| 198 | } |
| 199 | address += nextOp->len; |
| 200 | nextOp = nextOp->next; |
| 201 | } |
| 202 | this->thread->memory->addCode_nolock(startIp, eipLen, op, opCount); |
| 203 | } |
| 204 | } |
| 205 | #ifdef BOXEDWINE_JIT |
| 206 | op->jumpTargetFlags |= jumpTargetFlags; |
| 207 | if (jumpTargetFlags && (op->jumpTargetFlags & JUMP_TARGET_ASSUMED_FALSE)) { |
| 208 | kpanic("JUMP_TARGET_ASSUMED_FALSE"); |
| 209 | } |
| 210 | #endif |
| 211 | return op; |
| 212 | } |
| 213 | |
| 214 | void NormalCPU::run() { |
| 215 | #ifdef BOXEDWINE_JIT |
no test coverage detected