forked from withlin/advanced-go-programming-book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathch3-9-func-decl-02.ditaa.txt
30 lines (28 loc) · 1.56 KB
/
ch3-9-func-decl-02.ditaa.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
func Swap(a, b int) (int, int)
+----------+
| |
| stack |
| cRED | call frame
+----------+ +-----------+ <-=-arg+argsize(FP)
| stack | <--------=- | argsize | <------------------------+argsize
| | | cPNK | :
|call frame| +-----------+ <-=-arg+0(FP) |
| | | | cAAA | |
| | | +-----------+ <-=-tmp-0(SP) |
|cRED| | <--------=- | framesize | <---------+framesize |
| v | | cRED | : |
+----------+ <-=-0(SP) +-----------+ <-=-0(SP) | |
| cAAA | | |
| unused | | |
| | | |
+----------+ | |
| cGRE | | |
| heap | | |
| | +------+------------+------------+---+------+
+----------+ | | | | | |
| cBLU | +-----=- | TEXT | ·Swap(SB), | $framesize | - | 32 |
| data | | | cYEL | cYEL | cRED | | cRED |
+----------+ | +------+------------+------------+---+------+
| cYEL | <--+TEXT |
| text | :
+----------+ <--------------------------+SB