diff options
Diffstat (limited to 'mps/code/ssxcpp.s')
| -rw-r--r-- | mps/code/ssxcpp.s | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mps/code/ssxcpp.s b/mps/code/ssxcpp.s index 74060910262..07159c42cac 100644 --- a/mps/code/ssxcpp.s +++ b/mps/code/ssxcpp.s | |||
| @@ -107,10 +107,18 @@ | |||
| 107 | # Exported symbols | 107 | # Exported symbols |
| 108 | .globl _StackScan | 108 | .globl _StackScan |
| 109 | 109 | ||
| 110 | # Imported symbols | ||
| 111 | .globl _TraceScanArea | ||
| 112 | |||
| 110 | linkageArea = 24 ; size of linkage area to create | 113 | linkageArea = 24 ; size of linkage area to create |
| 111 | paramArea = 12 ; size of param area to create | 114 | paramArea = 12 ; size of param area to create |
| 112 | # .local.size: this size is directly related to what registers we save. | 115 | # .local.size: this size is directly related to what registers we save. |
| 113 | localArea = 76 ; size of local workspace (for 19 registers, r13-r31) | 116 | localArea = 76 ; size of local workspace (for 19 registers, r13-r31) |
| 117 | # A throwaway comment in [MORT] p32 "The called routine is responsible | ||
| 118 | # for allocating its own stack frame, making sure to preserve 16-byte | ||
| 119 | # alignment on the stack" implies that the stack must always be 16-byte | ||
| 120 | # aligned. Thus, this sum, frameSize, must be a multiple of 16. 24 + | ||
| 121 | # 12 + 76 = 112 = 7*16, so much for the abstraction. | ||
| 114 | frameSize = linkageArea + paramArea + localArea | 122 | frameSize = linkageArea + paramArea + localArea |
| 115 | 123 | ||
| 116 | _StackScan: | 124 | _StackScan: |
| @@ -122,6 +130,15 @@ _StackScan: | |||
| 122 | stwu r1, -frameSize(r1) | 130 | stwu r1, -frameSize(r1) |
| 123 | # r1 + frameSize is SPEP | 131 | # r1 + frameSize is SPEP |
| 124 | 132 | ||
| 133 | # setup arguments for call to TraceScanArea, and call it | ||
| 134 | # First Argument, ScanState, is our first argument, already in r3. | ||
| 135 | # Arguments are processed out of order because of the dependency on r4 | ||
| 136 | # Third Argument: highest stack address. | ||
| 137 | mr r5, r4 | ||
| 138 | # Second Argument: lowest stack address. | ||
| 139 | mr r4, r1 | ||
| 140 | bl _TraceScanArea | ||
| 141 | |||
| 125 | lwz r1, 0(r1) | 142 | lwz r1, 0(r1) |
| 126 | # r1 is SPEP again | 143 | # r1 is SPEP again |
| 127 | lwz r0, 8(r1) | 144 | lwz r0, 8(r1) |