swap vector*-ref' and
vector-ref', etc.
Merge to 5.0.2 original commit: 5d8e000d6d37cb9a032f4bcf4d82c63d8e51bae1
This commit is contained in:
parent
9b5a5a6bb5
commit
28406c5093
|
@ -21,8 +21,8 @@
|
|||
(define-syntax-class box-op
|
||||
#:commit
|
||||
;; we need the * versions of these unsafe operations to be chaperone-safe
|
||||
(pattern (~literal unbox) #:with unsafe #'unsafe-unbox*)
|
||||
(pattern (~literal set-box!) #:with unsafe #'unsafe-set-box*!))
|
||||
(pattern (~literal unbox) #:with unsafe #'unsafe-unbox)
|
||||
(pattern (~literal set-box!) #:with unsafe #'unsafe-set-box!))
|
||||
|
||||
(define-syntax-class box-opt-expr
|
||||
#:commit
|
||||
|
|
|
@ -51,8 +51,8 @@
|
|||
#:with opt
|
||||
(begin (log-optimization "in-vector" #'op)
|
||||
#'(let* ((i v*.opt)
|
||||
(len (unsafe-vector*-length i)))
|
||||
(values (lambda (x) (unsafe-vector*-ref i x))
|
||||
(len (unsafe-vector-length i)))
|
||||
(values (lambda (x) (unsafe-vector-ref i x))
|
||||
(lambda (x) (unsafe-fx+ 1 x))
|
||||
0
|
||||
(lambda (x) (unsafe-fx< x len))
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
(define-syntax-class vector-op
|
||||
#:commit
|
||||
;; we need the * versions of these unsafe operations to be chaperone-safe
|
||||
(pattern (~literal vector-ref) #:with unsafe #'unsafe-vector*-ref)
|
||||
(pattern (~literal vector-set!) #:with unsafe #'unsafe-vector*-set!))
|
||||
(pattern (~literal vector-ref) #:with unsafe #'unsafe-vector-ref)
|
||||
(pattern (~literal vector-set!) #:with unsafe #'unsafe-vector-set!))
|
||||
|
||||
(define-syntax-class vector-expr
|
||||
#:commit
|
||||
|
@ -43,7 +43,7 @@
|
|||
(pattern (#%plain-app (~and op (~literal vector-length)) v:expr)
|
||||
#:with opt
|
||||
(begin (log-optimization "vector-length" #'op)
|
||||
#`(unsafe-vector*-length #,((optimize) #'v))))
|
||||
#`(unsafe-vector-length #,((optimize) #'v))))
|
||||
;; same for flvector-length
|
||||
(pattern (#%plain-app (~and op (~literal flvector-length)) v:expr)
|
||||
#:with opt
|
||||
|
|
Loading…
Reference in New Issue
Block a user