From 651bdb4709c1b0c989beecd44124d769b59cef2f Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 14 Jan 2005 19:56:19 +0000 Subject: [PATCH] more parser cleanups; stack inference cleanups --- library/compiler/linearizer.factor | 13 ++-- library/compiler/optimizer.factor | 17 ++--- library/compiler/x86/generator.factor | 2 +- library/generic/predicate.factor | 2 +- library/inference/branches.factor | 6 +- library/inference/dataflow.factor | 3 - library/lists.factor | 16 +---- library/syntax/parse-syntax.factor | 19 +++-- library/syntax/parser.factor | 94 ++++++++----------------- library/test/compiler/linearizer.factor | 10 +++ library/test/dataflow.factor | 8 +-- library/test/parser.factor | 61 +++++++++------- library/test/test.factor | 1 + 13 files changed, 110 insertions(+), 142 deletions(-) create mode 100644 library/test/compiler/linearizer.factor diff --git a/library/compiler/linearizer.factor b/library/compiler/linearizer.factor index 9d39ef8e52..2f67034160 100644 --- a/library/compiler/linearizer.factor +++ b/library/compiler/linearizer.factor @@ -34,6 +34,8 @@ USE: namespaces USE: words USE: strings USE: errors +USE: prettyprint +USE: kernel-internals ! The linear IR is close to assembly language. It also resembles ! Forth code in some sense. It exists so that pattern matching @@ -51,7 +53,7 @@ SYMBOL: #jump ( tail-call ) SYMBOL: #jump-label ( tail-call ) SYMBOL: #return-to ( push addr on C stack ) -! #dispatch is linearized as #dispatch followed by a #target +! dispatch is linearized as dispatch followed by a #target ! for each dispatch table entry. The linearizer ensures the ! correct number of #targets is emitted. SYMBOL: #target ( part of jump table ) @@ -127,8 +129,7 @@ SYMBOL: #target ( part of jump table ) : linearize-ifte ( param -- ) #! The parameter is a list of two lists, each one a dataflow #! IR. - uncons car -