]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/intrinsics/strings/strings.factor
Switch to https urls
[factor.git] / basis / compiler / cfg / intrinsics / strings / strings.factor
1 ! Copyright (C) 2010 Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types compiler.cfg.hats compiler.cfg.instructions
4 compiler.cfg.stacks compiler.constants cpu.architecture kernel ;
5 IN: compiler.cfg.intrinsics.strings
6
7 : (string-nth) ( n string -- base offset rep c-type )
8     ^^tagged>integer swap ^^add string-offset int-rep uchar ; inline
9
10 : emit-string-nth-fast ( -- )
11     2inputs (string-nth) ^^load-memory-imm ds-push ;
12
13 : emit-set-string-nth-fast ( -- )
14     3inputs (string-nth) ##store-memory-imm, ;