Commit 0f41fef
Support for 32-bit platforms (with
* Restore support for 32-bit platforms
On 32-bit platforms, add an extra 32-bit word to both _StringObject and _StringGuts for padding and metadata bit storage.
Padding _StringObject rather than adding two extra words to _StringGuts makes for unattractively discontiguous inline storage. However, _StringObject needs 2 more metadata bits than are available in a 32-bit BridgeObject; shoving an extra word in there was easier than a full code reorganization.
To make use of all this luxurious extra space, on 32-bit platforms, _StringGuts._otherBits always contains the count for contiguous strings, while the new _StringGuts._extraBits stored property contains the start address. This makes extracting an unmanaged view a trivial operation.
* [runtime] SwiftObject, SwiftValue: Simplify -description implementation
Previously, these classes implemented -description and -debugDescription by
1) calling _getSummary in the stdlib to get the Swift String description corresponding to the value, and then
2) calling _convertStringToNSString in the Foundation overlay to convert the resulting String into an NSString.
To hold the Swift String value between the two calls, SwiftObject defined a dummy C++ struct whose layout is supposed match that of Swift Strings.
Instead of updating this struct to the new String representation, this commit collapses the two stages above into a single call into a new generic function, _getDescription (defined in the Foundation overlay), which gets rid of this maintenance chore.
* [runtime] Reflection: Update String representation to follow stdlib changes
* _StringObject: Replace _BridgeObject with AnyObject? on 32-bit platforms
Also, don't store any tagged value in _StringObject on 32-bit -- with AnyObject taking up a full word now, we only have 28 bits available (30 tops), which is not enough to store either a count nor a start address.
* LibcShims: Adjust _swift_stdlib_print_hex for 32-bit platforms.
* [test] Update 32-bit reflection tests
Previous (speculative) update missed a couple of offset/size changes.
* [test] IRGen/lazy_multi_file.swift: Allow for the possibility of an sret param before self.
String is 4 words long on 32 bit platforms, which gets returned via sret on i386.
* [test] DebugInfo/self.swift: Don't expect self to be alloca'd first
On i386, space for a String gets allocated before the self variable.
* _StringGuts: Add _RawBitPattern typealias
* _StringGuts: Fix an overlapping access warning
* _StringVariant: Remove IndexDistance condition
* [runtime] Update mangled symbolAnyObject? for now) (swiftlang#15)1 parent 2d4f8a9 commit 0f41fef
File tree
14 files changed
+470
-167
lines changed- stdlib/public
- SDK/Foundation
- core
- runtime
- stubs
- test/DebugInfo
- validation-test/Reflection
14 files changed
+470
-167
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 69 | | |
80 | 70 | | |
81 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
| 83 | + | |
| 84 | + | |
85 | 85 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 86 | + | |
| 87 | + | |
92 | 88 | | |
93 | 89 | | |
94 | 90 | | |
95 | 91 | | |
96 | 92 | | |
97 | 93 | | |
98 | 94 | | |
99 | | - | |
| 95 | + | |
100 | 96 | | |
101 | | - | |
| 97 | + | |
102 | 98 | | |
103 | 99 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 100 | + | |
| 101 | + | |
110 | 102 | | |
111 | 103 | | |
112 | 104 | | |
| |||
165 | 157 | | |
166 | 158 | | |
167 | 159 | | |
168 | | - | |
169 | | - | |
| 160 | + | |
170 | 161 | | |
171 | 162 | | |
172 | 163 | | |
| |||
232 | 223 | | |
233 | 224 | | |
234 | 225 | | |
235 | | - | |
236 | | - | |
237 | 226 | | |
238 | | - | |
239 | | - | |
| 227 | + | |
| 228 | + | |
240 | 229 | | |
241 | 230 | | |
242 | 231 | | |
| |||
259 | 248 | | |
260 | 249 | | |
261 | 250 | | |
262 | | - | |
263 | | - | |
264 | 251 | | |
265 | | - | |
266 | | - | |
| 252 | + | |
| 253 | + | |
267 | 254 | | |
268 | 255 | | |
269 | 256 | | |
| |||
0 commit comments