@@ -1325,10 +1325,12 @@ void Module::AllocateMaps()
13251325 m_TypeRefToMethodTableMap.dwCount = TYPEREF_MAP_INITIAL_SIZE;
13261326 m_MemberRefMap.dwCount = MEMBERREF_MAP_INITIAL_SIZE;
13271327 m_MethodDefToDescMap.dwCount = MEMBERDEF_MAP_INITIAL_SIZE;
1328- m_ILCodeVersioningStateMap.dwCount = MEMBERDEF_MAP_INITIAL_SIZE;
13291328 m_FieldDefToDescMap.dwCount = MEMBERDEF_MAP_INITIAL_SIZE;
13301329 m_GenericParamToDescMap.dwCount = GENERICPARAM_MAP_INITIAL_SIZE;
13311330 m_ManifestModuleReferencesMap.dwCount = ASSEMBLYREFERENCES_MAP_INITIAL_SIZE;
1331+ #ifdef FEATURE_CODE_VERSIONING
1332+ m_ILCodeVersioningStateMap.dwCount = MEMBERDEF_MAP_INITIAL_SIZE;
1333+ #endif // FEATURE_CODE_VERSIONING
13321334 }
13331335 else
13341336 {
@@ -1346,9 +1348,6 @@ void Module::AllocateMaps()
13461348 // Get # MethodDefs
13471349 m_MethodDefToDescMap.dwCount = pImport->GetCountWithTokenKind (mdtMethodDef)+1 ;
13481350
1349- // IL code versions are relatively rare so keep small.
1350- m_ILCodeVersioningStateMap.dwCount = 1 ;
1351-
13521351 // Get # FieldDefs
13531352 m_FieldDefToDescMap.dwCount = pImport->GetCountWithTokenKind (mdtFieldDef)+1 ;
13541353
@@ -1357,6 +1356,11 @@ void Module::AllocateMaps()
13571356
13581357 // Get the number of AssemblyReferences in the map
13591358 m_ManifestModuleReferencesMap.dwCount = pImport->GetCountWithTokenKind (mdtAssemblyRef)+1 ;
1359+
1360+ #ifdef FEATURE_CODE_VERSIONING
1361+ // IL code versions are relatively rare so keep small.
1362+ m_ILCodeVersioningStateMap.dwCount = 1 ;
1363+ #endif // FEATURE_CODE_VERSIONING
13601364 }
13611365
13621366 S_SIZE_T nTotal;
@@ -1365,10 +1369,12 @@ void Module::AllocateMaps()
13651369 nTotal += m_TypeRefToMethodTableMap.dwCount ;
13661370 nTotal += m_MemberRefMap.dwCount ;
13671371 nTotal += m_MethodDefToDescMap.dwCount ;
1368- nTotal += m_ILCodeVersioningStateMap.dwCount ;
13691372 nTotal += m_FieldDefToDescMap.dwCount ;
13701373 nTotal += m_GenericParamToDescMap.dwCount ;
13711374 nTotal += m_ManifestModuleReferencesMap.dwCount ;
1375+ #ifdef FEATURE_CODE_VERSIONING
1376+ nTotal += m_ILCodeVersioningStateMap.dwCount ;
1377+ #endif // FEATURE_CODE_VERSIONING
13721378
13731379 _ASSERTE (m_pAssembly && m_pAssembly->GetLowFrequencyHeap ());
13741380 pTable = (PTR_TADDR)(void *)m_pAssembly->GetLowFrequencyHeap ()->AllocMem (nTotal * S_SIZE_T (sizeof (TADDR)));
@@ -1382,7 +1388,7 @@ void Module::AllocateMaps()
13821388
13831389 m_TypeRefToMethodTableMap.pNext = NULL ;
13841390 m_TypeRefToMethodTableMap.supportedFlags = TYPE_REF_MAP_ALL_FLAGS;
1385- m_TypeRefToMethodTableMap.pTable = &pTable[m_TypeDefToMethodTableMap.dwCount ];
1391+ m_TypeRefToMethodTableMap.pTable = &m_TypeDefToMethodTableMap. pTable [m_TypeDefToMethodTableMap.dwCount ];
13861392
13871393 m_MemberRefMap.pNext = NULL ;
13881394 m_MemberRefMap.supportedFlags = MEMBER_REF_MAP_ALL_FLAGS;
@@ -1392,13 +1398,9 @@ void Module::AllocateMaps()
13921398 m_MethodDefToDescMap.supportedFlags = METHOD_DEF_MAP_ALL_FLAGS;
13931399 m_MethodDefToDescMap.pTable = &m_MemberRefMap.pTable [m_MemberRefMap.dwCount ];
13941400
1395- m_ILCodeVersioningStateMap.pNext = NULL ;
1396- m_ILCodeVersioningStateMap.supportedFlags = METHOD_DEF_MAP_ALL_FLAGS;
1397- m_ILCodeVersioningStateMap.pTable = &m_MethodDefToDescMap.pTable [m_MethodDefToDescMap.dwCount ];
1398-
13991401 m_FieldDefToDescMap.pNext = NULL ;
14001402 m_FieldDefToDescMap.supportedFlags = FIELD_DEF_MAP_ALL_FLAGS;
1401- m_FieldDefToDescMap.pTable = &m_ILCodeVersioningStateMap .pTable [m_ILCodeVersioningStateMap .dwCount ];
1403+ m_FieldDefToDescMap.pTable = &m_MethodDefToDescMap .pTable [m_MethodDefToDescMap .dwCount ];
14021404
14031405 m_GenericParamToDescMap.pNext = NULL ;
14041406 m_GenericParamToDescMap.supportedFlags = GENERIC_PARAM_MAP_ALL_FLAGS;
@@ -1407,6 +1409,12 @@ void Module::AllocateMaps()
14071409 m_ManifestModuleReferencesMap.pNext = NULL ;
14081410 m_ManifestModuleReferencesMap.supportedFlags = MANIFEST_MODULE_MAP_ALL_FLAGS;
14091411 m_ManifestModuleReferencesMap.pTable = &m_GenericParamToDescMap.pTable [m_GenericParamToDescMap.dwCount ];
1412+
1413+ #ifdef FEATURE_CODE_VERSIONING
1414+ m_ILCodeVersioningStateMap.pNext = NULL ;
1415+ m_ILCodeVersioningStateMap.supportedFlags = METHOD_DEF_MAP_ALL_FLAGS;
1416+ m_ILCodeVersioningStateMap.pTable = &m_ManifestModuleReferencesMap.pTable [m_ManifestModuleReferencesMap.dwCount ];
1417+ #endif // FEATURE_CODE_VERSIONING
14101418}
14111419
14121420
@@ -3143,16 +3151,18 @@ BYTE * GetTargetForVTableEntry(HINSTANCE hInst, BYTE **ppVTEntry)
31433151 return *ppVTEntry;
31443152}
31453153
3154+ #ifdef FEATURE_IJW
31463155// ======================================================================================
31473156// Fixup vtables stored in the header to contain pointers to method desc
31483157// prestubs rather than metadata method tokens.
31493158void Module::FixupVTables ()
31503159{
3151- CONTRACTL{
3160+ CONTRACTL
3161+ {
31523162 INSTANCE_CHECK;
31533163 STANDARD_VM_CHECK;
3154- } CONTRACTL_END;
3155-
3164+ }
3165+ CONTRACTL_END;
31563166
31573167 // If we've already fixed up, or this is not an IJW module, just return.
31583168 // NOTE: This relies on ILOnly files not having fixups. If this changes,
@@ -3412,6 +3422,7 @@ void Module::FixupVTables()
34123422 SetIsIJWFixedUp (); // On the module
34133423 } // End of Stage 3
34143424}
3425+ #endif // FEATURE_IJW
34153426
34163427ModuleBase *Module::GetModuleFromIndex (DWORD ix)
34173428{
0 commit comments