aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-05-30 13:30:19 +0000
committerdos-reis <gdr@axiomatics.org>2013-05-30 13:30:19 +0000
commitfcc96dd42a7374ad2fb44b16fa7198df4aeec8b8 (patch)
treeecd05082b6af229875208c51f69de3b7fe2b1a6c /src
parent13aab01d2e79671ac648645ff1c32ddf23d7947e (diff)
downloadopen-axiom-fcc96dd42a7374ad2fb44b16fa7198df4aeec8b8.tar.gz
Change backend code emitters to take a %Libname parameter
Diffstat (limited to 'src')
-rw-r--r--src/interp/c-util.boot12
-rw-r--r--src/interp/define.boot8
-rw-r--r--src/interp/lisp-backend.boot6
-rw-r--r--src/interp/lisplib.boot4
4 files changed, 15 insertions, 15 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 2c66f487..12aa3654 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1314,18 +1314,18 @@ clearReplacement name ==
property(name,"SPADreplace") := nil
property(name,'%redex) := nil
-evalAndPrintBackendStmt(db,stmt) ==
+evalAndPrintBackendStmt(lib,stmt) ==
eval stmt
- printBackendStmt(db,stmt)
+ printBackendStmt(lib,stmt)
++ Register the inlinable form of a function.
registerFunctionReplacement(db,name,body) ==
- evalAndPrintBackendStmt(db,
+ evalAndPrintBackendStmt(dbLibstream db,
["PUT",MKQ name,MKQ "SPADreplace",quoteMinimally body])
++ Remember the redex form of this function
registerRedexForm(db,name,parms,body) ==
- evalAndPrintBackendStmt(db,
+ evalAndPrintBackendStmt(dbLibstream db,
["PUT",quote name,quote '%redex,quote ['ILAM,parms,body]])
++ Retrieve the redex form of the function `name'.
@@ -1502,7 +1502,7 @@ setCompilerOptimizations level ==
++ Note that all capsule functions take an additional argument
++ standing for the domain of computation object.
proclaimCapsuleFunction(db,op,sig) ==
- printBackendStmt(db,
+ printBackendStmt(dbLibstream db,
["DECLAIM",["FTYPE",
["FUNCTION",[:[vmType first d for d in tails rest sig],"%Shell"],
vmType first sig],op]]) where
@@ -1557,7 +1557,7 @@ backendCompileSPADSLAM(db,name,args,body) ==
["PROGN",["SETQ",g2,app],
["SETQ",al,["cons5",["CONS",key,g2],al]],g2]]]]
-- define the global cache.
- evalAndPrintBackendStmt(db,['DEFPARAMETER,al,nil])
+ evalAndPrintBackendStmt(dbLibstream db,['DEFPARAMETER,al,nil])
assembleCode [auxfn,["LAMBDA",args,:body]]
assembleCode [name,["LAMBDA",args,code]]
diff --git a/src/interp/define.boot b/src/interp/define.boot
index c32f3ece..829faec9 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -1200,7 +1200,7 @@ compDefineCategory(df,m,e,fal) ==
dbClearForCompilation! db
dbConstructorForm(db) := lhs
dbCompilerData(db) := makeCompilationData()
- $backend: local := function(x +-> printBackendStmt(db,x))
+ $backend: local := function(x +-> printBackendStmt(dbLibstream db,x))
try
$insideFunctorIfTrue => compDefineCategory1(db,df,m,e,fal)
compDefineLisplib(db,df,m,e,fal,'compDefineCategory1)
@@ -1449,7 +1449,7 @@ compDefineFunctor(df,m,e,fal) ==
dbClearForCompilation! db
dbConstructorForm(db) := form
dbCompilerData(db) := makeCompilationData()
- $backend: local := function(x +-> printBackendStmt(db,x))
+ $backend: local := function(x +-> printBackendStmt(dbLibstream db,x))
try compDefineLisplib(db,df,m,e,fal,'compDefineFunctor1)
finally dbCompilerData(db) := nil
@@ -1555,7 +1555,7 @@ compDefineFunctor1(db,df is ['DEF,form,signature,body],m,$e,$formalArgList) ==
--either lookupComplete (for forgetful guys) or lookupIncomplete
$NRTslot1PredicateList :=
[simpBool x for x in $NRTslot1PredicateList]
- printBackendStmt(db,
+ printBackendStmt(dbLibstream db,
['MAKEPROP,MKQ $op,''infovec,getInfovecCode(db,$e)])
$lisplibOperationAlist:= operationAlist
[fun,['Mapping,:signature'],originale]
@@ -2161,7 +2161,7 @@ compileConstructor1(db,form:=[fn,[key,vl,:bodyl]]) ==
++ Subroutine of compileConstructor1. Called to compile the body
++ of a category constructor definition.
compAndDefine(db,l) ==
- $backend: local := function(x +-> evalAndPrintBackendStmt(db,x))
+ $backend: local := function(x +-> evalAndPrintBackendStmt(dbLibstream db,x))
backendCompile(db,l)
compHash(db,op,argl,body) ==
diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot
index c141ab6e..a2d89607 100644
--- a/src/interp/lisp-backend.boot
+++ b/src/interp/lisp-backend.boot
@@ -44,7 +44,7 @@ namespace BOOT
module lisp_-backend where
expandToVMForm: %Thing -> %Thing
eval: %Thing -> %Thing
- printBackendStmt: (%Database,%Code) -> %Void
+ printBackendStmt: (%Libstream,%Code) -> %Void
transformToBackendCode: %Form -> %Code
@@ -827,8 +827,8 @@ assembleCode x ==
else COMP370 x
first x
-printBackendStmt(db,stmt) ==
- st := dbCodeStream db
+printBackendStmt(lib,stmt) ==
+ st := libCodeStream lib
PRINT_-FULL(stmt,st)
flushOutput st
diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
index d7dab273..b6924f39 100644
--- a/src/interp/lisplib.boot
+++ b/src/interp/lisplib.boot
@@ -456,14 +456,14 @@ mkCtorDBForm db ==
writeInfo(db,info,key,prop) ==
if info ~= nil then
insn := ['%store,[prop,mkCtorDBForm db],quote info]
- printBackendStmt(db,expandToVMForm insn)
+ printBackendStmt(dbLibstream db,expandToVMForm insn)
lisplibWrite(symbolName key,info,dbLibstream db)
++ Like writeInfo, but only write to the load unit.
writeLoadInfo(db,info,key,prop) ==
info = nil => nil
insn := ['%store,[prop,mkCtorDBForm db],info]
- printBackendStmt(db,expandToVMForm insn)
+ printBackendStmt(dbLibstream db,expandToVMForm insn)
writeTemplate db ==
dbConstructorKind db = 'category => nil