home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / compiler / machines / sparc / rules4.scm < prev    next >
Encoding:
Text File  |  1999-01-02  |  3.1 KB  |  87 lines

  1. #| -*-Scheme-*-
  2.  
  3. $Id: rules4.scm,v 1.2 1999/01/02 06:06:43 cph Exp $
  4.  
  5. Copyright (c) 1988-1999 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. |#
  21.  
  22. ;;;; LAP Generation Rules: Interpreter Calls
  23.  
  24. (declare (usual-integrations))
  25.  
  26. ;;;; Interpreter Calls
  27.  
  28. (define-rule statement
  29.   (INTERPRETER-CALL:ACCESS (? environment register-expression) (? name))
  30.   (lookup-call code:compiler-access environment name))
  31.  
  32. (define-rule statement
  33.   (INTERPRETER-CALL:LOOKUP (? environment register-expression)
  34.                (? name)
  35.                (? safe?))
  36.   (lookup-call (if safe? code:compiler-safe-lookup code:compiler-lookup)
  37.            environment
  38.            name))
  39.  
  40. (define-rule statement
  41.   (INTERPRETER-CALL:UNASSIGNED? (? environment register-expression) (? name))
  42.   (lookup-call code:compiler-unassigned? environment name))
  43.  
  44. (define-rule statement
  45.   (INTERPRETER-CALL:UNBOUND? (? environment register-expression) (? name))
  46.   (lookup-call code:compiler-unbound? environment name))
  47.  
  48. (define (lookup-call code environment name)
  49.   (LAP ,@(load-interface-args! false environment false false)
  50.        ,@(load-constant regnum:third-arg name #F #F)
  51.        ,@(link-to-interface code)))
  52.  
  53. (define-rule statement
  54.   (INTERPRETER-CALL:DEFINE (? environment register-expression)
  55.                (? name)
  56.                (? value register-expression))
  57.   (assignment-call code:compiler-define environment name value))
  58.  
  59. (define-rule statement
  60.   (INTERPRETER-CALL:SET! (? environment register-expression)
  61.              (? name)
  62.              (? value register-expression))
  63.   (assignment-call code:compiler-set! environment name value))
  64.  
  65. (define (assignment-call code environment name value)
  66.   (LAP ,@(load-interface-args! false environment false value)
  67.        ,@(load-constant regnum:third-arg name #F #F)
  68.        ,@(link-to-interface code)))
  69.  
  70. (define-rule statement
  71.   (INTERPRETER-CALL:CACHE-REFERENCE (REGISTER (? extension)) (? safe?))
  72.   (LAP ,@(load-interface-args! false extension false false)
  73.        ,@(link-to-interface
  74.       (if safe?
  75.           code:compiler-safe-reference-trap
  76.           code:compiler-reference-trap))))
  77.  
  78. (define-rule statement
  79.   (INTERPRETER-CALL:CACHE-ASSIGNMENT (REGISTER (? extension))
  80.                      (? value register-expression))
  81.   (LAP ,@(load-interface-args! false extension value false)
  82.        ,@(link-to-interface code:compiler-assignment-trap)))
  83.  
  84. (define-rule statement
  85.   (INTERPRETER-CALL:CACHE-UNASSIGNED? (REGISTER (? extension)))
  86.   (LAP ,@(load-interface-args! false extension false false)
  87.        ,@(link-to-interface code:compiler-unassigned?-trap)))