Minor generic word optimization

slava 2006-05-30 00:03:06 +00:00
parent 9e4962dec4
commit 12fea48cc0
3 changed files with 9 additions and 9 deletions

View File

@ -22,7 +22,6 @@
- amd64 crash
- get factor running on mac intel
- constant branch folding
- new objc syntax
+ refactor style stack code so that nested styles are handled at a lower-level
- in HTML, we can nest div tags, etc

View File

@ -76,12 +76,16 @@ TUPLE: no-method object generic ;
: big-generic ( dispatch# word n dispatcher -- def )
[ >r pick picker % r> , <vtable> , \ dispatch , ] [ ] make ;
: tag-generic? ( word -- ? )
"methods" word-prop hash-keys [ types ] map concat
[ tag-mask < ] all? ;
: generic-tags ( word -- seq )
"methods" word-prop hash-keys [ types ] map concat prune ;
: small-generic? ( word -- ? )
"methods" word-prop hash-size 3 <= ;
: tag-generic? ( word -- ? )
#! 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 )
swap {

View File

@ -91,9 +91,6 @@ H{ } clone objc-methods set-global
: infer-send ( super? -- )
pop-literal rot make-objc-send infer-quot-value ;
: compile-send-error
"Objective C message sends must be compiled" throw ;
: (send) ( ... selector super? -- ... )
make-objc-send dup peek compile call ;