aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-11-11 07:37:32 +0000
committerdos-reis <gdr@axiomatics.org>2011-11-11 07:37:32 +0000
commit4ece7665979e34249e9779850aa15d4a88f41e6e (patch)
tree205b42d98dd4f8125fbe97f75507734b6e9b0b5b /src/interp
parent218672555b561f73b25f07168d16b24c56a494d4 (diff)
downloadopen-axiom-4ece7665979e34249e9779850aa15d4a88f41e6e.tar.gz
* interp/c-util.boot (dbByteList): New accessor macro.
* interp/define.boot ($byteVec): Remove. (getInfovecCode): Do not bind it. (makeGoGetSlot): Take DB as first parameter. Adjust caller. Update dbByteList. (NRTmakeCategoryAlist): Adjust.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot10
-rw-r--r--src/interp/define.boot18
2 files changed, 16 insertions, 12 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 3480c03b..a5369444 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -135,12 +135,13 @@ macro domainData d ==
--% Constructor Compilation Data.
--% Operational Semantics:
--% structure CompilationData ==
---% Record(formalSubst: Substitution,implicits: List Identifier)
+--% Record(formalSubst: Substitution,implicits: List Identifier,
+--% byteList: List SingleInteger)
--%
++ Make a fresh compilation data structure.
makeCompilationData() ==
- [nil,nil]
+ [nil,nil,nil]
++ Subsitution that replaces parameters with formals.
macro dbFormalSubst db ==
@@ -156,6 +157,11 @@ dbParameters db ==
macro dbImplicitData db ==
second dbCompilerData db
+++ Return the list of encoding bytes for a function during elaboration.
+++ Transcient data.
+macro dbByteList db ==
+ third dbCompilerData db
+
++ Return the existential substitution of `db'.
dbQuerySubst db ==
x := dbImplicitData db => first x
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 3212979b..d3c56105 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -75,7 +75,6 @@ $NRTattributeAlist := []
$NRTdeltaListComp := []
$signature := nil
$byteAddress := nil
-$byteVec := nil
$sigAlist := []
$predAlist := []
$argumentConditionList := []
@@ -344,7 +343,6 @@ chaseInferences(pred,$e) ==
--=======================================================================
++ Called by compDefineFunctor1 to create infovec at compile time
getInfovecCode(db,e) ==
- $byteVec: local := nil
$byteAddress: local := 0
['LIST,
MKQ makeDomainTemplate db,
@@ -365,18 +363,18 @@ makeDomainTemplate db ==
item = nil => nil
domainRef(vec,index) :=
item isnt [.,:.] => item
- cons? first item => makeGoGetSlot(item,index)
+ cons? first item => makeGoGetSlot(db,item,index)
item
- $byteVec := "append"/reverse! $byteVec
+ dbByteList(db) := "append"/reverse! dbByteList db
vec
-makeGoGetSlot(item,index) ==
+makeGoGetSlot(db,item,index) ==
--NOTES: creates byte vec strings for LATCH slots
---these parts of the $byteVec are created first; see also makeCompactDirect
+--these parts of the dbByteList are created first; see also makeCompactDirect
[sig,whereToGo,op,:flag] := item
n := #sig - 1
newcode := [n,whereToGo,:makeCompactSigCode sig,index]
- $byteVec := [newcode,:$byteVec]
+ dbByteList(db) := [newcode,:dbByteList db]
curAddress := $byteAddress
$byteAddress := $byteAddress + n + 4
[curAddress,:op]
@@ -391,7 +389,7 @@ makeCompactDirect(db,u) ==
[nam,[addForm,:opList]] := u
--pp opList
d := [[op,y] for [op,:items] in opList | y := makeCompactDirect1(db,op,items)]
- $byteVec := [:$byteVec,:"append"/reverse! $byteVecAcc]
+ dbByteList(db) := [:dbByteList db,:"append"/reverse! $byteVecAcc]
vector("append"/d)
makeCompactDirect1(db,op,items) ==
@@ -487,11 +485,11 @@ NRTmakeCategoryAlist(db,e) ==
predList := ASSOCRIGHT slot1 --is list of predicate indices
maxPredList := "MAX"/predList
catformvec := ASSOCLEFT slot1
- maxElement := "MAX"/$byteVec
+ maxElement := "MAX"/dbByteList db
['CONS, ['makeByteWordVec2,MAX(maxPredList,1),MKQ predList],
['CONS, MKQ vector slot0,
['CONS, MKQ vector [encodeCatform x for x in catformvec],
- ['makeByteWordVec2,maxElement,MKQ $byteVec]]]]
+ ['makeByteWordVec2,maxElement,MKQ dbByteList db]]]]
--NOTE: this is new form: old form satisfies vector? CDDR form
encodeCatform x ==