issue #358: Rename all of the words depends-on-* to add-depends-on*
parent
efbdf222a7
commit
1c3deddf61
|
@ -127,7 +127,7 @@ ERROR: local-allocation-error ;
|
|||
;
|
||||
|
||||
MACRO: (simple-local-allot) ( c-type -- quot )
|
||||
[ depends-on-c-type ]
|
||||
[ add-depends-on-c-type ]
|
||||
[ dup '[ _ heap-size _ c-type-align (local-allot) ] ] bi ;
|
||||
|
||||
: [hairy-local-allot] ( c-type initial -- quot )
|
||||
|
|
|
@ -139,11 +139,11 @@ M: struct-bit-slot-spec (writer-quot)
|
|||
drop [ >c-ptr ] ;
|
||||
|
||||
MACRO: read-struct-slot ( slot -- )
|
||||
dup type>> depends-on-c-type
|
||||
dup type>> add-depends-on-c-type
|
||||
(reader-quot) ;
|
||||
|
||||
MACRO: write-struct-slot ( slot -- )
|
||||
dup type>> depends-on-c-type
|
||||
dup type>> add-depends-on-c-type
|
||||
(writer-quot) ;
|
||||
PRIVATE>
|
||||
|
||||
|
|
|
@ -58,14 +58,14 @@ GENERIC: cleanup* ( node -- node/nodes )
|
|||
|
||||
: record-predicate-folding ( #call -- )
|
||||
>predicate-folding< pick literal?>>
|
||||
[ [ literal>> ] 2dip depends-on-instance-predicate ]
|
||||
[ [ class>> ] 2dip depends-on-class-predicate ]
|
||||
[ [ literal>> ] 2dip add-depends-on-instance-predicate ]
|
||||
[ [ class>> ] 2dip add-depends-on-class-predicate ]
|
||||
if ;
|
||||
|
||||
: record-folding ( #call -- )
|
||||
dup word>> predicate?
|
||||
[ record-predicate-folding ]
|
||||
[ word>> depends-on-definition ]
|
||||
[ word>> add-depends-on-definition ]
|
||||
if ;
|
||||
|
||||
: cleanup-folding ( #call -- nodes )
|
||||
|
@ -74,15 +74,15 @@ GENERIC: cleanup* ( node -- node/nodes )
|
|||
! Method inlining
|
||||
: add-method-dependency ( #call -- )
|
||||
dup method>> word? [
|
||||
[ [ class>> ] [ word>> ] bi depends-on-generic ]
|
||||
[ [ class>> ] [ word>> ] [ method>> ] tri depends-on-method ]
|
||||
[ [ class>> ] [ word>> ] bi add-depends-on-generic ]
|
||||
[ [ class>> ] [ word>> ] [ method>> ] tri add-depends-on-method ]
|
||||
bi
|
||||
] [ drop ] if ;
|
||||
|
||||
: record-inlining ( #call -- )
|
||||
dup method>>
|
||||
[ add-method-dependency ]
|
||||
[ word>> depends-on-definition ] if ;
|
||||
[ word>> add-depends-on-definition ] if ;
|
||||
|
||||
: cleanup-inlining ( #call -- nodes )
|
||||
[ record-inlining ] [ body>> cleanup ] bi ;
|
||||
|
|
|
@ -91,7 +91,7 @@ M: #push remove-dead-code*
|
|||
] [ drop f ] if ;
|
||||
|
||||
: remove-flushable-call ( #call -- node )
|
||||
[ word>> depends-on-flushable ]
|
||||
[ word>> add-depends-on-flushable ]
|
||||
[ in-d>> <#drop> remove-dead-code* ]
|
||||
bi ;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ GENERIC: finalize* ( node -- nodes )
|
|||
: splice-final ( quot -- nodes ) splice-quot finalize ;
|
||||
|
||||
: splice-predicate ( word -- nodes )
|
||||
[ depends-on-definition ] [ def>> splice-final ] bi ;
|
||||
[ add-depends-on-definition ] [ def>> splice-final ] bi ;
|
||||
|
||||
M: #copy finalize* drop f ;
|
||||
|
||||
|
|
|
@ -314,7 +314,7 @@ generic-comparison-ops [
|
|||
dup literal>> classoid?
|
||||
[
|
||||
literal>>
|
||||
[ depends-on-class ]
|
||||
[ add-depends-on-class ]
|
||||
[ predicate-output-infos ]
|
||||
bi
|
||||
] [ 2drop object-info ] if
|
||||
|
|
|
@ -32,26 +32,26 @@ M: #push propagate-before
|
|||
: set-value-infos ( infos values -- )
|
||||
[ set-value-info ] 2each ;
|
||||
|
||||
GENERIC: depends-on-class ( obj -- )
|
||||
GENERIC: add-depends-on-class ( obj -- )
|
||||
|
||||
M: class depends-on-class
|
||||
depends-on-conditionally ;
|
||||
M: class add-depends-on-class
|
||||
add-depends-on-conditionally ;
|
||||
|
||||
M: maybe depends-on-class
|
||||
class>> depends-on-class ;
|
||||
M: maybe add-depends-on-class
|
||||
class>> add-depends-on-class ;
|
||||
|
||||
M: anonymous-union depends-on-class
|
||||
members>> [ depends-on-class ] each ;
|
||||
M: anonymous-union add-depends-on-class
|
||||
members>> [ add-depends-on-class ] each ;
|
||||
|
||||
M: anonymous-intersection depends-on-class
|
||||
participants>> [ depends-on-class ] each ;
|
||||
M: anonymous-intersection add-depends-on-class
|
||||
participants>> [ add-depends-on-class ] each ;
|
||||
|
||||
M: #declare propagate-before
|
||||
#! We need to force the caller word to recompile when the
|
||||
#! classes mentioned in the declaration are redefined, since
|
||||
#! now we're making assumptions but their definitions.
|
||||
declaration>> [
|
||||
[ depends-on-class ]
|
||||
[ add-depends-on-class ]
|
||||
[ <class-info> swap refine-value-info ]
|
||||
bi
|
||||
] assoc-each ;
|
||||
|
@ -123,7 +123,7 @@ M: #declare propagate-before
|
|||
#! class definition itself.
|
||||
[ in-d>> first value-info ]
|
||||
[ "predicating" word-prop ] bi*
|
||||
[ nip depends-on-conditionally ]
|
||||
[ nip add-depends-on-conditionally ]
|
||||
[ predicate-output-infos 1array ] 2bi ;
|
||||
|
||||
: default-output-value-infos ( #call word -- infos )
|
||||
|
|
|
@ -167,7 +167,7 @@ ERROR: bad-partial-eval quot word ;
|
|||
: inline-new ( class -- quot/f )
|
||||
dup tuple-class? [
|
||||
dup tuple-layout
|
||||
[ depends-on-tuple-layout ]
|
||||
[ add-depends-on-tuple-layout ]
|
||||
[ drop all-slots [ initial>> literalize ] [ ] map-as ]
|
||||
[ nip ]
|
||||
2tri
|
||||
|
@ -318,7 +318,7 @@ M\ set intersect [ intersect-quot ] 1 define-partial-eval
|
|||
! We want to constant-fold calls to heap-size, and recompile those
|
||||
! calls when a C type is redefined
|
||||
\ heap-size [
|
||||
[ depends-on-c-type ] [ heap-size '[ _ ] ] bi
|
||||
[ add-depends-on-c-type ] [ heap-size '[ _ ] ] bi
|
||||
] 1 define-partial-eval
|
||||
|
||||
! Eliminates a few redundant checks here and there
|
||||
|
|
|
@ -38,7 +38,7 @@ TUPLE: alien-callback-params < alien-node-params xt ;
|
|||
return-prep-quot infer-quot-here ;
|
||||
|
||||
: pop-return ( params -- params )
|
||||
pop-literal [ depends-on-c-type ] [ nip >>return ] bi ;
|
||||
pop-literal [ add-depends-on-c-type ] [ nip >>return ] bi ;
|
||||
|
||||
: pop-library ( params -- params )
|
||||
pop-literal nip >>library ;
|
||||
|
@ -47,7 +47,7 @@ TUPLE: alien-callback-params < alien-node-params xt ;
|
|||
pop-literal nip >>function ;
|
||||
|
||||
: pop-params ( params -- params )
|
||||
pop-literal [ [ depends-on-c-type ] each ] [ nip >>parameters ] bi ;
|
||||
pop-literal [ [ add-depends-on-c-type ] each ] [ nip >>parameters ] bi ;
|
||||
|
||||
: pop-abi ( params -- params )
|
||||
pop-literal nip >>abi ;
|
||||
|
|
|
@ -85,7 +85,7 @@ GENERIC: apply-object ( obj -- )
|
|||
|
||||
M: wrapper apply-object
|
||||
wrapped>>
|
||||
[ dup word? [ depends-on-effect ] [ drop ] if ]
|
||||
[ dup word? [ add-depends-on-effect ] [ drop ] if ]
|
||||
[ push-literal ]
|
||||
bi ;
|
||||
|
||||
|
|
|
@ -30,26 +30,26 @@ SYMBOLS: effect-dependency conditional-dependency definition-dependency ;
|
|||
] [ 3drop ] if
|
||||
] if ;
|
||||
|
||||
: depends-on-effect ( word -- )
|
||||
: add-depends-on-effect ( word -- )
|
||||
effect-dependency depends-on ;
|
||||
|
||||
: depends-on-conditionally ( word -- )
|
||||
: add-depends-on-conditionally ( word -- )
|
||||
conditional-dependency depends-on ;
|
||||
|
||||
: depends-on-definition ( word -- )
|
||||
: add-depends-on-definition ( word -- )
|
||||
definition-dependency depends-on ;
|
||||
|
||||
GENERIC: depends-on-c-type ( c-type -- )
|
||||
GENERIC: add-depends-on-c-type ( c-type -- )
|
||||
|
||||
M: void depends-on-c-type drop ;
|
||||
M: void add-depends-on-c-type drop ;
|
||||
|
||||
M: c-type-word depends-on-c-type depends-on-definition ;
|
||||
M: c-type-word add-depends-on-c-type add-depends-on-definition ;
|
||||
|
||||
M: array depends-on-c-type
|
||||
[ word? ] filter [ depends-on-definition ] each ;
|
||||
M: array add-depends-on-c-type
|
||||
[ word? ] filter [ add-depends-on-definition ] each ;
|
||||
|
||||
M: pointer depends-on-c-type
|
||||
to>> depends-on-c-type ;
|
||||
M: pointer add-depends-on-c-type
|
||||
to>> add-depends-on-c-type ;
|
||||
|
||||
! Generic words that the current quotation depends on
|
||||
SYMBOL: generic-dependencies
|
||||
|
@ -57,7 +57,7 @@ SYMBOL: generic-dependencies
|
|||
: ?class-or ( class class/f -- class' )
|
||||
[ class-or ] when* ;
|
||||
|
||||
: depends-on-generic ( class generic -- )
|
||||
: add-depends-on-generic ( class generic -- )
|
||||
generic-dependencies get dup
|
||||
[ [ ?class-or ] change-at ] [ 3drop ] if ;
|
||||
|
||||
|
@ -73,7 +73,7 @@ GENERIC: satisfied? ( dependency -- ? )
|
|||
|
||||
TUPLE: depends-on-class-predicate class1 class2 result ;
|
||||
|
||||
: depends-on-class-predicate ( class1 class2 result -- )
|
||||
: add-depends-on-class-predicate ( class1 class2 result -- )
|
||||
\ depends-on-class-predicate add-conditional-dependency ;
|
||||
|
||||
M: depends-on-class-predicate satisfied?
|
||||
|
@ -84,7 +84,7 @@ M: depends-on-class-predicate satisfied?
|
|||
|
||||
TUPLE: depends-on-instance-predicate object class result ;
|
||||
|
||||
: depends-on-instance-predicate ( object class result -- )
|
||||
: add-depends-on-instance-predicate ( object class result -- )
|
||||
\ depends-on-instance-predicate add-conditional-dependency ;
|
||||
|
||||
M: depends-on-instance-predicate satisfied?
|
||||
|
@ -95,8 +95,8 @@ M: depends-on-instance-predicate satisfied?
|
|||
|
||||
TUPLE: depends-on-next-method class generic next-method ;
|
||||
|
||||
: depends-on-next-method ( class generic next-method -- )
|
||||
over depends-on-conditionally
|
||||
: add-depends-on-next-method ( class generic next-method -- )
|
||||
over add-depends-on-conditionally
|
||||
\ depends-on-next-method add-conditional-dependency ;
|
||||
|
||||
M: depends-on-next-method satisfied?
|
||||
|
@ -107,8 +107,8 @@ M: depends-on-next-method satisfied?
|
|||
|
||||
TUPLE: depends-on-method class generic method ;
|
||||
|
||||
: depends-on-method ( class generic method -- )
|
||||
over depends-on-conditionally
|
||||
: add-depends-on-method ( class generic method -- )
|
||||
over add-depends-on-conditionally
|
||||
\ depends-on-method add-conditional-dependency ;
|
||||
|
||||
M: depends-on-method satisfied?
|
||||
|
@ -119,8 +119,8 @@ M: depends-on-method satisfied?
|
|||
|
||||
TUPLE: depends-on-tuple-layout class layout ;
|
||||
|
||||
: depends-on-tuple-layout ( class layout -- )
|
||||
[ drop depends-on-conditionally ]
|
||||
: add-depends-on-tuple-layout ( class layout -- )
|
||||
[ drop add-depends-on-conditionally ]
|
||||
[ \ depends-on-tuple-layout add-conditional-dependency ] 2bi ;
|
||||
|
||||
M: depends-on-tuple-layout satisfied?
|
||||
|
@ -128,8 +128,8 @@ M: depends-on-tuple-layout satisfied?
|
|||
|
||||
TUPLE: depends-on-flushable word ;
|
||||
|
||||
: depends-on-flushable ( word -- )
|
||||
[ depends-on-conditionally ]
|
||||
: add-depends-on-flushable ( word -- )
|
||||
[ add-depends-on-conditionally ]
|
||||
[ \ depends-on-flushable add-conditional-dependency ] bi ;
|
||||
|
||||
M: depends-on-flushable satisfied?
|
||||
|
@ -137,8 +137,8 @@ M: depends-on-flushable satisfied?
|
|||
|
||||
TUPLE: depends-on-final class ;
|
||||
|
||||
: depends-on-final ( word -- )
|
||||
[ depends-on-conditionally ]
|
||||
: add-depends-on-final ( word -- )
|
||||
[ add-depends-on-conditionally ]
|
||||
[ \ depends-on-final add-conditional-dependency ] bi ;
|
||||
|
||||
M: depends-on-final satisfied?
|
||||
|
|
|
@ -147,7 +147,7 @@ M: declared-effect (undeclared-known) known>> (undeclared-known) ;
|
|||
|
||||
: inline-word ( word -- )
|
||||
commit-literals
|
||||
[ depends-on-definition ]
|
||||
[ add-depends-on-definition ]
|
||||
[ declare-input-effects ]
|
||||
[
|
||||
dup inline-recursive-label [
|
||||
|
|
|
@ -48,7 +48,7 @@ IN: stack-checker.known-words
|
|||
( value -- ) apply-word/effect ;
|
||||
|
||||
: non-inline-word ( word -- )
|
||||
dup depends-on-effect
|
||||
dup add-depends-on-effect
|
||||
{
|
||||
{ [ dup "shuffle" word-prop ] [ infer-shuffle-word ] }
|
||||
{ [ dup "special" word-prop ] [ infer-special ] }
|
||||
|
|
|
@ -127,7 +127,7 @@ IN: stack-checker.transforms
|
|||
[ "method-class" word-prop ]
|
||||
[ "method-generic" word-prop ] bi
|
||||
2dup next-method
|
||||
depends-on-next-method ;
|
||||
add-depends-on-next-method ;
|
||||
|
||||
\ (call-next-method) [
|
||||
[ add-next-method-dependency ]
|
||||
|
@ -140,7 +140,7 @@ IN: stack-checker.transforms
|
|||
\ boa [
|
||||
dup tuple-class? [
|
||||
dup tuple-layout
|
||||
[ depends-on-tuple-layout ]
|
||||
[ add-depends-on-tuple-layout ]
|
||||
[ [ "boa-check" word-prop [ ] or ] dip ] 2bi
|
||||
'[ @ _ <tuple-boa> ]
|
||||
] [
|
||||
|
|
|
@ -30,14 +30,14 @@ PREDICATE: typed-word < word "typed-word" word-prop >boolean ;
|
|||
: typed-stack-effect? ( effect -- ? )
|
||||
[ object = ] all? not ;
|
||||
|
||||
: depends-on-unboxing ( class -- )
|
||||
[ dup tuple-layout depends-on-tuple-layout ]
|
||||
[ depends-on-final ]
|
||||
: add-depends-on-unboxing ( class -- )
|
||||
[ dup tuple-layout add-depends-on-tuple-layout ]
|
||||
[ add-depends-on-final ]
|
||||
bi ;
|
||||
|
||||
: (unboxer) ( type -- quot )
|
||||
dup unboxable-tuple-class? [
|
||||
dup depends-on-unboxing
|
||||
dup add-depends-on-unboxing
|
||||
all-slots [
|
||||
[ name>> reader-word 1quotation ]
|
||||
[ class>> (unboxer) ] bi compose
|
||||
|
@ -57,7 +57,7 @@ PREDICATE: typed-word < word "typed-word" word-prop >boolean ;
|
|||
: (unboxed-types) ( type -- types )
|
||||
dup unboxable-tuple-class?
|
||||
[
|
||||
dup depends-on-unboxing
|
||||
dup add-depends-on-unboxing
|
||||
all-slots [ class>> (unboxed-types) ] map concat
|
||||
]
|
||||
[ 1array ] if ;
|
||||
|
@ -83,7 +83,7 @@ DEFER: make-boxer
|
|||
: boxer ( type -- quot )
|
||||
dup unboxable-tuple-class?
|
||||
[
|
||||
dup depends-on-unboxing
|
||||
dup add-depends-on-unboxing
|
||||
[ all-slots [ class>> ] map make-boxer ]
|
||||
[ [ boa ] curry ]
|
||||
bi compose
|
||||
|
|
Loading…
Reference in New Issue