about summary refs log tree commit diff
path: root/src/rt/arch/x86_64
AgeCommit message (Collapse)AuthorLines
2015-08-10Remove morestack supportAlex Crichton-73/+0
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-02-11bitrig integrationDave Huseby-2/+2
2014-12-22Removed unused context-switching assembly code.Maya Nitu-257/+0
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-2/+2
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-02-13Remove two allocations from spawning a green taskAlex Crichton-0/+33
Two unfortunate allocations were wrapping a proc() in a proc() with GreenTask::build_start_wrapper, and then boxing this proc in a ~proc() inside of Context::new(). Both of these allocations were a direct result from two conditions: 1. The Context::new() function has a nice api of taking a procedure argument to start up a new context with. This inherently required an allocation by build_start_wrapper because extra code needed to be run around the edges of a user-provided proc() for a new task. 2. The initial bootstrap code only understood how to pass one argument to the next function. By modifying the assembly and entry points to understand more than one argument, more information is passed through in registers instead of allocating a pointer-sized context. This is sadly where I end up throwing mips under a bus because I have no idea what's going on in the mips context switching code and don't know how to modify it. Closes #7767 cc #11389
2013-11-18rt: Namespace all C functions under rust_Brian Anderson-2/+2
2013-10-22Fix unwinding on OS X 10.9.Mark Rowe-0/+9
OS X 10.9's linker has a bug that results in it failing to preserve DWARF unwind information when passed the -no_compact_unwind flag. This flag is passed on OS X because the unwind information for __morestack cannot be represented by the compact unwind format. We can work around this problem by using a more targeted approach to disabling compact unwind information. The OS X linker looks for a particular pattern in the DWARF unwind information and will not attempt to convert the unwind information to the compact format. The pattern in question is the return address register being saved twice to the same location. Fixes #6849.
2013-10-19Use __morestack to detect stack overflowAlex Crichton-387/+16
This commit resumes management of the stack boundaries and limits when switching between tasks. This additionally leverages the __morestack function to run code on "stack overflow". The current behavior is to abort the process, but this is probably not the best behavior in the long term (for deails, see the comment I wrote up in the stack exhaustion routine).
2013-08-26Support Win64 context switchingklutzy-9/+75
This patch saves and restores win64's nonvolatile registers. This patch also saves stack information of thread environment block (TEB), which is at %gs:0x08 and %gs:0x10.
2013-08-26rt: Add {get,record}_sp_limit on Win64klutzy-0/+8
Uses ArbitraryUserPointer area at gs:0x28.
2013-08-26rt: Remove leading underscore on Win64klutzy-3/+6
Win64 convention does not use underscore.
2013-05-03add gitattributes and fix whitespace issuesDaniel Micay-5/+0
2013-04-18auto merge of #5418 : luqmana/rust/stack-float, r=brsonbors-19/+3
Like I commented in #2043, I can't reproduce the weirdness from #1388 on either mac or linux (x84_64) and pushing to try gives all green. That's 128 less bytes to have to keep in the stack for every call to __morestack.
2013-03-31mark the assembly object stacks as non-executableDaniel Micay-8/+27
Closes #5643 This also removes the need to pass noexecstack to gcc, but that wasn't actually working anymore.
2013-03-17rt: Inline get_sp_limit/set_sp_limit/get_sp for x86_64.Luqman Aden-52/+71
2013-03-17rt: don't save and restore xmm/regs in __morestack.Luqman Aden-19/+3
2013-03-11core: Add rt mod and add the new scheduler codeBrian Anderson-4/+9
2013-01-17Add a license check to tidy. #4018Brian Anderson-1/+0
2012-12-10Add license boilerplate to more files.Graydon Hoare-0/+20
2012-12-03Update license, add license boilerplate to most files. Remainder will follow.Graydon Hoare-0/+30
2012-06-28Remove FIXME questionTim Chevalier-2/+0
brson said the answer to the question is probably no... so I'm going to be bold and remove this. Closes #2685
2012-06-21Try removing code marked with "I don't think this is necessary"Tim Chevalier-6/+1
2012-06-07rt: Remove check_stack_alignmentBrian Anderson-10/+0
This function does not do what it tries to do and it is expensive
2012-04-04rt: Add architecture-specific general-purpose register definitionsPatrick Walton-0/+38
This will be used for stack crawling, which in turn will be used for GC and unwinding.
2012-04-03Refactor includes structure, getting rid of rust_internal.hJon Morton-6/+2
Many changes to code structure are included: - removed TIME_SLICE_IN_MS - removed sychronized_indexed_list - removed region_owned - kernel_owned move to kernel.h, task_owned moved to task.h - global configs moved to rust_globals.h - changed #pragma once to standard guard in rust_upcall.h - got rid of memory.h
2012-03-31rt: Fix whitespaceBrian Anderson-3/+3
2012-03-21rt: Shave 16 bytes off the __morestack frameBrian Anderson-2/+2
2012-03-21rt: Shave a few instructions off __morestackBrian Anderson-42/+31
2012-03-21rt: Add a get_sp_limit functionBrian Anderson-0/+18
2012-03-21rt: Rename record_sp to record_sp_limitBrian Anderson-7/+7
2012-02-09rt: Use rust_task_thread's C-stack pool for native callsBrian Anderson-6/+0
2012-02-09rt: Rename call_shim_on_c_stack to call_and_change_stacksBrian Anderson-1/+1
2012-02-09rt: Remove unused context functionsBrian Anderson-14/+0
2012-01-06fix alignment of registers structureNiko Matsakis-6/+3
2012-01-01add missing library, enable segmented stacks for freebsdJyun-Yan You-4/+6
2012-01-01forgot to add parenthesesJyun-Yan You-1/+1
2012-01-01freebsd supportUser Jyyou-7/+17
2011-12-29Save and restore xmm regs across the call to UPCALL_NEW_STACK during ↵Graydon Hoare-1/+27
__morestack, close #1388.
2011-12-29Remove obsolete comments.Graydon Hoare-1/+0
2011-12-19rt: Rename asm_call_on_stack to __morestackBrian Anderson-6/+15
Newer gdb's will backtrace through functions named __morestack even if they change the stack.
2011-12-19rt: Zero the bottom frame's return address and base pointerBrian Anderson-1/+5
My reading of libunwind leads me to believe this is expected. Closes #1322
2011-12-19rt: Save and restore %rax/%eax in __morestackBrian Anderson-3/+3
This doesn't matter now since we use an out pointer for return values but it's sure to show up mysteriously someday.
2011-12-19rt: Remove unused saves from __morestackBrian Anderson-4/+1
2011-12-19rt: Give upcall_new_stack the same convention as other upcallsBrian Anderson-17/+7
2011-12-19rt: Give upcall_del_stack the same convention as other upcallsBrian Anderson-4/+2
2011-12-18rt: Add lots of documentation to __morestackBrian Anderson-23/+23
2011-12-17rt: Use a DWARF CFI scheme that works on mac in __morestackBrian Anderson-11/+3
2011-12-16rt: Fix saved address of unwinding %rsp in __morestackBrian Anderson-1/+1
I haven't thought too deeply about this, but I think I was telling the unwinder to use the stack pointer for the wrong frame when unwinding. Not sure how that could have worked at all, but this results in the correct alignment for cleanups.
2011-12-16rt: Insert stack alignment checks into upcallsBrian Anderson-0/+10
2011-12-12rt: Remove some duplicated code from 64-bit __morestackBrian Anderson-12/+0