diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor old mode 100644 new mode 100755 index 9d2b43c1df..f2a2255949 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -84,6 +84,13 @@ FUNCTION: tiny ffi_test_17 int x ; [ 3 ] [ "ffi_test_1" f dlsym indirect-test-1 ] unit-test +: indirect-test-1' ( ptr -- ) + "int" { } "cdecl" alien-indirect drop ; + +{ 1 0 } [ indirect-test-1' ] must-infer-as + +[ ] [ "ffi_test_1" f dlsym indirect-test-1' ] unit-test + [ -1 indirect-test-1 ] must-fail : indirect-test-2 ( x y ptr -- result ) diff --git a/basis/compiler/tree/dead-code/simple/simple.factor b/basis/compiler/tree/dead-code/simple/simple.factor old mode 100644 new mode 100755 index 3ea9139e5f..9ebf064f79 --- a/basis/compiler/tree/dead-code/simple/simple.factor +++ b/basis/compiler/tree/dead-code/simple/simple.factor @@ -81,11 +81,19 @@ M: #alien-indirect compute-live-values* nip look-at-inputs ; drop-values ] ; -: drop-dead-outputs ( node -- nodes ) +: drop-dead-outputs ( node -- #shuffle ) dup out-d>> drop-dead-values tuck in-d>> >>out-d drop ; +: some-outputs-dead? ( #call -- ? ) + out-d>> [ live-value? not ] contains? ; + +: maybe-drop-dead-outputs ( node -- nodes ) + dup some-outputs-dead? [ + dup drop-dead-outputs 2array + ] when ; + M: #introduce remove-dead-code* ( #introduce -- nodes ) - dup drop-dead-outputs 2array ; + maybe-drop-dead-outputs ; M: #>r remove-dead-code* [ filter-live ] change-out-r @@ -110,17 +118,9 @@ M: #push remove-dead-code* [ in-d>> #drop remove-dead-code* ] bi ; -: some-outputs-dead? ( #call -- ? ) - out-d>> [ live-value? not ] contains? ; - M: #call remove-dead-code* - dup dead-flushable-call? [ - remove-flushable-call - ] [ - dup some-outputs-dead? [ - dup drop-dead-outputs 2array - ] when - ] if ; + dup dead-flushable-call? + [ remove-flushable-call ] [ maybe-drop-dead-outputs ] if ; M: #shuffle remove-dead-code* [ filter-live ] change-in-d @@ -136,3 +136,9 @@ M: #copy remove-dead-code* M: #terminate remove-dead-code* [ filter-live ] change-in-d [ filter-live ] change-in-r ; + +M: #alien-invoke remove-dead-code* + maybe-drop-dead-outputs ; + +M: #alien-indirect remove-dead-code* + maybe-drop-dead-outputs ; diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index 5e888cd871..36fe015611 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -136,7 +136,6 @@ IN: tools.deploy.shaker "specializer" "step-into" "step-into?" - "superclass" "transform-n" "transform-quot" "tuple-dispatch-generic" diff --git a/basis/ui/gadgets/buttons/buttons.factor b/basis/ui/gadgets/buttons/buttons.factor index b5e8e8a1e1..a079781d69 100755 --- a/basis/ui/gadgets/buttons/buttons.factor +++ b/basis/ui/gadgets/buttons/buttons.factor @@ -67,9 +67,12 @@ M: button-paint draw-interior M: button-paint draw-boundary button-paint draw-boundary ; +: align-left ( button -- button ) + { 0 1/2 } >>align ; inline + : roll-button-theme ( button -- button ) f black dup f >>boundary - { 0 1/2 } >>align ; inline + align-left ; inline : ( label quot -- button )