Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[armel tizen] Fixed dynamic code allocation and code pitching for ARM #16352

Merged
merged 4 commits into from Feb 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/vm/codepitchingmanager.cpp
Expand Up @@ -241,7 +241,7 @@ static void LookupOrCreateInPitchingCandidate(MethodDesc* pMD, ULONG sizeOfCode)
const char* szClassName = className.GetUTF8(scratch);
const char* szMethodSig = methodSig.GetUTF8(scratch);

printf("Candidate %lld %s :: %s %s\n",
printf("Candidate %lu %s :: %s %s\n",
sizeOfCode, szClassName, pMD->GetName(), szMethodSig);
}
#endif
Expand Down Expand Up @@ -346,7 +346,7 @@ StackWalkAction StackWalkCallback(CrawlFrame* pCf, VOID* data)
return CrawlFrameVisitor(pCf, (Thread *)data);
}

static ULONGLONG s_PitchedMethodCounter = 0;
static ULONG s_PitchedMethodCounter = 0;
void MethodDesc::PitchNativeCode()
{
WRAPPER_NO_CONTRACT;
Expand Down Expand Up @@ -383,7 +383,7 @@ void MethodDesc::PitchNativeCode()
MethodTable * pMT = GetMethodTable();
_ASSERTE(pMT != nullptr);

CodeHeader* pCH = ((CodeHeader*)(pCode & ~1)) - 1;
CodeHeader* pCH = dac_cast<PTR_CodeHeader>(PCODEToPINSTR(pCode)) - 1;
_ASSERTE(pCH->GetMethodDesc() == this);

HostCodeHeap* pHeap = HostCodeHeap::GetCodeHeap((TADDR)pCode);
Expand Down Expand Up @@ -436,11 +436,8 @@ void MethodDesc::PitchNativeCode()
const char* szClassName = className.GetUTF8(scratch);
const char* szMethodSig = methodSig.GetUTF8(scratch);

if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_JitPitchPrintStat) != 0)
{
printf("Pitched %lld %lld %s :: %s %s\n",
s_PitchedMethodCounter, pitchedBytes, szClassName, GetName(), szMethodSig);
}
printf("Pitched %lu %lu %s :: %s %s\n",
s_PitchedMethodCounter, pitchedBytes, szClassName, GetName(), szMethodSig);
}

DACNotify::DoJITPitchingNotification(this);
Expand Down Expand Up @@ -514,7 +511,7 @@ EXTERN_C void SavePitchingCandidate(MethodDesc* pMD, ULONG sizeOfCode)
SimpleWriteLockHolder swlh(s_totalNCSizeLock);
s_totalNCSize += sizeOfCode;
if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_JitPitchPrintStat) != 0)
printf("jitted %lld (bytes) pitched %lld (bytes)\n", s_totalNCSize, s_jitPitchedBytes);
printf("jitted %lu (bytes) pitched %lu (bytes)\n", s_totalNCSize, s_jitPitchedBytes);
}
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/vm/dynamicmethod.cpp
Expand Up @@ -795,7 +795,7 @@ struct HostCodeHeap::TrackAllocation * HostCodeHeap::GetTrackAllocation(TADDR co
{
LIMITED_METHOD_CONTRACT;

CodeHeader * pHdr = dac_cast<PTR_CodeHeader>(codeStart) - 1;
CodeHeader * pHdr = dac_cast<PTR_CodeHeader>(PCODEToPINSTR(codeStart)) - 1;

// Pointer to the TrackAllocation record is stored just before the code header
return *((TrackAllocation **)(pHdr) - 1);
Expand Down
2 changes: 1 addition & 1 deletion src/vm/prestub.cpp
Expand Up @@ -887,7 +887,7 @@ PCODE MethodDesc::JitCompileCodeLocked(PrepareCodeConfig* pConfig, JitListLockEn
#if defined(FEATURE_JIT_PITCHING)
else
{
SavePitchingCandidate(this, sizeOfCode);
SavePitchingCandidate(this, *pSizeOfCode);
}
#endif
}
Expand Down