/doc/stackFormat

http://github.com/ticking/self · #! · 69 lines · 63 code · 6 blank · 0 comment · 0 complexity · f74c15728e41c0f8e9346ade8a4d1a00 MD5 · raw file

  1. /* Sun-$Revision: 30.3 $ */
  2. Copyright 1992-2001 Sun Microsystems, Inc. and Stanford University.
  3. See the LICENSE file for license information.
  4. Sparc Format of Self & C Stack/Registers:
  5. argn ; args past the 5th are pushed on the stack
  6. ...
  7. arg7
  8. arg6
  9. in registers ; space to dump I0-I5 (if this frame was a C frame)
  10. hidden parameter word ; hidden parameter (if this frame was a C frame)
  11. caller I7 ; caller's saved register window
  12. ...
  13. FP: caller L0
  14. link ; stack frame nmethod link word
  15. currentPC ; current PC (valid only for frame with
  16. ; invalid nmethod)
  17. unused ; unused (SP must be doubleword-aligned)
  18. temp1 ; this frame's temporary stack locations
  19. temp2
  20. ...
  21. tempn
  22. callee argn ; space for callee's args past the 5th
  23. ...
  24. callee arg7
  25. callee arg6
  26. callee in registers ; space for callee to dump I0-I5 registers
  27. callee hidden parameter ; space for callee's hidden parameter word
  28. ; register window on stack
  29. I7: return pc ; return address for this frame
  30. I6: FP ; pointer to top of this frame
  31. I5: arg5 ; first 5 arguments in registers
  32. I4: arg4
  33. I3: arg3
  34. I2: arg2
  35. I1: arg1
  36. I0: receiver[/parent] ; receiver (and parent block in old compiler)
  37. L7:
  38. L6:
  39. L5:
  40. L4:
  41. L3:
  42. L2:
  43. L1:
  44. SP: L0:
  45. 68000 Format of Self & C stack:
  46. argn ; args pushed on right to left; receiver in D0
  47. ...
  48. arg2
  49. arg1
  50. return pc ; then call the callee
  51. FP: frame ; do a LINK
  52. link ; stack frame nmethod link word
  53. currentPC ; current PC (valid only for frame with
  54. ; invalid nmethod)
  55. unused ; unused (to reduce differences with sparc version)
  56. temp1[parent] ; callee's temps (parent block in old compiler)
  57. ...
  58. tempn
  59. registers ; saved registers (subset of D2-D7, A2-A5)
  60. callee argn ; outgoing arguments
  61. ... ; (stack frame always has same size)
  62. callee arg2
  63. callee arg1