]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/compiler/tree/propagation/call-effect/call-effect.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / compiler / tree / propagation / call-effect / call-effect.factor
index bc18aa6ec1ade38c9c04878e94361af9314dc473..a667ea727f69cfc371f3ced4ba3e6cb0511a0f25 100644 (file)
@@ -3,7 +3,8 @@
 USING: accessors combinators combinators.private effects fry
 kernel kernel.private make sequences continuations quotations
 words math stack-checker stack-checker.transforms
-compiler.tree.propagation.info slots.private ;
+compiler.tree.propagation.info
+compiler.tree.propagation.inlining ;
 IN: compiler.tree.propagation.call-effect
 
 ! call( and execute( have complex expansions.
@@ -34,7 +35,7 @@ M: +unknown+ curry-effect ;
 
 M: effect curry-effect
     [ in>> length ] [ out>> length ] [ terminated?>> ] tri
-    pick 0 = [ [ 1+ ] dip ] [ [ 1- ] 2dip ] if
+    pick 0 = [ [ 1 + ] dip ] [ [ 1 - ] 2dip ] if
     effect boa ;
 
 M: curry cached-effect
@@ -130,8 +131,9 @@ ERROR: uninferable ;
 : (infer-value) ( value-info -- effect )
     dup class>> {
         { \ quotation [
-            literal>> [ uninferable ] unless* cached-effect
-            dup +unknown+ = [ uninferable ] when
+            literal>> [ uninferable ] unless*
+            dup already-inlined? [ uninferable ] when
+            cached-effect dup +unknown+ = [ uninferable ] when
         ] }
         { \ curry [
             slots>> third (infer-value)
@@ -151,7 +153,7 @@ ERROR: uninferable ;
 
 : (value>quot) ( value-info -- quot )
     dup class>> {
-        { \ quotation [ literal>> '[ drop @ ] ] }
+        { \ quotation [ literal>> dup remember-inlining '[ drop @ ] ] }
         { \ curry [
             slots>> third (value>quot)
             '[ [ obj>> ] [ quot>> @ ] bi ]