blob: 80374001b722d82993e21b7546c3303b86865087 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
(define-module (modules utils assign-stack)
#:export (make-location
get-frame-size))
(define make-location)
(define get-frame-size)
(let ((dict (make-hash-table))
(ptr 0))
(set! make-location
(lambda (id)
(or (hash-ref dict id)
(begin (set! ptr (1+ ptr))
(hash-set! dict id (get-frame-size))))))
(set! get-frame-size (lambda () (* -4 ptr))))
|