Some more stack effect declarations

slava 2006-08-18 04:54:55 +00:00
parent 77d9ef20a3
commit 7f2e39430e
4 changed files with 13 additions and 14 deletions

View File

@ -138,7 +138,7 @@ C: indirect ( base index scale displacement -- indirect )
: indirect-scale* indirect-scale [ 0 ] unless* ;
GENERIC: sib-present?
GENERIC: sib-present? ( op -- ? )
M: indirect sib-present?
dup indirect-base { ESP RSP } memq?
@ -156,7 +156,7 @@ M: register r/m reg-code ;
: byte? -128 127 between? ;
GENERIC: modifier
GENERIC: modifier ( op -- n )
M: indirect modifier
dup indirect-base [
@ -179,7 +179,7 @@ M: register modifier drop BIN: 11 ;
drop f
] if ;
GENERIC: displacement
GENERIC: displacement ( op -- n )
M: indirect displacement indirect-displacement ;

View File

@ -55,11 +55,12 @@ TUPLE: no-method object generic ;
: methods* ( dispatch# word -- assoc )
#! Make a class->method association, together with a
#! default delegating method at the end.
empty-method object bootstrap-word swap 2array 1array
swap methods append ;
[
empty-method object bootstrap-word swap 2array 1array
] keep methods append ;
: small-generic ( dispatch# word -- def )
2dup methods* object bootstrap-word swap simplify-alist
dupd methods* object bootstrap-word swap simplify-alist
swapd class-predicates alist>quot ;
: vtable-methods ( dispatch# alist-seq -- alist-seq )
@ -71,7 +72,7 @@ TUPLE: no-method object generic ;
: <vtable> ( dispatch# word n -- vtable )
#! n is vtable size; either num-types or num-tags.
>r 2dup methods* r> sort-methods vtable-methods ;
>r dupd methods* r> sort-methods vtable-methods ;
: big-generic ( dispatch# word n dispatcher -- def )
[ >r pick picker % r> , <vtable> , \ dispatch , ] [ ] make ;

View File

@ -163,13 +163,13 @@ HELP: bignum/i ( x y -- z )
{ $description "Primitive version of " { $link /i } "." }
{ $warning "This word does not perform type checking, and passing objects of the wrong type can crash the runtime. User code should call the generic word " { $link /i } " instead." } ;
HELP: bignum-mod ( x y -- z w )
{ $values { "x" "a bignum" } { "y" "a bignum" } { "z" "a bignum" } { "w" "a bignum" } }
HELP: bignum-mod ( x y -- z )
{ $values { "x" "a bignum" } { "y" "a bignum" } { "z" "a bignum" } }
{ $description "Primitive version of " { $link mod } "." }
{ $warning "This word does not perform type checking, and passing objects of the wrong type can crash the runtime. User code should call the generic word " { $link mod } " instead." } ;
HELP: bignum/mod ( x y -- z )
{ $values { "x" "a bignum" } { "y" "a bignum" } { "z" "a bignum" } }
HELP: bignum/mod ( x y -- z w )
{ $values { "x" "a bignum" } { "y" "a bignum" } { "z" "a bignum" } { "w" "a bignum" } }
{ $description "Primitive version of " { $link /mod } "." }
{ $warning "This word does not perform type checking, and passing objects of the wrong type can crash the runtime. User code should call the generic word " { $link /mod } " instead." } ;

View File

@ -12,6 +12,4 @@ USING: kernel parser words compiler sequences ;
"/library/ui/x11/windows.factor"
"/library/ui/x11/clipboard.factor"
"/library/ui/x11/ui.factor"
} [ run-resource ] each
{ "x11" } compile-vocabs
} [ run-resource ] each