Remove tail-dispatch? optimization since it was not sound
parent
3696ce8168
commit
d14ee13f64
|
@ -3,7 +3,7 @@ USING: arrays compiler kernel kernel.private math
|
||||||
hashtables.private math.private namespaces sequences
|
hashtables.private math.private namespaces sequences
|
||||||
sequences.private tools.test namespaces.private slots.private
|
sequences.private tools.test namespaces.private slots.private
|
||||||
sequences.private byte-arrays alien alien.accessors layouts
|
sequences.private byte-arrays alien alien.accessors layouts
|
||||||
words definitions compiler.units ;
|
words definitions compiler.units io combinators ;
|
||||||
IN: temporary
|
IN: temporary
|
||||||
|
|
||||||
! Oops!
|
! Oops!
|
||||||
|
@ -191,3 +191,18 @@ TUPLE: my-tuple ;
|
||||||
2 1
|
2 1
|
||||||
[ 2dup fixnum< [ >r die r> ] when ] compile-call
|
[ 2dup fixnum< [ >r die r> ] when ] compile-call
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! Regression
|
||||||
|
: a-dummy drop "hi" print ;
|
||||||
|
|
||||||
|
[ ] [
|
||||||
|
1 [
|
||||||
|
dup 0 2 3dup pick >= [ >= ] [ 2drop f ] if [
|
||||||
|
drop - >fixnum {
|
||||||
|
[ a-dummy ]
|
||||||
|
[ a-dummy ]
|
||||||
|
[ a-dummy ]
|
||||||
|
} dispatch
|
||||||
|
] [ 2drop no-case ] if
|
||||||
|
] compile-call
|
||||||
|
] unit-test
|
||||||
|
|
|
@ -158,17 +158,10 @@ M: #if generate-node
|
||||||
] with-generator
|
] with-generator
|
||||||
] keep ;
|
] keep ;
|
||||||
|
|
||||||
: tail-dispatch? ( node -- ? )
|
|
||||||
#! Is the dispatch a jump to a tail call to a word?
|
|
||||||
dup #call? swap node-successor #return? and ;
|
|
||||||
|
|
||||||
: dispatch-branches ( node -- )
|
: dispatch-branches ( node -- )
|
||||||
node-children [
|
node-children [
|
||||||
dup tail-dispatch? [
|
|
||||||
node-param
|
|
||||||
] [
|
|
||||||
compiling-word get dispatch-branch
|
compiling-word get dispatch-branch
|
||||||
] if %dispatch-label
|
%dispatch-label
|
||||||
] each ;
|
] each ;
|
||||||
|
|
||||||
: generate-dispatch ( node -- )
|
: generate-dispatch ( node -- )
|
||||||
|
|
Loading…
Reference in New Issue