~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to comp/defs.lsp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
(in-package "BCOMP")
 
3
 
 
4
#|
 
5
after pass 1 only the following forms are allowed
 
6
 
 
7
forms1 == (form1 form1 ... form1)
 
8
form1  == output of (w1-walk form)
 
9
N == 0,1,2,3..
 
10
desk  == desk structure
 
11
var1 == var structure
 
12
       | (var N)
 
13
binds == ((var1  form1) (var1 form1) ..)
 
14
arglist  == (form1 form1 ... form1)
 
15
(LET desk binds  forms1)
 
16
;(LET* desk binds  forms1)  ; not needed since the variable assign done.
 
17
(CALL desk call-data )
 
18
(FUNCTION desk function-data)
 
19
 
 
20
----------------------
 
21
|#
 
22
 
 
23
;;Globals for Second pass
 
24
;; push on to this when special is bound, so that it can be unbound.
 
25
(defvar *sp-bind* nil)
 
26
;; set when a setjmp is laid down, so variables can be declared volatile
 
27
(defvar *volatile* nil)
 
28
 
 
29
;; tells unwind-set that number of values already set.
 
30
(defvar *MV-N-VALUES-SET* nil)
 
31
 
 
32
(defvar *top-form*
 
33
;; Passes of the compiler may bind this to a form name which they are compiling
 
34
;; to make the errors more meaninful.
 
35
  nil)
 
36
 
 
37
(defstruct var name
 
38
  ;; count of cross lambda block closure references
 
39
  clb
 
40
  type ;; rep type
 
41
  changed ;; var was altered
 
42
  ref    ;; var referred to
 
43
  special-p  ;; var declared special
 
44
  ;;for special var, something to which wr applies to write it 
 
45
  ;;for a closure var, if the the var is NOT in the *closure-vars*
 
46
  ;;   (ie those passed in to this function), then it is an (next-cvars) index
 
47
  ;;   if the var was passed in then this field is ignored, and the index is
 
48
  ;;   the position in the *closure-vars* list.
 
49
  ;;for a normal variable the (next-cvar), eg ind = 3 , var written V3   
 
50
  ind
 
51
  ;; vars which are maybe referred to after return from a setjmp
 
52
  volatile
 
53
  ) 
 
54
 
 
55
(defstruct (desk (:constructor make-desk1 (result-type )))
 
56
     result-type  ;result of first value
 
57
     ;CHANGED-VARS are the plain-var-p vars which are altered  in the
 
58
     ;scope of the form of which this desk appears as the second member.
 
59
     ;used when setting up args for a c call, to know if we need to save a var
 
60
     changed-vars
 
61
     single-value
 
62
     )
 
63
 
 
64
(defun make-desk (x)
 
65
  (or x (setq x t))
 
66
  (make-desk1 x))
 
67
 
 
68
(defstruct fdata
 
69
  name
 
70
  ll ; list : (ll &required (fdata-ll fd))   == the list of required args.
 
71
  closure-vars
 
72
  ind
 
73
  address-index
 
74
  doc
 
75
  form
 
76
  function-declaration  ;; at the time of definition
 
77
  argd
 
78
  local-template   ;; local function call template.
 
79
  closure-self   ;; if this is a closure and non nil then it points to a funobj = self
 
80
  tail-label
 
81
)
 
82
  
 
83
(defstruct (call-data (:constructor make-call-data
 
84
                                    (fname arglist local-fun
 
85
                                           function-declaration)))
 
86
  fname   ;  may be a name or else fdata for a local function.
 
87
  arglist
 
88
  local-fun 
 
89
  ;;declaration at the point of call.
 
90
  ;;If nil, and if not local then
 
91
  ;; it may be retrieved later.
 
92
  function-declaration  
 
93
  )
 
94
 
 
95
(defstruct label
 
96
  identifier
 
97
  ;; If this label is referred to across functions, a unique-id
 
98
  ;; is assigned and put in the clb-reference field.   Otherwise this is nil
 
99
  clb-reference
 
100
  ;; On pass1 this is set to 'clb by clb references.   If it is null it is
 
101
  ;; set to t by ordinary references.
 
102
  referred
 
103
  ind
 
104
  )
 
105
 
 
106
(defstruct (block (:constructor make-block (label)))
 
107
  label
 
108
  value
 
109
  exit)
 
110
 
 
111
(defstruct top-form
 
112
  lisp
 
113
  walked
 
114
  funp    ;T if contains a function
 
115
  )
 
116
 
 
117
(defstruct (link (:constructor make-link (fname proclaimed)))
 
118
  (argd  0 :type fixnum)
 
119
  ind
 
120
  proclaimed
 
121
  fname
 
122
  )
 
123
 
 
124
 
 
125
 
 
126
  
 
 
b'\\ No newline at end of file'