mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
IRGen/Runtime: Keep the payload offset inside both compiler- and runtime-generated box metadata.
A missing link in our polymorphic box projection story, and likely a perf improvement for the generic case as well. Swift SVN r29835
This commit is contained in:
@@ -211,6 +211,18 @@ IRGenModule::IRGenModule(IRGenModuleDispatcher &dispatcher, SourceFile *SF,
|
||||
});
|
||||
FullHeapMetadataPtrTy = FullHeapMetadataStructTy->getPointerTo(DefaultAS);
|
||||
|
||||
// A full box metadata is non-type heap metadata for a heap allocation of a
|
||||
// single value. The box tracks the offset to the value inside the box.
|
||||
FullBoxMetadataStructTy =
|
||||
createStructType(*this, "swift.full_boxmetadata", {
|
||||
dtorPtrTy,
|
||||
WitnessTablePtrTy,
|
||||
TypeMetadataStructTy,
|
||||
Int32Ty,
|
||||
});
|
||||
FullBoxMetadataPtrTy = FullBoxMetadataStructTy->getPointerTo(DefaultAS);
|
||||
|
||||
|
||||
llvm::Type *refCountedElts[] = { TypeMetadataPtrTy, Int32Ty, Int32Ty };
|
||||
RefCountedStructTy->setBody(refCountedElts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user