Skip to content

Commit f3c53e3

Browse files
committed
minor edit
1 parent 63aa29f commit f3c53e3

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

lecture-plan.txt

+16
Original file line numberDiff line numberDiff line change
@@ -496,4 +496,20 @@ Tracing GC's
496496
* Copied objects have forwarding pointers.
497497

498498

499+
Lecture: GC Q&A and Functions
500+
================================================================================
501+
502+
503+
Question:
504+
505+
This code is at the end of the garbage collection code in racket:
506+
507+
(movq (global-value free_ptr) (var t.2))
508+
(addq (int 16) (global-value free_ptr))
509+
(movq (int 131) (offset (var t.2) 0))
510+
511+
At the point where 131 is, I believe this is the tag at the front of
512+
the array. I've seen examples of it having 3, 131, and 160. Is there
513+
an explanation somewhere that I missed that tells us how to calculate
514+
the tag in-context?
499515

uncover-types.rkt

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
;; the vector, and uncover-call-live-roots needs the type information
1010
;; to identify roots at each collection call site.
1111
;;
12-
;; During the program level match for expose-allocation, the uncover
13-
;; types function can be called in order to get an association list
14-
;; mapping variables to types. This map can then be passed through the
15-
;; recursive steps of the expose-allocation pass. It is now possible
16-
;; determine the type of a vector at allocation by looking up the type
17-
;; of the variable to which that vector is assigned. After processing
18-
;; the entire program the type environment can be saved for the next
19-
;; pass is the locals slot of the program form.
12+
;; In the match clause for 'program' in expose-allocation, the uncover
13+
;; types function can be called to get an association list mapping
14+
;; variables to types. This map can then be passed as a parameter into
15+
;; expose-allocation so that you can determine the type of a vector
16+
;; needed for 'allocate' by looking up the type of the variable to
17+
;; which that vector is assigned. After processing the entire program
18+
;; the type environment can be saved for the next pass in the locals
19+
;; slot of the program form.
2020
;;
2121
;; While processing the program form of uncover-call-live-roots, this
2222
;; environment can be retrieved from the locals slot and again passed
2323
;; without change throughout the processing of the body of the
2424
;; program. When we find a variable in expression possition and the
25-
;; type in of the variable is a Vector type then we consider this
25+
;; type of the variable is a Vector type then we consider this
2626
;; variable to be a live root. All such live roots are collected at
2727
;; calls to the collector and stored in the live set. After this pass
2828
;; the original locals form can be restored by taking the car of all

0 commit comments

Comments
 (0)