IRGen/Runtime: Populate the runtime protocol conformance table with relative references.

By using relative references, either directly to symbols internal to the current TU, or to the GOT entry for external symbols, we avoid unnecessary runtime relocations, and we save space on 64-bit platforms, since a single image is still <2GB in size. For the 64-bit standard library, this trades 26KB of fake-const data in __DATA,__swift1_proto for 13KB of true-const data in __TEXT,__swift2_proto. Implements rdar://problem/22334380.

Swift SVN r31555
This commit is contained in:
Joe Groff
2015-08-28 18:07:22 +00:00
parent 68048a2b05
commit 773eadb9f2
14 changed files with 547 additions and 183 deletions

View File

@@ -238,9 +238,9 @@ IRGenModule::IRGenModule(IRGenModuleDispatcher &dispatcher, SourceFile *SF,
ProtocolConformanceRecordTy
= createStructType(*this, "swift.protocol_conformance", {
ProtocolDescriptorPtrTy,
OpaquePtrTy,
OpaquePtrTy,
RelativeAddressTy,
RelativeAddressTy,
RelativeAddressTy,
Int32Ty
});
ProtocolConformanceRecordPtrTy