Skip to content

Commit 7cc70cd

Browse files
committed
---
yaml --- r: 346051 b: refs/heads/master c: 62a3b02 h: refs/heads/master i: 346049: aad4c22 346047: 5e38dee
1 parent d8cb2e5 commit 7cc70cd

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 0273e6a9cbe0d15893a6a470a9e238f4306ecb4b
2+
refs/heads/master: 62a3b028c031dcd636e2366680ec93234b13de30
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/SILOptimizer/Transforms/PerformanceInliner.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,12 @@ bool SILPerformanceInliner::isProfitableToInline(
262262
int BaseBenefit = RemovedCallBenefit;
263263

264264
// Osize heuristic.
265+
//
266+
// As a hack, don't apply this at all to coroutine inlining; avoiding
267+
// coroutine allocation overheads is extremely valuable. There might be
268+
// more principled ways of getting this effect.
265269
bool isClassMethodAtOsize = false;
266-
if (OptMode == OptimizationMode::ForSize) {
270+
if (OptMode == OptimizationMode::ForSize && !isa<BeginApplyInst>(AI)) {
267271
// Don't inline into thunks.
268272
if (AI.getFunction()->isThunk())
269273
return false;

trunk/stdlib/public/SDK/CoreAudio/CoreAudio.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,17 @@ extension UnsafeMutableAudioBufferListPointer
151151
}
152152

153153
/// Access an indexed `AudioBuffer` (`mBuffers[i]`).
154+
@_borrowed
154155
public subscript(index: Index) -> Element {
155-
get {
156+
_read {
156157
precondition(index >= 0 && index < self.count,
157158
"subscript index out of range")
158-
return (_audioBuffersPointer + index).pointee
159+
yield ((_audioBuffersPointer + index).pointee)
159160
}
160-
nonmutating set(newValue) {
161+
nonmutating _modify {
161162
precondition(index >= 0 && index < self.count,
162163
"subscript index out of range")
163-
(_audioBuffersPointer + index).pointee = newValue
164+
yield (&(_audioBuffersPointer + index).pointee)
164165
}
165166
}
166167
}

trunk/stdlib/public/core/Collection.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ public protocol Collection: Sequence {
414414
/// `endIndex` property.
415415
///
416416
/// - Complexity: O(1)
417+
@_borrowed
417418
subscript(position: Index) -> Element { get }
418419

419420
/// Accesses a contiguous subrange of the collection's elements.

trunk/stdlib/public/core/MutableCollection.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ where SubSequence: MutableCollection
8585
/// `endIndex` property.
8686
///
8787
/// - Complexity: O(1)
88+
@_borrowed
8889
override subscript(position: Index) -> Element { get set }
8990

9091
/// Accesses a contiguous subrange of the collection's elements.

0 commit comments

Comments
 (0)