From e17d95fadd66d663ec13f2370d5afd785c24543e Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 29 May 2019 00:53:14 +0000 Subject: [PATCH] Integrate some subroutines that turn up hot in profiles. (cherry picked from commit 8f4e491fd35266b0c052866a1476c57d4a292a68) --- src/runtime/string.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/string.scm b/src/runtime/string.scm index c2fc9a9da..a2c4f0912 100644 --- a/src/runtime/string.scm +++ b/src/runtime/string.scm @@ -285,6 +285,7 @@ USA. ;;;; String slices +(declare (integrate-operator slice?)) (define (slice? object) (and (%record? object) (fix:= 4 (%record-length object)) @@ -300,17 +301,20 @@ USA. (define-integrable (slice-start slice) (%record-ref slice 2)) (define-integrable (slice-length slice) (%record-ref slice 3)) +(declare (integrate-operator slice-end)) (define (slice-end slice) (fix:+ (slice-start slice) (slice-length slice))) (define (slice-mutable? slice) (ustring-mutable? (slice-string slice))) +(declare (integrate-operator unpack-slice)) (define (unpack-slice string k) (if (slice? string) (k (slice-string string) (slice-start string) (slice-end string)) (k string 0 (ustring-length string)))) +(declare (integrate-operator translate-slice)) (define (translate-slice string start end k) (if (slice? string) (k (slice-string string) -- 2.25.1