Fix deadlocks in GC on Windows.
[sbcl.git] / src / compiler / hppa / memory.lisp
1 (in-package "SB!VM")
2
3 ;;; Cell-Ref and Cell-Set are used to define VOPs like CAR, where the offset to
4 ;;; be read or written is a property of the VOP used.  Cell-Setf is similar to
5 ;;; Cell-Set, but delivers the new value as the result.  Cell-Setf-Function
6 ;;; takes its arguments as if it were a setf function (new value first, as
7 ;;; apposed to a setf macro, which takes the new value last).
8 ;;;
9 (define-vop (cell-ref)
10   (:args (object :scs (descriptor-reg)))
11   (:results (value :scs (descriptor-reg any-reg)))
12   (:variant-vars offset lowtag)
13   (:policy :fast-safe)
14   (:generator 4
15     (loadw value object offset lowtag)))
16 ;;;
17 (define-vop (cell-set)
18   (:args (object :scs (descriptor-reg))
19          (value :scs (descriptor-reg any-reg null zero)))
20   (:variant-vars offset lowtag)
21   (:policy :fast-safe)
22   (:generator 1
23     (storew value object offset lowtag)))
24
25 ;;; Slot-Ref and Slot-Set are used to define VOPs like Closure-Ref, where the
26 ;;; offset is constant at compile time, but varies for different uses.  We add
27 ;;; in the stardard g-vector overhead.
28 ;;;
29 (define-vop (slot-ref)
30   (:args (object :scs (descriptor-reg)))
31   (:results (value :scs (descriptor-reg any-reg)))
32   (:variant-vars base lowtag)
33   (:info offset)
34   (:generator 4
35     (loadw value object (+ base offset) lowtag)))
36 ;;;
37 (define-vop (slot-set)
38   (:args (object :scs (descriptor-reg))
39          (value :scs (descriptor-reg any-reg null zero)))
40   (:variant-vars base lowtag)
41   (:info offset)
42   (:generator 4
43     (storew value object (+ base offset) lowtag)))
44