Support inline, foldable, flushable on methods; add declarations in a couple of places for ricing purposes

db4
Slava Pestov 2008-11-06 13:13:37 -06:00
parent 751426f283
commit 63a9975a0e
3 changed files with 9 additions and 9 deletions

View File

@ -39,7 +39,7 @@ HOOK: (wait-to-read) io-backend ( port -- )
M: input-port stream-read1 M: input-port stream-read1
dup check-disposed dup check-disposed
dup wait-to-read [ drop f ] [ buffer>> buffer-pop ] if ; dup wait-to-read [ drop f ] [ buffer>> buffer-pop ] if ; inline
: read-step ( count port -- byte-array/f ) : read-step ( count port -- byte-array/f )
dup wait-to-read [ 2drop f ] [ buffer>> buffer-read ] if ; dup wait-to-read [ 2drop f ] [ buffer>> buffer-read ] if ;
@ -105,7 +105,7 @@ TUPLE: output-port < buffered-port ;
M: output-port stream-write1 M: output-port stream-write1
dup check-disposed dup check-disposed
1 over wait-to-write 1 over wait-to-write
buffer>> byte>buffer ; buffer>> byte>buffer ; inline
M: output-port stream-write M: output-port stream-write
dup check-disposed dup check-disposed

View File

@ -8,7 +8,7 @@ ERROR: not-in-a-method-error ;
: CREATE-GENERIC ( -- word ) CREATE dup reset-word ; : CREATE-GENERIC ( -- word ) CREATE dup reset-word ;
: create-method-in ( class generic -- method ) : create-method-in ( class generic -- method )
create-method f set-word dup save-location ; create-method dup set-word dup save-location ;
: CREATE-METHOD ( -- method ) : CREATE-METHOD ( -- method )
scan-word bootstrap-word scan-word create-method-in ; scan-word bootstrap-word scan-word create-method-in ;
@ -18,11 +18,11 @@ SYMBOL: current-generic
: with-method-definition ( quot -- parsed ) : with-method-definition ( quot -- parsed )
[ [
>r [
[ "method-class" word-prop current-class set ] [ "method-class" word-prop current-class set ]
[ "method-generic" word-prop current-generic set ] [ "method-generic" word-prop current-generic set ]
[ ] tri [ ] tri
r> call ] dip call
] with-scope ; inline ] with-scope ; inline
: (M:) ( method def -- ) : (M:) ( method def -- )

View File

@ -262,7 +262,7 @@ M: word forget*
] if ; ] if ;
M: word hashcode* M: word hashcode*
nip 1 slot { fixnum } declare ; nip 1 slot { fixnum } declare ; foldable
M: word literalize <wrapper> ; M: word literalize <wrapper> ;