From 8d55616d346977da7500b80ecb879b7ce7eb193f Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 25 Aug 2009 23:44:01 -0500 Subject: [PATCH] compiler.cfg.debugger: fix fake-representations so that low-level-ir tests can pass on x86 --- basis/compiler/cfg/debugger/debugger.factor | 30 +++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/basis/compiler/cfg/debugger/debugger.factor b/basis/compiler/cfg/debugger/debugger.factor index 33f87ff1d4..d51aa477c9 100644 --- a/basis/compiler/cfg/debugger/debugger.factor +++ b/basis/compiler/cfg/debugger/debugger.factor @@ -1,15 +1,16 @@ ! Copyright (C) 2008, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: kernel words sequences quotations namespaces io vectors -classes.tuple accessors prettyprint prettyprint.config assocs -prettyprint.backend prettyprint.custom prettyprint.sections -parser compiler.tree.builder compiler.tree.optimizer -cpu.architecture compiler.cfg.builder compiler.cfg.linearization -compiler.cfg.registers compiler.cfg.stack-frame -compiler.cfg.linear-scan compiler.cfg.two-operand -compiler.cfg.optimizer compiler.cfg.instructions -compiler.cfg.utilities compiler.cfg.def-use -compiler.cfg.rpo compiler.cfg.mr compiler.cfg ; +arrays hashtables classes.tuple accessors prettyprint +prettyprint.config assocs prettyprint.backend prettyprint.custom +prettyprint.sections parser compiler.tree.builder +compiler.tree.optimizer cpu.architecture compiler.cfg.builder +compiler.cfg.linearization compiler.cfg.registers +compiler.cfg.stack-frame compiler.cfg.linear-scan +compiler.cfg.two-operand compiler.cfg.optimizer +compiler.cfg.instructions compiler.cfg.utilities +compiler.cfg.def-use compiler.cfg.rpo compiler.cfg.mr +compiler.cfg.representations.preferred compiler.cfg ; IN: compiler.cfg.debugger GENERIC: test-cfg ( quot -- cfgs ) @@ -73,8 +74,9 @@ M: rs-loc pprint* \ R pprint-loc ; : fake-representations ( cfg -- ) post-order [ - instructions>> - [ [ temp-vregs ] [ defs-vreg ] bi [ suffix ] when* ] - map concat - ] map concat - [ int-rep ] H{ } map>assoc representations set ; \ No newline at end of file + instructions>> [ + [ [ temp-vregs ] [ temp-vreg-reps ] bi zip ] + [ [ defs-vreg ] [ defs-vreg-rep ] bi 2dup and [ 2array ] [ 2drop f ] if ] + bi [ suffix ] when* + ] map concat + ] map concat >hashtable representations set ; \ No newline at end of file