diff options
author | dos-reis <gdr@axiomatics.org> | 2011-11-13 15:49:18 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-11-13 15:49:18 +0000 |
commit | 4d0c8ae73e443bbfae3793a1313e0e5c5cf0c6a7 (patch) | |
tree | 61036dbbde4d9173acb1f5b5ba7acacc943a17dc /src/interp | |
parent | 6c1c0bcb2816b92639a2a1e55f66504ae712d9d1 (diff) | |
download | open-axiom-4d0c8ae73e443bbfae3793a1313e0e5c5cf0c6a7.tar.gz |
* interp/sys-driver.boot (initializeDatabases): Honor --initial-db.
(initializeGlobalState): Don't bind $compileDefaultsOnly.
* interp/sys-globals.boot ($compileDefaultsOnly): Remove.
* interp/define.boot (compDefineCategory): Adjust.
(compDefineCategory1): Likewise.
(compDefineFunctor1): Clear dbCapsuleDefinitions.
* interp/lisplib.boot (compDefineLisplib): Tidy.
* interp/daase.lisp (BROWSEOPEN): Use dbSourceFile.
(GETDATABASE): Likewise.
(LOCALNRLIB): Likewise.
(WRITE-BROWSEDB): Likewise.
* algebra/Makefile.in (COMPILE_SPAD): Specifiy initial DB.
(BOOTSTRAP): Likewise.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/daase.lisp | 14 | ||||
-rw-r--r-- | src/interp/define.boot | 6 | ||||
-rw-r--r-- | src/interp/g-cndata.boot | 7 | ||||
-rw-r--r-- | src/interp/lisplib.boot | 114 | ||||
-rw-r--r-- | src/interp/sys-driver.boot | 7 | ||||
-rw-r--r-- | src/interp/sys-globals.boot | 5 |
6 files changed, 77 insertions, 76 deletions
diff --git a/src/interp/daase.lisp b/src/interp/daase.lisp index 8024a8fc..6d989a2c 100644 --- a/src/interp/daase.lisp +++ b/src/interp/daase.lisp @@ -528,7 +528,7 @@ (warn "will create a new one~%") (setq dbstruct (|makeDB| (first item))) (setq *allconstructors* (adjoin item *allconstructors*))) - (setf (database-sourcefile dbstruct) (second item)) + (setf (|dbSourceFile| dbstruct) (second item)) (setf (|dbConstructorForm| dbstruct) (third item)) (setf (database-documentation dbstruct) (fourth item)) (setf (|dbAttributes| dbstruct) (fifth item)) @@ -719,7 +719,7 @@ (sourcefile (setq stream *browse-stream*) (when struct - (setq data (database-sourcefile struct)))) + (setq data (|dbSourceFile| struct)))) (constructorform (setq stream *browse-stream*) (when struct @@ -791,7 +791,7 @@ (dependents (setf (database-dependents struct) data)) (sourcefile - (setf (database-sourcefile struct) data)))) + (setf (|dbSourceFile| struct) data)))) (case key ; fixup the special cases (sourcefile (when (and data (string= (directory-namestring data) "") @@ -922,11 +922,11 @@ (fetchdata alist in "constructorModemap")) (setf (|dbModemaps| dbstruct) (fetchdata alist in "modemaps")) - (setf (database-sourcefile dbstruct) + (setf (|dbSourceFile| dbstruct) (fetchdata alist in "sourceFile")) (when make-database? - (setf (database-sourcefile dbstruct) - (file-namestring (database-sourcefile dbstruct)))) + (setf (|dbSourceFile| dbstruct) + (file-namestring (|dbSourceFile| dbstruct)))) (setf (|dbConstructorKind| dbstruct) (setq kind (fetchdata alist in "constructorKind"))) (setf (|dbCategory| dbstruct) @@ -1222,7 +1222,7 @@ (let (struct) (setq struct (|constructorDB| constructor)) ; sourcefile is small. store the string directly - (setq src (database-sourcefile struct)) + (setq src (|dbSourceFile| struct)) (setq formpos (file-position out)) (print (|squeezeCopy| (|dbConstructorForm| struct)) out) (finish-output out) diff --git a/src/interp/define.boot b/src/interp/define.boot index 5e46a464..719f81e8 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -945,8 +945,6 @@ compDefineCategory1(df is ['DEF,form,sig,body],m,e,prefix,fal) == T := compDefine1(mkCategoryPackage(form,cat,categoryCapsule),$EmptyMode,e) or return stackSemanticError( ['"cannot compile defaults of",:bright opOf form],nil) - if $compileDefaultsOnly then - [d,m,e] := T [d,m,e] makeCategoryPredicates(form,u) == @@ -1144,8 +1142,7 @@ compDefineCategory(df,m,e,prefix,fal) == kind := dbConstructorKind db kind ~= "category" => throwKeyedMsg("S2IC0016",[ctor,"category",kind]) dbConstructorForm(db) := lhs - $insideFunctorIfTrue or $compileDefaultsOnly => - compDefineCategory1(df,m,e,prefix,fal) + $insideFunctorIfTrue => compDefineCategory1(df,m,e,prefix,fal) compDefineLisplib(df,m,e,prefix,fal,'compDefineCategory1) @@ -1390,6 +1387,7 @@ compDefineFunctor1(df is ['DEF,form,signature,body], dbFormalSubst(db) := pairList(form.args,$FormalMapVariableList) dbTemplate(db) := nil dbLookupFunction(db) := nil + dbCapsuleDefinitions(db) := nil deduceImplicitParameters(db,$e) $formalArgList:= [:argl,:$formalArgList] -- all defaulting packages should have caching turned off diff --git a/src/interp/g-cndata.boot b/src/interp/g-cndata.boot index ccf402ce..f1f98eb5 100644 --- a/src/interp/g-cndata.boot +++ b/src/interp/g-cndata.boot @@ -84,18 +84,17 @@ constructor? name == domainForm?: %Form -> %Boolean domainForm? d == - getConstructorKindFromDB opOf d = "domain" + getConstructorKindFromDB opOf d is "domain" packageForm?: %Form -> %Boolean packageForm? d == - getConstructorKindFromDB opOf d = "package" + getConstructorKindFromDB opOf d is "package" categoryFrom?: %Form -> %Boolean categoryForm? c == op := opOf c builtinCategoryName? op => true - getConstructorKindFromDB op is "category" => true - false + getConstructorKindFromDB op is "category" -- probably will switch over to 'libName soon getLisplibName(c) == getConstructorAbbreviation(c) diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot index 49fa50cf..32e00181 100644 --- a/src/interp/lisplib.boot +++ b/src/interp/lisplib.boot @@ -410,29 +410,28 @@ compDefineLisplib(df:=["DEF",[op,:.],:.],m,e,prefix,fal,fn) == --fn= compDefineCategory1 OR compDefineFunctor1 sayMSG fillerSpaces(72,char "-") $op: local := op - dbPredicates(constructorDB op) := nil + db := constructorDB op + dbPredicates(db) := nil $lisplibOperationAlist: local := nil $libFile: local := nil --- $lisplibRelatedDomains: local := nil --from ++ Related Domains: see c-doc --for categories, is rhs of definition; otherwise, is target of functor --will eventually become the "constructorCategory" property in lisplib --set in compDefineCategory1 if category, otherwise in finalizeLisplib - libName := getConstructorAbbreviation op + libName := dbAbbreviation db + if dbSourceFile db = nil then + dbSourceFile(db) := namestring _/EDITFILE $compileDocumentation => compileDocumentation(op,libName) sayMSG ['" initializing ",$spadLibFT,:bright libName, '"for",:bright op] initializeLisplib libName sayMSG ['" compiling into ",$spadLibFT,:bright libName] - -- res:= FUNCALL(fn,df,m,e,prefix,fal) - -- sayMSG ['" finalizing ",$spadLibFT,:bright libName] - -- finalizeLisplib libName -- following guarantee's compiler output files get closed. ok := false; try res:= FUNCALL(fn,df,m,e,prefix,fal) - leaveIfErrors(libName,dbConstructorKind constructorDB $op) + leaveIfErrors(libName,dbConstructorKind db) sayMSG ['" finalizing ",$spadLibFT,:bright libName] - ok := finalizeLisplib(op,libName) + ok := finalizeLisplib(db,libName) finally RSHUT $libFile if ok then lisplibDoRename(libName) filearg := $FILEP(libName,$spadLibFT,$libraryDirectory) @@ -441,7 +440,7 @@ compDefineLisplib(df:=["DEF",[op,:.],:.],m,e,prefix,fal,fn) == sayMSG fillerSpaces(72,char "-") unloadOneConstructor op $buildingSystemAlgebra => res - LOCALDATABASE([symbolName getConstructorAbbreviationFromDB op],nil) + LOCALDATABASE([symbolName dbAbbreviation db],nil) $newConlist := [op, :$newConlist] ----------> bound in function "compiler" res @@ -487,46 +486,54 @@ writeLookupFunction(db,file) == 'lookupFunction,'dbLookupFunction,file) nil -writeKind(ctor,kind,file) == - writeInfo(ctor,kind,'constructorKind,'dbConstructorKind,file) +writeKind(db,file) == + writeInfo(dbConstructor db,dbConstructorKind db, + 'constructorKind,'dbConstructorKind,file) writeAbbreviation(db,file) == writeInfo(dbConstructor db,dbAbbreviation db, 'abbreviation,'dbAbbreviation,file) -writeConstructorForm(ctor,form,file) == - writeInfo(ctor,form,'constructorForm,'dbConstructorForm,file) +writeConstructorForm(db,file) == + writeInfo(dbConstructor db,dbConstructorForm db, + 'constructorForm,'dbConstructorForm,file) -writeCategory(ctor,cat,file) == - writeInfo(ctor,cat,'constructorCategory,'dbCategory,file) +writeCategory(db,file) == + writeInfo(dbConstructor db,dbCategory db, + 'constructorCategory,'dbCategory,file) -writeSuperDomain(ctor,domPred,file) == - writeInfo(ctor,domPred,'superDomain,'dbSuperDomain,file) +writeSuperDomain(db,file) == + writeInfo(dbConstructor db,dbSuperDomain db, + 'superDomain,'dbSuperDomain,file) -writePredicates(ctor,preds,file) == - writeInfo(ctor,preds,'predicates,'dbPredicates,file) +writePredicates(db,file) == + writeInfo(dbConstructor db,dbPredicates db, + 'predicates,'dbPredicates,file) writeOperations(ctor,ops,file) == writeInfo(ctor,ops,'operationAlist,'dbOperations,file) -writeAttributes(ctor,ats,file) == - writeInfo(ctor,ats,'attributes,'dbAttributes,file) +writeAttributes(db,file) == + writeInfo(dbConstructor db,dbAttributes db, + 'attributes,'dbAttributes,file) -writeConstructorModemap(ctor,mm,file) == - writeInfo(ctor,mm,'constructorModemap,'dbConstructorModemap,file) +writeConstructorModemap(db,file) == + writeInfo(dbConstructor db,dbConstructorModemap db, + 'constructorModemap,'dbConstructorModemap,file) writeDualSignature(db,file) == writeInfo(dbConstructor db,dbDualSignature db, 'dualSignature,'dbDualSignature,file) -writeAncestors(ctor,x,file) == - writeInfo(ctor,x,'ancestors,'dbAncestors,file) +writeAncestors(db,file) == + writeInfo(dbConstructor db,dbAncestors db,'ancestors,'dbAncestors,file) -writePrincipals(ctor,x,file) == - writeInfo(ctor,x,'parents,'dbPrincipals,file) +writePrincipals(db,file) == + writeInfo(dbConstructor db,dbPrincipals db,'parents,'dbPrincipals,file) -writeCapsuleLevelDefinitions(ctor,x,file) == - writeInfo(ctor,x,'signaturesAndLocals,'dbCapsuleDefinitions,file) +writeCapsuleLevelDefinitions(db,file) == + writeInfo(dbConstructor db,dbCapsuleDefinitions db, + 'signaturesAndLocals,'dbCapsuleDefinitions,file) ++ If compilation produces an error, issue inform user and ++ return to toplevel reader. @@ -537,41 +544,39 @@ leaveIfErrors(libName,kind) == spadThrow() ++ Finalize `libName' compilation; returns true if everything is OK. -finalizeLisplib(ctor,libName) == - db := constructorDB ctor - kind := dbConstructorKind db +finalizeLisplib(db,libName) == form := dbConstructorForm db - mm := getConstructorModemap ctor writeTemplate(db,$libFile) writeLookupFunction(db,$libFile) - writeConstructorForm(ctor,form,$libFile) - writeKind(ctor,kind,$libFile) - writeConstructorModemap(ctor,mm,$libFile) + writeConstructorForm(db,$libFile) + writeKind(db,$libFile) + writeConstructorModemap(db,$libFile) writeDualSignature(db,$libFile) - -- set to target of mm for package/domain constructors; + -- set to target of dbConstructorModemap for package/domain constructors; -- to the right-hand sides (the definition) for category constructors if dbConstructorKind db = 'category then - writeCategory(ctor,dbCategory db,$libFile) - lisplibWrite('"sourceFile",namestring _/EDITFILE,$libFile) + writeCategory(db,$libFile) + lisplibWrite('"sourceFile",dbSourceFile db,$libFile) lisplibWrite('"modemaps",dbModemaps db,$libFile) opsAndAtts := - kind = 'category => getCategoryOpsAndAtts form - getFunctorOpsAndAtts(form,mm.mmTarget) - writeOperations(ctor,first opsAndAtts,$libFile) - if kind='category then + dbConstructorKind db = 'category => getCategoryOpsAndAtts db + getFunctorOpsAndAtts db + writeOperations(dbConstructor db,first opsAndAtts,$libFile) + if dbConstructorKind db = 'category then $NRTslot1PredicateList : local := [] NRTgenInitialAttributeAlist(db,rest opsAndAtts) - writeSuperDomain(ctor,dbSuperDomain db,$libFile) - writeCapsuleLevelDefinitions(ctor,dbCapsuleDefinitions db,$libFile) - writeAttributes(ctor,dbAttributes db,$libFile) - writePredicates(ctor,dbPredicates db,$libFile) + writeSuperDomain(db,$libFile) + writeCapsuleLevelDefinitions(db,$libFile) + writeAttributes(db,$libFile) + writePredicates(db,$libFile) writeAbbreviation(db,$libFile) - writePrincipals(ctor,dbPrincipals db,$libFile) - writeAncestors(ctor,dbAncestors db,$libFile) + writePrincipals(db,$libFile) + writeAncestors(db,$libFile) if not $bootStrapMode then - lisplibWrite('"documentation",finalizeDocumentation ctor,$libFile) + lisplibWrite('"documentation", + finalizeDocumentation dbConstructor db,$libFile) if $profileCompiler then profileWrite() - leaveIfErrors(libName,kind) + leaveIfErrors(libName,dbConstructorKind db) true lisplibDoRename(libName) == @@ -590,14 +595,15 @@ getPartialConstructorModemapSig(c) == (s := getConstructorSignature c) => rest s throwEvalTypeMsg("S2IL0015",[c]) -getCategoryOpsAndAtts(catForm) == +getCategoryOpsAndAtts db == + catForm := dbConstructorForm db -- returns [operations,:attributes] of first catForm [transformOperationAlist getSlotFromCategoryForm(catForm,1), :getSlotFromCategoryForm(catForm,2)] -getFunctorOpsAndAtts(form,target) == +getFunctorOpsAndAtts db == [transformOperationAlist $lisplibOperationAlist, - :getSlotFromFunctor target] + :getSlotFromFunctor dbConstructorModemap(db).mmTarget] getSlotFromFunctor(target) == t := compMakeCategoryObject(target,$e) or diff --git a/src/interp/sys-driver.boot b/src/interp/sys-driver.boot index 1a097549..b19aa5cf 100644 --- a/src/interp/sys-driver.boot +++ b/src/interp/sys-driver.boot @@ -176,7 +176,11 @@ restart() == initializeDatabases firstTime? == getOptionValue "build-initdb" => nil - initdb := getOptionValue "initial-db" => populateDBFromFile initdb + --initdb := getOptionValue "initial-db" => populateDBFromFile initdb + --FIXME: Ideally we should execute the previous line. The next line is + --FIXME: a short-term stopgap until build dependencies are in place. + if initdb := getOptionValue "initial-db" then + populateDBFromFile initdb not firstTime? => openDatabases() fillDatabasesInCore() mkLowerCaseConTable() @@ -196,7 +200,6 @@ initializeGlobalState() == $buildingSystemAlgebra := getOptionValue "system-algebra" $verbose := getOptionValue "verbose" $bootStrapMode := getOptionValue "bootstrap" - $compileDefaultsOnly := getOptionValue "defaults-only" $reportOptimization := getOptionValue "show-insn" $optimizeRep := getOptionValue "inline-rep" setCompilerOptimizations(getOptionValue "optimize" or diff --git a/src/interp/sys-globals.boot b/src/interp/sys-globals.boot index 86fcf9cf..5304caea 100644 --- a/src/interp/sys-globals.boot +++ b/src/interp/sys-globals.boot @@ -428,11 +428,6 @@ $buildingSystemAlgebra := false ++ code generation, etc. $verbose := true -++ True if the compiler is invoked to produce implementation -++ of category defaults only. This is meaningful only when -++ compiling categories. -$compileDefaultsOnly := false - ++ True if we should consider the representation domain (`Rep') ++ as candidate for inlining, for the purpose of reducing ++ abstraction penalty. |