@@ -97,7 +97,7 @@ public EETypeNode(NodeFactory factory, TypeDesc type)
97
97
_writableDataNode = SupportsWritableData ( factory . Target ) && ! _type . IsCanonicalSubtype ( CanonicalFormKind . Any ) ? new WritableDataNode ( this ) : null ;
98
98
_hasConditionalDependenciesFromMetadataManager = factory . MetadataManager . HasConditionalDependenciesDueToEETypePresence ( type ) ;
99
99
100
- if ( EmitVirtualSlotsAndInterfaces )
100
+ if ( EmitVirtualSlots )
101
101
_virtualMethodAnalysisFlags = AnalyzeVirtualMethods ( type ) ;
102
102
103
103
factory . TypeSystemContext . EnsureLoadableType ( type ) ;
@@ -201,7 +201,7 @@ protected bool MightHaveInterfaceDispatchMap(NodeFactory factory)
201
201
{
202
202
if ( ! _mightHaveInterfaceDispatchMap . HasValue )
203
203
{
204
- _mightHaveInterfaceDispatchMap = EmitVirtualSlotsAndInterfaces && InterfaceDispatchMapNode . MightHaveInterfaceDispatchMap ( _type , factory ) ;
204
+ _mightHaveInterfaceDispatchMap = EmitVirtualSlots && InterfaceDispatchMapNode . MightHaveInterfaceDispatchMap ( _type , factory ) ;
205
205
}
206
206
207
207
return _mightHaveInterfaceDispatchMap . Value ;
@@ -238,7 +238,7 @@ protected override ObjectNodeSection GetDehydratedSection(NodeFactory factory)
238
238
public static int GetMinimumObjectSize ( TypeSystemContext typeSystemContext )
239
239
=> typeSystemContext . Target . PointerSize * 3 ;
240
240
241
- protected virtual bool EmitVirtualSlotsAndInterfaces => false ;
241
+ protected virtual bool EmitVirtualSlots => false ;
242
242
243
243
public override bool InterestingForDynamicDependencyAnalysis
244
244
=> ( _virtualMethodAnalysisFlags & VirtualMethodAnalysisFlags . InterestingForDynamicDependencies ) != 0 ;
@@ -305,7 +305,7 @@ public sealed override bool HasConditionalStaticDependencies
305
305
return true ;
306
306
}
307
307
308
- if ( ! EmitVirtualSlotsAndInterfaces )
308
+ if ( ! EmitVirtualSlots )
309
309
return false ;
310
310
311
311
// Since the vtable is dependency driven, generate conditional static dependencies for
@@ -373,7 +373,7 @@ public sealed override IEnumerable<CombinedDependencyListEntry> GetConditionalSt
373
373
"Information about static bases for type with template" ) ) ;
374
374
}
375
375
376
- if ( ! EmitVirtualSlotsAndInterfaces )
376
+ if ( ! EmitVirtualSlots )
377
377
return result ;
378
378
379
379
DefType defType = _type . GetClosestDefType ( ) ;
@@ -586,7 +586,7 @@ protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFact
586
586
// emitting it.
587
587
dependencies . Add ( new DependencyListEntry ( _optionalFieldsNode , "Optional fields" ) ) ;
588
588
589
- if ( EmitVirtualSlotsAndInterfaces )
589
+ if ( EmitVirtualSlots )
590
590
{
591
591
if ( ! _type . IsArrayTypeWithoutGenericInterfaces ( ) )
592
592
{
@@ -677,7 +677,7 @@ protected override ObjectData GetDehydratableData(NodeFactory factory, bool relo
677
677
678
678
objData . EmitInt ( _type . GetHashCode ( ) ) ;
679
679
680
- if ( EmitVirtualSlotsAndInterfaces )
680
+ if ( EmitVirtualSlots )
681
681
{
682
682
// Emit VTable
683
683
Debug . Assert ( objData . CountBytes - ( ( ISymbolDefinitionNode ) this ) . Offset == GetVTableOffset ( objData . TargetPointerSize ) ) ;
@@ -687,23 +687,21 @@ protected override ObjectData GetDehydratableData(NodeFactory factory, bool relo
687
687
// Update slot count
688
688
int numberOfVtableSlots = virtualSlotCounter . CountSlots ( ref /* readonly */ objData ) ;
689
689
objData . EmitShort ( vtableSlotCountReservation , checked ( ( short ) numberOfVtableSlots ) ) ;
690
-
691
- // Emit interface map
692
- SlotCounter interfaceSlotCounter = SlotCounter . BeginCounting ( ref /* readonly */ objData ) ;
693
- OutputInterfaceMap ( factory , ref objData ) ;
694
-
695
- // Update slot count
696
- int numberOfInterfaceSlots = interfaceSlotCounter . CountSlots ( ref /* readonly */ objData ) ;
697
- objData . EmitShort ( interfaceCountReservation , checked ( ( short ) numberOfInterfaceSlots ) ) ;
698
-
699
690
}
700
691
else
701
692
{
702
693
// If we're not emitting any slots, the number of slots is zero.
703
694
objData . EmitShort ( vtableSlotCountReservation , 0 ) ;
704
- objData . EmitShort ( interfaceCountReservation , 0 ) ;
705
695
}
706
696
697
+ // Emit interface map
698
+ SlotCounter interfaceSlotCounter = SlotCounter . BeginCounting ( ref /* readonly */ objData ) ;
699
+ OutputInterfaceMap ( factory , ref objData ) ;
700
+
701
+ // Update slot count
702
+ int numberOfInterfaceSlots = interfaceSlotCounter . CountSlots ( ref /* readonly */ objData ) ;
703
+ objData . EmitShort ( interfaceCountReservation , checked ( ( short ) numberOfInterfaceSlots ) ) ;
704
+
707
705
OutputTypeManagerIndirection ( factory , ref objData ) ;
708
706
OutputWritableData ( factory , ref objData ) ;
709
707
OutputDispatchMap ( factory , ref objData ) ;
@@ -751,7 +749,7 @@ private void OutputFlags(NodeFactory factory, ref ObjectDataBuilder objData, boo
751
749
flags |= ( uint ) EETypeFlags . GenericVarianceFlag ;
752
750
}
753
751
754
- if ( EmitVirtualSlotsAndInterfaces && ! _type . IsArrayTypeWithoutGenericInterfaces ( ) )
752
+ if ( EmitVirtualSlots && ! _type . IsArrayTypeWithoutGenericInterfaces ( ) )
755
753
{
756
754
SealedVTableNode sealedVTable = factory . SealedVTable ( _type . ConvertToCanonForm ( CanonicalFormKind . Specific ) ) ;
757
755
if ( sealedVTable . BuildSealedVTableSlots ( factory , relocsOnly ) && sealedVTable . NumSealedVTableEntries > 0 )
@@ -949,7 +947,7 @@ protected virtual void OutputRelatedType(NodeFactory factory, ref ObjectDataBuil
949
947
950
948
private void OutputVirtualSlots ( NodeFactory factory , ref ObjectDataBuilder objData , TypeDesc implType , TypeDesc declType , TypeDesc templateType , bool relocsOnly )
951
949
{
952
- Debug . Assert ( EmitVirtualSlotsAndInterfaces ) ;
950
+ Debug . Assert ( EmitVirtualSlots ) ;
953
951
954
952
declType = declType . GetClosestDefType ( ) ;
955
953
templateType = templateType . ConvertToCanonForm ( CanonicalFormKind . Specific ) ;
@@ -1096,8 +1094,6 @@ protected virtual IEETypeNode GetInterfaceTypeNode(NodeFactory factory, TypeDesc
1096
1094
1097
1095
protected virtual void OutputInterfaceMap ( NodeFactory factory , ref ObjectDataBuilder objData )
1098
1096
{
1099
- Debug . Assert ( EmitVirtualSlotsAndInterfaces ) ;
1100
-
1101
1097
foreach ( var itf in _type . RuntimeInterfaces )
1102
1098
{
1103
1099
objData . EmitPointerReloc ( GetInterfaceTypeNode ( factory , itf ) ) ;
@@ -1150,7 +1146,7 @@ protected void OutputOptionalFields(NodeFactory factory, ref ObjectDataBuilder o
1150
1146
1151
1147
private void OutputSealedVTable ( NodeFactory factory , bool relocsOnly , ref ObjectDataBuilder objData )
1152
1148
{
1153
- if ( EmitVirtualSlotsAndInterfaces && ! _type . IsArrayTypeWithoutGenericInterfaces ( ) )
1149
+ if ( EmitVirtualSlots && ! _type . IsArrayTypeWithoutGenericInterfaces ( ) )
1154
1150
{
1155
1151
// Sealed vtables have relative pointers, so to minimize size, we build sealed vtables for the canonical types
1156
1152
SealedVTableNode sealedVTable = factory . SealedVTable ( _type . ConvertToCanonForm ( CanonicalFormKind . Specific ) ) ;
0 commit comments