STACK SCANNER FOR DIGITAL UNIX / ALPHA SYSTEMS design.mps.sso1al draft doc drj 1997-03-27 INTRODUCTION .readership: Any MPS developer. .intro: This is the design for Stack Scanner module that runs on DIGITAL UNIX / Alpha systems (See os.o1 and arch.al). The design adheres to the general design and interface described (probably not described actually) in design.mps.ss. .source.alpha: book.digital96 (Alpha Architecture Handbook) describes the Alpha Architecture independently of any particular implementation. The instruction mnemonics and the semantics for each instruction are specified in that document. .source.as: <URL:http://www.partner.digital.com/www-swdev/pages/Home/TECH/documents/Digital_ UNIX/V4.0/AA-PS31D-TET1_html/TITLE.html> (Assembly Language Programmer's Guide) describes the assembler syntax and assembler directives. It also summarises the calling conventions used. Chapters 1 and 6 were especially useful, especially chapter 6. .source.convention: <URL:http://www.partner.digital.com/www-swdev/pages/Home/TECH/documents/Digital_ UNIX/V4.0/AA-PY8AC-TET1_html/TITLE.html> (Calling Standard for Alpha Systems) describes the calling convetions used for Digital Alpha systems. Chapter 2 was useful. But the whole document was not used as much as the previous 2 documents. DEFINITIONS .def.saved: Saved Register. A saved register is one whose value is defined to be preserved across a procedure call according to the Calling Standard. They are $9-$15, $26, and $30. $30 is the stack pointer. .def.non-saved: Non-Saved Register. A non-save register is a register that is assumed to be modified across a procedure call according to the Calling Standard. .def.tos: Top of Stack. The top of stack is the youngest portion of the stack. .def.bos: Bottom of Stack. The bottom of stack is the oldest portion of the stack. .def.base: Base. Of a range of addresses, the base is the lowest address in the range. .def.limit: Limit. Of a range of addresses, the limit is "one past" the highest address in the range. OVERVIEW .overview: The registers and the stack need to be scanned. This is achieved by storing the contents of the registers into a frame at the top of the stack and then passing the base and limit of the stack region, including the newly created frame, to the function TraceScanAreaTagged. TraceScanAreaTagged performs the actual scanning and fixing. DETAIL DESIGN Functions .fun.stackscan: Res StackScan(ScanState ss, Addr *StackBot); .fun.stackscan.asm: The function is written in assembler. .fun.stackscan.asm.justify: This is because the machine registers need to be examined, and it is only possible to access the machine registers using assembler. .fun.stackscan.entry: On entry to this procedure all the non-saved (temporary) registers that contain live pointers must have been saved in some root (usually the stack) by the mutator (otherwise it would lose the values). Therefore only the saved registers need to be stored by this procedure. .fun.stackscan.assume.saved: We assume that all the saved registers are roots. This is conservative since some of the saved registers might not be used. .fun.stackscan.frame: A frame is be created on the top of the stack. .fun.stackscan.frame.justify: This frame is used to store the saved registers into so that they can be scanned. .fun.stackscan.save: All the saved registers, apart from $30 the stack pointer, are to be stored in the frame. .fun.stackscan.save.justify: This is so that they can be scanned. The stack pointer itself is not scanned as the stack is assumed to be a root (and therefore a priori alive). .fun.stackscan.call: TraceScanAreaTagged is called with the current stack pointer as the base and the (passed in) StackBot as the limit of the region to be scanned. .fun.stackscan.call.justify: This function does the actual scanning. The Stack on Alpha systems grows down so the stack pointer (which points to the top of the stack) is lower in memory than the bottom of the stack. .fun.stackscan.return: The return value from TraceScanAreaTagged is used as the return value for StackScan.
A. References
B. Document History
2002-06-07 | RB | Converted from MMInfo database design document. |
C. Copyright and License
This document is copyright © 1995-2002 Ravenbrook Limited. All rights reserved. This is an open source license. Contact Ravenbrook for commercial licensing options.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Redistributions in any form must be accompanied by information on how to obtain complete source code for the this software and any accompanying software that uses this software. The source code must either be included in the distribution or be available for no more than the cost of distribution plus a nominal fee, and must be freely redistributable under reasonable conditions. For an executable file, complete source code means the source code for all modules it contains. It does not include source code for modules or files that typically accompany the major components of the operating system on which the executable file runs.
This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement, are disclaimed. In no event shall the copyright holders and contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.