-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Experiment with moving the task pointer to thread local storage #466
Comments
SpiderMonkey, the new IonMonkey repo in particular but I hope it can be landed early, has an effort to move the JSContext *cx near-universal first parameter to TLS. Two bugs of interest: https://bugzilla.mozilla.org/show_bug.cgi?id=659404 Measure TLS cost on platforms/compilers of interest /be |
https://bugzilla.mozilla.org/show_bug.cgi?id=659404 might be of interest. /be |
This is working as of commit 9ba8617. Leaving this open while I work on removing a bunch of redundant rust_task traffic. |
This is needed for stack growth to work; bumping to 0.1 blocker. |
Enough of this is implemented to get stack growth to work; demoting from 0.1 blocker status. |
Does this mean we could drop the task argument to all functions and just make the runtime get it from tls when it needs it? |
Yes indeed :) It's a big win. Check out how it works in |
Only intrinsics still take a dummy taskptr. We'll have to do some makefile stunts to snapshot a version without taskptrs-in-intrinsics. Issue #466
Add clearenv()
Required manual fix due to API changes: - compiler/rustc_codegen_llvm/src/gotoc/mir_to_goto/context/goto_ctx.rs - compiler/rustc_codegen_llvm/src/gotoc/mir_to_goto/monomorphize/collector.rs Updated test expectations due to issue rust-lang#466: - src/test/expected/enum/expected - src/test/expected/niche/expected - src/test/expected/niche2/expected
I refactored how we codegen panic statements so it now it terminate the program per its spec. I have also removed the hack we had to try to get the assert location. Since we currently do not support stack unwinding, the panic codegen will always terminate immediately and it will not try to unwind the stack. I added an option to RMC to force the compiler to use abort as the panic strategy and a check to rmc codegen that will fail if the user tries to override that. Another note is that we currently do not support `#[track_caller]` and I have not changed that. This change fixes rust-lang#67, fixes rust-lang#466, fixes rust-lang#543, and fixes rust-lang#636. This change also mitigates rust-lang#545.
We currently thread the task pointer through all Rust functions, which increases register pressure and makes calls slightly more expensive. It may well be cheaper to put it in thread-local storage. We should experiment with this.
The text was updated successfully, but these errors were encountered: