Changeset 8317


Ignore:
Timestamp:
12/31/04 16:49:17 (17 years ago)
Author:
piso
Message:

Work in progress (tested).

File:
1 edited

Legend:

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

    r8316 r8317  
    22;;;
    33;;; Copyright (C) 2003-2004 Peter Graves
    4 ;;; $Id: jvm.lisp,v 1.331 2004-12-31 02:22:31 piso Exp $
     4;;; $Id: jvm.lisp,v 1.332 2004-12-31 16:49:17 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    125125  (%format t "  ~S special-p = ~S register = ~S level = ~S index = ~S declared-type = ~S~%"
    126126           (variable-name variable)
    127 ;;            (variable-kind variable)
    128127           (variable-special-p variable)
    129128           (variable-register variable)
     
    153152  index
    154153  (reads 0)
    155   (writes 0))
     154  (writes 0)
     155  used-non-locally-p
     156  (compiland *current-compiland*))
    156157
    157158;; obj can be a symbol or variable
     
    395396
    396397(defun p1-flet/labels (form)
     398  (dformat t "p1-flet/labels~%")
    397399  (when *current-compiland*
    398400    (incf (compiland-children *current-compiland*) (length (cadr form))))
     
    433435      (if variable
    434436          (progn
    435             (dformat t "p1-setq: write to ~S~%" arg1)
    436             (incf (variable-writes variable)))
     437            (incf (variable-writes variable))
     438            (cond
     439             ((eq (variable-compiland variable) *current-compiland*)
     440              (dformat t "p1-setq: write ~S~%" arg1))
     441             (t
     442              (dformat t "p1-setq: non-local write ~S~%" arg1)
     443              (setf (variable-used-non-locally-p variable) t))))
    437444          (dformat t "p1-setq: unknown variable ~S~%" arg1)))
    438445    (list 'SETQ arg1 (p1 arg2))))
     
    492499            value
    493500            form)))
     501     ((keywordp form)
     502      form)
    494503     (t
     504      (let ((variable (find-visible-variable form)))
     505        (if variable
     506            (progn
     507              (incf (variable-reads variable))
     508              (cond
     509               ((eq (variable-compiland variable) *current-compiland*)
     510                (dformat t "p1: read ~S~%" form))
     511               (t
     512                (dformat t "p1: non-local read ~S~%" form)
     513                (setf (variable-used-non-locally-p variable) t))))
     514            (dformat t "p1: unknown variable ~S~%" form)))
    495515      form)))
    496516   ((atom form)
     
    49925012
    49935013(defun compile-1 (compiland)
     5014  (dformat t "compile-1 ~S~%" (compiland-name compiland))
    49945015  (let ((*current-compiland* compiland)
    49955016        (precompiled-form (compiland-lambda-expression compiland))
     
    50015022    (process-optimization-declarations (cddr precompiled-form))
    50025023    ;; Pass 1.
    5003     (let ((*visible-variables* ()))
     5024    (let ((*visible-variables* *visible-variables*))
    50045025      (setf precompiled-form (p1 precompiled-form)))
    50055026    ;; Pass 2.
     
    50235044           (*arity* nil)
    50245045
    5025            (*child-p* (if *context* t nil))
     5046           (*child-p* (not (null (compiland-parent compiland))))
    50265047
    50275048           (*use-locals-vector* (or (> (compiland-children *current-compiland*) 0)
Note: See TracChangeset for help on using the changeset viewer.