@@ -5683,6 +5683,113 @@ const char* MethodContext::repGetClassName(CORINFO_CLASS_HANDLE cls)
56835683 return name;
56845684}
56855685
5686+ void MethodContext::recGetClassNameFromMetadata (CORINFO_CLASS_HANDLE cls,
5687+ char * className,
5688+ const char ** namespaceName)
5689+ {
5690+ if (GetClassNameFromMetadata == nullptr )
5691+ GetClassNameFromMetadata = new LightWeightMap<DLD, DD>();
5692+ DD value;
5693+ DLD key;
5694+ key.A = (DWORDLONG)cls;
5695+ key.B = (namespaceName != nullptr );
5696+
5697+ if (className != nullptr )
5698+ value.A =
5699+ GetClassNameFromMetadata->AddBuffer ((unsigned char *)className, (DWORD)strlen (className) + 1 );
5700+ else
5701+ value.A = (DWORD)-1 ;
5702+
5703+ if ((namespaceName != nullptr ) && (*namespaceName != nullptr ))
5704+ value.B =
5705+ GetClassNameFromMetadata->AddBuffer ((unsigned char *)*namespaceName, (DWORD)strlen (*namespaceName) + 1 );
5706+ else
5707+ value.B = (DWORD)-1 ;
5708+
5709+ GetClassNameFromMetadata->Add (key, value);
5710+ DEBUG_REC (dmpGetClassNameFromMetadata (key, value));
5711+ }
5712+
5713+ void MethodContext::dmpGetClassNameFromMetadata (DLD key, DD value)
5714+ {
5715+ unsigned char * className = (unsigned char *)GetClassNameFromMetadata->GetBuffer (value.A );
5716+ unsigned char * namespaceName = (unsigned char *)GetClassNameFromMetadata->GetBuffer (value.B );
5717+ printf (" GetClassNameFromMetadata key - classNonNull-%u namespaceNonNull-%u, value "
5718+ " class-'%s', namespace-'%s'" ,
5719+ key.A , key.B , className, namespaceName);
5720+ GetClassNameFromMetadata->Unlock ();
5721+ }
5722+
5723+ const char * MethodContext::repGetClassNameFromMetadata (CORINFO_CLASS_HANDLE cls, const char ** namespaceName)
5724+ {
5725+ const char * result = nullptr ;
5726+ DD value;
5727+ DLD key;
5728+ key.A = (DWORDLONG)cls;
5729+ key.B = (namespaceName != nullptr );
5730+
5731+ int itemIndex = -1 ;
5732+ if (GetClassNameFromMetadata != nullptr )
5733+ itemIndex = GetClassNameFromMetadata->GetIndex (key);
5734+ if (itemIndex < 0 )
5735+ {
5736+ if (namespaceName != nullptr )
5737+ {
5738+ *namespaceName = nullptr ;
5739+ }
5740+ }
5741+ else
5742+ {
5743+ value = GetClassNameFromMetadata->Get (key);
5744+ result = (const char *)GetClassNameFromMetadata->GetBuffer (value.A );
5745+
5746+ if (namespaceName != nullptr )
5747+ {
5748+ *namespaceName = (const char *)GetClassNameFromMetadata->GetBuffer (value.B );
5749+ }
5750+ }
5751+ DEBUG_REP (dmpGetClassNameFromMetadata (key, value));
5752+ return result;
5753+ }
5754+
5755+ void MethodContext::recGetTypeInstantiationArgument (CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE result, unsigned index)
5756+ {
5757+ if (GetTypeInstantiationArgument == nullptr )
5758+ GetTypeInstantiationArgument = new LightWeightMap<DWORDLONG, DWORDLONG>();
5759+
5760+ DWORDLONG key = (DWORDLONG)cls;
5761+
5762+ GetTypeInstantiationArgument->Add (key, (DWORDLONG)result);
5763+ DEBUG_REC (dmpGetTypeInstantiationArgument (key, (DWORDLONG)result));
5764+ }
5765+
5766+ void MethodContext::dmpGetTypeInstantiationArgument (DWORDLONG key, DWORDLONG value)
5767+ {
5768+ printf (" GetTypeInstantiationArgument key - classNonNull-%u, value NonNull-%u" , key, value);
5769+ GetTypeInstantiationArgument->Unlock ();
5770+ }
5771+
5772+
5773+ CORINFO_CLASS_HANDLE MethodContext::repGetTypeInstantiationArgument (CORINFO_CLASS_HANDLE cls, unsigned index)
5774+ {
5775+ CORINFO_CLASS_HANDLE result = nullptr ;
5776+ DWORDLONG value;
5777+ DWORDLONG key;
5778+ key = (DWORDLONG)cls;
5779+
5780+ int itemIndex = -1 ;
5781+ if (GetTypeInstantiationArgument != nullptr )
5782+ itemIndex = GetTypeInstantiationArgument->GetIndex (key);
5783+ if (itemIndex >= 0 )
5784+ {
5785+ value = GetTypeInstantiationArgument->Get (key);
5786+ result = (CORINFO_CLASS_HANDLE)value;
5787+ }
5788+
5789+ DEBUG_REP (dmpGetTypeInstantiationArgument (key, value));
5790+ return result;
5791+ }
5792+
56865793void MethodContext::recAppendClassName (
56875794 CORINFO_CLASS_HANDLE cls, BOOL fNamespace , BOOL fFullInst , BOOL fAssembly , const WCHAR* result)
56885795{
0 commit comments