-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Universal arm crossgen compiler #58279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
97125ca
ac4a3e1
2ba2162
77824a3
c3b175a
bd9a51c
3f4a439
05cea7a
adfc7b3
4078dc9
c90c3cd
efc7e20
a1b893f
255c1f8
5bfd6ca
75d38c2
94c30f5
6c8cb2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -384,11 +384,13 @@ bool MethodContext::Equal(MethodContext* other) | |
| // Compare MethodInfo's first. | ||
| CORINFO_METHOD_INFO otherInfo; | ||
| unsigned otherFlags = 0; | ||
| other->repCompileMethod(&otherInfo, &otherFlags); | ||
| CORINFO_OS otherOs = CORINFO_WINNT; | ||
| other->repCompileMethod(&otherInfo, &otherFlags, &otherOs); | ||
|
|
||
| CORINFO_METHOD_INFO ourInfo; | ||
| unsigned ourFlags = 0; | ||
| repCompileMethod(&ourInfo, &ourFlags); | ||
| CORINFO_OS ourOs = CORINFO_WINNT; | ||
| repCompileMethod(&ourInfo, &ourFlags, &ourOs); | ||
|
|
||
| if (otherInfo.ILCodeSize != ourInfo.ILCodeSize) | ||
| return false; | ||
|
|
@@ -419,6 +421,8 @@ bool MethodContext::Equal(MethodContext* other) | |
| return false; | ||
| if (otherFlags != ourFlags) | ||
| return false; | ||
| if (otherOs != ourOs) | ||
| return false; | ||
|
|
||
| // Now compare the other maps to "estimate" equality. | ||
|
|
||
|
|
@@ -643,7 +647,7 @@ unsigned int toCorInfoSize(CorInfoType cit) | |
| return -1; | ||
| } | ||
|
|
||
| void MethodContext::recCompileMethod(CORINFO_METHOD_INFO* info, unsigned flags) | ||
| void MethodContext::recCompileMethod(CORINFO_METHOD_INFO* info, unsigned flags, CORINFO_OS os) | ||
| { | ||
| if (CompileMethod == nullptr) | ||
| CompileMethod = new LightWeightMap<DWORD, Agnostic_CompileMethod>(); | ||
|
|
@@ -662,21 +666,23 @@ void MethodContext::recCompileMethod(CORINFO_METHOD_INFO* info, unsigned flags) | |
| value.info.args = SpmiRecordsHelper::StoreAgnostic_CORINFO_SIG_INFO(info->args, CompileMethod, SigInstHandleMap); | ||
| value.info.locals = SpmiRecordsHelper::StoreAgnostic_CORINFO_SIG_INFO(info->locals, CompileMethod, SigInstHandleMap); | ||
|
|
||
| value.os = (DWORD)os; | ||
|
|
||
| value.flags = (DWORD)flags; | ||
|
|
||
| CompileMethod->Add(0, value); | ||
| DEBUG_REC(dmpCompileMethod(0, value)); | ||
| } | ||
| void MethodContext::dmpCompileMethod(DWORD key, const Agnostic_CompileMethod& value) | ||
| { | ||
| printf("CompileMethod key %u, value ftn-%016llX scp-%016llX ilo-%u ils-%u ms-%u ehc-%u opt-%u rk-%u args-%s locals-%s flg-%08X", | ||
| printf("CompileMethod key %u, value ftn-%016llX scp-%016llX ilo-%u ils-%u ms-%u ehc-%u opt-%u rk-%u args-%s locals-%s flg-%08X os-%u", | ||
| key, value.info.ftn, value.info.scope, value.info.ILCode_offset, value.info.ILCodeSize, value.info.maxStack, | ||
| value.info.EHcount, value.info.options, value.info.regionKind, | ||
| SpmiDumpHelper::DumpAgnostic_CORINFO_SIG_INFO(value.info.args, CompileMethod, SigInstHandleMap).c_str(), | ||
| SpmiDumpHelper::DumpAgnostic_CORINFO_SIG_INFO(value.info.locals, CompileMethod, SigInstHandleMap).c_str(), | ||
| value.flags); | ||
| value.flags, value.os); | ||
| } | ||
| void MethodContext::repCompileMethod(CORINFO_METHOD_INFO* info, unsigned* flags) | ||
| void MethodContext::repCompileMethod(CORINFO_METHOD_INFO* info, unsigned* flags, CORINFO_OS* os) | ||
| { | ||
| AssertMapAndKeyExistNoMessage(CompileMethod, 0); | ||
|
|
||
|
|
@@ -699,6 +705,7 @@ void MethodContext::repCompileMethod(CORINFO_METHOD_INFO* info, unsigned* flags) | |
| info->locals = SpmiRecordsHelper::Restore_CORINFO_SIG_INFO(value.info.locals, CompileMethod, SigInstHandleMap); | ||
|
|
||
| *flags = (unsigned)value.flags; | ||
| *os = (CORINFO_OS)value.os; | ||
| } | ||
|
|
||
| void MethodContext::recGetMethodClass(CORINFO_METHOD_HANDLE methodHandle, CORINFO_CLASS_HANDLE classHandle) | ||
|
|
@@ -4188,7 +4195,9 @@ void MethodContext::repGetEEInfo(CORINFO_EE_INFO* pEEInfoOut) | |
| pEEInfoOut->osPageSize = (size_t)0x1000; | ||
| pEEInfoOut->maxUncheckedOffsetForNullObject = (size_t)((32 * 1024) - 1); | ||
| pEEInfoOut->targetAbi = CORINFO_DESKTOP_ABI; | ||
| #ifdef TARGET_UNIX | ||
| #ifdef TARGET_OSX | ||
| pEEInfoOut->osType = CORINFO_MACOS; | ||
| #elif defined(TARGET_UNIX) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder why we bother with faking up EEInfo instead of blowing things up. @BruceForstall any idea?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the JIT (or JIT32/JIT64) only called |
||
| pEEInfoOut->osType = CORINFO_UNIX; | ||
| #else | ||
| pEEInfoOut->osType = CORINFO_WINNT; | ||
|
|
@@ -6848,7 +6857,8 @@ int MethodContext::dumpMethodIdentityInfoToBuffer(char* buff, int len, bool igno | |
| } | ||
| else | ||
| { | ||
| repCompileMethod(&info, &flags); | ||
| CORINFO_OS os; | ||
| repCompileMethod(&info, &flags, &os); | ||
| pInfo = &info; | ||
| } | ||
|
|
||
|
|
@@ -6982,7 +6992,8 @@ bool MethodContext::hasPgoData(bool& hasEdgeProfile, bool& hasClassProfile, bool | |
| // Obtain the Method Info structure for this method | ||
| CORINFO_METHOD_INFO info; | ||
| unsigned flags = 0; | ||
| repCompileMethod(&info, &flags); | ||
| CORINFO_OS os; | ||
| repCompileMethod(&info, &flags, &os); | ||
|
|
||
| if ((GetPgoInstrumentationResults != nullptr) && | ||
| (GetPgoInstrumentationResults->GetIndex(CastHandle(info.ftn)) != -1)) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,14 @@ | |
|
|
||
| #define fatMC // this is nice to have on so ildump works... | ||
|
|
||
| CORINFO_OS g_currentOs = CORINFO_WINNT; | ||
|
||
|
|
||
| void interceptor_ICJC::setJitOs(CORINFO_OS os) | ||
| { | ||
| g_currentOs = os; | ||
| original_ICorJitCompiler->setJitOs(os); | ||
| } | ||
|
|
||
| CorJitResult interceptor_ICJC::compileMethod(ICorJitInfo* comp, /* IN */ | ||
| struct CORINFO_METHOD_INFO* info, /* IN */ | ||
| unsigned /* code:CorJitFlag */ flags, /* IN */ | ||
|
|
@@ -24,7 +32,7 @@ CorJitResult interceptor_ICJC::compileMethod(ICorJitInfo* comp, | |
| our_ICorJitInfo.mc = mc; | ||
| our_ICorJitInfo.mc->cr->recProcessName(GetCommandLineA()); | ||
|
|
||
| our_ICorJitInfo.mc->recCompileMethod(info, flags); | ||
| our_ICorJitInfo.mc->recCompileMethod(info, flags, g_currentOs); | ||
|
|
||
| // force some extra data into our tables.. | ||
| // data probably not needed with RyuJIT, but needed in 4.5 and 4.5.1 to help with catching cached values | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this should be exactly the same comment as in corjit.h