accurate type signature for make-tuple
parent
c0b441d49c
commit
99fde7534e
|
@ -15,7 +15,8 @@ hashtables errors sequences vectors ;
|
|||
: make-tuple ( class size -- tuple )
|
||||
#! Internal allocation function. Do not call it directly,
|
||||
#! since you can fool the runtime and corrupt memory by
|
||||
#! specifying an incorrect size.
|
||||
#! specifying an incorrect size. Note that this word is also
|
||||
#! handled specially by the compiler's type inferencer.
|
||||
<tuple> [ 2 set-slot ] keep ;
|
||||
|
||||
IN: generic
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
! Copyright (C) 2004, 2005 Slava Pestov.
|
||||
! See http://factor.sf.net/license.txt for BSD license.
|
||||
IN: inference
|
||||
USING: generic hashtables kernel namespaces sequences vectors
|
||||
words ;
|
||||
USING: generic hashtables kernel kernel-internals namespaces
|
||||
sequences vectors words ;
|
||||
|
||||
! Infer possible classes of values in a dataflow IR.
|
||||
|
||||
|
@ -85,11 +85,21 @@ M: node child-ties ( node -- seq )
|
|||
2drop
|
||||
] ifte ;
|
||||
|
||||
\ make-tuple [
|
||||
dup node-in-d first literal-value 1vector
|
||||
] "output-classes" set-word-prop
|
||||
|
||||
: output-classes ( node -- seq )
|
||||
dup node-param "output-classes" word-prop [
|
||||
call
|
||||
] [
|
||||
node-param "infer-effect" word-prop second
|
||||
] ?ifte ;
|
||||
|
||||
M: #call infer-classes* ( node -- )
|
||||
dup node-param [
|
||||
dup create-ties
|
||||
dup node-param "infer-effect" word-prop second
|
||||
swap node-out-d intersect-classes
|
||||
dup output-classes swap node-out-d intersect-classes
|
||||
] [
|
||||
drop
|
||||
] ifte ;
|
||||
|
|
Loading…
Reference in New Issue