Bum 3 instructions out of megamorphic fast path by switching to fixed-size caches
parent
1ce65acff1
commit
59d6131c7c
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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 <array> ;
|
||||
mega-cache-size get f <array> ;
|
||||
|
||||
M: standard-combination mega-cache-quot
|
||||
combination get #>> make-empty-cache [ mega-cache-lookup ] 3curry [ ] like ;
|
||||
|
|
|
@ -16,6 +16,8 @@ SYMBOL: tag-numbers
|
|||
|
||||
SYMBOL: type-numbers
|
||||
|
||||
SYMBOL: mega-cache-size
|
||||
|
||||
: type-number ( class -- n )
|
||||
type-numbers get at ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue