Add performance hint to var-promote.
This commit is contained in:
parent
9efa4af051
commit
01b2b8376e
|
@ -3,6 +3,7 @@
|
|||
(require "../utils/utils.rkt"
|
||||
(rep type-rep rep-utils)
|
||||
(types abbrev union utils structural)
|
||||
racket/performance-hint
|
||||
racket/list racket/match)
|
||||
|
||||
(provide/cond-contract
|
||||
|
@ -21,8 +22,8 @@
|
|||
[(Values: (list (Result: _ lf _) ...)) lf]
|
||||
[(ValuesDots: (list (Result: _ lf _) ...) _ _) lf]))
|
||||
|
||||
(define-values (var-promote var-demote)
|
||||
(let ()
|
||||
|
||||
(begin-encourage-inline
|
||||
(define (var-change V T change)
|
||||
(define (structural-recur t sym)
|
||||
(case sym
|
||||
|
@ -57,7 +58,7 @@
|
|||
[(? Filter?) ((sub-f co) T)]
|
||||
[(? Object?) ((sub-o co) T)]
|
||||
[(? Type?) ((sub-t co) T)]))
|
||||
|
||||
(values
|
||||
(lambda (T V) (var-change V T #t))
|
||||
(lambda (T V) (var-change V T #f)))))
|
||||
(define (var-promote T V)
|
||||
(var-change V T #t))
|
||||
(define (var-demote T V)
|
||||
(var-change V T #f)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user