Skip to content

Commit e490c17

Browse files
committed
Rollup merge of #25974 - richo:stack-msg, r=alexcrichton
These are implemented in asm, they're just not inlined. Open questions are: * Should I just inline them? They're.. big, but it seems as though this needs violates the #[inline(always)] gaurantees the others make. * Does something (llvm?) provide these as intrinsics? The structure of this code suggests that we could be hoisting off something else, instead of flagrantly ignoring it like we do for power and mips.
2 parents 27dd5e9 + 506d5a8 commit e490c17

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/libstd/sys/common/stack.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ pub unsafe fn record_os_managed_stack_bounds(stack_lo: usize, _stack_hi: usize)
139139
pub unsafe fn record_sp_limit(limit: usize) {
140140
return target_record_sp_limit(limit);
141141

142-
// x86-64
143142
#[cfg(all(target_arch = "x86_64",
144143
any(target_os = "macos", target_os = "ios")))]
145144
#[inline(always)]
@@ -164,7 +163,6 @@ pub unsafe fn record_sp_limit(limit: usize) {
164163
asm!("movq $0, %fs:32" :: "r"(limit) :: "volatile")
165164
}
166165

167-
// x86
168166
#[cfg(all(target_arch = "x86",
169167
any(target_os = "macos", target_os = "ios")))]
170168
#[inline(always)]
@@ -182,8 +180,8 @@ pub unsafe fn record_sp_limit(limit: usize) {
182180
unsafe fn target_record_sp_limit(_: usize) {
183181
}
184182

185-
// mips, arm - Some brave soul can port these to inline asm, but it's over
186-
// my head personally
183+
// mips, arm - The implementations are a bit big for inline asm!
184+
// They can be found in src/rt/arch/$target_arch/record_sp.S
187185
#[cfg(any(target_arch = "mips",
188186
target_arch = "mipsel",
189187
all(target_arch = "arm", not(target_os = "ios"))))]
@@ -221,7 +219,6 @@ pub unsafe fn record_sp_limit(limit: usize) {
221219
pub unsafe fn get_sp_limit() -> usize {
222220
return target_get_sp_limit();
223221

224-
// x86-64
225222
#[cfg(all(target_arch = "x86_64",
226223
any(target_os = "macos", target_os = "ios")))]
227224
#[inline(always)]
@@ -255,7 +252,6 @@ pub unsafe fn get_sp_limit() -> usize {
255252
return limit;
256253
}
257254

258-
// x86
259255
#[cfg(all(target_arch = "x86",
260256
any(target_os = "macos", target_os = "ios")))]
261257
#[inline(always)]
@@ -278,8 +274,8 @@ pub unsafe fn get_sp_limit() -> usize {
278274
return 1024;
279275
}
280276

281-
// mips, arm - Some brave soul can port these to inline asm, but it's over
282-
// my head personally
277+
// mips, arm - The implementations are a bit big for inline asm!
278+
// They can be found in src/rt/arch/$target_arch/record_sp.S
283279
#[cfg(any(target_arch = "mips",
284280
target_arch = "mipsel",
285281
all(target_arch = "arm", not(target_os = "ios"))))]

0 commit comments

Comments
 (0)