Changeset 4652


Ignore:
Timestamp:
11/05/03 18:45:06 (18 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

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

    r4651 r4652  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: jvm.lisp,v 1.7 2003-11-05 17:20:31 piso Exp $
     4;;; $Id: jvm.lisp,v 1.8 2003-11-05 18:45:06 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    304304(defvar *max-locals* 0)
    305305
    306 (defun allocate-local ()
    307   (let ((index (fill-pointer *locals*)))
    308     (incf (fill-pointer *locals*))
    309     (setf *max-locals* (fill-pointer *locals*))
    310     index))
     306;; (defun allocate-local ()
     307;;   (let ((index (fill-pointer *locals*)))
     308;;     (incf (fill-pointer *locals*))
     309;;     (setf *max-locals* (fill-pointer *locals*))
     310;;     index))
    311311
    312312(defvar *args* nil)
     
    486486;; Index of local variable used to hold the current thread.
    487487(defvar *thread* nil)
     488(defvar *thread-var-initialized* nil)
    488489
    489490(defun emit-clear-values ()
    490   (unless *thread*
    491     ;; Allocate a local variable to hold the current thread.
    492     (setf *thread* (allocate-local))
     491  (unless *thread-var-initialized*
    493492    ;; Put the code to initialize the local at the very beginning of the
    494493    ;; function, to guarantee that the local gets initialized even if the code
     
    502501            "()Lorg/armedbear/lisp/LispThread;")
    503502      (emit 'astore *thread*)
    504       (setf *code* (append code *code*))))
     503      (setf *code* (append code *code*)))
     504    (setf *thread-var-initialized* t))
    505505  (emit 'aload *thread*)
    506506  (emit 'invokevirtual
     
    18391839         (*pool-count* 1)
    18401840         (*val* nil)
    1841          (*thread* nil))
     1841         (*thread* nil)
     1842         (*thread-var-initialized* nil))
    18421843    (setf (method-name-index execute-method)
    18431844          (pool-name (method-name execute-method)))
     
    18591860        (setf (fill-pointer *locals*) (1+ (length args))))
    18601861    ;; Reserve the next available slot for the value register.
    1861     (setf *val* (allocate-local))
     1862    (setq *val* (fill-pointer *locals*))
     1863    (incf (fill-pointer *locals*))
     1864    (setf *max-locals* (fill-pointer *locals*))
     1865    ;; Reserve the next available slot for the thread register.
     1866    (setq *thread* (fill-pointer *locals*))
     1867    (incf (fill-pointer *locals*))
     1868    (setf *max-locals* (fill-pointer *locals*))
    18621869    (when *hairy-arglist-p*
    18631870      (emit 'aload_0)
Note: See TracChangeset for help on using the changeset viewer.