Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2021-03-03 22:36:12 +0300
committerGitHub <noreply@github.com>2021-03-03 22:36:12 +0300
commite0e665cdc1eb1f8311a7655529c7bafede8f8004 (patch)
treebe6a5ed287b610e913f710f0328af1802ac72624 /src/coreclr/ToolBox
parent7f491db5a211b7f460703845dae93f7eef65ffba (diff)
Fix SPMI replay with JitStress. (#49045)
Diffstat (limited to 'src/coreclr/ToolBox')
-rw-r--r--src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
index 1aac4350ba3..aeed2683d0f 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
+++ b/src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
@@ -1015,8 +1015,12 @@ CorInfoInitClassResult MethodContext::repInitClass(CORINFO_FIELD_HANDLE field,
key.method = CastHandle(method);
key.context = CastHandle(context);
- AssertCodeMsg(InitClass != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", key.method);
- AssertCodeMsg(InitClass->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", key.method);
+ if ((InitClass == nullptr) || (InitClass->GetIndex(key) == -1))
+ {
+ // We could try additional inlines with stress modes, just reject them.
+ return CORINFO_INITCLASS_DONT_INLINE;
+ }
+
CorInfoInitClassResult result = (CorInfoInitClassResult)InitClass->Get(key);
DEBUG_REP(dmpInitClass(key, result));
@@ -3554,6 +3558,9 @@ void MethodContext::dmpGetStaticFieldCurrentClass(DWORDLONG key, const Agnostic_
}
CORINFO_CLASS_HANDLE MethodContext::repGetStaticFieldCurrentClass(CORINFO_FIELD_HANDLE field, bool* pIsSpeculative)
{
+ AssertCodeMsg(GetStaticFieldCurrentClass != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", CastHandle(field));
+ AssertCodeMsg(GetStaticFieldCurrentClass->GetIndex(CastHandle(field)) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", CastHandle(field));
+
Agnostic_GetStaticFieldCurrentClass value = GetStaticFieldCurrentClass->Get(CastHandle(field));
if (pIsSpeculative != nullptr)
@@ -4098,6 +4105,7 @@ void MethodContext::recGetGSCookie(GSCookie* pCookieVal, GSCookie** ppCookieVal)
else
value.B = 0;
GetGSCookie->Add((DWORD)0, value);
+ DEBUG_REC(dmpGetGSCookie(0, value));
}
void MethodContext::dmpGetGSCookie(DWORD key, DLDL value)
{
@@ -4105,6 +4113,21 @@ void MethodContext::dmpGetGSCookie(DWORD key, DLDL value)
}
void MethodContext::repGetGSCookie(GSCookie* pCookieVal, GSCookie** ppCookieVal)
{
+ if (GetGSCookie == nullptr)
+ {
+ // fake the result because for the codegen it is just a constant.
+ if (pCookieVal != nullptr)
+ {
+ *pCookieVal = (GSCookie)0x06000000;
+ }
+ if (ppCookieVal != nullptr)
+ {
+ *ppCookieVal = (GSCookie*)0x06000001;
+ }
+ return;
+ }
+
+ AssertCodeMsg(GetGSCookie->GetIndex(0) != -1, EXCEPTIONCODE_MC, "Didn't find GetGSCookie");
DLDL value;
value = GetGSCookie->Get((DWORD)0);