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

Run Rust code on native stack segments #4479

Closed
brson opened this issue Jan 14, 2013 · 7 comments
Closed

Run Rust code on native stack segments #4479

brson opened this issue Jan 14, 2013 · 7 comments
Assignees
Labels
A-FFI Area: Foreign function interface (FFI) A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@brson
Copy link
Contributor

brson commented Jan 14, 2013

Currently when we call into C code we don't update the stack pointer to account for the native stack segment, and when we call back into Rust code we immediately switch back to a Rust stack, wasting space on the native stack.

Instead, we should treat the foreign segment the same as any other - putting it into the TCB. Instead of an explicit stack switch to call Rust code, we'll just Run it on the foreign stack. Then the Rust code will start adding new stack segments as needed.

This will give uv callbacks better performance, and will eliminate some of performance concerns around calls from SpiderMonkey into the Rust DOM.

It will also eliminate the need to set the TCB stack pointer to 0 when entering the native stack, eliminating some of the need for no_split_stack. (#1804, #1226)

@brson
Copy link
Contributor Author

brson commented Jan 14, 2013

This may necessitate changes in how we manage multiple reentries into the foreign stack, but I don't remember exactly what we do now.

@graydon
Copy link
Contributor

graydon commented Apr 30, 2013

@pcwalton is this in-scope or related to what you're doing in 0.7?

@graydon
Copy link
Contributor

graydon commented Apr 30, 2013

assigning bug; change assignment if you disagree

@ghost ghost assigned pcwalton Apr 30, 2013
@pnkfelix
Copy link
Member

pnkfelix commented Jul 2, 2013

@pcwalton should we drop this from the 0.7 milestone?

@brson
Copy link
Contributor Author

brson commented Jul 3, 2013

Bumping from 0.7

@alexcrichton
Copy link
Member

Nominating for a milestone. I'm not entirely sure how this interacts with the current runtime along with all the FFI changes for extern fns that happened recently. I would suggest milestone 1 because this sounds like it will likely help define how we manage stacks during FFI, but I would also be OK with other milestones.

@catamorphism
Copy link
Contributor

Closing as obsolete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-FFI Area: Foreign function interface (FFI) A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

6 participants