MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / getOp

Method getOp

source/emulation/cpu/normal/normalCPU.cpp:171–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171DecodedOp* 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
214void NormalCPU::run() {
215#ifdef BOXEDWINE_JIT

Callers 1

calculateLongestBlockMethod · 0.80

Calls 6

decodeBlockFunction · 0.85
kpanicFunction · 0.85
getDecodedOpMethod · 0.80
isBigMethod · 0.80
addCode_nolockMethod · 0.80
isAddressDynamicMethod · 0.45

Tested by

no test coverage detected