Changeset 4653


Ignore:
Timestamp:
11/05/03 19:34:28 (18 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/jvm.lisp

    r4652 r4653  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: jvm.lisp,v 1.8 2003-11-05 18:45:06 piso Exp $
     4;;; $Id: jvm.lisp,v 1.9 2003-11-05 19:34:28 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    488488(defvar *thread-var-initialized* nil)
    489489
    490 (defun emit-clear-values ()
     490(defun ensure-thread-var-initialized ()
    491491  (unless *thread-var-initialized*
     492    (format t "generating thread variable initialization code~%")
    492493    ;; Put the code to initialize the local at the very beginning of the
    493494    ;; function, to guarantee that the local gets initialized even if the code
     
    502503      (emit 'astore *thread*)
    503504      (setf *code* (append code *code*)))
    504     (setf *thread-var-initialized* t))
     505    (setf *thread-var-initialized* t)))
     506
     507(defun emit-clear-values ()
     508  (ensure-thread-var-initialized)
    505509  (emit 'aload *thread*)
    506510  (emit 'invokevirtual
     
    13871391         (varlist (second form))
    13881392         (specialp nil)
    1389          thread-var env-var)
     1393         env-var)
    13901394    ;; Are we going to bind any special variables?
    13911395    (dolist (varspec varlist)
     
    13961400    ;; If so...
    13971401    (when specialp
    1398       ;; Save current thread in a local variable.
    1399       (setq thread-var (vector-push nil *locals*))
    1400       (setq *max-locals* (max *max-locals* (fill-pointer *locals*)))
    1401       (emit 'invokestatic
    1402             +lisp-thread-class+
    1403             "currentThread"
    1404             "()Lorg/armedbear/lisp/LispThread;")
    1405       (emit 'astore thread-var)
    14061402      ;; Save current dynamic environment.
    14071403      (setq env-var (vector-push nil *locals*))
    14081404      (setq *max-locals* (max *max-locals* (fill-pointer *locals*)))
    1409       (emit 'aload thread-var)
     1405      (ensure-thread-var-initialized)
     1406      (emit 'aload *thread*)
    14101407      (emit 'invokevirtual
    14111408            +lisp-thread-class+
     
    14251422    (when specialp
    14261423      ;; Restore dynamic environment.
    1427       (emit 'aload thread-var)
     1424      (emit 'aload *thread*)
    14281425      (emit 'aload env-var)
    14291426      (emit 'invokevirtual
Note: See TracChangeset for help on using the changeset viewer.