From: Taylor R Campbell Date: Wed, 29 May 2019 00:53:14 +0000 (+0000) Subject: Integrate some subroutines that turn up hot in profiles. X-Git-Tag: mit-scheme-pucked-10.1.11~6^2~21 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=8f4e491fd35266b0c052866a1476c57d4a292a68;p=mit-scheme.git Integrate some subroutines that turn up hot in profiles. --- 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)