X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=basis%2Fcompiler%2Ftree%2Fescape-analysis%2Fescape-analysis-tests.factor;h=debb66b8d42044589aee98489e6d00b849b95a39;hp=be6b2863f0991b0384e11b69a0d1675fe37b9a9c;hb=3f3d57032bf29190e9bee12d168a4bce6d74653c;hpb=cd1bb8f4c8afba318249c7b756a45aa1c46ea51e diff --git a/basis/compiler/tree/escape-analysis/escape-analysis-tests.factor b/basis/compiler/tree/escape-analysis/escape-analysis-tests.factor index be6b2863f0..debb66b8d4 100644 --- a/basis/compiler/tree/escape-analysis/escape-analysis-tests.factor +++ b/basis/compiler/tree/escape-analysis/escape-analysis-tests.factor @@ -1,4 +1,3 @@ -IN: compiler.tree.escape-analysis.tests USING: compiler.tree.escape-analysis compiler.tree.escape-analysis.allocations compiler.tree.builder compiler.tree.recursive compiler.tree.normalization @@ -10,11 +9,12 @@ classes.tuple namespaces compiler.tree.propagation.info stack-checker.errors compiler.tree.checker kernel.private vectors ; +IN: compiler.tree.escape-analysis.tests GENERIC: count-unboxed-allocations* ( m node -- n ) : (count-unboxed-allocations) ( m node -- n ) - out-d>> first escaping-allocation? [ 1+ ] unless ; + out-d>> first escaping-allocation? [ 1 + ] unless ; M: #call count-unboxed-allocations* dup immutable-tuple-boa? @@ -25,7 +25,7 @@ M: #push count-unboxed-allocations* [ (count-unboxed-allocations) ] [ drop ] if ; M: #introduce count-unboxed-allocations* - out-d>> [ escaping-allocation? [ 1+ ] unless ] each ; + out-d>> [ escaping-allocation? [ 1 + ] unless ] each ; M: node count-unboxed-allocations* drop ; @@ -212,10 +212,10 @@ C: ro-box dup i>> 1 <= [ drop 1 ] [ - i>> 1- + i>> 1 - dup tuple-fib swap - i>> 1- + i>> 1 - tuple-fib swap i>> swap i>> + ] if ; inline recursive @@ -225,7 +225,7 @@ C: ro-box [ 3 ] [ [ tuple-fib ] count-unboxed-allocations ] unit-test : tuple-fib' ( m -- n ) - dup 1 <= [ 1- tuple-fib' i>> ] when ; inline recursive + dup 1 <= [ 1 - tuple-fib' i>> ] when ; inline recursive [ 0 ] [ [ tuple-fib' ] count-unboxed-allocations ] unit-test @@ -233,10 +233,10 @@ C: ro-box dup i>> 1 <= [ drop 1 ] [ - i>> 1- + i>> 1 - dup bad-tuple-fib-1 swap - i>> 1- + i>> 1 - bad-tuple-fib-1 dup . swap i>> swap i>> + ] if ; inline recursive @@ -248,10 +248,10 @@ C: ro-box dup i>> 1 <= [ drop 1 ] [ - i>> 1- + i>> 1 - dup bad-tuple-fib-2 swap - i>> 1- + i>> 1 - bad-tuple-fib-2 swap i>> swap i>> + ] if ; inline recursive @@ -262,9 +262,9 @@ C: ro-box dup 1 <= [ drop 1 ] [ - 1- dup tuple-fib-2 + 1 - dup tuple-fib-2 swap - 1- tuple-fib-2 + 1 - tuple-fib-2 swap i>> swap i>> + ] if ; inline recursive @@ -274,9 +274,9 @@ C: ro-box dup 1 <= [ drop 1 ] [ - 1- dup tuple-fib-3 + 1 - dup tuple-fib-3 swap - 1- tuple-fib-3 dup . + 1 - tuple-fib-3 dup . swap i>> swap i>> + ] if ; inline recursive @@ -286,9 +286,9 @@ C: ro-box dup 1 <= [ drop 1 ] [ - 1- dup bad-tuple-fib-3 + 1 - dup bad-tuple-fib-3 swap - 1- bad-tuple-fib-3 + 1 - bad-tuple-fib-3 2drop f ] if ; inline recursive @@ -344,4 +344,4 @@ TUPLE: empty-tuple ; [ 0 ] [ [ { vector } declare length>> ] count-unboxed-allocations -] unit-test \ No newline at end of file +] unit-test