diff --git a/basis/cpu/x86/bootstrap.factor b/basis/cpu/x86/bootstrap.factor index 7efb4197c2..4f9a94a58b 100644 --- a/basis/cpu/x86/bootstrap.factor +++ b/basis/cpu/x86/bootstrap.factor @@ -243,12 +243,8 @@ big-endian off temp0 0 MOV rc-absolute-cell rt-immediate jit-rel ! key = class temp2 temp1 MOV - ! compute cache.length - 1 - temp3 temp0 1 bootstrap-cells array tag-number - [+] MOV - temp3 1 SHR - temp3 4 SUB ! key &= cache.length - 1 - temp2 temp3 AND + temp2 mega-cache-size get 1- bootstrap-cell * AND ! cache += array-start-offset temp0 array-start-offset ADD ! cache += key diff --git a/core/bootstrap/layouts/layouts.factor b/core/bootstrap/layouts/layouts.factor index 0243ad040e..5ed92b7776 100644 --- a/core/bootstrap/layouts/layouts.factor +++ b/core/bootstrap/layouts/layouts.factor @@ -11,6 +11,8 @@ BIN: 111 tag-mask set 15 num-types set +32 mega-cache-size set + H{ { fixnum BIN: 000 } { bignum BIN: 001 } diff --git a/core/generic/standard/standard.factor b/core/generic/standard/standard.factor index 5d26cfa6ff..96c273e3f8 100644 --- a/core/generic/standard/standard.factor +++ b/core/generic/standard/standard.factor @@ -3,7 +3,7 @@ USING: accessors definitions generic generic.single kernel namespaces words math math.order combinators sequences generic.single.private quotations kernel.private -assocs arrays ; +assocs arrays layouts ; IN: generic.standard TUPLE: standard-combination < single-combination # ; @@ -47,8 +47,7 @@ M: standard-combination inline-cache-quot ( word methods -- ) combination get #>> [ f inline-cache-miss ] 3curry [ ] like ; : make-empty-cache ( -- array ) - generic-word get "methods" word-prop - assoc-size 2 * next-power-of-2 f ; + mega-cache-size get f ; M: standard-combination mega-cache-quot combination get #>> make-empty-cache [ mega-cache-lookup ] 3curry [ ] like ; diff --git a/core/layouts/layouts.factor b/core/layouts/layouts.factor index e30245abd1..00b9500211 100644 --- a/core/layouts/layouts.factor +++ b/core/layouts/layouts.factor @@ -16,6 +16,8 @@ SYMBOL: tag-numbers SYMBOL: type-numbers +SYMBOL: mega-cache-size + : type-number ( class -- n ) type-numbers get at ;