Commits
John McCall committed 2fc49df3195
Teach SILGen to take advantage of materializeForSet accessors on non-dynamic storage. This allows us to take advantage of dynamic knowledge that a property is implemented as stored in order to gain direct access to it instead of copying into a temporary. When a class or protocol-member property is expensive to copy, and particularly when it's of copy-on-write type, such direct accesses can massively improve the performance of a program. We are currently only able to apply this when the property is implemented purely as stored. A willSet observer inherently blocks the optimization, but we should be able to make it work even for properties with didSet observers. This could be done by returning an arbitrary callback from materializeForSet instead of returning a flag indicating whether to call the setter. rdar://17416120 Swift SVN r22122