source: branches/qres/ccl/xdump/hashenv.lisp @ 15278

Last change on this file since 15278 was 13070, checked in by gz, 10 years ago

r13066, r13067 from trunk: copyrights etc

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1;;;-*- Mode: Lisp; Package: CCL -*-
2;;;
3;;;   Copyright (C) 2009 Clozure Associates
4;;;   Copyright (C) 1994-2001 Digitool, Inc
5;;;   This file is part of Clozure CL. 
6;;;
7;;;   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
8;;;   License , known as the LLGPL and distributed with Clozure CL as the
9;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
10;;;   which is distributed with Clozure CL as the file "LGPL".  Where these
11;;;   conflict, the preamble takes precedence. 
12;;;
13;;;   Clozure CL is referenced in the preamble as the "LIBRARY."
14;;;
15;;;   The LLGPL is also available online at
16;;;   http://opensource.franz.com/preamble.html
17
18(in-package "CCL")
19
20(eval-when (:compile-toplevel :execute)
21
22;;; It's wired in to the code that the length of this vector is 8 and
23;;; that its largest element is < 30
24(defconstant secondary-keys #(3 5 7 11 13 17 19 23))
25(defconstant secondary-keys-*-2 #(6 10 14 22 26 34 38 46))
26
27
28(defconstant $nhash.lock-free #x80000)
29
30; The hash.vector cell contains a vector with some longwords of overhead
31; followed by alternating keys and values.
32;; If you change anything here, also update the kernel def in XXX-constantsNN.h
33(def-accessors () %svref
34  nhash.vector.link                     ; GC link for weak vectors
35  nhash.vector.flags                    ; a fixnum of flags
36  nhash.vector.gc-count                 ; gc-count kernel global
37  nhash.vector.free-alist               ; empty alist entries for finalization
38  nhash.vector.finalization-alist       ; deleted out key/value pairs put here
39  nhash.vector.weak-deletions-count     ; incremented when the GC deletes an element
40  nhash.vector.hash                     ; back-pointer
41  nhash.vector.deleted-count            ; if lock-free, hint to GC to delete marked keys.
42                                        ; else number of deleted entries
43  nhash.vector.count                    ; number of valid entries [not maintained if lock-free]
44  nhash.vector.cache-idx                ; index of last cached key/value pair
45  nhash.vector.cache-key                ; cached key
46  nhash.vector.cache-value              ; cached value
47  nhash.vector.size                     ; number of entries in table
48  nhash.vector.size-reciprocal          ; shifted reciprocal of nhash.vector.size
49  )
50
51
52; number of longwords of overhead in nhash.vector.
53; Must be a multiple of 2 or INDEX parameters in LAP code will not be tagged as fixnums.
54(defconstant $nhash.vector_overhead 14)
55
56(defconstant $nhash_weak_bit 12)        ; weak hash table
57(defconstant $nhash_weak_value_bit 11)  ; weak on value vice key if this bit set
58(defconstant $nhash_finalizeable_bit 10)
59(defconstant $nhash_keys_frozen_bit 9)  ; GC must not change key slots when deleting
60(defconstant $nhash_weak_flags_mask
61  (bitset $nhash_keys_frozen_bit (bitset $nhash_weak_bit (bitset $nhash_weak_value_bit (bitset $nhash_finalizeable_bit 0)))))
62
63
64(defconstant $nhash_track_keys_bit 28)  ; request GC to track relocation of keys.
65(defconstant $nhash_key_moved_bit 27)   ; set by GC if a key moved.
66(defconstant $nhash_ephemeral_bit 26)   ; set if a hash code was computed using an address
67                                        ; in ephemeral space
68(defconstant $nhash_component_address_bit 25) ; a hash code was computed from a key's component
69
70
71
72(defconstant $nhash-growing-bit 16)
73(defconstant $nhash-rehashing-bit 17)
74
75)
76
77(declare-arch-specific-macro immediate-p-macro)
78
79(declare-arch-specific-macro hashed-by-identity)
80         
81         
82;; state is #(hash-table index key-vector count) 
83(def-accessors %svref
84  nhti.hash-table
85  nhti.index
86  nhti.keys
87  nhti.values
88  nhti.nkeys)
89
90#+x8632-target
91(defconstant +nil-hash+ 201404780)
92
93#-x8632-target
94(defconstant +nil-hash+ (mixup-hash-code (%pname-hash "NIL" 3)))
95
96
97
98
99
100
101
Note: See TracBrowser for help on using the repository browser.