author | Camm Maguire <camm@debian.org> | 2013年11月11日 14:55:48 +0000 |
---|---|---|
committer | Camm Maguire <camm@debian.org> | 2013年11月11日 14:55:48 +0000 |
commit | 6f0281485a88ce8d44ad066bf77fef43751cf1d2 (patch) | |
tree | eca4df88d0af82db5328b84d6928408654fd18a5 | |
parent | 268f7fd1f4d22c97391c46f1ed92eb99758b1304 (diff) | |
download | gcl-Version_2_6_10pre.tar.gz |
-rwxr-xr-x | gcl/cmpnew/gcl_cmpwt.lsp | 7 | ||||
-rwxr-xr-x | gcl/cmpnew/sys-proclaim.lisp | 3 | ||||
-rwxr-xr-x | gcl/o/hash.d | 9 |
diff --git a/gcl/cmpnew/gcl_cmpwt.lsp b/gcl/cmpnew/gcl_cmpwt.lsp index 532faf7cb..d59826ddd 100755 --- a/gcl/cmpnew/gcl_cmpwt.lsp +++ b/gcl/cmpnew/gcl_cmpwt.lsp @@ -76,9 +76,10 @@ (setf (gethash x *hash-eq*) (if (> depth 3) 0 (if (typep x 'cons) - (logxor (setq depth (the fixnum (1+ depth))) - (memoized-hash-equal (car x) depth) - (memoized-hash-equal (cdr x) depth)) + (logxor (setq depth (the fixnum (1+ depth)));FIXME? + (logxor + (memoized-hash-equal (car x) depth) + (memoized-hash-equal (cdr x) depth))) (si::hash-equal x depth)))))) (defun push-data-incf (x) diff --git a/gcl/cmpnew/sys-proclaim.lisp b/gcl/cmpnew/sys-proclaim.lisp index f0c086708..649acc3f8 100755 --- a/gcl/cmpnew/sys-proclaim.lisp +++ b/gcl/cmpnew/sys-proclaim.lisp @@ -1,5 +1,6 @@ (IN-PACKAGE "COMPILER") +(PROCLAIM '(FTYPE (FUNCTION (T FIXNUM) T) MEMOIZED-HASH-EQUAL SI::HASH-EQUAL)) (PROCLAIM '(FTYPE (FUNCTION (T FIXNUM FIXNUM) T) DASH-TO-UNDERSCORE-INT)) (PROCLAIM '(FTYPE (FUNCTION (T FIXNUM T) T) C-FUNCTION-NAME)) (PROCLAIM '(FTYPE (FUNCTION (FIXNUM FIXNUM) T) MLIN)) @@ -176,4 +177,4 @@ (PROCLAIM '(FTYPE (FUNCTION (T T) T) CHECK-END COMPILER-CC PRIN1-CMP - MAKE-USER-INIT))
\ No newline at end of file + MAKE-USER-INIT)) diff --git a/gcl/o/hash.d b/gcl/o/hash.d index 022c81990..45637d32a 100755 --- a/gcl/o/hash.d +++ b/gcl/o/hash.d @@ -31,7 +31,7 @@ object sKsize; object sKrehash_size; object sKrehash_threshold; -#define MHSH(a_) ((a_) & ~(((unsigned long)1)<<(sizeof(a_)*CHAR_SIZE-1))) +#define MHSH(a_) ((a_) & ~(1UL<<(sizeof(a_)*CHAR_SIZE-1))) typedef union {/*FIXME size checks*/ float f; @@ -76,6 +76,9 @@ uarrhash(void *v,void *ve,uchar off,uchar bits) { } +#define hash_eq1(x) ufixhash((ufixnum)x/sizeof(x)) +#define hash_eq(x) MHSH(hash_eq1(x)) + static ufixnum hash_eql(object x) { @@ -126,7 +129,7 @@ hash_eql(object x) { break; default: - h=((unsigned long)x / sizeof(x)); + h=hash_eq1(x); break; } @@ -220,7 +223,7 @@ gethash(object key, object hashtable) { switch (htest) { case htt_eq: - hash_loop(eq,MHSH((long)key>>3)); + hash_loop(eq,hash_eq(key)); break; case htt_eql: hash_loop(eql,hash_eql(key)); |