about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-01-15 13:51:50 -0800
committerbors <bors@rust-lang.org>2014-01-15 13:51:50 -0800
commit149fc76698318f8f7cdfaa37a818e347721764e7 (patch)
tree670def8626471f07af6948700f044b4cabd344ac
parent7ce3386511efc7406ed284f75f9722c55948302e (diff)
parent86c60b68f996c45565543370b9fb93f2ce14865d (diff)
downloadrust-149fc76698318f8f7cdfaa37a818e347721764e7.tar.gz
rust-149fc76698318f8f7cdfaa37a818e347721764e7.zip
auto merge of #11550 : alexcrichton/rust/noinline, r=thestinger
The failure functions are generic, meaning they're candidates for getting
inlined across crates. This has been happening, leading to monstrosities like
that found in #11549. I have verified that the codegen is *much* better now that
we're not inlining the failure path (the slow path).
-rw-r--r--src/libstd/rt/unwind.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs
index 3a07e8c373b..ffe254574eb 100644
--- a/src/libstd/rt/unwind.rs
+++ b/src/libstd/rt/unwind.rs
@@ -364,6 +364,7 @@ pub mod eabi {
 /// This is the entry point of unwinding for things like lang items and such.
 /// The arguments are normally generated by the compiler, and need to
 /// have static lifetimes.
+#[inline(never)] #[cold] // this is the slow path, please never inline this
 pub fn begin_unwind_raw(msg: *c_char, file: *c_char, line: size_t) -> ! {
     #[inline]
     fn static_char_ptr(p: *c_char) -> &'static str {
@@ -381,6 +382,7 @@ pub fn begin_unwind_raw(msg: *c_char, file: *c_char, line: size_t) -> ! {
 }
 
 /// This is the entry point of unwinding for fail!() and assert!().
+#[inline(never)] #[cold] // this is the slow path, please never inline this
 pub fn begin_unwind<M: Any + Send>(msg: M, file: &'static str, line: uint) -> ! {
     // Note that this should be the only allocation performed in this block.
     // Currently this means that fail!() on OOM will invoke this code path,