From: Joe Marshall Date: Wed, 18 Jan 2012 04:17:26 +0000 (-0800) Subject: Change name->open-coders alist to a hash table. X-Git-Tag: release-9.2.0~334^2~15 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=69328657692e58cb5d9ffd3e906469637f1b6c1d;p=mit-scheme.git Change name->open-coders alist to a hash table. --- diff --git a/src/compiler/rtlgen/opncod.scm b/src/compiler/rtlgen/opncod.scm index 13c05a56b..335ae0102 100644 --- a/src/compiler/rtlgen/opncod.scm +++ b/src/compiler/rtlgen/opncod.scm @@ -66,11 +66,9 @@ USA. (rvalue/constant? callee) (let ((value (constant-value callee))) (and (scode/primitive-procedure? value) - (let ((entry - (assq (primitive-procedure-name value) - name->open-coders))) + (let ((entry (hash-table/get name->open-coders (primitive-procedure-name value) #f))) (and entry - (try-handler combination value (cdr entry))))))))) + (try-handler combination value entry)))))))) (define (try-handler combination primitive entry) (let ((operands (combination/operands combination))) @@ -209,12 +207,8 @@ USA. (let ((per-name (lambda (name handler) (if (available-primitive? name) - (let ((entry (assq name name->open-coders)) - (item (vector handler ->effect ->predicate ->value))) - (if entry - (set-cdr! entry item) - (set! name->open-coders - (cons (cons name item) name->open-coders)))))))) + (let ((item (vector handler ->effect ->predicate ->value))) + (hash-table/put! name->open-coders name item)))))) (lambda (name handler) (if (list? name) (for-each (lambda (name) @@ -223,8 +217,7 @@ USA. (per-name name handler)) name))) -(define name->open-coders - '()) +(define name->open-coders (make-strong-eq-hash-table)) (define define-open-coder/effect (open-coder-definer invoke/effect->effect