From: Sergey Andreenko Date: Wed, 28 Jun 2017 00:06:59 +0000 (-0700) Subject: spmi add R2R field to getFieldInfo (dotnet/coreclr#12498) X-Git-Tag: submit/tizen/20210909.063632~11030^2~6925^2~336 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1537b595d1efbe6c0d3588e0c04369ba085a2f0b;p=platform%2Fupstream%2Fdotnet%2Fruntime.git spmi add R2R field to getFieldInfo (dotnet/coreclr#12498) Commit migrated from https://github.com/dotnet/coreclr/commit/92edd69161c6ed23a2a28c17e212c37153edcf97 --- diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp index ecb33de..f522265 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp @@ -3102,6 +3102,7 @@ void MethodContext::recGetFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken, value.accessAllowed = (DWORD)pResult->accessAllowed; value.accessCalloutHelper.helperNum = (DWORD)pResult->accessCalloutHelper.helperNum; value.accessCalloutHelper.numArgs = (DWORD)pResult->accessCalloutHelper.numArgs; + value.fieldLookup = SpmiRecordsHelper::StoreAgnostic_CORINFO_CONST_LOOKUP(&pResult->fieldLookup); for (int i = 0; i < CORINFO_ACCESS_ALLOWED_MAX_ARGS; i++) { value.accessCalloutHelper.args[i].constant = (DWORDLONG)pResult->accessCalloutHelper.args[i].constant; @@ -3144,7 +3145,7 @@ void MethodContext::dmpGetFieldInfo(const Agnostic_GetFieldInfo& key, const Agno break; } } - printf("}"); + printf(" fl %s}", SpmiDumpHelper::DumpAgnostic_CORINFO_CONST_LOOKUP(value.fieldLookup).c_str()); } void MethodContext::repGetFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_HANDLE callerHandle, @@ -3207,6 +3208,7 @@ void MethodContext::repGetFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken, pResult->accessAllowed = (CorInfoIsAccessAllowedResult)value.accessAllowed; pResult->accessCalloutHelper.helperNum = (CorInfoHelpFunc)value.accessCalloutHelper.helperNum; pResult->accessCalloutHelper.numArgs = (unsigned)value.accessCalloutHelper.numArgs; + pResult->fieldLookup = SpmiRecordsHelper::RestoreCORINFO_CONST_LOOKUP(value.fieldLookup); for (int i = 0; i < CORINFO_ACCESS_ALLOWED_MAX_ARGS; i++) { pResult->accessCalloutHelper.args[i].constant = (size_t)value.accessCalloutHelper.args[i].constant; diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h index 88d2754..4b42fa7 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h @@ -191,16 +191,45 @@ public: DWORD numArgs; Agnostic_CORINFO_HELPER_ARG args[CORINFO_ACCESS_ALLOWED_MAX_ARGS]; }; + struct Agnostic_CORINFO_CONST_LOOKUP + { + DWORD accessType; + DWORDLONG handle; // actually a union of two pointer sized things + }; + struct Agnostic_CORINFO_LOOKUP_KIND + { + DWORD needsRuntimeLookup; + DWORD runtimeLookupKind; + WORD runtimeLookupFlags; + }; + struct Agnostic_CORINFO_RUNTIME_LOOKUP + { + DWORDLONG signature; + DWORD helper; + DWORD indirections; + DWORD testForNull; + DWORD testForFixup; + DWORDLONG offsets[CORINFO_MAXINDIRECTIONS]; + DWORD indirectFirstOffset; + }; + struct Agnostic_CORINFO_LOOKUP + { + Agnostic_CORINFO_LOOKUP_KIND lookupKind; + Agnostic_CORINFO_RUNTIME_LOOKUP runtimeLookup; // This and constLookup actually a union, but with different + // layouts.. :-| copy the right one based on lookupKinds value + Agnostic_CORINFO_CONST_LOOKUP constLookup; + }; struct Agnostic_CORINFO_FIELD_INFO { - DWORD fieldAccessor; - DWORD fieldFlags; - DWORD helper; - DWORD offset; - DWORD fieldType; - DWORDLONG structType; - DWORD accessAllowed; - Agnostic_CORINFO_HELPER_DESC accessCalloutHelper; + DWORD fieldAccessor; + DWORD fieldFlags; + DWORD helper; + DWORD offset; + DWORD fieldType; + DWORDLONG structType; + DWORD accessAllowed; + Agnostic_CORINFO_HELPER_DESC accessCalloutHelper; + Agnostic_CORINFO_CONST_LOOKUP fieldLookup; }; struct DD { @@ -227,34 +256,7 @@ public: DWORDLONG callerHandle; DWORD flags; }; - struct Agnostic_CORINFO_LOOKUP_KIND - { - DWORD needsRuntimeLookup; - DWORD runtimeLookupKind; - WORD runtimeLookupFlags; - }; - struct Agnostic_CORINFO_RUNTIME_LOOKUP - { - DWORDLONG signature; - DWORD helper; - DWORD indirections; - DWORD testForNull; - DWORD testForFixup; - DWORDLONG offsets[CORINFO_MAXINDIRECTIONS]; - DWORD indirectFirstOffset; - }; - struct Agnostic_CORINFO_CONST_LOOKUP - { - DWORD accessType; - DWORDLONG handle; // actually a union of two pointer sized things - }; - struct Agnostic_CORINFO_LOOKUP - { - Agnostic_CORINFO_LOOKUP_KIND lookupKind; - Agnostic_CORINFO_RUNTIME_LOOKUP runtimeLookup; // This and constLookup actually a union, but with different - // layouts.. :-| copy the right one based on lookupKinds value - Agnostic_CORINFO_CONST_LOOKUP constLookup; - }; + struct Agnostic_CORINFO_CALL_INFO { DWORDLONG hMethod;