@@ -24,6 +24,7 @@ public unsafe class MethodTableTests
24
24
{ nameof ( Data . MethodTable . ParentMethodTable ) , new ( ) { Offset = 40 , Type = DataType . pointer } } ,
25
25
{ nameof ( Data . MethodTable . NumInterfaces ) , new ( ) { Offset = 48 , Type = DataType . uint16 } } ,
26
26
{ nameof ( Data . MethodTable . NumVirtuals ) , new ( ) { Offset = 50 , Type = DataType . uint16 } } ,
27
+ { nameof ( Data . MethodTable . PerInstInfo ) , new ( ) { Offset = 56 , Type = DataType . pointer } } ,
27
28
}
28
29
} ;
29
30
@@ -33,6 +34,7 @@ public unsafe class MethodTableTests
33
34
{ nameof ( Data . EEClass . MethodTable ) , new ( ) { Offset = 8 , Type = DataType . pointer } } ,
34
35
{ nameof ( Data . EEClass . CorTypeAttr ) , new ( ) { Offset = 16 , Type = DataType . uint32 } } ,
35
36
{ nameof ( Data . EEClass . NumMethods ) , new ( ) { Offset = 20 , Type = DataType . uint16 } } ,
37
+ { nameof ( Data . EEClass . InternalCorElementType ) , new ( ) { Offset = 22 , Type = DataType . uint8 } } ,
36
38
}
37
39
} ;
38
40
@@ -150,7 +152,7 @@ public void HasRuntimeTypeSystemContract(MockTarget.Architecture arch)
150
152
{
151
153
Contracts . IRuntimeTypeSystem metadataContract = target . Contracts . RuntimeTypeSystem ;
152
154
Assert . NotNull ( metadataContract ) ;
153
- Contracts . MethodTableHandle handle = metadataContract . GetMethodTableHandle ( TestFreeObjectMethodTableAddress ) ;
155
+ Contracts . TypeHandle handle = metadataContract . GetTypeHandle ( TestFreeObjectMethodTableAddress ) ;
154
156
Assert . NotEqual ( TargetPointer . Null , handle . Address ) ;
155
157
Assert . True ( metadataContract . IsFreeObjectMethodTable ( handle ) ) ;
156
158
} ) ;
@@ -187,9 +189,9 @@ public void ValidateSystemObjectMethodTable(MockTarget.Architecture arch)
187
189
{
188
190
Contracts . IRuntimeTypeSystem metadataContract = target . Contracts . RuntimeTypeSystem ;
189
191
Assert . NotNull ( metadataContract ) ;
190
- Contracts . MethodTableHandle systemObjectMethodTableHandle = metadataContract . GetMethodTableHandle ( systemObjectMethodTablePtr ) ;
191
- Assert . Equal ( systemObjectMethodTablePtr . Value , systemObjectMethodTableHandle . Address . Value ) ;
192
- Assert . False ( metadataContract . IsFreeObjectMethodTable ( systemObjectMethodTableHandle ) ) ;
192
+ Contracts . TypeHandle systemObjectTypeHandle = metadataContract . GetTypeHandle ( systemObjectMethodTablePtr ) ;
193
+ Assert . Equal ( systemObjectMethodTablePtr . Value , systemObjectTypeHandle . Address . Value ) ;
194
+ Assert . False ( metadataContract . IsFreeObjectMethodTable ( systemObjectTypeHandle ) ) ;
193
195
} ) ;
194
196
}
195
197
@@ -226,10 +228,10 @@ public void ValidateSystemStringMethodTable(MockTarget.Architecture arch)
226
228
{
227
229
Contracts . IRuntimeTypeSystem metadataContract = target . Contracts . RuntimeTypeSystem ;
228
230
Assert . NotNull ( metadataContract ) ;
229
- Contracts . MethodTableHandle systemStringMethodTableHandle = metadataContract . GetMethodTableHandle ( systemStringMethodTablePtr ) ;
230
- Assert . Equal ( systemStringMethodTablePtr . Value , systemStringMethodTableHandle . Address . Value ) ;
231
- Assert . False ( metadataContract . IsFreeObjectMethodTable ( systemStringMethodTableHandle ) ) ;
232
- Assert . True ( metadataContract . IsString ( systemStringMethodTableHandle ) ) ;
231
+ Contracts . TypeHandle systemStringTypeHandle = metadataContract . GetTypeHandle ( systemStringMethodTablePtr ) ;
232
+ Assert . Equal ( systemStringMethodTablePtr . Value , systemStringTypeHandle . Address . Value ) ;
233
+ Assert . False ( metadataContract . IsFreeObjectMethodTable ( systemStringTypeHandle ) ) ;
234
+ Assert . True ( metadataContract . IsString ( systemStringTypeHandle ) ) ;
233
235
} ) ;
234
236
}
235
237
@@ -258,7 +260,7 @@ public void MethodTableEEClassInvalidThrows(MockTarget.Architecture arch)
258
260
{
259
261
Contracts . IRuntimeTypeSystem metadataContract = target . Contracts . RuntimeTypeSystem ;
260
262
Assert . NotNull ( metadataContract ) ;
261
- Assert . Throws < InvalidOperationException > ( ( ) => metadataContract . GetMethodTableHandle ( badMethodTablePtr ) ) ;
263
+ Assert . Throws < InvalidOperationException > ( ( ) => metadataContract . GetTypeHandle ( badMethodTablePtr ) ) ;
262
264
} ) ;
263
265
}
264
266
@@ -308,11 +310,11 @@ public void ValidateGenericInstMethodTable(MockTarget.Architecture arch)
308
310
{
309
311
Contracts . IRuntimeTypeSystem metadataContract = target . Contracts . RuntimeTypeSystem ;
310
312
Assert . NotNull ( metadataContract ) ;
311
- Contracts . MethodTableHandle genericInstanceMethodTableHandle = metadataContract . GetMethodTableHandle ( genericInstanceMethodTablePtr ) ;
312
- Assert . Equal ( genericInstanceMethodTablePtr . Value , genericInstanceMethodTableHandle . Address . Value ) ;
313
- Assert . False ( metadataContract . IsFreeObjectMethodTable ( genericInstanceMethodTableHandle ) ) ;
314
- Assert . False ( metadataContract . IsString ( genericInstanceMethodTableHandle ) ) ;
315
- Assert . Equal ( numMethods , metadataContract . GetNumMethods ( genericInstanceMethodTableHandle ) ) ;
313
+ Contracts . TypeHandle genericInstanceTypeHandle = metadataContract . GetTypeHandle ( genericInstanceMethodTablePtr ) ;
314
+ Assert . Equal ( genericInstanceMethodTablePtr . Value , genericInstanceTypeHandle . Address . Value ) ;
315
+ Assert . False ( metadataContract . IsFreeObjectMethodTable ( genericInstanceTypeHandle ) ) ;
316
+ Assert . False ( metadataContract . IsString ( genericInstanceTypeHandle ) ) ;
317
+ Assert . Equal ( numMethods , metadataContract . GetNumMethods ( genericInstanceTypeHandle ) ) ;
316
318
} ) ;
317
319
}
318
320
@@ -365,11 +367,11 @@ public void ValidateArrayInstMethodTable(MockTarget.Architecture arch)
365
367
{
366
368
Contracts . IRuntimeTypeSystem metadataContract = target . Contracts . RuntimeTypeSystem ;
367
369
Assert . NotNull ( metadataContract ) ;
368
- Contracts . MethodTableHandle arrayInstanceMethodTableHandle = metadataContract . GetMethodTableHandle ( arrayInstanceMethodTablePtr ) ;
369
- Assert . Equal ( arrayInstanceMethodTablePtr . Value , arrayInstanceMethodTableHandle . Address . Value ) ;
370
- Assert . False ( metadataContract . IsFreeObjectMethodTable ( arrayInstanceMethodTableHandle ) ) ;
371
- Assert . False ( metadataContract . IsString ( arrayInstanceMethodTableHandle ) ) ;
372
- Assert . Equal ( arrayInstanceComponentSize , metadataContract . GetComponentSize ( arrayInstanceMethodTableHandle ) ) ;
370
+ Contracts . TypeHandle arrayInstanceTypeHandle = metadataContract . GetTypeHandle ( arrayInstanceMethodTablePtr ) ;
371
+ Assert . Equal ( arrayInstanceMethodTablePtr . Value , arrayInstanceTypeHandle . Address . Value ) ;
372
+ Assert . False ( metadataContract . IsFreeObjectMethodTable ( arrayInstanceTypeHandle ) ) ;
373
+ Assert . False ( metadataContract . IsString ( arrayInstanceTypeHandle ) ) ;
374
+ Assert . Equal ( arrayInstanceComponentSize , metadataContract . GetComponentSize ( arrayInstanceTypeHandle ) ) ;
373
375
} ) ;
374
376
375
377
}
0 commit comments