@@ -156,13 +156,13 @@ pub unsafe fn record_rust_managed_stack_bounds(stack_lo: uint, stack_hi: uint) {
156156 #[ cfg( not( windows) ) ] #[ inline( always) ]
157157 unsafe fn target_record_stack_bounds ( _stack_lo : uint , _stack_hi : uint ) { }
158158
159- #[ cfg( windows, target_arch = "x86" ) ] #[ inline( always) ]
159+ #[ cfg( all ( windows, target_arch = "x86" ) ) ] #[ inline( always) ]
160160 unsafe fn target_record_stack_bounds ( stack_lo : uint , stack_hi : uint ) {
161161 // stack range is at TIB: %fs:0x04 (top) and %fs:0x08 (bottom)
162162 asm ! ( "mov $0, %fs:0x04" :: "r" ( stack_hi) :: "volatile" ) ;
163163 asm ! ( "mov $0, %fs:0x08" :: "r" ( stack_lo) :: "volatile" ) ;
164164 }
165- #[ cfg( windows, target_arch = "x86_64" ) ] #[ inline( always) ]
165+ #[ cfg( all ( windows, target_arch = "x86_64" ) ) ] #[ inline( always) ]
166166 unsafe fn target_record_stack_bounds ( stack_lo : uint , stack_hi : uint ) {
167167 // stack range is at TIB: %gs:0x08 (top) and %gs:0x10 (bottom)
168168 asm ! ( "mov $0, %gs:0x08" :: "r" ( stack_hi) :: "volatile" ) ;
@@ -189,49 +189,53 @@ pub unsafe fn record_sp_limit(limit: uint) {
189189 return target_record_sp_limit ( limit) ;
190190
191191 // x86-64
192- #[ cfg( target_arch = "x86_64" , target_os = "macos" ) ]
193- #[ cfg( target_arch = "x86_64" , target_os = "ios" ) ] #[ inline( always) ]
192+ #[ cfg( all( target_arch = "x86_64" ,
193+ any( target_os = "macos" , target_os = "ios" ) ) ) ]
194+ #[ inline( always) ]
194195 unsafe fn target_record_sp_limit ( limit : uint ) {
195196 asm ! ( "movq $$0x60+90*8, %rsi
196197 movq $0, %gs:(%rsi)" :: "r" ( limit) : "rsi" : "volatile" )
197198 }
198- #[ cfg( target_arch = "x86_64" , target_os = "linux" ) ] #[ inline( always) ]
199+ #[ cfg( all ( target_arch = "x86_64" , target_os = "linux" ) ) ] #[ inline( always) ]
199200 unsafe fn target_record_sp_limit ( limit : uint ) {
200201 asm ! ( "movq $0, %fs:112" :: "r" ( limit) :: "volatile" )
201202 }
202- #[ cfg( target_arch = "x86_64" , target_os = "windows" ) ] #[ inline( always) ]
203+ #[ cfg( all ( target_arch = "x86_64" , target_os = "windows" ) ) ] #[ inline( always) ]
203204 unsafe fn target_record_sp_limit ( _: uint ) {
204205 }
205- #[ cfg( target_arch = "x86_64" , target_os = "freebsd" ) ] #[ inline( always) ]
206+ #[ cfg( all ( target_arch = "x86_64" , target_os = "freebsd" ) ) ] #[ inline( always) ]
206207 unsafe fn target_record_sp_limit ( limit : uint ) {
207208 asm ! ( "movq $0, %fs:24" :: "r" ( limit) :: "volatile" )
208209 }
209- #[ cfg( target_arch = "x86_64" , target_os = "dragonfly" ) ] #[ inline( always) ]
210+ #[ cfg( all ( target_arch = "x86_64" , target_os = "dragonfly" ) ) ] #[ inline( always) ]
210211 unsafe fn target_record_sp_limit ( limit : uint ) {
211212 asm ! ( "movq $0, %fs:32" :: "r" ( limit) :: "volatile" )
212213 }
213214
214215 // x86
215- #[ cfg( target_arch = "x86" , target_os = "macos" ) ]
216- #[ cfg( target_arch = "x86" , target_os = "ios" ) ] #[ inline( always) ]
216+ #[ cfg( all( target_arch = "x86" ,
217+ any( target_os = "macos" , target_os = "ios" ) ) ) ]
218+ #[ inline( always) ]
217219 unsafe fn target_record_sp_limit ( limit : uint ) {
218220 asm ! ( "movl $$0x48+90*4, %eax
219221 movl $0, %gs:(%eax)" :: "r" ( limit) : "eax" : "volatile" )
220222 }
221- #[ cfg( target_arch = "x86" , target_os = "linux" ) ]
222- #[ cfg( target_arch = "x86" , target_os = "freebsd" ) ] #[ inline( always) ]
223+ #[ cfg( all( target_arch = "x86" ,
224+ any( target_os = "linux" , target_os = "freebsd" ) ) ) ]
225+ #[ inline( always) ]
223226 unsafe fn target_record_sp_limit ( limit : uint ) {
224227 asm ! ( "movl $0, %gs:48" :: "r" ( limit) :: "volatile" )
225228 }
226- #[ cfg( target_arch = "x86" , target_os = "windows" ) ] #[ inline( always) ]
229+ #[ cfg( all ( target_arch = "x86" , target_os = "windows" ) ) ] #[ inline( always) ]
227230 unsafe fn target_record_sp_limit ( _: uint ) {
228231 }
229232
230233 // mips, arm - Some brave soul can port these to inline asm, but it's over
231234 // my head personally
232- #[ cfg( target_arch = "mips" ) ]
233- #[ cfg( target_arch = "mipsel" ) ]
234- #[ cfg( target_arch = "arm" , not( target_os = "ios" ) ) ] #[ inline( always) ]
235+ #[ cfg( any( target_arch = "mips" ,
236+ target_arch = "mipsel" ,
237+ all( target_arch = "arm" , not( target_os = "ios" ) ) ) ) ]
238+ #[ inline( always) ]
235239 unsafe fn target_record_sp_limit ( limit : uint ) {
236240 use libc:: c_void;
237241 return record_sp_limit ( limit as * const c_void ) ;
@@ -241,7 +245,7 @@ pub unsafe fn record_sp_limit(limit: uint) {
241245 }
242246
243247 // iOS segmented stack is disabled for now, see related notes
244- #[ cfg( target_arch = "arm" , target_os = "ios" ) ] #[ inline( always) ]
248+ #[ cfg( all ( target_arch = "arm" , target_os = "ios" ) ) ] #[ inline( always) ]
245249 unsafe fn target_record_sp_limit ( _: uint ) {
246250 }
247251}
@@ -259,31 +263,32 @@ pub unsafe fn get_sp_limit() -> uint {
259263 return target_get_sp_limit ( ) ;
260264
261265 // x86-64
262- #[ cfg( target_arch = "x86_64" , target_os = "macos" ) ]
263- #[ cfg( target_arch = "x86_64" , target_os = "ios" ) ] #[ inline( always) ]
266+ #[ cfg( all( target_arch = "x86_64" ,
267+ any( target_os = "macos" , target_os = "ios" ) ) ) ]
268+ #[ inline( always) ]
264269 unsafe fn target_get_sp_limit ( ) -> uint {
265270 let limit;
266271 asm ! ( "movq $$0x60+90*8, %rsi
267272 movq %gs:(%rsi), $0" : "=r" ( limit) :: "rsi" : "volatile" ) ;
268273 return limit;
269274 }
270- #[ cfg( target_arch = "x86_64" , target_os = "linux" ) ] #[ inline( always) ]
275+ #[ cfg( all ( target_arch = "x86_64" , target_os = "linux" ) ) ] #[ inline( always) ]
271276 unsafe fn target_get_sp_limit ( ) -> uint {
272277 let limit;
273278 asm ! ( "movq %fs:112, $0" : "=r" ( limit) :: : "volatile" ) ;
274279 return limit;
275280 }
276- #[ cfg( target_arch = "x86_64" , target_os = "windows" ) ] #[ inline( always) ]
281+ #[ cfg( all ( target_arch = "x86_64" , target_os = "windows" ) ) ] #[ inline( always) ]
277282 unsafe fn target_get_sp_limit ( ) -> uint {
278283 return 1024 ;
279284 }
280- #[ cfg( target_arch = "x86_64" , target_os = "freebsd" ) ] #[ inline( always) ]
285+ #[ cfg( all ( target_arch = "x86_64" , target_os = "freebsd" ) ) ] #[ inline( always) ]
281286 unsafe fn target_get_sp_limit ( ) -> uint {
282287 let limit;
283288 asm ! ( "movq %fs:24, $0" : "=r" ( limit) :: : "volatile" ) ;
284289 return limit;
285290 }
286- #[ cfg( target_arch = "x86_64" , target_os = "dragonfly" ) ] #[ inline( always) ]
291+ #[ cfg( all ( target_arch = "x86_64" , target_os = "dragonfly" ) ) ] #[ inline( always) ]
287292 unsafe fn target_get_sp_limit ( ) -> uint {
288293 let limit;
289294 asm ! ( "movq %fs:32, $0" : "=r" ( limit) :: : "volatile" ) ;
@@ -292,31 +297,34 @@ pub unsafe fn get_sp_limit() -> uint {
292297
293298
294299 // x86
295- #[ cfg( target_arch = "x86" , target_os = "macos" ) ]
296- #[ cfg( target_arch = "x86" , target_os = "ios" ) ] #[ inline( always) ]
300+ #[ cfg( all( target_arch = "x86" ,
301+ any( target_os = "macos" , target_os = "ios" ) ) ) ]
302+ #[ inline( always) ]
297303 unsafe fn target_get_sp_limit ( ) -> uint {
298304 let limit;
299305 asm ! ( "movl $$0x48+90*4, %eax
300306 movl %gs:(%eax), $0" : "=r" ( limit) :: "eax" : "volatile" ) ;
301307 return limit;
302308 }
303- #[ cfg( target_arch = "x86" , target_os = "linux" ) ]
304- #[ cfg( target_arch = "x86" , target_os = "freebsd" ) ] #[ inline( always) ]
309+ #[ cfg( all( target_arch = "x86" ,
310+ any( target_os = "linux" , target_os = "freebsd" ) ) ) ]
311+ #[ inline( always) ]
305312 unsafe fn target_get_sp_limit ( ) -> uint {
306313 let limit;
307314 asm ! ( "movl %gs:48, $0" : "=r" ( limit) :: : "volatile" ) ;
308315 return limit;
309316 }
310- #[ cfg( target_arch = "x86" , target_os = "windows" ) ] #[ inline( always) ]
317+ #[ cfg( all ( target_arch = "x86" , target_os = "windows" ) ) ] #[ inline( always) ]
311318 unsafe fn target_get_sp_limit ( ) -> uint {
312319 return 1024 ;
313320 }
314321
315322 // mips, arm - Some brave soul can port these to inline asm, but it's over
316323 // my head personally
317- #[ cfg( target_arch = "mips" ) ]
318- #[ cfg( target_arch = "mipsel" ) ]
319- #[ cfg( target_arch = "arm" , not( target_os = "ios" ) ) ] #[ inline( always) ]
324+ #[ cfg( any( target_arch = "mips" ,
325+ target_arch = "mipsel" ,
326+ all( target_arch = "arm" , not( target_os = "ios" ) ) ) ) ]
327+ #[ inline( always) ]
320328 unsafe fn target_get_sp_limit ( ) -> uint {
321329 use libc:: c_void;
322330 return get_sp_limit ( ) as uint ;
@@ -328,7 +336,7 @@ pub unsafe fn get_sp_limit() -> uint {
328336 // iOS doesn't support segmented stacks yet. This function might
329337 // be called by runtime though so it is unsafe to mark it as
330338 // unreachable, let's return a fixed constant.
331- #[ cfg( target_arch = "arm" , target_os = "ios" ) ] #[ inline( always) ]
339+ #[ cfg( all ( target_arch = "arm" , target_os = "ios" ) ) ] #[ inline( always) ]
332340 unsafe fn target_get_sp_limit ( ) -> uint {
333341 1024
334342 }
0 commit comments