Skip to content

Commit c353801

Browse files
authored
[registrar] Remove 32-bit support. (#22671)
1 parent 61938fe commit c353801

File tree

7 files changed

+15
-85
lines changed

7 files changed

+15
-85
lines changed

runtime/runtime.m

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,9 @@
110110
void* retain_tramp;
111111
void* static_tramp;
112112
void* ctor_tramp;
113-
void* x86_double_abi_stret_tramp;
114113
void* static_fpret_single_tramp;
115114
void* static_fpret_double_tramp;
116115
void* static_stret_tramp;
117-
void* x86_double_abi_static_stret_tramp;
118116
void* long_tramp;
119117
void* static_long_tramp;
120118
#if MONOMAC
@@ -171,19 +169,9 @@
171169
(void *) &xamarin_retain_trampoline,
172170
(void *) &xamarin_static_trampoline,
173171
(void *) &xamarin_ctor_trampoline,
174-
#if defined (__i386__)
175-
(void *) &xamarin_x86_double_abi_stret_trampoline,
176-
#else
177-
NULL,
178-
#endif
179172
(void *) &xamarin_static_fpret_single_trampoline,
180173
(void *) &xamarin_static_fpret_double_trampoline,
181174
(void *) &xamarin_static_stret_trampoline,
182-
#if defined (__i386__)
183-
(void *) &xamarin_static_x86_double_abi_stret_trampoline,
184-
#else
185-
NULL,
186-
#endif
187175
(void *) &xamarin_longret_trampoline,
188176
(void *) &xamarin_static_longret_trampoline,
189177
#if MONOMAC

runtime/xamarin/trampolines.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ id xamarin_retain_trampoline (id self, SEL sel);
3131
void xamarin_dealloc_trampoline (id self, SEL sel);
3232
void * xamarin_static_trampoline (id self, SEL sel, ...);
3333
void * xamarin_ctor_trampoline (id self, SEL sel, ...);
34-
void xamarin_x86_double_abi_stret_trampoline ();
3534
float xamarin_static_fpret_single_trampoline (id self, SEL sel, ...);
3635
double xamarin_static_fpret_double_trampoline (id self, SEL sel, ...);
3736
void xamarin_static_stret_trampoline (void *buffer, id self, SEL sel, ...);
38-
void xamarin_static_x86_double_abi_stret_trampoline ();
3937
long long xamarin_longret_trampoline (id self, SEL sel, ...);
4038
long long xamarin_static_longret_trampoline (id self, SEL sel, ...);
4139
id xamarin_copyWithZone_trampoline1 (id self, SEL sel, NSZone *zone);

src/ObjCRuntime/DynamicRegistrar.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,6 @@ protected override bool IsSimulatorOrDesktop {
163163
}
164164
}
165165

166-
protected override bool Is64Bits {
167-
get {
168-
return IntPtr.Size == 8;
169-
}
170-
}
171-
172166
protected override bool IsARM64 {
173167
get {
174168
return Runtime.IsARM64CallingConvention;
@@ -1117,12 +1111,6 @@ bool RegisterMethod (ObjCMethod method)
11171111
case Trampoline.Stret:
11181112
tramp = Method.StretTrampoline;
11191113
break;
1120-
case Trampoline.X86_DoubleABI_StaticStretTrampoline:
1121-
tramp = Method.X86_DoubleABI_StaticStretTrampoline;
1122-
break;
1123-
case Trampoline.X86_DoubleABI_StretTrampoline:
1124-
tramp = Method.X86_DoubleABI_StretTrampoline;
1125-
break;
11261114
#if MONOMAC
11271115
case Trampoline.CopyWithZone1:
11281116
tramp = Method.CopyWithZone1;

src/ObjCRuntime/Method.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,6 @@ internal unsafe static IntPtr RetainTrampoline {
7171
}
7272
}
7373

74-
internal unsafe static IntPtr X86_DoubleABI_StretTrampoline {
75-
get {
76-
return Runtime.options->Trampolines->x86_double_abi_stret_tramp;
77-
}
78-
}
79-
80-
internal unsafe static IntPtr X86_DoubleABI_StaticStretTrampoline {
81-
get {
82-
return Runtime.options->Trampolines->x86_double_abi_static_stret_tramp;
83-
}
84-
}
85-
8674
internal unsafe static IntPtr LongTrampoline {
8775
get {
8876
return Runtime.options->Trampolines->long_tramp;

src/ObjCRuntime/Registrar.cs

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -916,11 +916,7 @@ public Trampoline Trampoline {
916916
throw Registrar.CreateException (4104, Method, "The registrar cannot marshal the return value of type `{0}` in the method `{1}.{2}`.", Registrar.GetTypeFullName (NativeReturnType), Registrar.GetTypeFullName (DeclaringType.Type), Registrar.GetDescriptiveMethodName (Method));
917917

918918
if (is_stret) {
919-
if (Registrar.IsSimulatorOrDesktop && !Registrar.Is64Bits) {
920-
trampoline = is_static_trampoline ? Trampoline.X86_DoubleABI_StaticStretTrampoline : Trampoline.X86_DoubleABI_StretTrampoline;
921-
} else {
922-
trampoline = is_static_trampoline ? Trampoline.StaticStret : Trampoline.Stret;
923-
}
919+
trampoline = is_static_trampoline ? Trampoline.StaticStret : Trampoline.Stret;
924920
} else {
925921
switch (Signature [0]) {
926922
case 'Q':
@@ -1151,7 +1147,6 @@ protected virtual void OnRegisterCategory (ObjCType type, ref List<Exception> ex
11511147
protected abstract TType GetFieldType (TField field);
11521148
protected abstract int GetValueTypeSize (TType type);
11531149
protected abstract bool IsSimulatorOrDesktop { get; }
1154-
protected abstract bool Is64Bits { get; }
11551150
protected abstract bool IsARM64 { get; }
11561151
protected abstract Exception CreateExceptionImpl (int code, bool error, Exception innerException, TMethod method, string message, params object [] args);
11571152
protected abstract Exception CreateExceptionImpl (int code, bool error, Exception innerException, TType type, string message, params object [] args);
@@ -2256,8 +2251,8 @@ ObjCType RegisterTypeUnsafe (TType type, ref List<Exception> exceptions)
22562251
DeclaringType = objcType,
22572252
Name = ca.Name ?? GetPropertyName (property),
22582253
#if !MTOUCH && !MMP && !BUNDLER
2259-
Size = Is64Bits ? 8 : 4,
2260-
Alignment = (byte) (Is64Bits ? 3 : 2),
2254+
Size = 8,
2255+
Alignment = (byte) 3,
22612256
#endif
22622257
FieldType = "@",
22632258
IsProperty = true,
@@ -2681,7 +2676,7 @@ protected string ToSignature (TType type, ObjCMember member, ref bool success, b
26812676
switch (App.Platform) {
26822677
case ApplePlatform.iOS:
26832678
case ApplePlatform.TVOS:
2684-
return Is64Bits ? "B" : "c";
2679+
return "B";
26852680
case ApplePlatform.MacOSX:
26862681
case ApplePlatform.MacCatalyst:
26872682
return IsARM64 ? "B" : "c";
@@ -2692,22 +2687,22 @@ protected string ToSignature (TType type, ObjCMember member, ref bool success, b
26922687
#if MONOMAC || __MACCATALYST__
26932688
return IsARM64 ? "B" : "c";
26942689
#else
2695-
return Is64Bits ? "B" : "c";
2690+
return "B";
26962691
#endif
26972692
#endif
26982693
case "System.Void": return "v";
26992694
case "System.String":
27002695
return forProperty ? "@\"NSString\"" : "@";
27012696
case "System.nint":
2702-
return Is64Bits ? "q" : "i";
2697+
return "q";
27032698
case "System.nuint":
2704-
return Is64Bits ? "Q" : "I";
2699+
return "Q";
27052700
case "System.DateTime":
27062701
throw CreateException (4102, member, Errors.MT4102, "System.DateTime", "Foundation.NSDate", member.FullName);
27072702
}
27082703

27092704
if (typeFullName == NFloatTypeName)
2710-
return Is64Bits ? "d" : "f";
2705+
return "d";
27112706

27122707
if (Is (type, ObjCRuntime, "Selector"))
27132708
return ":";
@@ -2729,18 +2724,7 @@ protected string ToSignature (TType type, ObjCMember member, ref bool success, b
27292724
return "^v";
27302725

27312726
if (IsEnum (type, out isNativeEnum)) {
2732-
if (isNativeEnum && !Is64Bits) {
2733-
switch (GetEnumUnderlyingType (type).FullName) {
2734-
case "System.Int64":
2735-
return "i";
2736-
case "System.UInt64":
2737-
return "I";
2738-
default:
2739-
throw CreateException (4145, Errors.MT4145, GetTypeFullName (type));
2740-
}
2741-
} else {
2742-
return ToSignature (GetEnumUnderlyingType (type), member, ref success);
2743-
}
2727+
return ToSignature (GetEnumUnderlyingType (type), member, ref success);
27442728
}
27452729

27462730
if (IsValueType (type))
@@ -2855,8 +2839,6 @@ enum Trampoline {
28552839
Constructor,
28562840
Long,
28572841
StaticLong,
2858-
X86_DoubleABI_StaticStretTrampoline,
2859-
X86_DoubleABI_StretTrampoline,
28602842
CopyWithZone1,
28612843
CopyWithZone2,
28622844
GetGCHandle,

src/ObjCRuntime/Runtime.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,9 @@ internal struct Trampolines {
151151
public IntPtr retain_tramp;
152152
public IntPtr static_tramp;
153153
public IntPtr ctor_tramp;
154-
public IntPtr x86_double_abi_stret_tramp;
155154
public IntPtr static_fpret_single_tramp;
156155
public IntPtr static_fpret_double_tramp;
157156
public IntPtr static_stret_tramp;
158-
public IntPtr x86_double_abi_static_stret_tramp;
159157
public IntPtr long_tramp;
160158
public IntPtr static_long_tramp;
161159
#if MONOMAC

tools/common/StaticRegistrar.cs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ protected override void ReportWarning (int code, string message, params object [
747747
ErrorHelper.Show (ErrorHelper.CreateWarning (code, message, args));
748748
}
749749

750-
public static int GetValueTypeSize (TypeDefinition type, bool is_64_bits)
750+
public static int GetValueTypeSize (TypeDefinition type)
751751
{
752752
switch (type.FullName) {
753753
case "System.Char": return 2;
@@ -764,15 +764,15 @@ public static int GetValueTypeSize (TypeDefinition type, bool is_64_bits)
764764
case "System.UInt64": return 8;
765765
case "System.IntPtr":
766766
case "System.nuint":
767-
case "System.nint": return is_64_bits ? 8 : 4;
767+
case "System.nint": return 8;
768768
default:
769769
if (type.FullName == NFloatTypeName)
770-
return is_64_bits ? 8 : 4;
770+
return 8;
771771
int size = 0;
772772
foreach (FieldDefinition field in type.Fields) {
773773
if (field.IsStatic)
774774
continue;
775-
int s = GetValueTypeSize (field.FieldType.Resolve (), is_64_bits);
775+
int s = GetValueTypeSize (field.FieldType.Resolve ());
776776
if (s == -1)
777777
return -1;
778778
size += s;
@@ -783,7 +783,7 @@ public static int GetValueTypeSize (TypeDefinition type, bool is_64_bits)
783783

784784
protected override int GetValueTypeSize (TypeReference type)
785785
{
786-
return GetValueTypeSize (type.Resolve (), Is64Bits);
786+
return GetValueTypeSize (type.Resolve ());
787787
}
788788

789789
public override bool HasReleaseAttribute (MethodDefinition method)
@@ -807,16 +807,6 @@ protected override bool IsSimulatorOrDesktop {
807807
}
808808
}
809809

810-
protected override bool Is64Bits {
811-
get {
812-
if (IsSingleAssembly)
813-
return App.Is64Build;
814-
815-
// Target can be null when mmp is run for multiple assemblies
816-
return Target is not null ? Target.Is64Build : App.Is64Build;
817-
}
818-
}
819-
820810
protected override bool IsARM64 {
821811
get {
822812
return Application.IsArchEnabled (Target?.Abis ?? App.Abis, Xamarin.Abi.ARM64);
@@ -2422,7 +2412,7 @@ void ProcessStructure (StringBuilder name, AutoIndentStringBuilder body, TypeDef
24222412
case "System.UIntPtr":
24232413
name.Append ('p');
24242414
body.AppendLine ("void *v{0};", size);
2425-
size += Is64Bits ? 8 : 4;
2415+
size += 8;
24262416
break;
24272417
default:
24282418
bool found = false;
@@ -3525,8 +3515,6 @@ bool TryGetReturnType (ObjCMethod method, string descriptiveMethodName, List<Exc
35253515
case Trampoline.StaticLong:
35263516
case Trampoline.StaticDouble:
35273517
case Trampoline.StaticSingle:
3528-
case Trampoline.X86_DoubleABI_StaticStretTrampoline:
3529-
case Trampoline.X86_DoubleABI_StretTrampoline:
35303518
case Trampoline.StaticStret:
35313519
case Trampoline.Stret:
35323520
case Trampoline.CopyWithZone2:

0 commit comments

Comments
 (0)