From 8f4e491fd35266b0c052866a1476c57d4a292a68 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. --- src/runtime/string.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/string.scm b/src/runtime/string.scm index 9c401d0ee..aa09f977f 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