@@ -836,17 +836,40 @@ struct TargetVTableDescriptorHeader {
836
836
}
837
837
};
838
838
839
+ template <typename Runtime> struct TargetContextDescriptor ;
840
+
841
+ template <typename Runtime>
842
+ using TargetRelativeContextPointer =
843
+ RelativeIndirectablePointer<const TargetContextDescriptor<Runtime>,
844
+ /* nullable*/ true >;
845
+
846
+ using RelativeContextPointer = TargetRelativeContextPointer<InProcess>;
847
+
848
+ template <typename Runtime, typename IntTy,
849
+ template <typename _Runtime> class Context = TargetContextDescriptor>
850
+ using RelativeContextPointerIntPair =
851
+ RelativeIndirectablePointerIntPair<const Context<Runtime>, IntTy,
852
+ /* nullable*/ true , int32_t >;
853
+
854
+ template <typename Runtime> struct TargetMethodDescriptor ;
855
+
856
+ template <typename Runtime>
857
+ using TargetRelativeMethodDescriptorPointer =
858
+ RelativeIndirectablePointer<const TargetMethodDescriptor<Runtime>,
859
+ /* nullable*/ true >;
860
+
861
+ using RelativeMethodDescriptorPointer =
862
+ TargetRelativeMethodDescriptorPointer<InProcess>;
863
+
839
864
// / An entry in the method override table, referencing a method from one of our
840
865
// / ancestor classes, together with an implementation.
841
866
template <typename Runtime>
842
867
struct TargetMethodOverrideDescriptor {
843
868
// / The class containing the base method.
844
- TargetRelativeIndirectablePointer<Runtime, TargetClassDescriptor<Runtime>,
845
- /* nullable*/ true > Class;
869
+ TargetRelativeContextPointer<Runtime> Class;
846
870
847
871
// / The base method.
848
- TargetRelativeIndirectablePointer<Runtime, TargetMethodDescriptor<Runtime>,
849
- /* nullable*/ true > Method;
872
+ TargetRelativeMethodDescriptorPointer<Runtime> Method;
850
873
851
874
// / The implementation of the override.
852
875
TargetRelativeDirectPointer<Runtime, void , /* nullable*/ true > Impl;
@@ -2191,21 +2214,14 @@ struct TargetTypeMetadataRecord {
2191
2214
2192
2215
using TypeMetadataRecord = TargetTypeMetadataRecord<InProcess>;
2193
2216
2194
- template <typename Runtime> struct TargetContextDescriptor ;
2195
-
2196
- template <typename Runtime>
2197
- using RelativeContextPointer =
2198
- RelativeIndirectablePointer<const TargetContextDescriptor<Runtime>,
2199
- /* nullable*/ true >;
2200
-
2201
2217
// / The structure of a protocol reference record.
2202
2218
template <typename Runtime>
2203
2219
struct TargetProtocolRecord {
2204
2220
// / The protocol referenced.
2205
2221
// /
2206
2222
// / The remaining low bit is reserved for future use.
2207
- RelativeIndirectablePointerIntPair<TargetProtocolDescriptor< Runtime> ,
2208
- /* reserved= */ bool >
2223
+ RelativeContextPointerIntPair< Runtime, /* reserved= */ bool ,
2224
+ TargetProtocolDescriptor >
2209
2225
Protocol;
2210
2226
};
2211
2227
using ProtocolRecord = TargetProtocolRecord<InProcess>;
@@ -2333,15 +2349,15 @@ template <typename Runtime>
2333
2349
struct TargetProtocolConformanceDescriptor final
2334
2350
: public swift::ABI::TrailingObjects<
2335
2351
TargetProtocolConformanceDescriptor<Runtime>,
2336
- RelativeContextPointer <Runtime>,
2352
+ TargetRelativeContextPointer <Runtime>,
2337
2353
TargetGenericRequirementDescriptor<Runtime>,
2338
2354
TargetResilientWitnessesHeader<Runtime>,
2339
2355
TargetResilientWitness<Runtime>,
2340
2356
TargetGenericWitnessTable<Runtime>> {
2341
2357
2342
2358
using TrailingObjects = swift::ABI::TrailingObjects<
2343
2359
TargetProtocolConformanceDescriptor<Runtime>,
2344
- RelativeContextPointer <Runtime>,
2360
+ TargetRelativeContextPointer <Runtime>,
2345
2361
TargetGenericRequirementDescriptor<Runtime>,
2346
2362
TargetResilientWitnessesHeader<Runtime>,
2347
2363
TargetResilientWitness<Runtime>,
@@ -2408,7 +2424,8 @@ struct TargetProtocolConformanceDescriptor final
2408
2424
const TargetContextDescriptor<Runtime> *getRetroactiveContext () const {
2409
2425
if (!Flags.isRetroactive ()) return nullptr ;
2410
2426
2411
- return this ->template getTrailingObjects <RelativeContextPointer<Runtime>>();
2427
+ return this ->template getTrailingObjects <
2428
+ TargetRelativeContextPointer<Runtime>>();
2412
2429
}
2413
2430
2414
2431
// / Whether this conformance is non-unique because it has been synthesized
@@ -2481,7 +2498,7 @@ struct TargetProtocolConformanceDescriptor final
2481
2498
2482
2499
private:
2483
2500
size_t numTrailingObjects (
2484
- OverloadToken<RelativeContextPointer <Runtime>>) const {
2501
+ OverloadToken<TargetRelativeContextPointer <Runtime>>) const {
2485
2502
return Flags.isRetroactive () ? 1 : 0 ;
2486
2503
}
2487
2504
@@ -2527,7 +2544,7 @@ struct TargetContextDescriptor {
2527
2544
ContextDescriptorFlags Flags;
2528
2545
2529
2546
// / The parent context, or null if this is a top-level context.
2530
- RelativeContextPointer <Runtime> Parent;
2547
+ TargetRelativeContextPointer <Runtime> Parent;
2531
2548
2532
2549
bool isGeneric () const { return Flags.isGeneric (); }
2533
2550
bool isUnique () const { return Flags.isUnique (); }
0 commit comments