| [13067] | 1 | ;;; Copyright 2009 Clozure Associates
|
|---|
| 2 | ;;; This file is part of Clozure CL.
|
|---|
| 3 | ;;;
|
|---|
| 4 | ;;; Clozure CL is licensed under the terms of the Lisp Lesser GNU
|
|---|
| 5 | ;;; Public License , known as the LLGPL and distributed with Clozure
|
|---|
| 6 | ;;; CL as the file "LICENSE". The LLGPL consists of a preamble and
|
|---|
| 7 | ;;; the LGPL, which is distributed with Clozure CL as the file "LGPL".
|
|---|
| 8 | ;;; Where these conflict, the preamble takes precedence.
|
|---|
| 9 | ;;;
|
|---|
| 10 | ;;; Clozure CL is referenced in the preamble as the "LIBRARY."
|
|---|
| 11 | ;;;
|
|---|
| 12 | ;;; The LLGPL is also available online at
|
|---|
| 13 | ;;; http://opensource.franz.com/preamble.html
|
|---|
| 14 |
|
|---|
| [8077] | 15 | (in-package "CCL")
|
|---|
| 16 |
|
|---|
| 17 | (defx8632lapfunction %address-of ((arg arg_z))
|
|---|
| 18 | ;; %address-of a fixnum is a fixnum, just for spite.
|
|---|
| 19 | ;; %address-of anything else is the address of that thing as an integer.
|
|---|
| 20 | (testb ($ x8632::fixnummask) (%b arg))
|
|---|
| 21 | (je @done)
|
|---|
| 22 | (movl (% arg) (% imm0))
|
|---|
| 23 | (jmp-subprim .SPmakeu32)
|
|---|
| 24 | @done
|
|---|
| 25 | (single-value-return))
|
|---|
| 26 |
|
|---|
| 27 | ;;; "areas" are fixnum-tagged and, for the most part, so are their
|
|---|
| 28 | ;;; contents.
|
|---|
| 29 |
|
|---|
| 30 | ;;; The nilreg-relative global all-areas is a doubly-linked-list header
|
|---|
| 31 | ;;; that describes nothing. Its successor describes the current/active
|
|---|
| 32 | ;;; dynamic heap. Return a fixnum which "points to" that area, after
|
|---|
| 33 | ;;; ensuring that the "active" pointers associated with the current thread's
|
|---|
| 34 | ;;; stacks are correct.
|
|---|
| 35 |
|
|---|
| 36 | (defx8632lapfunction %normalize-areas ()
|
|---|
| 37 | (let ((address temp0)
|
|---|
| 38 | (temp temp1))
|
|---|
| 39 |
|
|---|
| 40 | ; update active pointer for tsp area.
|
|---|
| [10575] | 41 | (movl (:rcontext x8632::tcr.ts-area) (% address))
|
|---|
| 42 | (movl (:rcontext x8632::tcr.save-tsp) (% temp))
|
|---|
| [8077] | 43 | (movl (% temp) (@ x8632::area.active (% address)))
|
|---|
| 44 |
|
|---|
| 45 | ;; Update active pointer for vsp area.
|
|---|
| [10575] | 46 | (movl (:rcontext x8632::tcr.vs-area) (% address))
|
|---|
| [8077] | 47 | (movl (% esp) (@ x8632::area.active (% address)))
|
|---|
| 48 |
|
|---|
| 49 | (ref-global all-areas arg_z)
|
|---|
| 50 | (movl (@ x8632::area.succ (% arg_z)) (% arg_z))
|
|---|
| 51 |
|
|---|
| 52 | (single-value-return)))
|
|---|
| 53 |
|
|---|
| 54 | (defx8632lapfunction %active-dynamic-area ()
|
|---|
| 55 | (ref-global all-areas arg_z)
|
|---|
| 56 | (movl (@ x8632::area.succ (% arg_z)) (% arg_z))
|
|---|
| 57 | (single-value-return))
|
|---|
| 58 |
|
|---|
| 59 | (defx8632lapfunction %object-in-stack-area-p ((object arg_y) (area arg_z))
|
|---|
| 60 | (rcmp (% object) (@ x8632::area.active (% area)))
|
|---|
| 61 | (movl ($ nil) (% temp0))
|
|---|
| 62 | (movl ($ t) (% imm0))
|
|---|
| 63 | (jb @done)
|
|---|
| 64 | (rcmp (% object) (@ x8632::area.high (% area)))
|
|---|
| 65 | (cmovbl (% imm0) (% temp0))
|
|---|
| 66 | @done
|
|---|
| 67 | (movl (% temp0) (% arg_z))
|
|---|
| 68 | (single-value-return))
|
|---|
| 69 |
|
|---|
| 70 | (defx8632lapfunction %object-in-heap-area-p ((object arg_y) (area arg_z))
|
|---|
| 71 | (rcmp (% object) (@ x8632::area.low (% area)))
|
|---|
| 72 | (movl ($ nil) (% temp0))
|
|---|
| 73 | (movl ($ t) (% imm0))
|
|---|
| 74 | (jb @done)
|
|---|
| 75 | (rcmp (% object) (@ x8632::area.active (% area)))
|
|---|
| 76 | (cmovbl (% imm0) (% temp0))
|
|---|
| 77 | @done
|
|---|
| 78 | (movl (% temp0) (% arg_z))
|
|---|
| 79 | (single-value-return))
|
|---|
| 80 |
|
|---|
| [8746] | 81 | ;;; In these heap-walking functions, all other threads should be
|
|---|
| 82 | ;;; suspended; the only consing that should happen is any consing
|
|---|
| 83 | ;;; that the function (the "f" argument) does when we call it.
|
|---|
| 84 | ;;;
|
|---|
| 85 | ;;; We can therefore basically walk dnode-aligned addresses (but we
|
|---|
| 86 | ;;; have to be careful, especially in the %WALK-DYNAMIC-AREA case,
|
|---|
| 87 | ;;; to hold onto only tagged pointers when we call the funtion, since
|
|---|
| 88 | ;;; consing by the called function could cause a gc).
|
|---|
| [8077] | 89 |
|
|---|
| [8746] | 90 | (defx8632lapfunction walk-static-area ((a arg_y) (f arg_z))
|
|---|
| 91 | (let ((obj temp0)
|
|---|
| 92 | (fun -4)
|
|---|
| 93 | (limit -8))
|
|---|
| 94 | (save-simple-frame)
|
|---|
| 95 | (push (% f))
|
|---|
| 96 | (pushl (@ x8632::area.active (% a)))
|
|---|
| 97 | (movl (@ x8632::area.low (% a)) (% obj))
|
|---|
| 98 | (jmp @test)
|
|---|
| 99 | @loop
|
|---|
| 100 | (movb (@ (% obj)) (% imm0.b))
|
|---|
| 101 | (andb ($ x8632::fulltagmask) (% imm0.b))
|
|---|
| 102 | (cmpb ($ x8632::fulltag-immheader) (% imm0.b))
|
|---|
| 103 | (je @misc)
|
|---|
| 104 | (cmpb ($ x8632::fulltag-nodeheader) (% imm0.b))
|
|---|
| 105 | (je @misc)
|
|---|
| 106 | ;; not a header, so must be a cons
|
|---|
| 107 | (add ($ x8632::fulltag-cons) (% obj))
|
|---|
| 108 | (mov (% obj) (% arg_z))
|
|---|
| 109 | (set-nargs 1)
|
|---|
| 110 | (push (% obj))
|
|---|
| 111 | (:talign 5)
|
|---|
| 112 | (call (@ fun (% ebp)))
|
|---|
| 113 | (recover-fn)
|
|---|
| 114 | (pop (% obj))
|
|---|
| 115 | (add ($ (- x8632::cons.size x8632::fulltag-cons)) (% obj))
|
|---|
| 116 | (jmp @test)
|
|---|
| 117 | @misc
|
|---|
| [11077] | 118 | (lea (@ x8632::fulltag-misc (% obj)) (% arg_z))
|
|---|
| [8746] | 119 | (set-nargs 1)
|
|---|
| 120 | (push (% obj))
|
|---|
| 121 | (:talign 5)
|
|---|
| 122 | (call (@ fun (% ebp)))
|
|---|
| 123 | (recover-fn)
|
|---|
| 124 | (pop (% obj))
|
|---|
| [9271] | 125 | (mov (@ (% obj)) (% imm0))
|
|---|
| [8746] | 126 | (andb ($ x8632::fulltagmask) (% imm0.b))
|
|---|
| 127 | (cmpb ($ x8632::fulltag-nodeheader) (% imm0.b))
|
|---|
| [9271] | 128 | (mov (@ (% obj)) (% imm0))
|
|---|
| [8746] | 129 | (je @32)
|
|---|
| 130 | (cmpb ($ x8632::max-32-bit-ivector-subtag) (% imm0.b))
|
|---|
| [11363] | 131 | (jbe @32)
|
|---|
| [8746] | 132 | (cmpb ($ x8632::max-8-bit-ivector-subtag) (% imm0.b))
|
|---|
| [11363] | 133 | (jbe @8)
|
|---|
| [8746] | 134 | (cmpb ($ x8632::max-16-bit-ivector-subtag) (% imm0.b))
|
|---|
| [11363] | 135 | (jbe @16)
|
|---|
| [16010] | 136 | (cmpb ($ x8632::subtag-complex-double-float-vector) (% imm0.b))
|
|---|
| 137 | (je @complex-double-float-vector)
|
|---|
| 138 | (cmpb ($ x8632::subtag-bit-vector) (% imm0.b))
|
|---|
| 139 | (jne @double-float)
|
|---|
| [8746] | 140 | ;; if we get here, it's a bit vector
|
|---|
| 141 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 142 | (add ($ 7) (% imm0))
|
|---|
| 143 | (shrl ($ 3) (% imm0))
|
|---|
| 144 | (jmp @uvector-next)
|
|---|
| 145 | @double-float
|
|---|
| 146 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 147 | (shll ($ 3) (% imm0))
|
|---|
| 148 | (jmp @uvector-next)
|
|---|
| [16010] | 149 | @complex-double-float-vector
|
|---|
| 150 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 151 | (shll ($ 4) (% imm0))
|
|---|
| 152 | (jmp @uvector-next)
|
|---|
| [8746] | 153 | @8
|
|---|
| 154 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 155 | (jmp @uvector-next)
|
|---|
| 156 | @16
|
|---|
| 157 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 158 | (shll ($ 1) (% imm0))
|
|---|
| 159 | (jmp @uvector-next)
|
|---|
| 160 | @32
|
|---|
| 161 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 162 | (shll ($ 2) (% imm0))
|
|---|
| 163 | ;; size of obj in bytes (without header or alignment padding)
|
|---|
| 164 | ;; is in imm0
|
|---|
| 165 | @uvector-next
|
|---|
| 166 | (add ($ (+ x8632::node-size (1- x8632::dnode-size))) (% imm0))
|
|---|
| 167 | (andb ($ (lognot (1- x8632::dnode-size))) (% imm0.b))
|
|---|
| 168 | (add (% imm0) (% obj))
|
|---|
| 169 | @test
|
|---|
| 170 | (cmpl (@ limit (% ebp)) (% obj))
|
|---|
| 171 | (jb @loop)
|
|---|
| [10959] | 172 | (movl ($ (target-nil-value)) (% arg_z))
|
|---|
| [8746] | 173 | (restore-simple-frame)
|
|---|
| 174 | (single-value-return)))
|
|---|
| [8077] | 175 |
|
|---|
| [8746] | 176 | ;;; This walks the active "dynamic" area. Objects might be moving around
|
|---|
| 177 | ;;; while we're doing this, so we have to be a lot more careful than we
|
|---|
| 178 | ;;; are when walking a static area.
|
|---|
| 179 | ;;; There are a couple of approaches to termination:
|
|---|
| 180 | ;;; a) Allocate a "sentinel" cons, and terminate when we run into it.
|
|---|
| 181 | ;;; b) Check the area limit (which is changing if we're consing) and
|
|---|
| 182 | ;;; terminate when we hit it.
|
|---|
| 183 | ;;; (b) loses if the function conses. (a) conses. I can't think of anything
|
|---|
| 184 | ;;; better than (a).
|
|---|
| 185 | ;;; This, of course, assumes that any GC we're doing does in-place compaction
|
|---|
| 186 | ;;; (or at least preserves the relative order of objects in the heap.)
|
|---|
| [8077] | 187 |
|
|---|
| [8746] | 188 | (defx8632lapfunction %walk-dynamic-area ((a arg_y) (f arg_z))
|
|---|
| 189 | (let ((obj temp0)
|
|---|
| 190 | (fun -4)
|
|---|
| 191 | (sentinel -8))
|
|---|
| 192 | (save-simple-frame)
|
|---|
| 193 | (push (% f))
|
|---|
| 194 | (subl ($ (- x8632::cons.size x8632::fulltag-cons))
|
|---|
| [10575] | 195 | (:rcontext x8632::tcr.save-allocptr))
|
|---|
| 196 | (movl (:rcontext x8632::tcr.save-allocptr) (% allocptr)) ;aka temp0
|
|---|
| 197 | (cmpl (:rcontext x8632::tcr.save-allocbase) (% allocptr))
|
|---|
| [11556] | 198 | (ja @ok)
|
|---|
| [8746] | 199 | (uuo-alloc)
|
|---|
| 200 | @ok
|
|---|
| 201 | (andb ($ (lognot x8632::fulltagmask))
|
|---|
| [10575] | 202 | (:rcontext x8632::tcr.save-allocptr))
|
|---|
| [8746] | 203 | (push (% allocptr)) ;sentinel
|
|---|
| 204 | (ref-global tenured-area a)
|
|---|
| 205 | (movl (@ x8632::area.low (% a)) (% obj))
|
|---|
| 206 | (jmp @test)
|
|---|
| 207 | @loop
|
|---|
| 208 | (movb (@ (% obj)) (% imm0.b))
|
|---|
| 209 | (andb ($ x8632::fulltagmask) (% imm0.b))
|
|---|
| 210 | (cmpb ($ x8632::fulltag-immheader) (% imm0.b))
|
|---|
| 211 | (je @misc)
|
|---|
| 212 | (cmpb ($ x8632::fulltag-nodeheader) (% imm0.b))
|
|---|
| 213 | (je @misc)
|
|---|
| 214 | ;; not a header, so must be a cons
|
|---|
| 215 | (add ($ x8632::fulltag-cons) (% obj))
|
|---|
| 216 | (mov (% obj) (% arg_z))
|
|---|
| 217 | (set-nargs 1)
|
|---|
| 218 | (push (% obj))
|
|---|
| 219 | (:talign 5)
|
|---|
| 220 | (call (@ fun (% ebp)))
|
|---|
| 221 | (recover-fn)
|
|---|
| 222 | (pop (% obj))
|
|---|
| 223 | (add ($ (- x8632::cons.size x8632::fulltag-cons)) (% obj))
|
|---|
| 224 | (jmp @test)
|
|---|
| 225 | @misc
|
|---|
| 226 | (add ($ x8632::fulltag-misc) (% obj))
|
|---|
| 227 | (mov (% obj) (% arg_z))
|
|---|
| 228 | (set-nargs 1)
|
|---|
| 229 | (push (% obj))
|
|---|
| 230 | (:talign 5)
|
|---|
| 231 | (call (@ fun (% ebp)))
|
|---|
| 232 | (recover-fn)
|
|---|
| 233 | (pop (% obj))
|
|---|
| 234 | (sub ($ x8632::fulltag-misc) (% obj))
|
|---|
| [9271] | 235 | (mov (@ (% obj)) (% imm0))
|
|---|
| [8746] | 236 | (andb ($ x8632::fulltagmask) (% imm0.b))
|
|---|
| [10741] | 237 | (cmpb ($ x8632::fulltag-nodeheader) (% imm0.b))
|
|---|
| [9271] | 238 | (mov (@ (% obj)) (% imm0))
|
|---|
| [8746] | 239 | (je @32)
|
|---|
| 240 | (cmpb ($ x8632::max-32-bit-ivector-subtag) (% imm0.b))
|
|---|
| [11363] | 241 | (jbe @32)
|
|---|
| [8746] | 242 | (cmpb ($ x8632::max-8-bit-ivector-subtag) (% imm0.b))
|
|---|
| [11363] | 243 | (jbe @8)
|
|---|
| [8746] | 244 | (cmpb ($ x8632::max-16-bit-ivector-subtag) (% imm0.b))
|
|---|
| [11363] | 245 | (jbe @16)
|
|---|
| [16010] | 246 | (cmpb ($ x8632::subtag-complex-double-float-vector) (% imm0.b))
|
|---|
| 247 | (je @complex-double-float-vector)
|
|---|
| 248 | (cmpb ($ x8632::subtag-bit-vector) (% imm0.b))
|
|---|
| 249 | (jne @double-float)
|
|---|
| [8746] | 250 | ;; if we get here, it's a bit vector
|
|---|
| 251 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 252 | (add ($ 7) (% imm0))
|
|---|
| 253 | (shrl ($ 3) (% imm0))
|
|---|
| 254 | (jmp @uvector-next)
|
|---|
| 255 | @double-float
|
|---|
| 256 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 257 | (shll ($ 3) (% imm0))
|
|---|
| 258 | (jmp @uvector-next)
|
|---|
| [16010] | 259 | @complex-double-float-vector
|
|---|
| 260 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 261 | (shll ($ 4) (% imm0))
|
|---|
| 262 | (jmp @uvector-next)
|
|---|
| [8746] | 263 | @8
|
|---|
| 264 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 265 | (jmp @uvector-next)
|
|---|
| 266 | @16
|
|---|
| 267 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 268 | (shll ($ 1) (% imm0))
|
|---|
| 269 | (jmp @uvector-next)
|
|---|
| 270 | @32
|
|---|
| 271 | (shrl ($ x8632::num-subtag-bits) (% imm0))
|
|---|
| 272 | (shll ($ 2) (% imm0))
|
|---|
| 273 | ;; size of obj in bytes (without header or alignment padding)
|
|---|
| 274 | ;; is in imm0
|
|---|
| 275 | @uvector-next
|
|---|
| 276 | (add ($ (+ x8632::node-size (1- x8632::dnode-size))) (% imm0))
|
|---|
| 277 | (andb ($ (lognot (1- x8632::dnode-size))) (% imm0.b))
|
|---|
| 278 | (add (% imm0) (% obj))
|
|---|
| 279 | @test
|
|---|
| 280 | (cmpl (@ sentinel (% ebp)) (% obj))
|
|---|
| 281 | (jb @loop)
|
|---|
| 282 | @done
|
|---|
| [10959] | 283 | (movl ($ (target-nil-value)) (% arg_z))
|
|---|
| [8746] | 284 | (restore-simple-frame)
|
|---|
| 285 | (single-value-return)))
|
|---|
| 286 |
|
|---|
| 287 | ;;; xxx duplicated in level-0/x86-utils.lisp
|
|---|
| 288 | (defun walk-dynamic-area (area func)
|
|---|
| 289 | (with-other-threads-suspended
|
|---|
| 290 | (%walk-dynamic-area area func)))
|
|---|
| 291 |
|
|---|
| [9126] | 292 | (defx8632lapfunction %class-of-instance ((i arg_z))
|
|---|
| 293 | (svref i instance.class-wrapper arg_z)
|
|---|
| 294 | (svref arg_z %wrapper-class arg_z)
|
|---|
| 295 | (single-value-return))
|
|---|
| 296 |
|
|---|
| 297 | (defx8632lapfunction class-of ((x arg_z))
|
|---|
| 298 | (check-nargs 1)
|
|---|
| 299 | (extract-fulltag x imm0)
|
|---|
| 300 | (cmpb ($ x8632::fulltag-misc) (% imm0.b))
|
|---|
| [9312] | 301 | (movl (% arg_z) (% imm0))
|
|---|
| [9126] | 302 | (jne @have-tag)
|
|---|
| 303 | (extract-subtag x imm0)
|
|---|
| 304 | @have-tag
|
|---|
| 305 | (movl (@ '*class-table* (% fn)) (% temp1))
|
|---|
| 306 | (movl (@ x8632::symbol.vcell (% temp1)) (% temp1))
|
|---|
| 307 | (movzbl (% imm0.b) (% imm0))
|
|---|
| 308 | (movl (@ x8632::misc-data-offset (% temp1) (% imm0) 4) (% temp0))
|
|---|
| [10959] | 309 | (cmpl ($ (target-nil-value)) (% temp0))
|
|---|
| [9126] | 310 | (je @bad)
|
|---|
| 311 | ;; functionp?
|
|---|
| 312 | (extract-typecode temp0 imm0)
|
|---|
| 313 | (cmpb ($ x8632::subtag-function) (% imm0.b))
|
|---|
| 314 | (jne @ret)
|
|---|
| 315 | ;; jump to the function
|
|---|
| 316 | (set-nargs 1)
|
|---|
| 317 | (jmp (% temp0))
|
|---|
| 318 | @bad
|
|---|
| 319 | (load-constant no-class-error fname)
|
|---|
| 320 | (set-nargs 1)
|
|---|
| 321 | (jmp (@ x8632::symbol.fcell (% fname)))
|
|---|
| 322 | @ret
|
|---|
| 323 | (movl (% temp0) (% arg_z)) ;return frob from table
|
|---|
| 324 | (single-value-return))
|
|---|
| 325 |
|
|---|
| 326 | (defx8632lapfunction gc ()
|
|---|
| [9369] | 327 | (check-nargs 0)
|
|---|
| 328 | (movl ($ arch::gc-trap-function-gc) (% imm0))
|
|---|
| 329 | (uuo-gc-trap)
|
|---|
| 330 | (movl ($ nil) (% arg_z))
|
|---|
| 331 | (single-value-return))
|
|---|
| [9126] | 332 |
|
|---|
| 333 | (defx8632lapfunction full-gccount ()
|
|---|
| [9369] | 334 | (ref-global tenured-area arg_z)
|
|---|
| 335 | (test (% arg_z) (% arg_z))
|
|---|
| [10959] | 336 | (cmovel (@ (+ (target-nil-value) (x8632::%kernel-global 'gc-count))) (% arg_z))
|
|---|
| [9369] | 337 | (cmovnel (@ x8632::area.gc-count (% arg_z)) (% arg_z))
|
|---|
| 338 | (single-value-return))
|
|---|
| [9126] | 339 |
|
|---|
| 340 | (defx8632lapfunction egc ((arg arg_z))
|
|---|
| [9369] | 341 | "Enable the EGC if arg is non-nil, disables the EGC otherwise. Return
|
|---|
| 342 | the previous enabled status. Although this function is thread-safe (in
|
|---|
| 343 | the sense that calls to it are serialized), it doesn't make a whole lot
|
|---|
| 344 | of sense to be turning the EGC on and off from multiple threads ..."
|
|---|
| [9474] | 345 | (check-nargs 1)
|
|---|
| 346 | (clrl imm0)
|
|---|
| 347 | (cmp-reg-to-nil arg)
|
|---|
| 348 | (setne (% imm0.b))
|
|---|
| 349 | (movd (% imm0) (% mm0))
|
|---|
| 350 | (movl ($ arch::gc-trap-function-egc-control) (% imm0))
|
|---|
| 351 | (uuo-gc-trap)
|
|---|
| [9369] | 352 | (single-value-return))
|
|---|
| [9126] | 353 |
|
|---|
| 354 | (defx8632lapfunction %configure-egc ((e0size 4)
|
|---|
| 355 | #|(ra 0)|#
|
|---|
| 356 | (e1size arg_y)
|
|---|
| 357 | (e2size arg_z))
|
|---|
| [9369] | 358 | (check-nargs 3)
|
|---|
| 359 | (movl (@ e0size (% esp)) (% temp0))
|
|---|
| 360 | (movl ($ arch::gc-trap-function-configure-egc) (% imm0))
|
|---|
| 361 | (uuo-gc-trap)
|
|---|
| 362 | (single-value-return 3))
|
|---|
| [9126] | 363 |
|
|---|
| 364 | (defx8632lapfunction purify ()
|
|---|
| [9369] | 365 | (check-nargs 0)
|
|---|
| 366 | (movl ($ arch::gc-trap-function-purify) (% imm0))
|
|---|
| 367 | (uuo-gc-trap)
|
|---|
| 368 | (movl ($ nil) (% arg_z))
|
|---|
| 369 | (single-value-return))
|
|---|
| [9126] | 370 |
|
|---|
| 371 | (defx8632lapfunction impurify ()
|
|---|
| [9369] | 372 | (check-nargs 0)
|
|---|
| 373 | (movl ($ arch::gc-trap-function-impurify) (% imm0))
|
|---|
| 374 | (uuo-gc-trap)
|
|---|
| 375 | (movl ($ nil) (% arg_z))
|
|---|
| 376 | (single-value-return))
|
|---|
| [9126] | 377 |
|
|---|
| [9474] | 378 | (defx8632lapfunction lisp-heap-gc-threshold ()
|
|---|
| 379 | "Return the value of the kernel variable that specifies the amount
|
|---|
| 380 | of free space to leave in the heap after full GC."
|
|---|
| 381 | (check-nargs 0)
|
|---|
| 382 | (movl ($ arch::gc-trap-function-get-lisp-heap-threshold) (% imm0))
|
|---|
| 383 | (uuo-gc-trap)
|
|---|
| 384 | (jmp-subprim .SPmakeu32))
|
|---|
| 385 |
|
|---|
| 386 | (defx8632lapfunction set-lisp-heap-gc-threshold ((new arg_z))
|
|---|
| 387 | "Set the value of the kernel variable that specifies the amount of free
|
|---|
| 388 | space to leave in the heap after full GC to new-value, which should be a
|
|---|
| 389 | non-negative fixnum. Returns the value of that kernel variable (which may
|
|---|
| 390 | be somewhat larger than what was specified)."
|
|---|
| 391 | (check-nargs 1)
|
|---|
| 392 | (save-simple-frame)
|
|---|
| 393 | (call-subprim .SPgetu32)
|
|---|
| 394 | (movd (% imm0) (% mm0))
|
|---|
| 395 | (movl ($ arch::gc-trap-function-set-lisp-heap-threshold) (% imm0))
|
|---|
| 396 | (uuo-gc-trap)
|
|---|
| 397 | (restore-simple-frame)
|
|---|
| 398 | (jmp-subprim .SPmakeu32))
|
|---|
| 399 |
|
|---|
| [8077] | 400 | (defx8632lapfunction use-lisp-heap-gc-threshold ()
|
|---|
| 401 | "Try to grow or shrink lisp's heap space, so that the free space is (approximately) equal to the current heap threshold. Return NIL"
|
|---|
| 402 | (check-nargs 0)
|
|---|
| 403 | (movl ($ arch::gc-trap-function-use-lisp-heap-threshold) (% imm0))
|
|---|
| 404 | (uuo-gc-trap)
|
|---|
| [10959] | 405 | (movl ($ (target-nil-value)) (%l arg_z))
|
|---|
| [8077] | 406 | (single-value-return))
|
|---|
| 407 |
|
|---|
| [10450] | 408 |
|
|---|
| [12797] | 409 | (defx8632lapfunction %watch ((uvector arg_z))
|
|---|
| 410 | (check-nargs 1)
|
|---|
| 411 | (movl ($ arch::watch-trap-function-watch) (%l imm0))
|
|---|
| 412 | (uuo-watch-trap)
|
|---|
| 413 | (single-value-return))
|
|---|
| 414 |
|
|---|
| [12837] | 415 | (defx8632lapfunction %unwatch ((watched arg_y) (new arg_z))
|
|---|
| 416 | (check-nargs 2)
|
|---|
| [12797] | 417 | (movl ($ arch::watch-trap-function-unwatch) (%l imm0))
|
|---|
| 418 | (uuo-watch-trap)
|
|---|
| 419 | (single-value-return))
|
|---|
| 420 |
|
|---|
| [11521] | 421 | (defx8632lapfunction %allocate-list ((initial-element arg_y) (nconses arg_z))
|
|---|
| 422 | (check-nargs 2)
|
|---|
| 423 | (save-simple-frame)
|
|---|
| 424 | (ud2a)
|
|---|
| 425 | (:byte 10)
|
|---|
| 426 | (push (% arg_z))
|
|---|
| 427 | (push (% allocptr))
|
|---|
| 428 | (set-nargs 2)
|
|---|
| 429 | (jmp-subprim .SPnvalret))
|
|---|
| 430 |
|
|---|
| [13279] | 431 | (defx8632lapfunction %ensure-static-conses ()
|
|---|
| 432 | (check-nargs 0)
|
|---|
| 433 | (movl ($ arch::gc-trap-function-ensure-static-conses) (% imm0))
|
|---|
| 434 | (uuo-gc-trap)
|
|---|
| 435 | (movl ($ (target-nil-value)) (% arg_z))
|
|---|
| 436 | (single-value-return))
|
|---|
| 437 |
|
|---|
| [13792] | 438 | (defx8632lapfunction set-gc-notification-threshold ((threshold arg_z))
|
|---|
| 439 | "Set the value of the kernel variable that can be used to trigger
|
|---|
| 440 | GC notifications."
|
|---|
| 441 | (check-nargs 1)
|
|---|
| 442 | (save-simple-frame)
|
|---|
| 443 | (call-subprim .SPgetu32)
|
|---|
| 444 | (movd (% imm0) (% mm0))
|
|---|
| 445 | (movl ($ arch::gc-trap-function-set-gc-notification-threshold) (% imm0))
|
|---|
| 446 | (uuo-gc-trap)
|
|---|
| 447 | (restore-simple-frame)
|
|---|
| 448 | (jmp-subprim .SPmakeu32))
|
|---|
| 449 |
|
|---|
| 450 | (defx8632lapfunction get-gc-notification-threshold ()
|
|---|
| 451 | "Get the value of the kernel variable that can be used to trigger
|
|---|
| 452 | GC notifications."
|
|---|
| 453 | (check-nargs 0)
|
|---|
| 454 | (movl ($ arch::gc-trap-function-get-gc-notification-threshold) (% imm0))
|
|---|
| 455 | (uuo-gc-trap)
|
|---|
| 456 | (jmp-subprim .SPmakeu32))
|
|---|
| 457 |
|
|---|
| [16082] | 458 | (defx8632lapfunction allow-heap-allocation ((flag arg_z))
|
|---|
| 459 | (check-nargs 1)
|
|---|
| 460 | (cmpl ($ (target-nil-value)) (% arg_z))
|
|---|
| 461 | (setne (%b imm0))
|
|---|
| 462 | (andl ($ 1) (%l imm0))
|
|---|
| 463 | (movd (% imm0) (% xmm0))
|
|---|
| 464 | (movl ($ arch::gc-trap-function-allocation-control) (%l imm0))
|
|---|
| 465 | (uuo-gc-trap)
|
|---|
| 466 | (single-value-return))
|
|---|
| 467 |
|
|---|
| 468 | (defx8632lapfunction heap-allocation-allowed-p ()
|
|---|
| 469 | (check-nargs 0)
|
|---|
| 470 | (movl ($ 2) (% imm0))
|
|---|
| 471 | (movd (% imm0) (% xmm0))
|
|---|
| 472 | (movl ($ arch::gc-trap-function-allocation-control) (%l imm0))
|
|---|
| 473 | (uuo-gc-trap)
|
|---|
| 474 | (single-value-return))
|
|---|
| 475 |
|
|---|
| 476 |
|
|---|
| [8077] | 477 | ;;; offset is a fixnum, one of the x8632::kernel-import-xxx constants.
|
|---|
| 478 | ;;; Returns that kernel import, a fixnum.
|
|---|
| 479 | (defx8632lapfunction %kernel-import ((offset arg_z))
|
|---|
| [8633] | 480 | (unbox-fixnum arg_z imm0)
|
|---|
| [10959] | 481 | (addl (@ (+ (target-nil-value) (x8632::%kernel-global 'kernel-imports))) (% imm0))
|
|---|
| [8633] | 482 | (movl (@ (% imm0)) (% imm0))
|
|---|
| 483 | (box-fixnum imm0 arg_z)
|
|---|
| [8077] | 484 | (single-value-return))
|
|---|
| 485 |
|
|---|
| 486 | (defx8632lapfunction %get-unboxed-ptr ((macptr arg_z))
|
|---|
| 487 | (macptr-ptr arg_z imm0)
|
|---|
| 488 | (movl (@ (% imm0)) (% arg_z))
|
|---|
| 489 | (single-value-return))
|
|---|
| 490 |
|
|---|
| 491 | (defx8632lapfunction %revive-macptr ((p arg_z))
|
|---|
| 492 | (movb ($ x8632::subtag-macptr) (@ x8632::misc-subtag-offset (% p)))
|
|---|
| 493 | (single-value-return))
|
|---|
| 494 |
|
|---|
| 495 | (defx86lapfunction %macptr-type ((p arg_z))
|
|---|
| 496 | (check-nargs 1)
|
|---|
| 497 | (trap-unless-typecode= p x8632::subtag-macptr)
|
|---|
| 498 | (svref p x8632::macptr.type-cell imm0)
|
|---|
| 499 | (box-fixnum imm0 arg_z)
|
|---|
| 500 | (single-value-return))
|
|---|
| 501 |
|
|---|
| 502 | (defx86lapfunction %macptr-domain ((p arg_z))
|
|---|
| 503 | (check-nargs 1)
|
|---|
| 504 | (trap-unless-typecode= p x8632::subtag-macptr)
|
|---|
| 505 | (svref p x8632::macptr.domain-cell imm0)
|
|---|
| 506 | (box-fixnum imm0 arg_z)
|
|---|
| 507 | (single-value-return))
|
|---|
| 508 |
|
|---|
| 509 | (defx8632lapfunction %set-macptr-type ((p arg_y) (new arg_z))
|
|---|
| 510 | (check-nargs 2)
|
|---|
| 511 | (trap-unless-typecode= p x8632::subtag-macptr)
|
|---|
| 512 | (unbox-fixnum new imm0)
|
|---|
| 513 | (svset p x8632::macptr.type-cell imm0)
|
|---|
| 514 | (single-value-return))
|
|---|
| 515 |
|
|---|
| 516 | (defx8632lapfunction %set-macptr-domain ((p arg_y) (new arg_z))
|
|---|
| 517 | (check-nargs 2)
|
|---|
| 518 | (trap-unless-typecode= p x8632::subtag-macptr)
|
|---|
| 519 | (unbox-fixnum new imm0)
|
|---|
| 520 | (svset p x8632::macptr.domain-cell imm0)
|
|---|
| 521 | (single-value-return))
|
|---|
| 522 |
|
|---|
| 523 | (defx8632lapfunction true ()
|
|---|
| [9821] | 524 | (pop (% temp0))
|
|---|
| [8998] | 525 | (subl ($ '2) (% nargs))
|
|---|
| 526 | (leal (@ '2 (% esp) (% nargs)) (% imm0))
|
|---|
| [8077] | 527 | (cmoval (% imm0) (% esp))
|
|---|
| [10959] | 528 | (movl ($ (target-t-value)) (% arg_z))
|
|---|
| [9821] | 529 | (push (% temp0))
|
|---|
| [8077] | 530 | (single-value-return))
|
|---|
| 531 |
|
|---|
| 532 | (defx8632lapfunction false ()
|
|---|
| [9821] | 533 | (pop (% temp0))
|
|---|
| [8998] | 534 | (subl ($ '2) (% nargs))
|
|---|
| 535 | (leal (@ '2 (% esp) (% nargs)) (% imm0))
|
|---|
| [8077] | 536 | (cmoval (% imm0) (% esp))
|
|---|
| [10959] | 537 | (movl ($ (target-nil-value)) (% arg_z))
|
|---|
| [9821] | 538 | (push (% temp0))
|
|---|
| [8077] | 539 | (single-value-return))
|
|---|
| [9126] | 540 |
|
|---|
| [15489] | 541 | (defx8632lapfunction constant-ref ()
|
|---|
| 542 | (pop (% temp0))
|
|---|
| 543 | (subl ($ '2) (% nargs))
|
|---|
| 544 | (leal (@ '2 (% esp) (% nargs)) (% imm0))
|
|---|
| 545 | (cmoval (% imm0) (% esp))
|
|---|
| [15490] | 546 | (movl (@ 'constant (% fn)) (% arg_z))
|
|---|
| [15489] | 547 | (push (% temp0))
|
|---|
| 548 | (single-value-return))
|
|---|
| 549 |
|
|---|
| [9126] | 550 | (defx8632lapfunction int3 ()
|
|---|
| 551 | (int ($ 3))
|
|---|
| [10959] | 552 | (single-value-return))
|
|---|