From 00338f62f312ddb2c01295a96a2a9af9b0172896 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 10 Aug 2015 12:55:27 -0500 Subject: [PATCH] factor: put inline on same line as ; for experimentation --- basis/binary-search/binary-search.factor | 3 +-- basis/bootstrap/image/image.factor | 3 +-- basis/compiler/tree/combinators/combinators.factor | 4 ++-- basis/compiler/tree/recursive/recursive.factor | 4 ++-- basis/io/timeouts/timeouts.factor | 8 ++++---- basis/stack-checker/stack-checker-tests.factor | 5 +++-- basis/ui/gadgets/panes/panes.factor | 3 +-- core/math/integers/integers.factor | 3 +-- core/sorting/sorting.factor | 3 +-- extra/benchmark/beust2/beust2.factor | 3 +-- extra/benchmark/recursive/recursive.factor | 5 +++-- extra/benchmark/yuv-to-rgb/yuv-to-rgb.factor | 6 ++---- extra/koszul/koszul.factor | 3 +-- extra/sequences/extras/extras.factor | 4 ++-- 14 files changed, 25 insertions(+), 32 deletions(-) diff --git a/basis/binary-search/binary-search.factor b/basis/binary-search/binary-search.factor index 976f5fbb71..d5a24e08fa 100644 --- a/basis/binary-search/binary-search.factor +++ b/basis/binary-search/binary-search.factor @@ -23,8 +23,7 @@ IN: binary-search PRIVATE> : search ( seq quot: ( elt -- <=> ) -- i elt ) - over empty? [ 2drop f f ] [ [ 0 over length ] dip (search) ] if ; - inline + over empty? [ 2drop f f ] [ [ 0 over length ] dip (search) ] if ; inline GENERIC: natural-search ( obj seq -- i elt ) M: object natural-search [ <=> ] with search ; diff --git a/basis/bootstrap/image/image.factor b/basis/bootstrap/image/image.factor index 94f1ec5943..3be291f5b2 100755 --- a/basis/bootstrap/image/image.factor +++ b/basis/bootstrap/image/image.factor @@ -248,8 +248,7 @@ SPECIAL-OBJECT: undefined-quot 65 : emit-object ( class quot -- addr ) [ type-number ] dip over here-as - [ swap emit-header call align-here ] dip ; - inline + [ swap emit-header call align-here ] dip ; inline ! Write an object to the image. GENERIC: ' ( obj -- ptr ) diff --git a/basis/compiler/tree/combinators/combinators.factor b/basis/compiler/tree/combinators/combinators.factor index d41796678c..7d709fd02d 100644 --- a/basis/compiler/tree/combinators/combinators.factor +++ b/basis/compiler/tree/combinators/combinators.factor @@ -53,5 +53,5 @@ IN: compiler.tree.combinators : until-fixed-point ( ... #recursive quot: ( ... node -- ... ) -- ... ) over label>> t >>fixed-point drop [ with-scope ] 2keep - over label>> fixed-point>> [ 2drop ] [ until-fixed-point ] if ; - inline recursive + over label>> fixed-point>> + [ 2drop ] [ until-fixed-point ] if ; inline recursive diff --git a/basis/compiler/tree/recursive/recursive.factor b/basis/compiler/tree/recursive/recursive.factor index 2c65a700b6..cd00e931fc 100644 --- a/basis/compiler/tree/recursive/recursive.factor +++ b/basis/compiler/tree/recursive/recursive.factor @@ -108,8 +108,8 @@ SYMBOL: changed? : while-changing ( ... quot: ( ... -- ... ) -- ... ) changed? off - [ call ] [ changed? get [ while-changing ] [ drop ] if ] bi ; - inline recursive + [ call ] + [ changed? get [ while-changing ] [ drop ] if ] bi ; inline recursive : detect-loops ( call-graph -- ) HS{ } clone not-loops set diff --git a/basis/io/timeouts/timeouts.factor b/basis/io/timeouts/timeouts.factor index 42238b6526..9dbd475fc8 100644 --- a/basis/io/timeouts/timeouts.factor +++ b/basis/io/timeouts/timeouts.factor @@ -17,12 +17,12 @@ GENERIC: cancel-operation ( obj -- ) [ '[ _ cancel-operation ] ] dip later ; : with-timeout* ( obj timeout quot -- ) - 2over queue-timeout [ nip call ] dip stop-timer ; - inline + 2over queue-timeout + [ nip call ] dip stop-timer ; inline : with-timeout ( obj quot -- ) - over timeout [ [ dup timeout ] dip with-timeout* ] [ call ] if ; - inline + over timeout + [ [ dup timeout ] dip with-timeout* ] [ call ] if ; inline : timeouts ( dt -- ) [ input-stream get set-timeout ] diff --git a/basis/stack-checker/stack-checker-tests.factor b/basis/stack-checker/stack-checker-tests.factor index 6c31370e54..5426b773b2 100644 --- a/basis/stack-checker/stack-checker-tests.factor +++ b/basis/stack-checker/stack-checker-tests.factor @@ -346,8 +346,9 @@ FORGET: bad-recursion-3 { 2 0 } [ drop f f [ 2drop "A" throw ] [ ] if 2drop ] must-infer-as : unbalanced-retain-usage ( a b -- ) - dup 10 < [ 2drop 5 1 + unbalanced-retain-usage ] [ 2drop ] if ; - inline recursive + dup 10 < + [ 2drop 5 1 + unbalanced-retain-usage ] + [ 2drop ] if ; inline recursive [ [ unbalanced-retain-usage ] infer ] [ inference-error? ] must-fail-with diff --git a/basis/ui/gadgets/panes/panes.factor b/basis/ui/gadgets/panes/panes.factor index 27d231a01b..6ebf493055 100644 --- a/basis/ui/gadgets/panes/panes.factor +++ b/basis/ui/gadgets/panes/panes.factor @@ -270,8 +270,7 @@ TUPLE: nested-pane-stream < pane-stream style parent ; : new-nested-pane-stream ( style parent class -- stream ) new swap >>parent - swap apply-wrap-style [ >>style ] [ >>pane ] bi* ; - inline + swap apply-wrap-style [ >>style ] [ >>pane ] bi* ; inline : unnest-pane-stream ( stream -- child parent ) [ [ style>> ] [ pane>> smash-pane ] bi style-pane ] [ parent>> ] bi ; diff --git a/core/math/integers/integers.factor b/core/math/integers/integers.factor index 07a2e2bbd2..bf36076ace 100644 --- a/core/math/integers/integers.factor +++ b/core/math/integers/integers.factor @@ -175,8 +175,7 @@ M: bignum (log2) bignum-log2 ; inline zero? [ dup 2 bitand zero? not rot or [ 1 + ] when ] [ nip 1 + ] if - ] [ drop nip ] if ; - inline + ] [ drop nip ] if ; inline ! Fourth step: post-scaling ! Because of rounding, our mantissa with guard bit is now in the diff --git a/core/sorting/sorting.factor b/core/sorting/sorting.factor index 52c8656008..511318e00c 100644 --- a/core/sorting/sorting.factor +++ b/core/sorting/sorting.factor @@ -135,8 +135,7 @@ PRIVATE> : sort ( seq quot: ( obj1 obj2 -- <=> ) -- sortedseq ) [ ] dip - [ sort-pairs ] [ sort-loop ] [ drop accum>> underlying>> ] 2tri ; - inline + [ sort-pairs ] [ sort-loop ] [ drop accum>> underlying>> ] 2tri ; inline : natural-sort ( seq -- sortedseq ) [ <=> ] sort ; diff --git a/extra/benchmark/beust2/beust2.factor b/extra/benchmark/beust2/beust2.factor index 2d37ab48f9..90187c0b77 100644 --- a/extra/benchmark/beust2/beust2.factor +++ b/extra/benchmark/beust2/beust2.factor @@ -28,8 +28,7 @@ IN: benchmark.beust2 ] any? ; inline recursive :: count-numbers ( max listener -- ) - 10 iota [ 1 + 1 1 0 max listener (count-numbers) ] any? drop ; - inline + 10 iota [ 1 + 1 1 0 max listener (count-numbers) ] any? drop ; inline :: beust2-benchmark ( -- ) 0 :> i! diff --git a/extra/benchmark/recursive/recursive.factor b/extra/benchmark/recursive/recursive.factor index f53a70a127..e9a65205be 100644 --- a/extra/benchmark/recursive/recursive.factor +++ b/extra/benchmark/recursive/recursive.factor @@ -2,8 +2,9 @@ USING: math kernel hints prettyprint io combinators ; IN: benchmark.recursive : fib ( m -- n ) - dup 2 < [ drop 1 ] [ [ 1 - fib ] [ 2 - fib ] bi + ] if ; - inline recursive + dup 2 < + [ drop 1 ] + [ [ 1 - fib ] [ 2 - fib ] bi + ] if ; inline recursive : ack ( m n -- x ) { diff --git a/extra/benchmark/yuv-to-rgb/yuv-to-rgb.factor b/extra/benchmark/yuv-to-rgb/yuv-to-rgb.factor index cf4719490a..3da80ec192 100644 --- a/extra/benchmark/yuv-to-rgb/yuv-to-rgb.factor +++ b/extra/benchmark/yuv-to-rgb/yuv-to-rgb.factor @@ -56,15 +56,13 @@ STRUCT: yuv-buffer drop 516 * 128 + swap 298 * + -8 shift clamp ; inline : compute-green ( y u v -- g ) - [ [ 298 * ] dip 100 * - ] dip 208 * - 128 + -8 shift clamp ; - inline + [ [ 298 * ] dip 100 * - ] dip 208 * - 128 + -8 shift clamp ; inline : compute-red ( y u v -- g ) nip 409 * swap 298 * + 128 + -8 shift clamp ; inline : compute-rgb ( y u v -- b g r ) - [ compute-blue ] [ compute-green ] [ compute-red ] 3tri ; - inline + [ compute-blue ] [ compute-green ] [ compute-red ] 3tri ; inline : store-rgb ( index rgb b g r -- index ) [ pick 0 + pick set-nth-unsafe ] diff --git a/extra/koszul/koszul.factor b/extra/koszul/koszul.factor index 4776d0f47f..d81abc77b4 100644 --- a/extra/koszul/koszul.factor +++ b/extra/koszul/koszul.factor @@ -242,8 +242,7 @@ DEFER: (d) dup length [ graded-triple ] with map ; : graded-laplacian ( generators quot -- seq ) - [ basis graded graded-triples [ first3 ] ] dip compose map ; - inline + [ basis graded graded-triples [ first3 ] ] dip compose map ; inline : graded-laplacian-betti ( generators -- seq ) [ laplacian-betti ] graded-laplacian ; diff --git a/extra/sequences/extras/extras.factor b/extra/sequences/extras/extras.factor index 21450c0551..4775f33d8f 100644 --- a/extra/sequences/extras/extras.factor +++ b/extra/sequences/extras/extras.factor @@ -212,8 +212,8 @@ PRIVATE> : ((each-from)) ( i seq -- n quot ) [ length over [-] swap ] keep '[ _ + _ nth-unsafe ] ; inline -: (each-from) ( i seq quot -- n quot' ) [ ((each-from)) ] dip compose ; - inline +: (each-from) ( i seq quot -- n quot' ) + [ ((each-from)) ] dip compose ; inline PRIVATE> -- 2.34.1