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
|
||||
sequences.private tools.test namespaces.private slots.private
|
||||
sequences.private byte-arrays alien alien.accessors layouts
|
||||
words definitions compiler.units ;
|
||||
words definitions compiler.units io combinators ;
|
||||
IN: temporary
|
||||
|
||||
! Oops!
|
||||
|
@ -191,3 +191,18 @@ TUPLE: my-tuple ;
|
|||
2 1
|
||||
[ 2dup fixnum< [ >r die r> ] when ] compile-call
|
||||
] 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
|
||||
] 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 -- )
|
||||
node-children [
|
||||
dup tail-dispatch? [
|
||||
node-param
|
||||
] [
|
||||
compiling-word get dispatch-branch
|
||||
] if %dispatch-label
|
||||
compiling-word get dispatch-branch
|
||||
%dispatch-label
|
||||
] each ;
|
||||
|
||||
: generate-dispatch ( node -- )
|
||||
|
|
Loading…
Reference in New Issue