From ce109d79234e63d24c2921225b8dad08ef2bb089 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Wed, 18 Sep 2013 09:11:36 -0700 Subject: [PATCH] Move unboxed tables to seperate file. --- .../typed-racket/optimizer/float-complex.rkt | 19 ++---------------- .../typed-racket/optimizer/unboxed-let.rkt | 2 +- .../typed-racket/optimizer/unboxed-tables.rkt | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-tables.rkt diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/float-complex.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/float-complex.rkt index 5325d80486..c01e180803 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/float-complex.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/float-complex.rkt @@ -6,13 +6,12 @@ (for-template racket/base racket/math racket/flonum racket/unsafe/ops) (utils tc-utils) (types numeric-tower subtype type-table utils) - (optimizer utils numeric-utils logging float)) + (optimizer utils numeric-utils logging float unboxed-tables)) (provide float-complex-opt-expr float-complex-arith-expr unboxed-float-complex-opt-expr - float-complex-call-site-opt-expr arity-raising-opt-msg - unboxed-vars-table unboxed-funs-table) + float-complex-call-site-opt-expr arity-raising-opt-msg) (define-literal-syntax-class +) (define-literal-syntax-class -) @@ -34,20 +33,6 @@ (define-syntax-class/specialize float-expr (subtyped-expr -Flonum)) (define-syntax-class/specialize float-complex-expr (subtyped-expr -FloatComplex)) - -;; contains the bindings which actually exist as separate bindings for each component -;; associates identifiers to lists (real-binding imag-binding orig-binding-occurrence) -(define unboxed-vars-table (make-free-id-table)) - -;; associates the names of functions with unboxed args (and whose call sites have to -;; be modified) to the arguments which can be unboxed and those which have to be boxed -;; entries in the table are of the form: -;; ((unboxed ...) (boxed ...)) -;; all these values are indices, since arg names don't make sense for call sites -;; 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 (binding-names) (generate-temporaries (list "unboxed-real-" "unboxed-imag-"))) 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 448f65c693..cf902cb622 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 @@ -6,7 +6,7 @@ (for-template racket/base) (types numeric-tower utils type-table) (rep type-rep) (env mvar-env) - (optimizer utils logging float-complex)) + (optimizer utils logging float-complex unboxed-tables)) (provide unboxed-let-opt-expr) 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 new file mode 100644 index 0000000000..dc7d045f67 --- /dev/null +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-tables.rkt @@ -0,0 +1,20 @@ +#lang racket/base + +(require syntax/id-table) + +(provide + unboxed-vars-table + unboxed-funs-table) + +;; contains the bindings which actually exist as separate bindings for each component +;; associates identifiers to lists (real-binding imag-binding orig-binding-occurrence) +(define unboxed-vars-table (make-free-id-table)) + +;; associates the names of functions with unboxed args (and whose call sites have to +;; be modified) to the arguments which can be unboxed and those which have to be boxed +;; entries in the table are of the form: +;; ((unboxed ...) (boxed ...)) +;; all these values are indices, since arg names don't make sense for call sites +;; 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))