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
7 : (string-nth) ( n string -- base offset rep c-type )
8 ^^tagged>integer swap ^^add string-offset int-rep uchar ; inline
10 : emit-string-nth-fast ( -- )
11 2inputs (string-nth) ^^load-memory-imm ds-push ;
13 : emit-set-string-nth-fast ( -- )
14 3inputs (string-nth) ##store-memory-imm, ;