From d751349d259b5f8ec8a67de1cf1851d7a5e97d0b Mon Sep 17 00:00:00 2001 From: David Jones Date: Wed, 2 Mar 2005 09:56:51 +0000 Subject: Mps: working stack scanner for xcppgc Copied from Perforce Change: 147224 ServerID: perforce.ravenbrook.com --- mps/code/ssxcpp.s | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mps/code/ssxcpp.s') 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 @@ # Exported symbols .globl _StackScan +# Imported symbols +.globl _TraceScanArea + linkageArea = 24 ; size of linkage area to create paramArea = 12 ; size of param area to create # .local.size: this size is directly related to what registers we save. localArea = 76 ; size of local workspace (for 19 registers, r13-r31) +# A throwaway comment in [MORT] p32 "The called routine is responsible +# for allocating its own stack frame, making sure to preserve 16-byte +# alignment on the stack" implies that the stack must always be 16-byte +# aligned. Thus, this sum, frameSize, must be a multiple of 16. 24 + +# 12 + 76 = 112 = 7*16, so much for the abstraction. frameSize = linkageArea + paramArea + localArea _StackScan: @@ -122,6 +130,15 @@ _StackScan: stwu r1, -frameSize(r1) # r1 + frameSize is SPEP +# setup arguments for call to TraceScanArea, and call it +# First Argument, ScanState, is our first argument, already in r3. +# Arguments are processed out of order because of the dependency on r4 +# Third Argument: highest stack address. + mr r5, r4 +# Second Argument: lowest stack address. + mr r4, r1 + bl _TraceScanArea + lwz r1, 0(r1) # r1 is SPEP again lwz r0, 8(r1) -- cgit v1.2.1