Minor generic word optimization
parent
9e4962dec4
commit
12fea48cc0
|
|
@ -22,7 +22,6 @@
|
||||||
- amd64 crash
|
- amd64 crash
|
||||||
- get factor running on mac intel
|
- get factor running on mac intel
|
||||||
- constant branch folding
|
- constant branch folding
|
||||||
- new objc syntax
|
|
||||||
|
|
||||||
+ refactor style stack code so that nested styles are handled at a lower-level
|
+ refactor style stack code so that nested styles are handled at a lower-level
|
||||||
- in HTML, we can nest div tags, etc
|
- in HTML, we can nest div tags, etc
|
||||||
|
|
|
||||||
|
|
@ -76,12 +76,16 @@ TUPLE: no-method object generic ;
|
||||||
: big-generic ( dispatch# word n dispatcher -- def )
|
: big-generic ( dispatch# word n dispatcher -- def )
|
||||||
[ >r pick picker % r> , <vtable> , \ dispatch , ] [ ] make ;
|
[ >r pick picker % r> , <vtable> , \ dispatch , ] [ ] make ;
|
||||||
|
|
||||||
: tag-generic? ( word -- ? )
|
: generic-tags ( word -- seq )
|
||||||
"methods" word-prop hash-keys [ types ] map concat
|
"methods" word-prop hash-keys [ types ] map concat prune ;
|
||||||
[ tag-mask < ] all? ;
|
|
||||||
|
|
||||||
: small-generic? ( word -- ? )
|
: tag-generic? ( word -- ? )
|
||||||
"methods" word-prop hash-size 3 <= ;
|
#! If all the types we dispatch upon can be identified
|
||||||
|
#! based on tag alone, we change the dispatcher primitive
|
||||||
|
#! from 'type' to 'tag'.
|
||||||
|
generic-tags [ tag-mask < ] all? ;
|
||||||
|
|
||||||
|
: small-generic? ( word -- ? ) generic-tags length 3 <= ;
|
||||||
|
|
||||||
: standard-combination ( word dispatch# -- quot )
|
: standard-combination ( word dispatch# -- quot )
|
||||||
swap {
|
swap {
|
||||||
|
|
|
||||||
|
|
@ -91,9 +91,6 @@ H{ } clone objc-methods set-global
|
||||||
: infer-send ( super? -- )
|
: infer-send ( super? -- )
|
||||||
pop-literal rot make-objc-send infer-quot-value ;
|
pop-literal rot make-objc-send infer-quot-value ;
|
||||||
|
|
||||||
: compile-send-error
|
|
||||||
"Objective C message sends must be compiled" throw ;
|
|
||||||
|
|
||||||
: (send) ( ... selector super? -- ... )
|
: (send) ( ... selector super? -- ... )
|
||||||
make-objc-send dup peek compile call ;
|
make-objc-send dup peek compile call ;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue