@@ -31,15 +31,7 @@ public static void EmitObjectStore(this ILProcessor body, TypeSignature original
31
31
body . Add ( OpCodes . Call , imports . IL2CPP_ManagedStringToIl2Cpp . Value ) ;
32
32
body . Add ( OpCodes . Call , imports . WriteFieldWBarrier ) ;
33
33
}
34
- else if ( originalType is PointerTypeSignature )
35
- {
36
- Debug . Assert ( newType is PointerTypeSignature ) ;
37
-
38
- body . AddLoadArgument ( argumentIndex ) ;
39
- body . Add ( OpCodes . Stobj , newType . ToTypeDefOrRef ( ) ) ;
40
- body . Add ( OpCodes . Pop ) ;
41
- }
42
- else if ( originalType . IsValueType )
34
+ else if ( originalType . IsValueTypeLike ( ) )
43
35
{
44
36
var typeSpecifics = enclosingType . AssemblyContext . GlobalContext . JudgeSpecificsByOriginalType ( originalType ) ;
45
37
if ( typeSpecifics == TypeRewriteContext . TypeSpecifics . BlittableStruct )
@@ -195,15 +187,9 @@ public static void EmitObjectToPointer(this ILProcessor body, TypeSignature orig
195
187
body . Add ( OpCodes . Conv_I ) ;
196
188
}
197
189
}
198
- else if ( originalType is PointerTypeSignature )
199
- {
200
- Debug . Assert ( newType is PointerTypeSignature ) ;
201
-
202
- body . AddLoadArgumentAddress ( argumentIndex ) ;
203
- }
204
- else if ( originalType . IsValueType )
190
+ else if ( originalType . IsValueTypeLike ( ) )
205
191
{
206
- if ( newType . IsValueType )
192
+ if ( newType . IsValueTypeLike ( ) )
207
193
{
208
194
if ( argumentIndex == 0 && valueTypeArgument0IsAPointer )
209
195
body . Add ( OpCodes . Ldarg_0 ) ;
@@ -310,17 +296,9 @@ public static void EmitPointerToObject(this ILProcessor body, TypeSignature orig
310
296
{
311
297
// do nothing
312
298
}
313
- else if ( originalReturnType is PointerTypeSignature )
314
- {
315
- Debug . Assert ( convertedReturnType is PointerTypeSignature ) ;
316
-
317
- body . Add ( OpCodes . Ldloc , pointerVariable ) ;
318
- if ( unboxValueType ) body . Add ( OpCodes . Call , imports . IL2CPP_il2cpp_object_unbox . Value ) ;
319
- body . Add ( OpCodes . Ldobj , convertedReturnType . ToTypeDefOrRef ( ) ) ;
320
- }
321
- else if ( originalReturnType . IsValueType )
299
+ else if ( originalReturnType . IsValueTypeLike ( ) )
322
300
{
323
- if ( convertedReturnType . IsValueType )
301
+ if ( convertedReturnType . IsValueTypeLike ( ) )
324
302
{
325
303
body . Add ( OpCodes . Ldloc , pointerVariable ) ;
326
304
if ( unboxValueType ) body . Add ( OpCodes . Call , imports . IL2CPP_il2cpp_object_unbox . Value ) ;
0 commit comments