fix sleep bug
parent
b0426d93e4
commit
277630eeae
|
@ -1,5 +1,5 @@
|
|||
- quot>interp needs to go
|
||||
- nth-unsafe and set-nth-unsafe with bignums
|
||||
- nodes: lazily create history, class/literal map hashes
|
||||
|
||||
+ ui:
|
||||
|
||||
|
@ -92,6 +92,7 @@
|
|||
- set-path: iterative
|
||||
- parse-command-line: no unswons of cli args
|
||||
- investigate if rehashing on startup is really necessary
|
||||
- remove word transfer hack in bootstrap
|
||||
|
||||
+ i/o:
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespaces parser prettyprint sequences strings vectors words ;
|
|||
: unify-values ( seq -- value )
|
||||
#! If all values in list are equal, return the value.
|
||||
#! Otherwise, unify.
|
||||
dup [ eq? ] monotonic? [ first ] [ drop <computed> ] ifte ;
|
||||
dup [ eq? ] monotonic? [ first ] [ drop <value> ] ifte ;
|
||||
|
||||
: unify-stacks ( seq -- stack )
|
||||
#! Replace differing literals in stacks with unknown
|
||||
|
|
|
@ -15,11 +15,7 @@ C: value ( -- value )
|
|||
|
||||
M: value = eq? ;
|
||||
|
||||
TUPLE: computed ;
|
||||
|
||||
C: computed ( -- value ) <value> over set-delegate ;
|
||||
|
||||
M: computed hashcode value-uid hashcode ;
|
||||
M: value hashcode value-uid hashcode ;
|
||||
|
||||
TUPLE: literal value ;
|
||||
|
||||
|
@ -27,7 +23,7 @@ C: literal ( obj -- value )
|
|||
<value> over set-delegate
|
||||
[ set-literal-value ] keep ;
|
||||
|
||||
M: literal hashcode value-uid hashcode ;
|
||||
M: literal hashcode delegate hashcode ;
|
||||
|
||||
! The dataflow IR is the first of the two intermediate
|
||||
! representations used by Factor. It annotates concatenative
|
||||
|
|
|
@ -44,11 +44,11 @@ SYMBOL: d-in
|
|||
: pop-literal ( -- rstate obj )
|
||||
1 #drop node, pop-d dup value-recursion swap literal-value ;
|
||||
|
||||
: computed-value-vector ( n -- vector )
|
||||
[ drop <computed> ] map >vector ;
|
||||
: value-vector ( n -- vector )
|
||||
[ drop <value> ] map >vector ;
|
||||
|
||||
: required-inputs ( n stack -- values )
|
||||
length - 0 max computed-value-vector ;
|
||||
length - 0 max value-vector ;
|
||||
|
||||
: ensure-values ( n -- )
|
||||
length meta-d get required-inputs dup
|
||||
|
|
|
@ -10,7 +10,7 @@ hashtables parser prettyprint ;
|
|||
over 0 rot node-inputs [ pop-d 2drop ] each ;
|
||||
|
||||
: produce-values ( n node -- )
|
||||
over [ drop <computed> push-d ] each 0 swap node-outputs ;
|
||||
over [ drop <value> push-d ] each 0 swap node-outputs ;
|
||||
|
||||
: consume/produce ( word effect -- )
|
||||
#! Add a node to the dataflow graph that consumes and
|
||||
|
|
|
@ -23,7 +23,7 @@ DEFER: next-thread
|
|||
|
||||
: do-sleep ( -- quot )
|
||||
sleep-queue* dup sleep-time dup 0 =
|
||||
[ drop pop ] [ nip io-multiplex next-thread ] ifte ;
|
||||
[ drop pop cdr ] [ nip io-multiplex next-thread ] ifte ;
|
||||
|
||||
: next-thread ( -- quot )
|
||||
run-queue dup queue-empty? [ drop do-sleep ] [ deque ] ifte ;
|
||||
|
|
Loading…
Reference in New Issue