Changeset 8322


Ignore:
Timestamp:
01/01/05 19:26:12 (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

    r8321 r8322  
    22;;;
    33;;; Copyright (C) 2003-2004 Peter Graves
    4 ;;; $Id: jvm.lisp,v 1.336 2005-01-01 18:31:03 piso Exp $
     4;;; $Id: jvm.lisp,v 1.337 2005-01-01 19:26:12 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    50665066      (write-u2 0 stream))))
    50675067
     5068(defun p1-compiland (compiland)
     5069  (let ((precompiled-form (compiland-lambda-expression compiland)))
     5070    (aver (eq (car precompiled-form) 'LAMBDA))
     5071    (process-optimization-declarations (cddr precompiled-form))
     5072    (let ((lambda-list (cadr precompiled-form))
     5073          syms vars)
     5074      (multiple-value-bind (required optional restp rest keyp keys allowp auxp aux)
     5075        (sys::parse-lambda-list lambda-list)
     5076        (setf syms required)
     5077        (when optional
     5078          (setf syms (append syms optional)))
     5079        (when restp
     5080          (setf syms (append syms (list rest))))
     5081        (when keyp
     5082          (setf syms (append syms keys)))
     5083        (dformat t "syms = ~S~%" syms))
     5084      (dolist (sym syms)
     5085        (push (make-variable :name sym) vars))
     5086      (setf (compiland-arg-vars compiland) (nreverse vars)))
     5087    ;; Pass 1.
     5088    (let ((*visible-variables* *visible-variables*))
     5089      (setf *visible-variables*
     5090            (append *visible-variables* (compiland-arg-vars compiland)))
     5091      (setf (compiland-p1-result compiland) (p1 precompiled-form)))))
     5092
    50685093(defun p2-compiland (compiland)
    50695094  (let* ((p1-result (compiland-p1-result compiland))
     
    52465271                 (setf (variable-index variable) nil)))))
    52475272
    5248 ;;       (process-optimization-declarations body)
    5249 
    52505273      (compile-progn-body body :stack)
    52515274
     
    53095332  (dformat t "compile-1 ~S~%" (compiland-name compiland))
    53105333  (let ((*current-compiland* compiland)
    5311         (precompiled-form (compiland-lambda-expression compiland))
    53125334        (*speed* *speed*)
    53135335        (*safety* *safety*)
    53145336        (*debug* *debug*))
    5315     (process-optimization-declarations (cddr precompiled-form))
    5316     (aver (eq (car precompiled-form) 'LAMBDA))
    5317     (let ((lambda-list (cadr precompiled-form))
    5318           syms vars)
    5319       (multiple-value-bind (required optional restp rest keyp keys allowp auxp aux)
    5320           (sys::parse-lambda-list lambda-list)
    5321         (setf syms required)
    5322         (when optional
    5323           (setf syms (append syms optional)))
    5324         (when restp
    5325           (setf syms (append syms (list rest))))
    5326         (when keyp
    5327           (setf syms (append syms keys)))
    5328         (dformat t "syms = ~S~%" syms))
    5329       (dolist (sym syms)
    5330         (push (make-variable :name sym) vars))
    5331       (setf (compiland-arg-vars compiland) (nreverse vars)))
    53325337    ;; Pass 1.
    5333     (let ((*visible-variables* *visible-variables*))
    5334       (setf *visible-variables*
    5335             (append *visible-variables* (compiland-arg-vars compiland)))
    5336       (setf (compiland-p1-result compiland) (p1 precompiled-form)))
     5338    (p1-compiland compiland)
    53375339    ;; Pass 2.
    53385340    (p2-compiland compiland)))
Note: See TracChangeset for help on using the changeset viewer.