// original instruction. Only one instruction must be used,
// because multiple threads can be executing the same code stream.
-void RemoveGcCoverageInterrupt(Volatile<BYTE>* instrPtr, BYTE * savedInstrPtr)
+void RemoveGcCoverageInterrupt(TADDR instrPtr, BYTE * savedInstrPtr)
{
#ifdef _TARGET_ARM_
if (GetARMInstructionLength(savedInstrPtr) == 2)
#elif defined(_TARGET_ARM64_)
*(DWORD *)instrPtr = *(DWORD *)savedInstrPtr;
#else
- *instrPtr = *savedInstrPtr;
+ *(BYTE *)instrPtr = *savedInstrPtr;
#endif
}
GCcoverCount++;
forceStack[0]= ®s; // This is so I can see it fastchecked
- BYTE* pControlPc = (BYTE*)GetIP(regs);
+ PCODE controlPc = GetIP(regs);
+ TADDR instrPtr = PCODEToPINSTR(controlPc);
- Volatile<BYTE>* instrPtr = (Volatile<BYTE>*)pControlPc;
forceStack[0] = &instrPtr; // This is so I can see it fastchecked
- EECodeInfo codeInfo((PCODE)pControlPc);
+ EECodeInfo codeInfo(controlPc);
if (!codeInfo.IsValid())
return(FALSE);
void DoGcStress (PCONTEXT regs, MethodDesc *pMD)
{
- BYTE* pControlPc = (BYTE*)GetIP(regs);
- Volatile<BYTE>* instrPtr = (Volatile<BYTE>*)pControlPc;
+ PCODE controlPc = GetIP(regs);
+ TADDR instrPtr = PCODEToPINSTR(controlPc);
if (!pMD)
{
- pMD = ExecutionManager::GetCodeMethodDesc((PCODE)pControlPc);
+ pMD = ExecutionManager::GetCodeMethodDesc(controlPc);
if (!pMD)
return;
}
GCCoverageInfo *gcCover = pMD->m_GcCover;
- EECodeInfo codeInfo((TADDR)instrPtr);
+ EECodeInfo codeInfo(controlPc);
_ASSERTE(codeInfo.GetMethodDesc() == pMD);
DWORD offset = codeInfo.GetRelOffset();
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
- BYTE instrVal = *instrPtr;
+ BYTE instrVal = *(BYTE *)instrPtr;
forceStack[6] = &instrVal; // This is so I can see it fastchecked
if (instrVal != INTERRUPT_INSTR &&
#elif defined(_TARGET_ARM_)
- _ASSERTE(((TADDR)instrPtr) & THUMB_CODE);
- instrPtr = instrPtr - THUMB_CODE;
-
WORD instrVal = *(WORD*)instrPtr;
forceStack[6] = &instrVal; // This is so I can see it fastchecked
}
// Must flush instruction cache before returning as instruction has been modified.
- FlushInstructionCache(GetCurrentProcess(), instrPtr, 6);
+ FlushInstructionCache(GetCurrentProcess(), (LPCVOID)instrPtr, 6);
// It's not GC safe point, the GC Stress instruction is
// already commited and interrupt is already put at next instruction so we just return.
UpdateGCStressInstructionWithoutGC ();
// Must flush instruction cache before returning as instruction has been modified.
- FlushInstructionCache(GetCurrentProcess(), instrPtr, 4);
+ FlushInstructionCache(GetCurrentProcess(), (LPCVOID)instrPtr, 4);
CONSISTENCY_CHECK(!pThread->HasPendingGCStressInstructionUpdate());