Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 45 lines (27 sloc) 1.173 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#lang typed/racket/base


(require "arity-structs.rkt"
         "expression-structs.rkt"
         "lexical-structs.rkt"
         "kernel-primitives.rkt"
"il-structs.rkt")


(provide (all-defined-out))


;; Static knowledge about an expression.
;;
;; We try to keep at compile time a mapping from environment positions to
;; statically known things, to generate better code.


(define-type CompileTimeEnvironment (Listof CompileTimeEnvironmentEntry))

(define-type CompileTimeEnvironmentEntry
  (U '? ;; no knowledge
     Prefix ;; placeholder: necessary since the toplevel lives in the environment too
     StaticallyKnownLam ;; The value is a known lam
     ModuleVariable ;; The value is a variable from a module
     PrimitiveKernelValue
     Const
     ))


(define-struct: StaticallyKnownLam ([name : (U Symbol LamPositionalName)]
                                    [entry-point : Symbol]
                                    [arity : Arity]) #:transparent)





(define-struct: Analysis ([ht : (HashTable Expression CompileTimeEnvironmentEntry)]))


(: empty-analysis (-> Analysis))
(define (empty-analysis)
  (make-Analysis (make-hash)))
Something went wrong with that request. Please try again.