# HG changeset patch # User Steve Losh # Date 1468276405 0 # Node ID 401cba673bda74b98438207d81590fb4f486a589 # Parent 789aa55407463827dbb268d4b9e413b665e7f30c Simplify and optimize register allocation just a bit diff -r 789aa5540746 -r 401cba673bda src/wam/compiler.lisp --- a/src/wam/compiler.lisp Mon Jul 11 21:38:10 2016 +0000 +++ b/src/wam/compiler.lisp Mon Jul 11 22:33:25 2016 +0000 @@ -542,7 +542,7 @@ (defstruct allocation-state (local-registers (vector) :type (vector t *)) ; todo should this be a (vector symbol) instead? - (stack-registers (make-array 1) :type (simple-array symbol (*))) + (stack-registers nil :type list) (permanent-variables nil :type list) (anonymous-variables nil :type list) (reserved-variables nil :type list) @@ -656,15 +656,14 @@ (local-registers (make-array 64 :fill-pointer (or reserved-arity actual-arity) :adjustable t - :initial-element nil)) + :initial-element 0)) ;; We essentially "preallocate" all the permanent variables up front ;; because we need them to always be in the same stack registers across ;; all the terms of our clause. ;; ;; The ones that won't get used in this term will end up getting ;; flattened away anyway. - (stack-registers (make-array (length permanent-variables) - :initial-contents permanent-variables)) + (stack-registers permanent-variables) (allocation-state (make-allocation-state :local-registers local-registers