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