From b8bcdc8909e65e79c3d4c7d58a844212638cc090 Mon Sep 17 00:00:00 2001 From: slava Date: Sat, 4 Mar 2006 07:53:22 +0000 Subject: [PATCH] Working on optimizer --- TODO.FACTOR.txt | 2 +- library/bootstrap/boot-stage1.factor | 1 - library/compiler/compiler.factor | 6 ++---- library/compiler/generator.factor | 5 ++--- library/compiler/linearizer.factor | 6 +++--- library/inference/dataflow.factor | 2 +- library/inference/kill-literals.factor | 4 ++-- library/inference/known-words.factor | 4 ++-- library/inference/optimizer.factor | 9 +++++---- library/inference/words.factor | 2 +- 10 files changed, 19 insertions(+), 22 deletions(-) diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index ffe9412ef4..a12232a591 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -54,7 +54,7 @@ - code gc - compiled gc check slows things down - fix branch folding -- remove branch splitting +- new x86 write barrier + misc: diff --git a/library/bootstrap/boot-stage1.factor b/library/bootstrap/boot-stage1.factor index 65ce254ecf..b6dd39d917 100644 --- a/library/bootstrap/boot-stage1.factor +++ b/library/bootstrap/boot-stage1.factor @@ -133,7 +133,6 @@ vectors words ; "/library/compiler/xt.factor" "/library/compiler/stack.factor" "/library/compiler/intrinsics.factor" - "/library/compiler/basic-blocks.factor" "/library/compiler/generator.factor" "/library/compiler/compiler.factor" diff --git a/library/compiler/compiler.factor b/library/compiler/compiler.factor index 94942f0fe3..d03c25e0b1 100644 --- a/library/compiler/compiler.factor +++ b/library/compiler/compiler.factor @@ -7,7 +7,7 @@ sequences words ; : (compile) ( word -- ) #! Should be called inside the with-compiler scope. dup word-def dataflow optimize linearize - [ split-blocks simplify generate ] hash-each ; + [ generate ] hash-each ; : inform-compile ( word -- ) "Compiling " write . flush ; @@ -47,8 +47,6 @@ sequences words ; ] if ; \ dataflow profile -\ optimize profile \ linearize profile -\ split-blocks profile -\ simplify profile \ generate profile +\ optimize profile diff --git a/library/compiler/generator.factor b/library/compiler/generator.factor index 381b6d873e..620b067462 100644 --- a/library/compiler/generator.factor +++ b/library/compiler/generator.factor @@ -12,14 +12,13 @@ GENERIC: generate-node ( vop -- ) #! The %prologue node contains the maximum stack reserve of #! all VOPs. The precise meaning of stack reserve is #! platform-specific. - 0 [ 0 [ stack-reserve max ] reduce max ] reduce - \ stack-reserve set ; + 0 [ stack-reserve max ] reduce \ stack-reserve set ; : generate-code ( word linear -- length ) compiled-offset >r compile-aligned swap save-xt - [ [ dup [ generate-node ] with-vop ] each ] each + [ dup [ generate-node ] with-vop ] each compile-aligned compiled-offset r> - ; diff --git a/library/compiler/linearizer.factor b/library/compiler/linearizer.factor index 344c6acb38..37ad4a9e9e 100644 --- a/library/compiler/linearizer.factor +++ b/library/compiler/linearizer.factor @@ -80,15 +80,15 @@ M: #label linearize* ( node -- next ) dup node-successor #if? [ node-param "if-intrinsic" word-prop ] [ drop f ] if ; -: linearize-if ( node label -- next ) +: linearize-if ( node label -- )