Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
Implement portable tailcall helpers#341
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
cc45a0e62a0134b6af537de7608ac121e9e442f186f21b9c62671b740406cbb08a44e40b7e46446a869bf43b6a2710f7a26af504aad93d07565833f13c9e2222096646081e53a5089474801b2529f283203256b6bd4fe1bcc3678484bd83ebcd44dab1d2b41bd8415b4219e96564b089f3d9f0928878a88b641b147030d28fc501cfb3d8833ac518720138abbe718baf1e5638File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -5956,12 +5956,14 @@ void MethodContext::recGetTailCallCopyArgsThunk(CORINFO_SIG_INFO* | ||
| GetTailCallCopyArgsThunk->Add(key, (DWORDLONG)result); | ||
| DEBUG_REC(dmpGetTailCallCopyArgsThunk(key, (DWORDLONG)result)); | ||
| } | ||
| void MethodContext::dmpGetTailCallCopyArgsThunk(const Agnostic_GetTailCallCopyArgsThunk& key, DWORDLONG value) | ||
| { | ||
| printf("GetTailCallCopyArgsThunk key sig%s flg-%08X", | ||
| SpmiDumpHelper::DumpAgnostic_CORINFO_SIG_INFO(key.Sig).c_str(), key.flags); | ||
| printf(", value res-%016llX", value); | ||
| } | ||
| void* MethodContext::repGetTailCallCopyArgsThunk(CORINFO_SIG_INFO* pSig, CorInfoHelperTailCallSpecialHandling flags) | ||
| { | ||
| AssertCodeMsg(GetTailCallCopyArgsThunk != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for ..."); | ||
| @@ -5980,6 +5982,78 @@ void* MethodContext::repGetTailCallCopyArgsThunk(CORINFO_SIG_INFO* pSig, CorInfo | ||
| return result; | ||
| } | ||
| void MethodContext::recGetTailCallHelpers( | ||
| CORINFO_RESOLVED_TOKEN* callToken, | ||
| CORINFO_SIG_INFO* sig, | ||
| CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, | ||
| CORINFO_TAILCALL_HELPERS* pResult) | ||
| { | ||
| if (GetTailCallHelpers == nullptr) | ||
| GetTailCallHelpers = new LightWeightMap<Agnostic_GetTailCallHelpers, Agnostic_CORINFO_TAILCALL_HELPERS>(); | ||
| Agnostic_GetTailCallHelpers key; | ||
| ZeroMemory(&key, sizeof(Agnostic_GetTailCallHelpers)); | ||
| key.callToken = SpmiRecordsHelper::StoreAgnostic_CORINFO_RESOLVED_TOKEN(callToken, GetTailCallHelpers); | ||
| key.sig = SpmiRecordsHelper::StoreAgnostic_CORINFO_SIG_INFO(*sig, GetTailCallHelpers); | ||
| key.flags = (DWORD)flags; | ||
| Agnostic_CORINFO_TAILCALL_HELPERS value; | ||
| ZeroMemory(&value, sizeof(Agnostic_CORINFO_TAILCALL_HELPERS)); | ||
| value.result = pResult != nullptr; | ||
| if (pResult != nullptr) | ||
| { | ||
| value.flags = (DWORD)pResult->flags; | ||
| value.hStoreArgs = (DWORDLONG)pResult->hStoreArgs; | ||
| value.hCallTarget = (DWORDLONG)pResult->hCallTarget; | ||
| value.hDispatcher = (DWORDLONG)pResult->hDispatcher; | ||
| } | ||
| GetTailCallHelpers->Add(key, value); | ||
| DEBUG_REC(dmpGetTailCallHelpers(key, value)); | ||
| } | ||
| void MethodContext::dmpGetTailCallHelpers(const Agnostic_GetTailCallHelpers& key, const Agnostic_CORINFO_TAILCALL_HELPERS& value) | ||
| { | ||
| printf("GetTailCallHelpers key callToken-%s sig-%s flg-%08X", | ||
| SpmiDumpHelper::DumpAgnostic_CORINFO_RESOLVED_TOKEN(key.callToken).c_str(), | ||
| SpmiDumpHelper::DumpAgnostic_CORINFO_SIG_INFO(key.sig).c_str(), | ||
| key.flags); | ||
| printf(", value result-%s flg-%08X hStoreArgs-%016llX hCallTarget-%016llX hDispatcher-%016llX", | ||
| value.result ? "true" : "false", | ||
| value.flags, | ||
| value.hStoreArgs, | ||
| value.hCallTarget, | ||
| value.hDispatcher); | ||
| } | ||
jakobbotsch marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| bool MethodContext::repGetTailCallHelpers( | ||
| CORINFO_RESOLVED_TOKEN* callToken, | ||
| CORINFO_SIG_INFO* sig, | ||
| CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, | ||
| CORINFO_TAILCALL_HELPERS* pResult) | ||
| { | ||
| AssertCodeMsg(GetTailCallHelpers != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for ..."); | ||
| Agnostic_GetTailCallHelpers key; | ||
| ZeroMemory(&key, sizeof(Agnostic_GetTailCallHelpers)); | ||
| key.callToken = SpmiRecordsHelper::RestoreAgnostic_CORINFO_RESOLVED_TOKEN(callToken, GetTailCallHelpers); | ||
| key.sig = SpmiRecordsHelper::RestoreAgnostic_CORINFO_SIG_INFO(*sig, GetTailCallHelpers); | ||
| key.flags = (DWORD)flags; | ||
| AssertCodeMsg(GetTailCallHelpers->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Could not find matching tail call helper call"); | ||
| Agnostic_CORINFO_TAILCALL_HELPERS value = GetTailCallHelpers->Get(key); | ||
| if (!value.result) | ||
| return false; | ||
| pResult->flags = (CORINFO_TAILCALL_HELPERS_FLAGS)value.flags; | ||
| pResult->hStoreArgs = (CORINFO_METHOD_HANDLE)value.hStoreArgs; | ||
| pResult->hCallTarget = (CORINFO_METHOD_HANDLE)value.hCallTarget; | ||
| pResult->hDispatcher = (CORINFO_METHOD_HANDLE)value.hDispatcher; | ||
| DEBUG_REP(dmpGetTailCallHelpers(key, value)); | ||
| return true; | ||
| } | ||
| void MethodContext::recGetMethodDefFromMethod(CORINFO_METHOD_HANDLE hMethod, mdMethodDef result) | ||
| { | ||
| if (GetMethodDefFromMethod == nullptr) | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.