Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std: Optimize panic::catch_unwind slightly #35444

Merged
merged 1 commit into from
Aug 15, 2016

Conversation

alexcrichton
Copy link
Member

The previous implementation of this function was overly conservative with
liberal usage of Option and .unwrap() which in theory never triggers. This
commit essentially removes the Options in favor of unsafe implementations,
improving the code generation of the fast path for LLVM to see through what's
happening more clearly.

cc #34727

@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
unsafe {
let data = data as *mut Data<F, R>;
let f = mem::replace(&mut (*data).f, mem::uninitialized());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ptr::read.

@alexcrichton alexcrichton force-pushed the optimize-catch-unwind branch from 8a75cb0 to 2420e81 Compare August 8, 2016 16:31
@bors
Copy link
Contributor

bors commented Aug 11, 2016

☔ The latest upstream changes (presumably #34866) made this pull request unmergeable. Please resolve the merge conflicts.

The previous implementation of this function was overly conservative with
liberal usage of `Option` and `.unwrap()` which in theory never triggers. This
commit essentially removes the `Option`s in favor of unsafe implementations,
improving the code generation of the fast path for LLVM to see through what's
happening more clearly.

cc rust-lang#34727
@alexcrichton alexcrichton force-pushed the optimize-catch-unwind branch from 2420e81 to 045c8c8 Compare August 11, 2016 18:25
@alexcrichton
Copy link
Member Author

r? @brson

@rust-highfive rust-highfive assigned brson and unassigned aturon Aug 11, 2016
@brson
Copy link
Contributor

brson commented Aug 12, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Aug 12, 2016

📌 Commit 045c8c8 has been approved by brson

@brson brson added the relnotes Marks issues that should be documented in the release notes of the next release. label Aug 12, 2016
Manishearth added a commit to Manishearth/rust that referenced this pull request Aug 13, 2016
… r=brson

std: Optimize panic::catch_unwind slightly

The previous implementation of this function was overly conservative with
liberal usage of `Option` and `.unwrap()` which in theory never triggers. This
commit essentially removes the `Option`s in favor of unsafe implementations,
improving the code generation of the fast path for LLVM to see through what's
happening more clearly.

cc rust-lang#34727
Manishearth added a commit to Manishearth/rust that referenced this pull request Aug 13, 2016
… r=brson

std: Optimize panic::catch_unwind slightly

The previous implementation of this function was overly conservative with
liberal usage of `Option` and `.unwrap()` which in theory never triggers. This
commit essentially removes the `Option`s in favor of unsafe implementations,
improving the code generation of the fast path for LLVM to see through what's
happening more clearly.

cc rust-lang#34727
@bors
Copy link
Contributor

bors commented Aug 13, 2016

⌛ Testing commit 045c8c8 with merge 367b59e...

@bors
Copy link
Contributor

bors commented Aug 13, 2016

💔 Test failed - auto-linux-64-debug-opt

@alexcrichton
Copy link
Member Author

@bors: retry

On Sat, Aug 13, 2016 at 3:29 PM, bors notifications@github.com wrote:

💔 Test failed - auto-linux-64-debug-opt
https://buildbot.rust-lang.org/builders/auto-linux-64-debug-opt/builds/3465


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#35444 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95EAN5CjSOBTADshr7R4toQOGkr-jks5qfkVYgaJpZM4JeZ-g
.

@eddyb
Copy link
Member

eddyb commented Aug 14, 2016

@bors rollup

eddyb added a commit to eddyb/rust that referenced this pull request Aug 14, 2016
… r=brson

std: Optimize panic::catch_unwind slightly

The previous implementation of this function was overly conservative with
liberal usage of `Option` and `.unwrap()` which in theory never triggers. This
commit essentially removes the `Option`s in favor of unsafe implementations,
improving the code generation of the fast path for LLVM to see through what's
happening more clearly.

cc rust-lang#34727
eddyb added a commit to eddyb/rust that referenced this pull request Aug 14, 2016
… r=brson

std: Optimize panic::catch_unwind slightly

The previous implementation of this function was overly conservative with
liberal usage of `Option` and `.unwrap()` which in theory never triggers. This
commit essentially removes the `Option`s in favor of unsafe implementations,
improving the code generation of the fast path for LLVM to see through what's
happening more clearly.

cc rust-lang#34727
bors added a commit that referenced this pull request Aug 14, 2016
@bors bors merged commit 045c8c8 into rust-lang:master Aug 15, 2016
@alexcrichton alexcrichton deleted the optimize-catch-unwind branch August 26, 2016 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants