Stop tracking struct constructors.
Was only used by OC, for a now-defunct recommendation.
This commit is contained in:
parent
6fb0fa04e7
commit
319e6fd4e1
|
@ -45,18 +45,6 @@
|
|||
#:do [(log-optimization-info "hidden parameter (random)" #'op)]
|
||||
#:with opt (syntax/loc this-syntax (op args.opt ...)))
|
||||
|
||||
;; Log calls to struct constructors, so that OC can report those used in
|
||||
;; hot loops.
|
||||
;; Note: Sometimes constructors are wrapped in `#%expression', need to watch
|
||||
;; for that too.
|
||||
(pattern (#%plain-app (~and op-part (~or op:id (#%expression op:id)))
|
||||
args:opt-expr ...)
|
||||
#:when (let ([constructor-for (syntax-property #'op 'constructor-for)])
|
||||
(or (and constructor-for (struct-constructor? constructor-for))
|
||||
(struct-constructor? #'op)))
|
||||
#:do [(log-optimization-info "struct constructor" #'op)]
|
||||
#:with opt (syntax/loc this-syntax (op-part args.opt ...)))
|
||||
|
||||
;; regexp-match (or other regexp operation) with non-regexp pattern argument
|
||||
;; (i.e. string or bytes)
|
||||
(pattern (#%plain-app op:regexp-function pattern-arg:opt-expr
|
||||
|
|
|
@ -193,10 +193,6 @@
|
|||
|
||||
(define extra-constructor (struct-names-extra-constructor names))
|
||||
|
||||
(add-struct-constructor! (struct-names-constructor names))
|
||||
(when extra-constructor
|
||||
(add-struct-constructor! extra-constructor))
|
||||
|
||||
(define constructor-binding
|
||||
(make-def-binding (struct-names-constructor names)
|
||||
(poly-wrapper (->* all-fields poly-base))))
|
||||
|
|
|
@ -9,10 +9,6 @@
|
|||
(env init-envs env-utils))
|
||||
|
||||
(define struct-fn-table (make-free-id-table))
|
||||
(define struct-constructor-table (make-free-id-table))
|
||||
|
||||
(define (add-struct-constructor! id) (dict-set! struct-constructor-table id #t))
|
||||
(define (struct-constructor? id) (dict-ref struct-constructor-table id #f))
|
||||
|
||||
(define (add-struct-fn! id pe mut?) (dict-set! struct-fn-table id (list pe mut?)))
|
||||
|
||||
|
@ -42,8 +38,6 @@
|
|||
|
||||
(provide/cond-contract
|
||||
[add-struct-fn! (identifier? StructPE? boolean? . c:-> . c:any/c)]
|
||||
[add-struct-constructor! (identifier? . c:-> . c:any)]
|
||||
[struct-constructor? (identifier? . c:-> . boolean?)]
|
||||
[struct-accessor? (identifier? . c:-> . (c:or/c #f StructPE?))]
|
||||
[struct-mutator? (identifier? . c:-> . (c:or/c #f StructPE?))]
|
||||
[struct-fn-idx (identifier? . c:-> . exact-integer?)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user