~ chicken-core (chicken-5) /tweaks.scm
Trap1;;;; tweaks.scm - Some inline-routines and declarations for the compiler2;3; Copyright (c) 2008-2022, The CHICKEN Team4; Copyright (c) 2000-2007, Felix L. Winkelmann5; All rights reserved.6;7; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following8; conditions are met:9;10; Redistributions of source code must retain the above copyright notice, this list of conditions and the following11; disclaimer.12; Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following13; disclaimer in the documentation and/or other materials provided with the distribution.14; Neither the name of the author nor the names of its contributors may be used to endorse or promote15; products derived from this software without specific prior written permission.16;17; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS18; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY19; AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR20; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR21; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR22; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY23; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR24; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE25; POSSIBILITY OF SUCH DAMAGE.262728;; This file contains some stuff to speed up basic node accessors, and also29;; contains common declarations.303132(cond-expand33 ((not debugbuild)34 (declare35 (disable-interrupts)36 (no-bound-checks)37 (no-procedure-checks)38 (no-argc-checks)))39 (else))4041(define-inline (node? x) (##sys#structure? x 'chicken.compiler.support#node))42(define-inline (make-node c p s) (##sys#make-structure 'chicken.compiler.support#node c p s))4344(cond-expand45 ((not debugbuild)46 (define-inline (node-class n) (##sys#slot n 1))47 (define-inline (node-parameters n) (##sys#slot n 2))48 (define-inline (node-subexpressions n) (##sys#slot n 3)))49 (else))5051(define-inline (intrinsic? sym) (##sys#get sym '##compiler#intrinsic))5253(define-inline (namespaced-symbol? sym)54 (##core#inline "C_u_i_namespaced_symbolp" sym))5556(define-inline (mark-variable var mark #!optional (val #t))57 (##sys#put! var mark val) )5859(define-inline (variable-mark var mark)60 (##sys#get var mark) )