]> gitweb.factorcode.org Git - factor.git/commitdiff
stack-checker.dependencies: removing the add-depends-on-<blah> words
authorBjörn Lindqvist <bjourne@gmail.com>
Sat, 3 Dec 2016 14:50:55 +0000 (15:50 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Sat, 3 Dec 2016 14:50:55 +0000 (15:50 +0100)
basis/compiler/tree/cleanup/cleanup.factor
basis/compiler/tree/finalization/finalization.factor
basis/compiler/tree/propagation/simple/simple.factor
basis/stack-checker/backend/backend.factor
basis/stack-checker/dependencies/dependencies.factor
basis/stack-checker/inlining/inlining.factor
basis/stack-checker/known-words/known-words.factor

index ac2426dda155bf1ae5398d6aeaff81eddc43c024..6572ce8dd01386353bffa32ccd9a746d63ca0c82 100644 (file)
@@ -51,7 +51,7 @@ GENERIC: cleanup-tree* ( node -- node/nodes )
 : record-folding ( #call -- )
     dup word>> predicate?
     [ record-predicate-folding ]
-    [ word>> add-depends-on-definition ]
+    [ word>> +definition+ depends-on ]
     if ;
 
 : cleanup-folding ( #call -- nodes )
@@ -68,7 +68,7 @@ GENERIC: cleanup-tree* ( node -- node/nodes )
 : record-inlining ( #call -- )
     dup method>>
     [ add-method-dependency ]
-    [ word>> add-depends-on-definition ] if ;
+    [ word>> +definition+ depends-on ] if ;
 
 : cleanup-inlining ( #call -- nodes )
     [ record-inlining ] [ body>> cleanup-tree ] bi ;
index 0ada655b80cb864db8342a69de70474e7ef5dfa8..13adc832180b9df4bf3c96f734d2f2571a502328 100644 (file)
@@ -15,7 +15,7 @@ GENERIC: finalize* ( node -- nodes )
 : splice-final ( quot -- nodes ) splice-quot finalize ;
 
 : splice-predicate ( word -- nodes )
-    [ add-depends-on-definition ] [ def>> splice-final ] bi ;
+    [ +definition+ depends-on ] [ def>> splice-final ] bi ;
 
 M: #copy finalize* drop f ;
 
index 2692767f396b0fa15e4bfcbbc8bac4db33fa2b71..d9b208edb103d7a81e5f551aaf5cec904239f92f 100644 (file)
@@ -25,7 +25,7 @@ M: #push propagate-before
 GENERIC: add-depends-on-class ( obj -- )
 
 M: class add-depends-on-class
-    add-depends-on-conditionally ;
+    +conditional+ depends-on ;
 
 M: maybe add-depends-on-class
     class>> add-depends-on-class ;
@@ -118,7 +118,7 @@ ERROR: invalid-outputs #call infos ;
 : propagate-predicate ( #call word -- infos )
     [ in-d>> first value-info ]
     [ "predicating" word-prop ] bi*
-    [ nip add-depends-on-conditionally ]
+    [ nip +conditional+ depends-on ]
     [ predicate-output-infos 1array ] 2bi ;
 
 : default-output-value-infos ( #call word -- infos )
index 19c2ac73af24df406cb869b2f30a5af0eb0f6fca..cbcc4b095b4a7d4f5d31a0fffda828d45bf35056 100644 (file)
@@ -82,7 +82,7 @@ GENERIC: apply-object ( obj -- )
 
 M: wrapper apply-object
     wrapped>>
-    [ dup word? [ add-depends-on-effect ] [ drop ] if ]
+    [ dup word? [ +effect+ depends-on ] [ drop ] if ]
     [ push-literal ]
     bi ;
 
index 2bf4c48d194c20334de55cfdbb9939ca19192740..8044796204682ca36cd2574ef519bb9a387b69e7 100644 (file)
@@ -26,28 +26,18 @@ SYMBOLS: +effect+ +conditional+ +definition+ ;
         ] [ 3drop ] if
     ] if ;
 
-: add-depends-on-effect ( word -- )
-    +effect+ depends-on ;
-
-: add-depends-on-conditionally ( word -- )
-    +conditional+ depends-on ;
-
-: add-depends-on-definition ( word -- )
-    +definition+ depends-on ;
-
 GENERIC: add-depends-on-c-type ( c-type -- )
 
 M: void add-depends-on-c-type drop ;
 
-M: c-type-word add-depends-on-c-type add-depends-on-definition ;
+M: c-type-word add-depends-on-c-type +definition+ depends-on ;
 
 M: array add-depends-on-c-type
-    [ word? ] filter [ add-depends-on-definition ] each ;
+    [ word? ] filter [ +definition+ depends-on ] each ;
 
 M: pointer add-depends-on-c-type
     to>> add-depends-on-c-type ;
 
-! Generic words that the current quotation depends on
 SYMBOL: generic-dependencies
 
 : ?class-or ( class class/f -- class' )
@@ -57,8 +47,6 @@ SYMBOL: generic-dependencies
     generic-dependencies get
     [ [ ?class-or ] change-at ] [ 2drop ] if* ;
 
-! Conditional dependencies are re-evaluated when classes change;
-! if any fail, the word is recompiled
 SYMBOL: conditional-dependencies
 
 GENERIC: satisfied? ( dependency -- ? )
@@ -93,7 +81,7 @@ M: depends-on-instance-predicate satisfied?
 TUPLE: depends-on-next-method class generic next-method ;
 
 : add-depends-on-next-method ( class generic next-method -- )
-    over add-depends-on-conditionally
+    over +conditional+ depends-on
     depends-on-next-method add-conditional-dependency ;
 
 M: depends-on-next-method satisfied?
@@ -105,7 +93,7 @@ M: depends-on-next-method satisfied?
 TUPLE: depends-on-method class generic method ;
 
 : add-depends-on-method ( class generic method -- )
-    over add-depends-on-conditionally
+    over +conditional+ depends-on
     depends-on-method add-conditional-dependency ;
 
 M: depends-on-method satisfied?
@@ -117,7 +105,7 @@ M: depends-on-method satisfied?
 TUPLE: depends-on-tuple-layout class layout ;
 
 : add-depends-on-tuple-layout ( class layout -- )
-    [ drop add-depends-on-conditionally ]
+    [ drop +conditional+ depends-on ]
     [ depends-on-tuple-layout add-conditional-dependency ] 2bi ;
 
 M: depends-on-tuple-layout satisfied?
@@ -126,7 +114,7 @@ M: depends-on-tuple-layout satisfied?
 TUPLE: depends-on-flushable word ;
 
 : add-depends-on-flushable ( word -- )
-    [ add-depends-on-conditionally ]
+    [ +conditional+ depends-on ]
     [ depends-on-flushable add-conditional-dependency ] bi ;
 
 M: depends-on-flushable satisfied?
@@ -135,7 +123,7 @@ M: depends-on-flushable satisfied?
 TUPLE: depends-on-final class ;
 
 : add-depends-on-final ( word -- )
-    [ add-depends-on-conditionally ]
+    [ +conditional+ depends-on ]
     [ depends-on-final add-conditional-dependency ] bi ;
 
 M: depends-on-final satisfied?
index 2d82a6262d4bbcd20f5a373f555929bcd234d045..0cd39fc731a5652a296abad6935176308628b0dd 100644 (file)
@@ -141,7 +141,7 @@ M: declared-effect (undeclared-known) known>> (undeclared-known) ;
 
 : inline-word ( word -- )
     commit-literals
-    [ add-depends-on-definition ]
+    [ +definition+ depends-on ]
     [ declare-input-effects ]
     [
         dup inline-recursive-label [
index edab7e2918dc54b9c34938b84f182bf3e69aa682..fab1354fe208202114c2f6c95f1028d19bba8907 100644 (file)
@@ -47,7 +47,7 @@ IN: stack-checker.known-words
     ( value -- ) apply-word/effect ;
 
 : non-inline-word ( word -- )
-    dup add-depends-on-effect
+    dup +effect+ depends-on
     {
         { [ dup "shuffle" word-prop ] [ infer-shuffle-word ] }
         { [ dup "special" word-prop ] [ infer-special ] }