Changeset 10192

Show
Ignore:
Timestamp:
05/14/04 13:40:19 (5 years ago)
Author:
rtoy
Message:

Add support for storing the symbol hash into a slot in the symbol
itself. Only for sparc currently.

Doesn't lazily compute the symbol hash yet. Simple test shows a 5%
increase in compilation speed, despite making make-symbol
significantly slower.

  • src/code/hash-new.lisp (internal-sxhash): Use the symbol-hash slot instead of computing the hash value.
  • src/compiler/generic/new-genesis.lisp (allocate-symbol): Write out the sxhash value of the symbol into the symbol-hash slot.
  • src/compiler/globaldb.lisp (info-hash): Update to use the symbol hash instead of computing the sxhash.
  • src/code/symbol.lisp (make-symbol): Compute the symbol hash when creating the symbol.
  • src/compiler/sparc/cell.lisp ((symbol-hash)): Add vop to extract out the symbol hash from a symbol.
  • src/compiler/generic/objdef.lisp: Rename the unused slot to hash, so we can make it the symbol hash.
Location:
trunk/src
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/code/hash-new.lisp

    r10007 r10125  
    185185;;;  
    186186(defun make-hash-table (&key (test 'eql) (size 65) (rehash-size 1.5) 
    187                              (rehash-threshold 1) (weak-p nil)) 
     187                             (rehash-threshold 1.0) (weak-p nil)) 
    188188  "Creates and returns a new hash table.  The keywords are as follows: 
    189189     :TEST -- Indicates what kind of test to use.  Only EQ, EQL, EQUAL, 
     
    230230      (let* ((size (max 36 size)) ; Needs to be at least 1, say 36. 
    231231             (size+1 (1+ size))   ; The first element is not usable. 
     232             ;; Don't let rehash-threshold get too small to cause 
     233             ;; overflows or division by zero.  It's a hint, not a 
     234             ;; requirement, anyway. 
     235             (rehash-threshold (max 0.1 (float rehash-threshold 1.0))) 
    232236             (scaled-size (round (/ (float size+1) rehash-threshold))) 
    233237             (length (if (<= scaled-size 37) 37 (almost-primify scaled-size)))) 
  • trunk/src/code/symbol.lisp

    r8991 r9500  
    158158      ((null plist) default) 
    159159    (cond ((atom (cdr plist)) 
    160            (simple-program-error "~S is a malformed property list." place)) 
     160           (error 'simple-type-error 
     161                  :datum place 
     162                  :expected-type 'list 
     163                  :format-control "Malformed property list: ~S" 
     164                  :format-arguments (list place)))          
    161165          ((eq (car plist) indicator) 
    162166           (return (cadr plist)))))) 
     
    179183      ((null plist) (values nil nil nil)) 
    180184    (cond ((atom (cdr plist)) 
    181            (simple-program-error "~S is a malformed property list." place)) 
     185           (error 'simple-type-error 
     186                  :datum place 
     187                  :expected-type 'list 
     188                  :format-control "Malformed property list: ~S" 
     189                  :format-arguments (list place))) 
    182190          ((memq (car plist) indicator-list) 
    183191           (return (values (car plist) (cadr plist) plist)))))) 
  • trunk/src/compiler/generic/new-genesis.lisp

    r10007 r10139  
    708708      (frob kernel::yellow-zone-hit) 
    709709      (frob kernel::red-zone-hit)) 
     710    #+heap-overflow-check 
     711    (progn 
     712      (frob kernel::dynamic-space-overflow-error-hit) 
     713      (frob kernel::dynamic-space-overflow-warning-hit)) 
    710714    (frob di::handle-breakpoint) 
    711715    (frob di::handle-function-end-breakpoint) 
     
    19261930  (cold-register-foreign-linkage "resolve_linkage_tramp" :code) 
    19271931  #+sparc 
    1928   (cold-register-foreign-linkage "call_into_c" :code)) 
     1932  (progn 
     1933    (cold-register-foreign-linkage "call_into_c" :code) 
     1934    (cold-register-foreign-linkage "undefined_tramp" :data) 
     1935    (cold-register-foreign-linkage "closure_tramp" :data) 
     1936    )) 
    19291937 
    19301938(defvar *cold-assembler-routines* nil) 
     
    22242232            (test-head "TRACE-TABLE-" "tracetab_" 4) 
    22252233            (test-tail "-SC-NUMBER" "sc_" 5) 
    2226             (test-head "TARGET-FOREIGN-" "" 6))))) 
     2234            (test-head "TARGET-FOREIGN" "" 6) 
     2235            (test-head "PSEUDO-ATOMIC-" "pseudo_atomic_" 7) 
     2236            (test-head "LOWTAG-" "lowtag_" 8) 
     2237            (test-head "TYPE-" "type_" 9) 
     2238            (test-tail "-SPACE-START" "SpaceStart_" 10))))) 
    22272239    (setf constants 
    22282240          (sort constants 
  • trunk/src/compiler/sparc/cell.lisp

    r9087 r10181  
    264264  (:generator 4 
    265265    (loadw temp struct 0 instance-pointer-type) 
    266     (inst srl res temp vm:type-bits))) 
     266    (inst srln res temp vm:type-bits))) 
    267267 
    268268(define-vop (instance-ref slot-ref) 
     
    274274(define-vop (instance-set slot-set) 
    275275  (:policy :fast-safe) 
    276   (:translate %instance-set) 
     276  ;; This is an invalid translation because %instance-set needs a 
     277  ;; return value, and this VOP doesn't return anything.  I (RLT) 
     278  ;; don't know how to fix this so that this VOP returns a value and 
     279  ;; still works correctly when it is called directly by the compiler. 
     280  ;; However, disabling the translation works around the bug. 
     281   
     282  ;;(:translate %instance-set) 
    277283  (:variant instance-slots-offset instance-pointer-type) 
    278284  (:arg-types instance (:constant index) *))