\f
(define (%make-tag metatag name predicate extra)
(let ((tag
- (%record metatag
- (get-tag-cache-number)
- (get-tag-cache-number)
- (get-tag-cache-number)
- (get-tag-cache-number)
- (get-tag-cache-number)
- (get-tag-cache-number)
- (get-tag-cache-number)
- (get-tag-cache-number)
- name
- predicate
- extra
- (%make-weak-set))))
+ (apply %record
+ metatag
+ (get-tag-cache-number)
+ (get-tag-cache-number)
+ (get-tag-cache-number)
+ (get-tag-cache-number)
+ (get-tag-cache-number)
+ (get-tag-cache-number)
+ (get-tag-cache-number)
+ (get-tag-cache-number)
+ name
+ predicate
+ (%make-weak-set)
+ extra)))
(set-predicate-tag! predicate tag)
tag))
(define-integrable (%dispatch-tag->predicate tag)
(%record-ref tag 10))
-(define-integrable (%dispatch-tag-extra tag)
+(define-integrable (%tag-supersets tag)
(%record-ref tag 11))
-(define-integrable (%tag-supersets tag)
- (%record-ref tag 12))
+(define-integrable (%dispatch-tag-extra-ref tag index)
+ (%record-ref tag (fix:+ 12 index)))
+
+(define-integrable (%dispatch-tag-extra-length tag)
+ (fix:- (%record-length tag) 12))
(define-integrable tag-cache-number-adds-ok
;; This constant controls the number of non-zero bits tag cache
(lambda (object)
(and (%record? object)
(eq? metatag (%record-ref object 0)))))
- (metatag (%make-tag metatag-tag name predicate '#())))
+ (metatag (%make-tag metatag-tag name predicate '())))
(set-dispatch-tag<=! metatag metatag-tag)
metatag))
(guarantee unary-procedure? predicate caller)
(if (predicate? predicate)
(error "Can't assign multiple tags to the same predicate:" name))
- (%make-tag metatag name predicate (list->vector extra))))
+ (%make-tag metatag name predicate extra)))
(define (dispatch-metatag? object)
(and (%record? object)
(define metatag-tag)
(add-boot-init!
(lambda ()
- (set! metatag-tag (%make-tag #f 'metatag dispatch-metatag? '#()))
+ (set! metatag-tag (%make-tag #f 'metatag dispatch-metatag? '()))
(%record-set! metatag-tag 0 metatag-tag)))
-
+\f
(define (dispatch-tag-metatag tag)
(guarantee dispatch-tag? tag 'dispatch-tag-metatag)
(%record-ref tag 0))
(guarantee dispatch-tag? tag 'dispatch-tag->predicate)
(%dispatch-tag->predicate tag))
-(define (dispatch-tag-extra tag index)
- (guarantee dispatch-tag? tag 'dispatch-tag-extra)
- (vector-ref (%dispatch-tag-extra tag) index))
+(define (dispatch-tag-extra-ref tag index)
+ (guarantee dispatch-tag? tag 'dispatch-tag-extra-ref)
+ (%dispatch-tag-extra-ref tag index))
+
+(define (dispatch-tag-extra-length tag)
+ (guarantee dispatch-tag? tag 'dispatch-tag-extra-length)
+ (%dispatch-tag-extra-length tag))
+
+(define (dispatch-tag-extra tag)
+ (do ((i (fix:- (dispatch-tag-extra-length tag) 1) (fix:- i 1))
+ (elts '() (cons (%dispatch-tag-extra-ref tag i) elts)))
+ ((fix:< i 0) elts)))
(define (any-dispatch-tag-superset procedure tag)
(guarantee dispatch-tag? tag 'any-dispatch-tag-superset)
(list (list 'metatag (dispatch-tag-metatag tag))
(list 'name (dispatch-tag-name tag))
(list 'predicate (dispatch-tag->predicate tag))
- (cons 'extra (vector->list (%dispatch-tag-extra tag))))))
\ No newline at end of file
+ (cons 'extra (dispatch-tag-extra tag)))))
\ No newline at end of file