aboutsummaryrefslogtreecommitdiff
path: root/src/interp/i-spec2.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-05-27 23:53:34 +0000
committerdos-reis <gdr@axiomatics.org>2010-05-27 23:53:34 +0000
commite8df6a1fe9e9f218b8d9147a3de55f6d60fcc080 (patch)
treef46a06b99b7e3fe8c9990530c19e8f80ac64325b /src/interp/i-spec2.boot
parent307e4ad0a2676ef94b42121e79e71888f4778883 (diff)
downloadopen-axiom-e8df6a1fe9e9f218b8d9147a3de55f6d60fcc080.tar.gz
* interp/sys-macros.lisp (eval): Expand opcodes before calling EVAL.
* interp/slam.boot (reportFunctionCompilation): Tidy. Take extra care when generating code that access global variables. (reportFunctionCacheAll): Likewise. * interp/i-util.boot (isLocallyBound): Define. * interp/i-spec1.boot (upCOLLECT1): Bind $iteratorVars to nil. (upLoopIterSTEP): Call mkIteratorVariable instead of mkLocalVar. (upLoopIterIN): Likewise. (upStreamIterIN): Likewise. (upStreamIterSTEP): Likewise. (collectOneStream): Tidy. (mkAndApplyPredicates): Likewise. (mkIterFun): Lose last parameter. Tidy. (declare): Use isLocallyBound. (getAndEvalConstructorArgument): Likewise. (mkIteratorVariable): New. ($iteratorVars): New. * interp/i-spec2.boot (upREPEAT1): Bind $iteratorVars to nil. (isLocalPred): Use isLocallyBound. (compileIs): Likewise. (evalLETput): Likewise. (evalLETchangeValue): Likewise. (isType): Likewise. * interp/i-analy.boot (bottomUp): Likewise. (bottomUpDefaultCompile): Likewise. * interp/i-eval.boot (evalForm): Likewise. (getMappingArgValue): Likewise. * interp/i-map.boot (findLocalVars1): Likewise. (findLocalsInLoop): Tidy. Filter out iterator variables. (isLocalVar): Remove. * interp/g-util.boot (mkCacheName): Define here. (mkAuxiliaryName): Likewise. * interp/c-util.boot (backendCompileSLAM): Use mkCacheName. (backendCompileSPADSLAM): Likewise. * interp/clam.boot (compClam): Likewise. (clearCategoryCaches): Likewise. (clearCategoryCache): Likewise. * interp/g-timer.boot (timedEVALFUN): expandToVMForm is now implicitly called by eval.
Diffstat (limited to 'src/interp/i-spec2.boot')
-rw-r--r--src/interp/i-spec2.boot21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/interp/i-spec2.boot b/src/interp/i-spec2.boot
index 85035890..989ca1da 100644
--- a/src/interp/i-spec2.boot
+++ b/src/interp/i-spec2.boot
@@ -383,18 +383,18 @@ evalis(op,[a,pattern],mode) ==
putValue(op,triple)
isLocalPred pattern ==
- -- returns true if the is predicate is to be compiled
+ -- returns true if this predicate is to be compiled
for pat in pattern repeat
- IDENTP pat and isLocalVar(pat) => return true
- pat is [":",var] and isLocalVar(var) => return true
- pat is ["=",var] and isLocalVar(var) => return true
+ IDENTP pat and isLocallyBound pat => return true
+ pat is [":",var] and isLocallyBound var => return true
+ pat is ["=",var] and isLocallyBound var => return true
compileIs(val,pattern) ==
-- produce code for compiled "is" predicate. makes pattern variables
-- into local variables of the function
vars:= NIL
for pat in rest pattern repeat
- IDENTP(pat) and isLocalVar(pat) => vars:=[pat,:vars]
+ IDENTP(pat) and isLocallyBound pat => vars:=[pat,:vars]
pat is [":",var] => vars:= [var,:vars]
pat is ["=",var] => vars:= [var,:vars]
predCode:=["%LET",g:=gensym(),["isPatternMatch",
@@ -567,7 +567,7 @@ evalLETput(lhs,value) ==
name:= getUnname lhs
if not $genValue then
code:=
- isLocalVar(name) =>
+ isLocallyBound name =>
om := objMode(value)
dm := get(name,'mode,$env)
dm and not ((om = dm) or isSubDomain(om,dm) or
@@ -584,7 +584,7 @@ evalLETput(lhs,value) ==
['unwrap,['evalLETchangeValue,MKQ name,
objNewCode(['wrap,objVal value],objMode value)]]
value:= objNew(code,objMode value)
- isLocalVar(name) =>
+ isLocallyBound name =>
if not get(name,'mode,$env) then put(name,'autoDeclare,'T,$env)
put(name,'mode,objMode(value),$env)
put(name,'automode,objMode(value),$env)
@@ -621,7 +621,7 @@ evalLETchangeValue(name,value) ==
objMode val ~= objMode(value)
if clearCompilationsFlag then
clearDependencies(name,true)
- if localEnv and isLocalVar(name)
+ if localEnv and isLocallyBound name
then $env:= putHist(name,'value,value,$env)
else putIntSymTab(name,'value,value,$e)
objVal value
@@ -745,7 +745,7 @@ isType t ==
argTypes := [isType type for type in rest t]
"or"/[null type for type in argTypes] => nil
['Mapping, :argTypes]
- isLocalVar(op) => NIL
+ isLocallyBound op => NIL
d := isDomainValuedVariable op => d
type:=
-- next line handles subscripted vars
@@ -763,7 +763,7 @@ upLETtype(op,lhs,type) ==
compFailure ['" Cannot compile type assignment to",:bright opName]
mode := conceptualType type
val:= objNew(type,mode)
- if isLocalVar(opName) then put(opName,'value,val,$env)
+ if isLocallyBound opName then put(opName,'value,val,$env)
else putHist(opName,'value,val,$e)
putValue(op,val)
-- have to fix the following
@@ -934,6 +934,7 @@ upREPEAT1 t ==
$interpOnly => interpREPEAT(op,itrl,body,repeatMode)
-- analyze iterators and loop body
+ $iteratorVars: local := nil
upLoopIters itrl
bottomUpCompile body