diff --git a/library/compiler/linearizer.factor b/library/compiler/linearizer.factor index 6d686e29a9..9bb95fb7d7 100644 --- a/library/compiler/linearizer.factor +++ b/library/compiler/linearizer.factor @@ -5,8 +5,6 @@ USING: compiler-backend errors generic lists inference kernel math namespaces prettyprint sequences strings words ; -SYMBOL: simple-labels - GENERIC: linearize* ( node -- ) : linearize ( dataflow -- linear ) @@ -14,7 +12,6 @@ GENERIC: linearize* ( node -- ) #! stack flow information, and flattens conditionals into #! jumps and labels. [ - { } clone simple-labels set %prologue , linearize* ] { } make ; @@ -25,41 +22,16 @@ M: f linearize* ( f -- ) drop ; M: node linearize* ( node -- ) linearize-next ; -: simple-label? ( #label -- ? ) - #! A simple label only contains tail calls to itself. - dup node-param swap node-child [ - dup #call-label? [ - [ node-param = not ] keep node-successor #return? or - ] [ - 2drop t - ] ifte - ] all-nodes-with? ; - -: simple-label ( #label -- ) - dup node-param %label , node-child linearize* ; - M: #label linearize* ( node -- ) - dup simple-label? [ - dup node-param simple-labels get push - dup simple-label - ] [ - dup