From d2bb8c8d376da707b0d95198ee447a5eafb80af4 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 15 Dec 2011 08:56:47 +0000 Subject: * interp/g-opt.boot (modified?): Tidy. --- src/ChangeLog | 4 ++++ src/interp/g-opt.boot | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 386c9887..3412327d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-12-15 Gabriel Dos Reis + + * interp/g-opt.boot (modified?): Tidy. + 2011-12-15 Gabriel Dos Reis * lisp/core.lisp.in: Do not require SB-SPROF or SB-POSIX on Windows. diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index c2e18d41..0236e4f4 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -657,13 +657,18 @@ findVMFreeVars form == setUnion(findVMFreeVars op,vars) ++ Return true is `var' is the left hand side of an assignment -++ in `form'. +++ or a sort of binding in `form'. modified?(var,form) == atomic? form => false form is [op,var',expr,:.] and op in '(%LET LETT SETQ %store) => modified?(var,expr) => true symbol? var' => var' = var -- whole var is assigned - var' is [.,=var] -- only part of it is modified + var' is [.,=var,:.] -- only part of it is modified + form is ['%bind,:.] and + (or/[symbolEq?(var,var') for [var',.] in form.absParms]) => true + form is ['%loop,:iters,.,.] and + (or/[symbolEq?(var,iteratorName i) for i in iters]) => true + abstraction? form and symbolMember?(var,form.absParms) => true or/[modified?(var,f) for f in form] @@ -695,6 +700,7 @@ canInlineVarDefinition(var,expr,body) == or/[modified?(x,body) for x in dependentVars expr] => false -- If the initializer is a variable and not modified in body, -- and the new var is not modified, then we can inline. + -- FIXME: except if the modification is done via normal function calls. ident? expr => true -- Conversatively stay out of loops cons? body and body.op in '(%loop %collect) => false -- cgit v1.2.3