cs: improve eq?
hashing
Use the fixnum-mixing idea of dc82685ce0
on pointers, too.
This change provides a significant improvement on the "hash-mem.rkt"
benchmark, for example, because the allocated objects have a size that
triggers a repeating pattern in the low bits of the allocated address.
This commit is contained in:
parent
f07c2fea71
commit
5ca183a710
|
@ -338,7 +338,7 @@ RACKET_FOR_BOOTFILES = $(RACKET)
|
||||||
RACKET_FOR_BUILD = $(RACKET)
|
RACKET_FOR_BUILD = $(RACKET)
|
||||||
|
|
||||||
# This branch name changes each time the pb boot files are updated:
|
# This branch name changes each time the pb boot files are updated:
|
||||||
PB_BRANCH == circa-7.9.0.6-1
|
PB_BRANCH == circa-7.9.0.8-1
|
||||||
PB_REPO = https://github.com/racket/pb
|
PB_REPO = https://github.com/racket/pb
|
||||||
|
|
||||||
# Alternative source for Chez Scheme boot files, normally set by
|
# Alternative source for Chez Scheme boot files, normally set by
|
||||||
|
|
12
Makefile
12
Makefile
|
@ -47,7 +47,7 @@ RACKETCS_SUFFIX =
|
||||||
RACKET =
|
RACKET =
|
||||||
RACKET_FOR_BOOTFILES = $(RACKET)
|
RACKET_FOR_BOOTFILES = $(RACKET)
|
||||||
RACKET_FOR_BUILD = $(RACKET)
|
RACKET_FOR_BUILD = $(RACKET)
|
||||||
PB_BRANCH = circa-7.9.0.6-1
|
PB_BRANCH = circa-7.9.0.8-1
|
||||||
PB_REPO = https://github.com/racket/pb
|
PB_REPO = https://github.com/racket/pb
|
||||||
EXTRA_REPOS_BASE =
|
EXTRA_REPOS_BASE =
|
||||||
CS_CROSS_SUFFIX =
|
CS_CROSS_SUFFIX =
|
||||||
|
@ -306,14 +306,14 @@ maybe-fetch-pb-as-is:
|
||||||
echo done
|
echo done
|
||||||
fetch-pb-from:
|
fetch-pb-from:
|
||||||
mkdir -p racket/src/ChezScheme/boot
|
mkdir -p racket/src/ChezScheme/boot
|
||||||
if [ ! -d racket/src/ChezScheme/boot/pb ] ; then git clone -q -b circa-7.9.0.6-1 $(PB_REPO) racket/src/ChezScheme/boot/pb ; else cd racket/src/ChezScheme/boot/pb && git fetch -q origin circa-7.9.0.6-1:remotes/origin/circa-7.9.0.6-1 ; fi
|
if [ ! -d racket/src/ChezScheme/boot/pb ] ; then git clone -q -b circa-7.9.0.8-1 $(PB_REPO) racket/src/ChezScheme/boot/pb ; else cd racket/src/ChezScheme/boot/pb && git fetch -q origin circa-7.9.0.8-1:remotes/origin/circa-7.9.0.8-1 ; fi
|
||||||
cd racket/src/ChezScheme/boot/pb && git checkout -q circa-7.9.0.6-1
|
cd racket/src/ChezScheme/boot/pb && git checkout -q circa-7.9.0.8-1
|
||||||
pb-stage:
|
pb-stage:
|
||||||
cd racket/src/ChezScheme/boot/pb && git branch circa-7.9.0.6-1
|
cd racket/src/ChezScheme/boot/pb && git branch circa-7.9.0.8-1
|
||||||
cd racket/src/ChezScheme/boot/pb && git checkout circa-7.9.0.6-1
|
cd racket/src/ChezScheme/boot/pb && git checkout circa-7.9.0.8-1
|
||||||
cd racket/src/ChezScheme/boot/pb && git add . && git commit --amend -m "new build"
|
cd racket/src/ChezScheme/boot/pb && git add . && git commit --amend -m "new build"
|
||||||
pb-push:
|
pb-push:
|
||||||
cd racket/src/ChezScheme/boot/pb && git push -u origin circa-7.9.0.6-1
|
cd racket/src/ChezScheme/boot/pb && git push -u origin circa-7.9.0.8-1
|
||||||
win-cs-base:
|
win-cs-base:
|
||||||
IF "$(RACKET_FOR_BUILD)" == "" $(MAKE) win-bc-then-cs-base SETUP_BOOT_MODE=--boot WIN32_BUILD_LEVEL=bc PLAIN_RACKET=racket\racketbc DISABLE_STATIC_LIBS="$(DISABLE_STATIC_LIBS)" EXTRA_REPOS_BASE="$(EXTRA_REPOS_BASE)" JOB_OPTIONS="$(JOB_OPTIONS)" PLT_SETUP_OPTIONS="$(PLT_SETUP_OPTIONS)" RACKETBC_SUFFIX="$(RACKETBC_SUFFIX)" RACKETCS_SUFFIX="$(RACKETCS_SUFFIX)"
|
IF "$(RACKET_FOR_BUILD)" == "" $(MAKE) win-bc-then-cs-base SETUP_BOOT_MODE=--boot WIN32_BUILD_LEVEL=bc PLAIN_RACKET=racket\racketbc DISABLE_STATIC_LIBS="$(DISABLE_STATIC_LIBS)" EXTRA_REPOS_BASE="$(EXTRA_REPOS_BASE)" JOB_OPTIONS="$(JOB_OPTIONS)" PLT_SETUP_OPTIONS="$(PLT_SETUP_OPTIONS)" RACKETBC_SUFFIX="$(RACKETBC_SUFFIX)" RACKETCS_SUFFIX="$(RACKETCS_SUFFIX)"
|
||||||
IF not "$(RACKET_FOR_BUILD)" == "" $(MAKE) win-just-cs-base SETUP_BOOT_MODE=--chain DISABLE_STATIC_LIBS="$(DISABLE_STATIC_LIBS)" EXTRA_REPOS_BASE="$(EXTRA_REPOS_BASE)" JOB_OPTIONS="$(JOB_OPTIONS)" PLT_SETUP_OPTIONS="$(PLT_SETUP_OPTIONS)" RACKETCS_SUFFIX="$(RACKETCS_SUFFIX)" RACKET_FOR_BUILD="$(RACKET_FOR_BUILD)"
|
IF not "$(RACKET_FOR_BUILD)" == "" $(MAKE) win-just-cs-base SETUP_BOOT_MODE=--chain DISABLE_STATIC_LIBS="$(DISABLE_STATIC_LIBS)" EXTRA_REPOS_BASE="$(EXTRA_REPOS_BASE)" JOB_OPTIONS="$(JOB_OPTIONS)" PLT_SETUP_OPTIONS="$(PLT_SETUP_OPTIONS)" RACKETCS_SUFFIX="$(RACKETCS_SUFFIX)" RACKET_FOR_BUILD="$(RACKET_FOR_BUILD)"
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
;; In the Racket source repo, this version should change only when
|
;; In the Racket source repo, this version should change only when
|
||||||
;; "racket_version.h" changes:
|
;; "racket_version.h" changes:
|
||||||
(define version "7.9.0.7")
|
(define version "7.9.0.8")
|
||||||
|
|
||||||
(define deps `("racket-lib"
|
(define deps `("racket-lib"
|
||||||
["racket" #:version ,version]))
|
["racket" #:version ,version]))
|
||||||
|
|
|
@ -47,4 +47,4 @@
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(module config info
|
(module config info
|
||||||
(define timeout 400)))
|
(define timeout 200)))
|
||||||
|
|
|
@ -85,11 +85,9 @@ FORCEINLINE seginfo *MaybeSegInfo(uptr i) {
|
||||||
#define SegmentGeneration(i) (SegInfo(i)->generation)
|
#define SegmentGeneration(i) (SegInfo(i)->generation)
|
||||||
#define SegmentOldSpace(i) (SegInfo(i)->old_space)
|
#define SegmentOldSpace(i) (SegInfo(i)->old_space)
|
||||||
|
|
||||||
|
/* Must be consistent with `eq-hash` in "../s/library.ss" */
|
||||||
|
|
||||||
FORCEINLINE uptr eq_hash(ptr key) {
|
FORCEINLINE uptr eq_hash(ptr key) {
|
||||||
if (Sfixnump(key)) {
|
uptr x = (uptr)key >> primary_type_bits;
|
||||||
uptr x = UNFIX(key);
|
|
||||||
#if (ptr_bits == 64)
|
#if (ptr_bits == 64)
|
||||||
uptr x1 = x ^ ((x >> 32) & (uptr)0xFFFFFFFF);
|
uptr x1 = x ^ ((x >> 32) & (uptr)0xFFFFFFFF);
|
||||||
#else
|
#else
|
||||||
|
@ -98,6 +96,4 @@ FORCEINLINE uptr eq_hash(ptr key) {
|
||||||
uptr x2 = x1 ^ ((x1 >> 16) & (uptr)0xFFFF);
|
uptr x2 = x1 ^ ((x1 >> 16) & (uptr)0xFFFF);
|
||||||
uptr x3 = x2 ^ ((x2 >> 8) & (uptr)0xFF);
|
uptr x3 = x2 ^ ((x2 >> 8) & (uptr)0xFF);
|
||||||
return x3;
|
return x3;
|
||||||
} else
|
|
||||||
return (uptr)key >> primary_type_bits;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ InstallLZ4Target=
|
||||||
# no changes should be needed below this point #
|
# no changes should be needed below this point #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
Version=csv9.5.3.50
|
Version=csv9.5.3.51
|
||||||
Include=boot/$m
|
Include=boot/$m
|
||||||
PetiteBoot=boot/$m/petite.boot
|
PetiteBoot=boot/$m/petite.boot
|
||||||
SchemeBoot=boot/$m/scheme.boot
|
SchemeBoot=boot/$m/scheme.boot
|
||||||
|
|
|
@ -357,7 +357,7 @@
|
||||||
;; ---------------------------------------------------------------------
|
;; ---------------------------------------------------------------------
|
||||||
;; Version and machine types:
|
;; Version and machine types:
|
||||||
|
|
||||||
(define-constant scheme-version #x09050332)
|
(define-constant scheme-version #x09050333)
|
||||||
|
|
||||||
(define-syntax define-machine-types
|
(define-syntax define-machine-types
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
|
@ -2152,10 +2152,10 @@
|
||||||
;; a copy of this conversion for rehashing in "segment.h".
|
;; a copy of this conversion for rehashing in "segment.h".
|
||||||
(let* ([x x-expr]
|
(let* ([x x-expr]
|
||||||
[x1 (constant-case ptr-bits
|
[x1 (constant-case ptr-bits
|
||||||
[(64) (fxxor x (fxand (fxsra x 32) #xFFFFFFFF))]
|
[(64) (fxxor x (fxand (fxsrl x 32) #xFFFFFFFF))]
|
||||||
[else x])]
|
[else x])]
|
||||||
[x2 (fxxor x1 (fxand (fxsra x1 16) #xFFFF))]
|
[x2 (fxxor x1 (fxand (fxsrl x1 16) #xFFFF))]
|
||||||
[x3 (fxxor x2 (fxand (fxsra x2 8) #xFF))])
|
[x3 (fxxor x2 (fxand (fxsrl x2 8) #xFF))])
|
||||||
x3)]))
|
x3)]))
|
||||||
|
|
||||||
; keep in sync with make-date
|
; keep in sync with make-date
|
||||||
|
|
|
@ -1544,12 +1544,10 @@
|
||||||
(adjust! h vec n n2)
|
(adjust! h vec n n2)
|
||||||
(loop n2)))))))]))
|
(loop n2)))))))]))
|
||||||
|
|
||||||
|
;; Must be consistent with `eq_hash` in "../c/segment.h"
|
||||||
(define-syntax eq-hash
|
(define-syntax eq-hash
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
[(_ v-expr) (let ([v v-expr])
|
[(_ v-expr) (fixmix ($fxaddress v-expr))]))
|
||||||
(if (fixnum? v)
|
|
||||||
(fixmix v)
|
|
||||||
($fxaddress v)))]))
|
|
||||||
|
|
||||||
(define adjust!
|
(define adjust!
|
||||||
(lambda (h vec1 n1 n2)
|
(lambda (h vec1 n1 n2)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
;; Check to make we're using a build of Chez Scheme
|
;; Check to make we're using a build of Chez Scheme
|
||||||
;; that has all the features we need.
|
;; that has all the features we need.
|
||||||
(define-values (need-maj need-min need-sub need-dev)
|
(define-values (need-maj need-min need-sub need-dev)
|
||||||
(values 9 5 3 50))
|
(values 9 5 3 51))
|
||||||
|
|
||||||
(unless (guard (x [else #f]) (eval 'scheme-fork-version-number))
|
(unless (guard (x [else #f]) (eval 'scheme-fork-version-number))
|
||||||
(error 'compile-file
|
(error 'compile-file
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#define MZSCHEME_VERSION_X 7
|
#define MZSCHEME_VERSION_X 7
|
||||||
#define MZSCHEME_VERSION_Y 9
|
#define MZSCHEME_VERSION_Y 9
|
||||||
#define MZSCHEME_VERSION_Z 0
|
#define MZSCHEME_VERSION_Z 0
|
||||||
#define MZSCHEME_VERSION_W 7
|
#define MZSCHEME_VERSION_W 8
|
||||||
|
|
||||||
/* A level of indirection makes `#` work as needed: */
|
/* A level of indirection makes `#` work as needed: */
|
||||||
#define AS_a_STR_HELPER(x) #x
|
#define AS_a_STR_HELPER(x) #x
|
||||||
|
|
Loading…
Reference in New Issue
Block a user