@@ -121,37 +121,6 @@ pub unsafe fn record_os_managed_stack_bounds(stack_lo: uint, _stack_hi: uint) {
121121 record_sp_limit ( stack_lo + RED_ZONE ) ;
122122}
123123
124- #[ inline( always) ]
125- pub unsafe fn record_rust_managed_stack_bounds ( stack_lo : uint , stack_hi : uint ) {
126- // When the old runtime had segmented stacks, it used a calculation that was
127- // "limit + RED_ZONE + FUDGE". The red zone was for things like dynamic
128- // symbol resolution, llvm function calls, etc. In theory this red zone
129- // value is 0, but it matters far less when we have gigantic stacks because
130- // we don't need to be so exact about our stack budget. The "fudge factor"
131- // was because LLVM doesn't emit a stack check for functions < 256 bytes in
132- // size. Again though, we have giant stacks, so we round all these
133- // calculations up to the nice round number of 20k.
134- record_sp_limit ( stack_lo + RED_ZONE ) ;
135-
136- return target_record_stack_bounds ( stack_lo, stack_hi) ;
137-
138- #[ cfg( not( windows) ) ] #[ inline( always) ]
139- unsafe fn target_record_stack_bounds ( _stack_lo : uint , _stack_hi : uint ) { }
140-
141- #[ cfg( all( windows, target_arch = "x86" ) ) ] #[ inline( always) ]
142- unsafe fn target_record_stack_bounds ( stack_lo : uint , stack_hi : uint ) {
143- // stack range is at TIB: %fs:0x04 (top) and %fs:0x08 (bottom)
144- asm ! ( "mov $0, %fs:0x04" :: "r" ( stack_hi) :: "volatile" ) ;
145- asm ! ( "mov $0, %fs:0x08" :: "r" ( stack_lo) :: "volatile" ) ;
146- }
147- #[ cfg( all( windows, target_arch = "x86_64" ) ) ] #[ inline( always) ]
148- unsafe fn target_record_stack_bounds ( stack_lo : uint , stack_hi : uint ) {
149- // stack range is at TIB: %gs:0x08 (top) and %gs:0x10 (bottom)
150- asm ! ( "mov $0, %gs:0x08" :: "r" ( stack_hi) :: "volatile" ) ;
151- asm ! ( "mov $0, %gs:0x10" :: "r" ( stack_lo) :: "volatile" ) ;
152- }
153- }
154-
155124/// Records the current limit of the stack as specified by `end`.
156125///
157126/// This is stored in an OS-dependent location, likely inside of the thread
0 commit comments