aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@axiomatics.org>2016-01-31 14:56:44 -0800
committerGabriel Dos Reis <gdr@axiomatics.org>2016-01-31 14:56:44 -0800
commita4f62a012320bfe5c898ba7d4af0680c101b7548 (patch)
tree0bb55865e071e240a9fd4f1a0e7488a3af28bb9a
parent9f2772a6d017e67ef9bd80b36bd3ab7c98e61894 (diff)
downloadopen-axiom-a4f62a012320bfe5c898ba7d4af0680c101b7548.tar.gz
Rename compileConstrutor to compileConstructorIR
Establish a distinct control path for compiling constructor bodies. Avoid routing these IRs via 'compile', which should be used only for capsule-level definitions.
-rw-r--r--src/interp/define.boot27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/interp/define.boot b/src/interp/define.boot
index c9676be3..564b41c9 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -1142,7 +1142,7 @@ compDefineCategory2(db,form,signature,body,m,e,$formalArgList) ==
body:=
["%bind",[[g:= gensym(),body]],
['%seq,['%store,['%tref,g,0],mkConstructor $form],g]]
- fun := compile(db,[op',['%lambda,sargl,body]],signature')
+ fun := compileConstructorIR(db,[op',['%lambda,sargl,body]])
-- 5. give operator a 'modemap property
pairlis := pairList(form.args,$FormalMapVariableList)
@@ -1540,7 +1540,7 @@ compDefineFunctor1(db,df is ['DEF,form,signature,body],m,$e,$formalArgList) ==
lamOrSlam :=
dbInstanceCache db = nil => '%lambda
'%slam
- fun := compile(db,dbSubstituteFormals(db,[op',[lamOrSlam,form.args,body']]),signature')
+ fun := compileConstructorIR(db,dbSubstituteFormals(db,[op',[lamOrSlam,form.args,body']]))
--The above statement stops substitutions gettting in one another's way
operationAlist := dbSubstituteAllQuantified(db,$lisplibOperationAlist)
dbModemaps(db) := modemapsFromFunctor(db,parForm,operationAlist)
@@ -2096,11 +2096,7 @@ putInLocalDomainReferences(db,def := [opName,[lam,varl,body]]) ==
compile(db,u,signature) ==
- optimizedBody := optimizeFunctionDef u
- stuffToCompile :=
- $insideCapsuleFunctionIfTrue =>
- putInLocalDomainReferences(db,optimizedBody)
- optimizedBody
+ stuffToCompile := putInLocalDomainReferences(db,optimizeFunctionDef u)
try spadCompileOrSetq(db,stuffToCompile)
finally
functionStats := [0,elapsedTime()]
@@ -2108,8 +2104,7 @@ compile(db,u,signature) ==
printStats functionStats
++ Subroutine of compile. Called to generate backend code for
-++ items defined directly or indirectly at capsule level. This is
-++ also used to compile functors.
+++ items defined directly or indirectly at capsule level.
spadCompileOrSetq(db,form is [nam,[lam,vl,body]]) ==
vl := cleanParameterList! vl
if $optReplaceSimpleFunctions then
@@ -2129,15 +2124,13 @@ spadCompileOrSetq(db,form is [nam,[lam,vl,body]]) ==
[nam,[lam,vl,["DECLARE",["IGNORE",last vl]],body]]
[nam,[lam,vl,body]]
- $insideCapsuleFunctionIfTrue =>
- $optExportedFunctionReference =>
- dbCapsuleIR(db) := [form,:dbCapsuleIR db]
- first form
- first backendCompile(db,[form])
- compileConstructor(db,form)
+ $optExportedFunctionReference =>
+ dbCapsuleIR(db) := [form,:dbCapsuleIR db]
+ first form
+ first backendCompile(db,[form])
-compileConstructor(db,form) ==
- u := compileConstructor1(db,form)
+compileConstructorIR(db,form) ==
+ u := compileConstructor1(db,optimizeFunctionDef form)
clearClams() --clear all CLAMmed functions
clearConstructorCache u --clear cache for constructor
u