Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/coreclr/ToolBox/superpmi/superpmi-shared/agnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct Agnostic_CORINFO_SIG_INFO
DWORDLONG args;
DWORD pSig_Index;
DWORD cbSig;
DWORDLONG sigHandle; // used instead of cbSig/pSig_Index on crossgen2 if (cbSig == 0) && (pSig != nullptr)
DWORDLONG methodSignature;
DWORDLONG scope;
DWORD token;
};
Expand Down Expand Up @@ -136,7 +136,7 @@ struct Agnostic_GetArgType_Key
DWORD sigInst_classInst_Index;
DWORD sigInst_methInstCount;
DWORD sigInst_methInst_Index;
DWORDLONG sigHandle; // used instead of cbSig/pSig_Index on crossgen2 if (cbSig == 0) && (pSig != nullptr)
DWORDLONG methodSignature;
DWORDLONG scope;

// Other getArgType() arguments
Expand All @@ -149,9 +149,9 @@ struct Agnostic_GetArgClass_Key
DWORD sigInst_classInst_Index;
DWORD sigInst_methInstCount;
DWORD sigInst_methInst_Index;
DWORDLONG methodSignature;
DWORDLONG scope;
DWORDLONG args;
DWORDLONG sigHandle; // used instead of cbSig/pSig_Index on crossgen2 if (cbSig == 0) && (pSig != nullptr)
};

struct Agnostic_GetBoundaries
Expand Down
54 changes: 14 additions & 40 deletions src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2524,21 +2524,15 @@ void MethodContext::recGetArgType(CORINFO_SIG_INFO* sig,
// TODO: verify that the above comment is still true (that some of the fields of incoming argument `sig` contain garbage), or
// can we store the whole thing and use StoreAgnostic_CORINFO_SIG_INFO()?

key.flags = (DWORD)sig->flags;
key.numArgs = (DWORD)sig->numArgs;

if ((sig->cbSig == 0) && (sig->pSig != nullptr))
{
// In this case, assume it is crossgen2 and pSig is actually a "handle" (some kind of pointer
// to an object), not a pointer to an array of signature bytes. Store the handle itself.
key.sigHandle = CastHandle((void*)sig->pSig);
}
key.flags = (DWORD)sig->flags;
key.numArgs = (DWORD)sig->numArgs;

SpmiRecordsHelper::StoreAgnostic_CORINFO_SIG_INST_HandleArray(sig->sigInst.classInstCount, sig->sigInst.classInst, SigInstHandleMap, &key.sigInst_classInstCount, &key.sigInst_classInst_Index);
SpmiRecordsHelper::StoreAgnostic_CORINFO_SIG_INST_HandleArray(sig->sigInst.methInstCount, sig->sigInst.methInst, SigInstHandleMap, &key.sigInst_methInstCount, &key.sigInst_methInst_Index);

key.scope = CastHandle(sig->scope);
key.args = CastHandle(args);
key.methodSignature = CastPointer(sig->methodSignature);
key.scope = CastHandle(sig->scope);
key.args = CastHandle(args);

Agnostic_GetArgType_Value value;
value.vcTypeRet = CastHandle(*vcTypeRet);
Expand All @@ -2550,12 +2544,11 @@ void MethodContext::recGetArgType(CORINFO_SIG_INFO* sig,
}
void MethodContext::dmpGetArgType(const Agnostic_GetArgType_Key& key, const Agnostic_GetArgType_Value& value)
{
printf("GetArgType key flg-%08X na-%u sigHnd-%016llX %s %s scp-%016llX arg-%016llX",
printf("GetArgType key flg-%08X na-%u %s %s msig-%016llX scp-%016llX arg-%016llX",
key.flags, key.numArgs,
key.sigHandle,
SpmiDumpHelper::DumpAgnostic_CORINFO_SIG_INST_Element("", "cc", "ci", key.sigInst_classInstCount, key.sigInst_classInst_Index, SigInstHandleMap).c_str(),
SpmiDumpHelper::DumpAgnostic_CORINFO_SIG_INST_Element("", "mc", "mi", key.sigInst_methInstCount, key.sigInst_methInst_Index, SigInstHandleMap).c_str(),
key.scope, key.args);
key.methodSignature, key.scope, key.args);
printf(", value result(cit)-%u(%s) vcType-%016llX excp-%08X", value.result, toString((CorInfoTypeWithMod)value.result), value.vcTypeRet, value.exceptionCode);
}
CorInfoTypeWithMod MethodContext::repGetArgType(CORINFO_SIG_INFO* sig,
Expand All @@ -2572,16 +2565,9 @@ CorInfoTypeWithMod MethodContext::repGetArgType(CORINFO_SIG_INFO* sig,

key.flags = (DWORD)sig->flags;
key.numArgs = (DWORD)sig->numArgs;

if ((sig->cbSig == 0) && (sig->pSig != nullptr))
{
// In this case, assume it is crossgen2 and pSig is actually a "handle" (some kind of pointer
// to an object), not a pointer to an array of signature bytes. Store the handle itself.
key.sigHandle = CastHandle((void*)sig->pSig);
}

key.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
key.sigInst_methInstCount = (DWORD)sig->sigInst.methInstCount;
key.methodSignature = CastPointer(sig->methodSignature);
key.scope = CastHandle(sig->scope);
key.args = CastHandle(args);

Expand Down Expand Up @@ -2674,15 +2660,9 @@ void MethodContext::recGetArgClass(CORINFO_SIG_INFO* sig,
SpmiRecordsHelper::StoreAgnostic_CORINFO_SIG_INST_HandleArray(sig->sigInst.classInstCount, sig->sigInst.classInst, SigInstHandleMap, &key.sigInst_classInstCount, &key.sigInst_classInst_Index);
SpmiRecordsHelper::StoreAgnostic_CORINFO_SIG_INST_HandleArray(sig->sigInst.methInstCount, sig->sigInst.methInst, SigInstHandleMap, &key.sigInst_methInstCount, &key.sigInst_methInst_Index);

key.scope = CastHandle(sig->scope);
key.args = CastHandle(args);

if ((sig->cbSig == 0) && (sig->pSig != nullptr))
{
// In this case, assume it is crossgen2 and pSig is actually a "handle" (some kind of pointer
// to an object), not a pointer to an array of signature bytes. Store the handle itself.
key.sigHandle = CastHandle((void*)sig->pSig);
}
key.methodSignature = CastPointer(sig->methodSignature);
key.scope = CastHandle(sig->scope);
key.args = CastHandle(args);

Agnostic_GetArgClass_Value value;
value.result = CastHandle(result);
Expand All @@ -2693,10 +2673,10 @@ void MethodContext::recGetArgClass(CORINFO_SIG_INFO* sig,
}
void MethodContext::dmpGetArgClass(const Agnostic_GetArgClass_Key& key, const Agnostic_GetArgClass_Value& value)
{
printf("GetArgClass key %s %s scp-%016llX args-%016llX sigHnd-%016llX",
printf("GetArgClass key %s %s msig-%016llX scp-%016llX args-%016llX",
SpmiDumpHelper::DumpAgnostic_CORINFO_SIG_INST_Element("", "cc", "ci", key.sigInst_classInstCount, key.sigInst_classInst_Index, SigInstHandleMap).c_str(),
SpmiDumpHelper::DumpAgnostic_CORINFO_SIG_INST_Element("", "mc", "mi", key.sigInst_methInstCount, key.sigInst_methInst_Index, SigInstHandleMap).c_str(),
key.scope, key.args, key.sigHandle);
key.methodSignature, key.scope, key.args);
printf(", value %016llX excp-%08X", value.result, value.exceptionCode);
}
CORINFO_CLASS_HANDLE MethodContext::repGetArgClass(CORINFO_SIG_INFO* sig,
Expand All @@ -2712,16 +2692,10 @@ CORINFO_CLASS_HANDLE MethodContext::repGetArgClass(CORINFO_SIG_INFO* sig,

key.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
key.sigInst_methInstCount = (DWORD)sig->sigInst.methInstCount;
key.methodSignature = CastPointer(sig->methodSignature);
key.scope = CastHandle(sig->scope);
key.args = CastHandle(args);

if ((sig->cbSig == 0) && (sig->pSig != nullptr))
{
// In this case, assume it is crossgen2 and pSig is actually a "handle" (some kind of pointer
// to an object), not a pointer to an array of signature bytes. Store the handle itself.
key.sigHandle = CastHandle((void*)sig->pSig);
}

key.sigInst_classInst_Index = SpmiRecordsHelper::ContainsHandleMap(sig->sigInst.classInstCount, sig->sigInst.classInst, SigInstHandleMap);
key.sigInst_methInst_Index = SpmiRecordsHelper::ContainsHandleMap(sig->sigInst.methInstCount, sig->sigInst.methInst, SigInstHandleMap);

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/ToolBox/superpmi/superpmi-shared/spmidumphelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ inline std::string SpmiDumpHelper::DumpAgnostic_CORINFO_SIG_INFO(
FormatAgnostic_CORINFO_SIG_INST_Element(pbuf, sizeOfBuffer, " ", "cc", "ci", sigInfo.sigInst_classInstCount, sigInfo.sigInst_classInst_Index, handleMap);
FormatAgnostic_CORINFO_SIG_INST_Element(pbuf, sizeOfBuffer, " ", "mc", "mi", sigInfo.sigInst_methInstCount, sigInfo.sigInst_methInst_Index, handleMap);

cch = sprintf_s(pbuf, sizeOfBuffer, " args-%016llX sig-%s sigHnd-%016llX scp-%016llX tok-%08X}",
sigInfo.args, DumpPSig(sigInfo.pSig_Index, sigInfo.cbSig, buffers).c_str(), sigInfo.sigHandle, sigInfo.scope, sigInfo.token);
cch = sprintf_s(pbuf, sizeOfBuffer, " args-%016llX sig-%s msig-%016llX scp-%016llX tok-%08X}",
sigInfo.args, DumpPSig(sigInfo.pSig_Index, sigInfo.cbSig, buffers).c_str(), sigInfo.methodSignature, sigInfo.scope, sigInfo.token);
pbuf += cch;
sizeOfBuffer -= cch;

Expand Down
20 changes: 4 additions & 16 deletions src/coreclr/ToolBox/superpmi/superpmi-shared/spmirecordhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,7 @@ inline Agnostic_CORINFO_SIG_INFO SpmiRecordsHelper::CreateAgnostic_CORINFO_SIG_I
sig.sigInst_methInstCount = (DWORD)sigInfo.sigInst.methInstCount;
sig.args = CastHandle(sigInfo.args);
sig.cbSig = (DWORD)sigInfo.cbSig;
if ((sigInfo.cbSig == 0) && (sigInfo.pSig != nullptr))
{
// In this case, assume it is crossgen2 and pSig is actually a "handle" (some kind of pointer
// to an object), not a pointer to an array of signature bytes. Store the handle itself.
sig.sigHandle = CastHandle((void*)sigInfo.pSig);
}
sig.methodSignature = CastPointer(sigInfo.methodSignature);
sig.scope = CastHandle(sigInfo.scope);
sig.token = (DWORD)sigInfo.token;
return sig;
Expand Down Expand Up @@ -391,16 +386,9 @@ inline CORINFO_SIG_INFO SpmiRecordsHelper::Restore_CORINFO_SIG_INFO(const Agnost
sig.flags = (unsigned)sigInfo.flags;
sig.numArgs = (unsigned)sigInfo.numArgs;
sig.args = (CORINFO_ARG_LIST_HANDLE)sigInfo.args;
if (sigInfo.sigHandle != 0)
{
sig.cbSig = 0;
sig.pSig = (PCCOR_SIGNATURE)sigInfo.sigHandle;
}
else
{
sig.cbSig = (unsigned int)sigInfo.cbSig;
sig.pSig = (PCCOR_SIGNATURE)buffers->GetBuffer(sigInfo.pSig_Index);
}
sig.cbSig = (unsigned int)sigInfo.cbSig;
sig.pSig = (PCCOR_SIGNATURE)buffers->GetBuffer(sigInfo.pSig_Index);
sig.methodSignature = (MethodSignatureInfo*)sigInfo.methodSignature;
sig.scope = (CORINFO_MODULE_HANDLE)sigInfo.scope;
sig.token = (mdToken)sigInfo.token;

Expand Down
6 changes: 5 additions & 1 deletion src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,9 @@ typedef struct CORINFO_VarArgInfo * CORINFO_VARARGS_HANDLE;
// (or the open instantiation) is being referred to.
typedef struct CORINFO_CONTEXT_STRUCT_* CORINFO_CONTEXT_HANDLE;

// MethodSignatureInfo is an opaque handle for passing method signature information across the Jit/EE interface
struct MethodSignatureInfo;

typedef struct CORINFO_DEPENDENCY_STRUCT_
{
CORINFO_MODULE_HANDLE moduleFrom;
Expand Down Expand Up @@ -1091,10 +1094,11 @@ struct CORINFO_SIG_INFO
CorInfoType retType : 8;
unsigned flags : 8; // used by IL stubs code
unsigned numArgs : 16;
struct CORINFO_SIG_INST sigInst; // information about how type variables are being instantiated in generic code
struct CORINFO_SIG_INST sigInst; // information about how type variables are being instantiated in generic code
CORINFO_ARG_LIST_HANDLE args;
PCCOR_SIGNATURE pSig;
unsigned cbSig;
MethodSignatureInfo* methodSignature;// used in place of pSig and cbSig to reference a method signature object handle
CORINFO_MODULE_HANDLE scope; // passed to getArgClass
mdToken token;

Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//

constexpr GUID JITEEVersionIdentifier = { /* a904114d-6fe1-4884-82ab-47849d22d882 */
0xa904114d,
0x6fe1,
0x4884,
{0x82, 0xab, 0x47, 0x84, 0x9d, 0x22, 0xd8, 0x82}
constexpr GUID JITEEVersionIdentifier = { /* 20017875-6552-4375-80A8-F7E2CFC6AAB7 */
0x20017875,
0x6552,
0x4375,
{ 0x80, 0xa8, 0xf7, 0xe2, 0xcf, 0xc6, 0xaa, 0xb7 }
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Loading