inline record-type-descriptor and record-type-uid

original commit: cc7ebd105c0447870eeefe5214fcc0a6d0ead64d
This commit is contained in:
Matthew Flatt 2018-12-07 12:32:17 -07:00
parent 31e65b1554
commit 7eb7089c79
2 changed files with 13 additions and 8 deletions

View File

@ -3307,14 +3307,18 @@
(define-inline 2 record-type-descriptor?
[(?x)
(cond
[(nanopass-case (Lsrc Expr) (result-exp (value-visit-operand! ?x))
[(record-type ,rtd ,e) #t]
[(quote ,d) (record-type-descriptor? d)]
[else #f])
(residualize-seq '() (list ?x) ctxt)
true-rec]
[else #f])])
(let ([?x-val (value-visit-operand! ?x)])
(cond
[(nanopass-case (Lsrc Expr) (result-exp ?x-val)
[(record-type ,rtd ,e) #t]
[(quote ,d) (record-type-descriptor? d)]
[else #f])
(residualize-seq '() (list ?x) ctxt)
true-rec]
[else
(residualize-seq (list ?x) '() ctxt)
(build-primcall (app-preinfo ctxt) 3 'record?
(list ?x-val `(quote ,#!base-rtd)))]))])
(define-inline 2 record-constructor-descriptor?
[(?x)

View File

@ -5167,6 +5167,7 @@
(inline-accessor csv7:record-type-descriptor record-type-disp)
(inline-accessor $record-type-descriptor record-type-disp)
(inline-accessor record-rtd record-type-disp)
(inline-accessor record-type-uid record-type-uid-disp)
(inline-accessor $port-handler port-handler-disp)
(inline-accessor $port-info port-info-disp)
(inline-accessor port-name port-name-disp)