aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code/ssxcpp.s
diff options
context:
space:
mode:
authorDavid Jones2005-03-02 09:56:51 +0000
committerDavid Jones2005-03-02 09:56:51 +0000
commitd751349d259b5f8ec8a67de1cf1851d7a5e97d0b (patch)
tree08433d5c5c1da126bf08d68c4456af0bcccac020 /mps/code/ssxcpp.s
parent013278a0c2594d08f824b9cab078dc7cd22b43d7 (diff)
downloademacs-d751349d259b5f8ec8a67de1cf1851d7a5e97d0b.tar.gz
emacs-d751349d259b5f8ec8a67de1cf1851d7a5e97d0b.zip
Mps: working stack scanner for xcppgc
Copied from Perforce Change: 147224 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code/ssxcpp.s')
-rw-r--r--mps/code/ssxcpp.s17
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
110linkageArea = 24 ; size of linkage area to create 113linkageArea = 24 ; size of linkage area to create
111paramArea = 12 ; size of param area to create 114paramArea = 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.
113localArea = 76 ; size of local workspace (for 19 registers, r13-r31) 116localArea = 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.
114frameSize = linkageArea + paramArea + localArea 122frameSize = 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)