File tree Expand file tree Collapse file tree 10 files changed +326
-324
lines changed Expand file tree Collapse file tree 10 files changed +326
-324
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/incoming: a692777224150e2dadb5ec02c6ecd5c10ce0dd98
9
+ refs/heads/incoming: 087a015a727b11d46ff5a309ff37c7967e8636d1
10
10
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ .text
2
+
3
+ #if defined(__APPLE__) || defined(_WIN32)
4
+ #define RECORD_SP_LIMIT _record_sp_limit
5
+ #define GET_SP_LIMIT _get_sp_limit
6
+ #define GET_SP _get_sp
7
+ #else
8
+ #define RECORD_SP_LIMIT record_sp_limit
9
+ #define GET_SP_LIMIT get_sp_limit
10
+ #define GET_SP get_sp
11
+ #endif
12
+
13
+ .globl RECORD_SP_LIMIT
14
+ .globl GET_SP_LIMIT
15
+ .globl GET_SP
16
+
17
+ #if defined(__linux__) || defined(__FreeBSD__)
18
+ RECORD_SP_LIMIT:
19
+ movl 4 (%esp ), %eax
20
+ movl %eax , %gs :48
21
+ ret
22
+ #endif
23
+
24
+ #if defined(__APPLE__)
25
+ RECORD_SP_LIMIT:
26
+ movl $0x48 +90*4 , %eax
27
+ movl 4 (%esp ), %ecx
28
+ movl %ecx , %gs :(%eax )
29
+ ret
30
+ #endif
31
+
32
+ #if defined(_WIN32)
33
+ RECORD_SP_LIMIT:
34
+ movl 4 (%esp ), %eax
35
+ movl %eax , %fs :0x14
36
+ ret
37
+ #endif
38
+
39
+ #if defined(__linux__) || defined(__FreeBSD__)
40
+ GET_SP_LIMIT:
41
+ movl %gs :48 , %eax
42
+ ret
43
+ #endif
44
+
45
+ #if defined(__APPLE__)
46
+ GET_SP_LIMIT:
47
+ movl $0x48 +90*4 , %ecx
48
+ movl %gs :(%ecx ), %eax
49
+ ret
50
+ #endif
51
+
52
+ #if defined(_WIN32)
53
+ GET_SP_LIMIT:
54
+ movl %fs :0x14 , %eax
55
+ ret
56
+ #endif
57
+
58
+ GET_SP:
59
+ movl %esp , %eax
60
+ ret
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ .text
2
+
3
+ #if defined(__APPLE__) || defined(_WIN32)
4
+ #define RECORD_SP_LIMIT _record_sp_limit
5
+ #define GET_SP_LIMIT _get_sp_limit
6
+ #define GET_SP _get_sp
7
+ #else
8
+ #define RECORD_SP_LIMIT record_sp_limit
9
+ #define GET_SP_LIMIT get_sp_limit
10
+ #define GET_SP get_sp
11
+ #endif
12
+
13
+ .globl RECORD_SP_LIMIT
14
+ .globl GET_SP_LIMIT
15
+ .globl GET_SP
16
+
17
+ #if defined(__linux__)
18
+ RECORD_SP_LIMIT:
19
+ movq %rdi , %fs :112
20
+ ret
21
+ #elif defined(__APPLE__)
22
+ RECORD_SP_LIMIT:
23
+ movq $0x60 +90*8 , %rsi
24
+ movq %rdi , %gs :(%rsi )
25
+ ret
26
+ #elif defined(__FreeBSD__)
27
+ RECORD_SP_LIMIT:
28
+ movq %rdi , %fs :24
29
+ ret
30
+ #else
31
+ RECORD_SP_LIMIT:
32
+ ret
33
+ #endif
34
+
35
+ #if defined(__linux__)
36
+ GET_SP_LIMIT:
37
+ movq %fs :112 , %rax
38
+ ret
39
+ #elif defined(__APPLE__)
40
+ GET_SP_LIMIT:
41
+ movq $0x60 +90*8 , %rsi
42
+ movq %gs :(%rsi ), %rax
43
+ ret
44
+ #elif defined(__FreeBSD__)
45
+ GET_SP_LIMIT:
46
+ movq %fs :24 , %rax
47
+ ret
48
+ #endif
49
+
50
+ GET_SP:
51
+ movq %rsp , %rax
52
+ ret
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11
11
#ifndef RUST_GLOBALS_H
12
12
#define RUST_GLOBALS_H
13
13
14
- #if defined(__cplusplus )
15
- #define INLINE inline
16
- #elif defined(_MSC_VER ) || defined(__GNUC__ )
17
- #define INLINE __inline__
18
- #else
19
- #define INLINE inline
20
- #endif
21
-
22
- #if defined(__GNUC__ )
23
- #define ALWAYS_INLINE __attribute((always_inline)) INLINE
24
- #elif defined(_MSC_VER )
25
- #define ALWAYS_INLINE __forceinline
26
- #else
27
- #define ALWAYS_INLINE INLINE
28
- #endif
29
-
30
14
#ifndef __STDC_LIMIT_MACROS
31
15
#define __STDC_LIMIT_MACROS 1
32
16
#endif
Original file line number Diff line number Diff line change 118
118
#include " rust_stack.h"
119
119
#include " rust_type.h"
120
120
#include " rust_sched_loop.h"
121
- #include " sp.h"
122
121
123
122
// The amount of extra space at the end of each stack segment, available
124
123
// to the rt, compiler and dynamic linker for running small functions
@@ -420,6 +419,15 @@ template <typename T> struct task_owned {
420
419
}
421
420
};
422
421
422
+ // This stuff is on the stack-switching fast path
423
+
424
+ // Records the pointer to the end of the Rust stack in a platform-
425
+ // specific location in the thread control block
426
+ extern " C" CDECL void record_sp_limit (void *limit);
427
+ extern " C" CDECL uintptr_t get_sp_limit ();
428
+ // Gets a pointer to the vicinity of the current stack pointer
429
+ extern " C" uintptr_t get_sp ();
430
+
423
431
// This is the function that switches between the C and the Rust stack by
424
432
// calling another function with a single void* argument while changing the
425
433
// stack pointer. It has a funny name because gdb doesn't normally like to
@@ -592,6 +600,9 @@ rust_task::prev_stack() {
592
600
record_stack_limit ();
593
601
}
594
602
603
+ extern " C" CDECL void
604
+ record_sp_limit (void *limit);
605
+
595
606
// The LLVM-generated segmented-stack function prolog compares the amount of
596
607
// stack needed for each frame to the end-of-stack pointer stored in the
597
608
// TCB. As an optimization, when the frame size is less than 256 bytes, it
You can’t perform that action at this time.
0 commit comments