Runtime: Provide value witness implementations for class existentials.

Same deal as for opaque existentials--pre-instantiate a static witness table for one-witness-table types (the zero-witness-tables case is nicely handled by Builtin.ObjCPointer's value witness), and generate a vwtable using dynamic witness implementations for each different-sized container on demand as necessary.

Swift SVN r9850
This commit is contained in:
Joe Groff
2013-10-31 18:38:54 +00:00
parent eeed35909e
commit fe7ecec60c
3 changed files with 333 additions and 21 deletions

View File

@@ -1396,6 +1396,15 @@ OpaqueValue *swift_assignExistentialWithCopy1(OpaqueValue *dest,
const OpaqueValue *src,
const Metadata *type);
/// \brief Standard 'typeof' value witness for heap object references that may
/// not be native Swift objects.
///
/// \param obj The object reference.
///
/// \returns The dynamic type metadata for the object.
extern "C"
const Metadata *swift_unknownTypeOf(HeapObject *obj);
} // end namespace swift
#endif /* SWIFT_RUNTIME_METADATA_H */