From 071e56bb4462703a28d85dff4b94bee152c5522a Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Wed, 18 Sep 2013 09:43:48 -0700 Subject: [PATCH] Make function for adding an unboxed function. original commit: c76ec838cf8d7ee2864eded6e300291d82d1b1e2 --- .../typed-racket-lib/typed-racket/optimizer/unboxed-let.rkt | 4 +--- .../typed-racket/optimizer/unboxed-tables.rkt | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-let.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-let.rkt index 6823b56a..8394847e 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-let.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-let.rkt @@ -100,9 +100,7 @@ ;; if so, add to the table of functions with ;; unboxed params, so we can modify its call ;; sites, its body and its header - (dict-set! unboxed-funs-table fun-name - (list (reverse unboxed) - (reverse boxed))))] + (add-unboxed-fun! fun-name unboxed boxed))] [(and (equal? (car doms) -FloatComplex) (could-be-unboxed-in? (car params) #'(begin body ...))) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-tables.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-tables.rkt index 25c3fd00..0d46442c 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-tables.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-tables.rkt @@ -6,6 +6,7 @@ (provide unboxed-funs-table + add-unboxed-fun! add-unboxed-var! unboxed-var) @@ -35,3 +36,6 @@ ;; the new calling convention for these functions have all real parts of unboxed ;; params first, then all imaginary parts, then all boxed arguments (define unboxed-funs-table (make-free-id-table)) + +(define (add-unboxed-fun! fun-name unboxed boxed) + (dict-set! unboxed-funs-table fun-name (list unboxed boxed)))