Changeset 13164


Ignore:
Timestamp:
Nov 3, 2009, 6:38:03 PM (10 years ago)
Author:
gb
Message:

Suboptimal fix for ticket:617. Keep track of whether or not we're
in the compiler frontend (*NX-IN-FRONTEND*); avoid doing type inference/
propagation on lexical variable references if so.

That's overly conservative: the real fix is to not try to do much
type inference/propagation at all in the frontend (and to do it
later, after full information about variable usage is available.)
That involves some restructuring that may be hard to bootstrap, hence
this fix.

Location:
trunk/source/compiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/nx.lisp

    r13067 r13164  
    155155(defparameter *nx-discard-xref-info-hook* nil)
    156156
     157(defparameter *nx-in-frontend* nil)
     158
    157159(defun compile-named-function (def &key name env policy load-time-eval-token target
    158160                                function-note keep-lambda keep-symbols source-notes
     
    180182     (setf (lexenv.variables env) 'barrier)
    181183     (let* ((*target-backend* (or (if target (find-backend target)) *host-backend*))
     184            (*nx-in-frontend* t)
    182185            (afunc (nx1-compile-lambda
    183186                    name
     
    188191                    (or policy *default-compiler-policy*)
    189192                    *load-time-eval-token*)))
     193       (setq *nx-in-frontend* nil)
    190194       (if (afunc-lfun afunc)
    191195         afunc
  • trunk/source/compiler/nx0.lisp

    r13131 r13164  
    466466                                    (%cadr form)))
    467467                                (if (eq op (%nx1-operator lexical-reference))
    468                                   (let* ((var (cadr form))
    469                                          (bits (nx-var-bits var))
    470                                          (punted (logbitp $vbitpunted bits)))
    471                                     (if (or punted
    472                                             (eql 0 (%ilogand $vsetqmask bits)))
    473                                       (var-inittype var)))
     468                                  (locally (declare (special *nx-in-frontend*))
     469                                    (unless *nx-in-frontend*
     470                                      (let* ((var (cadr form))
     471                                             (bits (nx-var-bits var))
     472                                             (punted (logbitp $vbitpunted bits)))
     473                                        (if (or punted
     474                                                (eql 0 (%ilogand $vsetqmask bits)))
     475                                          (var-inittype var)))))
    474476                                  (if (or (eq op (%nx1-operator %aref1))
    475477                                          (eq op (%nx1-operator simple-typed-aref2))
Note: See TracChangeset for help on using the changeset viewer.