Gauche:YAGHG:VM:Insn:LOCAL-ENV

Gauche:YAGHG:VM:Insn:LOCAL-ENV

概要

;; LOCAL-ENV(NLOCALS)
;;  Create a new environment frame from the current arg frame.
;;  Used for let.
(define-insn LOCAL-ENV  1 none)

環境フレームヘッダを積んで環境フレームを完成させる。

パラメータ

未使用

動作

           BEFORE                                 AFTER
          +=========+                            +=========+
          :         :                            :         :
 env ---->+=========+                            +=========+<---+
          |         |                            |         |    |
          | E#0     |                            | E#0     |    |
          |         |                            |         |    |
          +=========+                            +=========+    |
          :         :                            :         :    |
argp ---->+=========+                            +=========+====+==========
          | arg#1   |                            | arg#1   |    |
          +---------+                            +---------+    |
          :         :                            :         :    |
          +---------+                            +---------+    |
          | arg#N   |                            | arg#N   |    |       E#1
  sp ---->+---------+                   env ---->+---------+    |
          |         |                         up |       --+----+
          |         |                            +---------+
                                            size |    N    |
                                   argp, sp ---->+=========+===============
                                                 |         |
                                                 |         |

コード例

(compile-p3
 '(let ((i 0))
     (set! i 1)))

0 CONSTI-PUSH(0)
1 LOCAL-ENV(1)             ; (let ((i 0)) (set! i 1))
2 CONSTI(1)
3 LSET(0,0)                ; i
4 RET

Last modified : 2006/01/29 09:05:35 UTC