Changeset 4652
- Timestamp:
- 11/05/03 18:45:06 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/jvm.lisp
r4651 r4652 2 2 ;;; 3 3 ;;; Copyright (C) 2003 Peter Graves 4 ;;; $Id: jvm.lisp,v 1. 7 2003-11-05 17:20:31piso Exp $4 ;;; $Id: jvm.lisp,v 1.8 2003-11-05 18:45:06 piso Exp $ 5 5 ;;; 6 6 ;;; This program is free software; you can redistribute it and/or … … 304 304 (defvar *max-locals* 0) 305 305 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)) 311 311 312 312 (defvar *args* nil) … … 486 486 ;; Index of local variable used to hold the current thread. 487 487 (defvar *thread* nil) 488 (defvar *thread-var-initialized* nil) 488 489 489 490 (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* 493 492 ;; Put the code to initialize the local at the very beginning of the 494 493 ;; function, to guarantee that the local gets initialized even if the code … … 502 501 "()Lorg/armedbear/lisp/LispThread;") 503 502 (emit 'astore *thread*) 504 (setf *code* (append code *code*)))) 503 (setf *code* (append code *code*))) 504 (setf *thread-var-initialized* t)) 505 505 (emit 'aload *thread*) 506 506 (emit 'invokevirtual … … 1839 1839 (*pool-count* 1) 1840 1840 (*val* nil) 1841 (*thread* nil)) 1841 (*thread* nil) 1842 (*thread-var-initialized* nil)) 1842 1843 (setf (method-name-index execute-method) 1843 1844 (pool-name (method-name execute-method))) … … 1859 1860 (setf (fill-pointer *locals*) (1+ (length args)))) 1860 1861 ;; 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*)) 1862 1869 (when *hairy-arglist-p* 1863 1870 (emit 'aload_0)
Note: See TracChangeset
for help on using the changeset viewer.