aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-02-24 18:06:28 +0000
committerdos-reis <gdr@axiomatics.org>2011-02-24 18:06:28 +0000
commit1f68c8c90efaf97535bfc1bfc99cad368213870e (patch)
treeb58a560a5e83f5dc73b3e5443e3a8bcabf5d0f19 /src/interp
parent04608dfa938b011bce60031e7eccfb6cb67c2ced (diff)
downloadopen-axiom-1f68c8c90efaf97535bfc1bfc99cad368213870e.tar.gz
* interp/sys-macros.lisp (shellEntry): New.
* interp/g-util.boot (setShellEntry): Remove. * interp/compiler.boot: Use %store to %tref forms instead of setHSellEntry. * interp/define.boot: Likewise. * interp/functor.boot: Likewise. * interp/nruncomp.boot: Likewise. * interp/nrunfast.boot: Likewise. * interp/showimp.boot: Likewise. * interp/c-util.boot (isSimple): Tidy. (isSideEffectFree): Likewise. (updateCapsuleDirectory): Likewise.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot13
-rw-r--r--src/interp/compiler.boot2
-rw-r--r--src/interp/define.boot8
-rw-r--r--src/interp/functor.boot32
-rw-r--r--src/interp/g-util.boot6
-rw-r--r--src/interp/i-eval.boot2
-rw-r--r--src/interp/lisp-backend.boot2
-rw-r--r--src/interp/nruncomp.boot10
-rw-r--r--src/interp/nrunfast.boot2
-rw-r--r--src/interp/showimp.boot4
-rw-r--r--src/interp/sys-macros.lisp3
-rw-r--r--src/interp/wi1.boot4
-rw-r--r--src/interp/wi2.boot5
13 files changed, 41 insertions, 52 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 9d081520..0034fce3 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -692,12 +692,11 @@ isDomainInScope(domain,e) ==
isSimple x ==
atomic? x => true
- constructor? x.op or
- isSideEffectFree x.op and (and/[isSimple y for y in x.args])
+ isSideEffectFree x.op and (and/[isSimple y for y in x.args])
isSideEffectFree op ==
- member(op,$SideEffectFreeFunctionList) or op is ["elt",.,op'] and
- isSideEffectFree op'
+ op is ["elt",.,op'] => isSideEffectFree op'
+ member(op,$SideEffectFreeFunctionList)
isAlmostSimple x ==
--returns (<new predicate> . <list of assignments>) or nil
@@ -1047,9 +1046,9 @@ getCapsuleDirectoryEntry slot ==
updateCapsuleDirectory(item,pred) ==
pred ~= true => nil
entry :=
- item is ["$",slot,["CONS",["dispatchFunction",fun],:.],:.] => [slot,:fun]
- item is ["$",slot,["CONS","IDENTITY",
- ["FUNCALL",["dispatchFunction",fun],"$"]]] => [slot,:fun]
+ item is [['$,slot],['CONS,['dispatchFunction,fun],:.],:.] => [slot,:fun]
+ item is [['$,slot],['CONS,'IDENTITY,
+ ['FUNCALL,['dispatchFunction,fun],'$]]] => [slot,:fun]
nil
entry = nil => nil
$capsuleDirectory := [entry,:$capsuleDirectory]
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index ea2becbf..51254152 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -830,7 +830,7 @@ setqSingle(id,val,m,E) ==
--all we do now is to allocate a slot number for lhs
--e.g. the %LET form below will be changed by putInLocalDomainReferences
form :=
- k := NRTassocIndex(id) => ["setShellEntry","$",k,x]
+ k := NRTassocIndex(id) => ['%store,['%tref,'$,k],x]
["%LET",id,x]
[form,m',e']
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 1d41c54e..c0ede0fa 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -73,7 +73,6 @@ $lisplibCategory := nil
$lisplibAncestors := nil
$lisplibAbbreviation := nil
$CheckVectorList := []
-$setelt := nil
$pairlis := []
$functorTarget := nil
$condAlist := []
@@ -513,7 +512,7 @@ compDefineCategory2(form,signature,specialCases,body,m,e,
[['devaluate,u] for u in sargl]]],body]
body:=
["%bind",[[g:= gensym(),body]],
- ["setShellEntry",g,0,mkConstructor $form],g]
+ ['%store,['%tref,g,0],mkConstructor $form],g]
fun:= compile [op',["LAM",sargl,body]]
-- 5. give operator a 'modemap property
@@ -630,7 +629,6 @@ compDefineFunctor1(df is ['DEF,form,signature,nils,body],
$CheckVectorList: local := nil
$getDomainCode: local := nil -- code for getting views
$insideFunctorIfTrue: local:= true
- $setelt: local := "setShellEntry"
$genSDVar: local:= 0
originale:= $e
[$op,:argl]:= form
@@ -1494,9 +1492,9 @@ doIt(item,$predl) ==
if $optimizeRep then
registerInlinableDomain($Representation,$e)
code is ["%LET",:.] =>
- item.op := "setShellEntry"
+ item.op := '%store
rhsCode := rhs'
- item.rest := ['$,NRTgetLocalIndex lhs,rhsCode]
+ item.args := [['%tref,'$,NRTgetLocalIndex lhs],rhsCode]
item.op := code.op
item.rest := rest code
item is [":",a,t] => [.,.,$e]:= compOrCroak(item,$EmptyMode,$e)
diff --git a/src/interp/functor.boot b/src/interp/functor.boot
index c75d34da..213fc733 100644
--- a/src/interp/functor.boot
+++ b/src/interp/functor.boot
@@ -303,7 +303,7 @@ setVector0(catNames,definition) ==
--to the definition of the category
definition:= mkTypeForm definition
for u in catNames repeat
- definition:= ["setShellEntry",u,0,definition]
+ definition:= ['%store,['%tref,u,0],definition]
definition
setVector12 args ==
@@ -363,7 +363,7 @@ setVector3(name,instantiator) ==
--element 3 is data structure representing category
--returns a single LISP statement
instantiator is ['DomainSubstitutionMacro,.,body] => setVector3(name,body)
- ["setShellEntry",name,3,mkTypeForm instantiator]
+ ['%store,['%tref,name,3],mkTypeForm instantiator]
mkDomainFormer x ==
if x is ['DomainSubstitutionMacro,parms,body] then
@@ -397,7 +397,7 @@ setVector5(catNames,locals) ==
else generated:= [[u,uname],:generated]
[(w:= mkVectorWithDeferral(first u,second u);
for v in rest u repeat
- w:= ["setShellEntry",v,5,w];
+ w:= ['%store,['%tref,v,5],w];
w)
for u in generated]
@@ -408,10 +408,7 @@ mkVectorWithDeferral(objects,tag) ==
['%vector,:
[if CONTAINED('$,u) then -- It's not safe to instantiate this now
$ConstantAssignments:=[:$ConstantAssignments,
- ["setShellEntry",
- ["getShellEntry", tag, 5],
- count,
- u]]
+ ['%store,['%tref,['%tref,tag,5],count],u]]
[]
else u
for u in objects for count in 0..]]
@@ -463,7 +460,7 @@ DescendCodeAdd1(base,flag,target,formalArgs,formalArgModes) ==
code.op in '(getShellEntry ELT) =>
copyvec.(third code):=union(copyvec.(third code), sofar)
true
- code is ['setShellEntry,name,number,u'] =>
+ code is ['%store,['%tref,name,number],u'] =>
update(u',copyvec,[[name,:number],:sofar])
for i in 6..n repeat
for u in copyvec.i repeat
@@ -482,7 +479,7 @@ DescendCodeAdd1(base,flag,target,formalArgs,formalArgModes) ==
v:=["getShellEntry",instantiatedBase,i]
for u in copyvec.i repeat
[name,:count]:=u
- v:=["setShellEntry",name,count,v]
+ v:=['%store,['%tref,name,count],v]
code:=[v,:code]
[["%LET",instantiatedBase,base],:code]
@@ -528,7 +525,7 @@ DescendCode(code,flag,viewAssoc,EnvToPass) ==
u:=member(name,$locals) =>
CONTAINED('$,body) and isDomainForm(body,$e) =>
--instantiate domains which depend on $ after constants are set
- code:=["setShellEntry",["getShellEntry",'$,5],#$locals-#u,code]
+ code:=['%store,['%tref,['%tref,'$,5],#$locals-#u],code]
$epilogue:=
TruthP flag => [code,:$epilogue]
[['%when,[ProcessCond flag,code]],:$epilogue]
@@ -542,12 +539,12 @@ DescendCode(code,flag,viewAssoc,EnvToPass) ==
u:= LASSOC(dom,viewAssoc) => ['getDomainView,dom,u]
dom
body:= ['CONS,implem,dom]
- u:= SetFunctionSlots(sig,body,flag,'original)
+ u := SetFunctionSlots(sig,body,flag,'original)
-- ??? We do not resolve default definitions, yet.
if not $insideCategoryPackageIfTrue then
- updateCapsuleDirectory(rest u, flag)
+ updateCapsuleDirectory([second(u).args,third u],flag)
ConstantCreator u =>
- if flag ~=true then u:= ['%when,[ProcessCond flag,u]]
+ if flag ~= true then u:= ['%when,[ProcessCond flag,u]]
$ConstantAssignments:= [u,:$ConstantAssignments]
nil
u
@@ -557,14 +554,13 @@ DescendCode(code,flag,viewAssoc,EnvToPass) ==
code is ['devaluate,:.] => nil
code is ['MDEF,:.] => nil
code is ['%call,:.] => code
- code is ["setShellEntry",:.] => code -- can be generated by doItIf
+ code is ['%store,:.] => code -- can be generated by doItIf
stackWarning('"unknown Functor code: %1 ",[code])
code
ConstantCreator u ==
null u => false
- u is ['setShellEntry,.,.,u'] =>
- ConstantCreator u'
+ u is ['%store,['%tref,.,.],u'] => ConstantCreator u'
u is ['CONS,:.] => false
true
@@ -593,7 +589,7 @@ SetFunctionSlots(sig,body,flag,mode) == --mode is either "original" or "adding"
catImplem is [q,.,index] and (q='ELT or q='CONST) =>
if q is 'CONST and body is ['CONS,a,b] then
body := ['CONS,'IDENTITY,['FUNCALL,a,b]]
- body:= ['setShellEntry,'$,index,body]
+ body:= ['%store,['%tref,'$,index],body]
not vector? $SetFunctions => nil --packages don't set it
if TruthP flag then -- unconditionally defined function
u.index := true
@@ -608,7 +604,7 @@ SetFunctionSlots(sig,body,flag,mode) == --mode is either "original" or "adding"
truename is [fn,:.] and fn in '(Zero One) => nil --hack by RDJ 8/90
body := SetFunctionSlots(truename,body,nil,mode)
keyedSystemError("S2OR0002",[catImplem])
- body is ['setShellEntry,:.] => body
+ body is ['%store,:.] => body
nil
LookUpSigSlots(sig,siglist) ==
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 17b6d459..9e0d7126 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -901,11 +901,5 @@ newShell: %Short -> SIMPLE_-ARRAY
newShell n ==
MAKE_-ARRAY(n,KEYWORD::INITIAL_-ELEMENT,nil)
-++ sets the nth nth entry of a domain shell to an item.
-setShellEntry: (%Shell,%Short,%Thing) -> %Thing
-setShellEntry(s,i,t) ==
- SVREF(s,i) := t
-
-
-- Push into the BOOT package when invoked in batch mode.
AxiomCore::$sysScope := '"BOOT"
diff --git a/src/interp/i-eval.boot b/src/interp/i-eval.boot
index f9c39d4f..ef02faf9 100644
--- a/src/interp/i-eval.boot
+++ b/src/interp/i-eval.boot
@@ -42,7 +42,7 @@ $noEvalTypeMsg := nil
evalDomain form ==
startTimingProcess 'instantiation
newType? form => form
- form is ['setShellEntry,:.] => eval form
+ form is ['%store,:.] => eval form
result := eval mkEvalable form
stopTimingProcess 'instantiation
result
diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot
index 4a711f50..637e1629 100644
--- a/src/interp/lisp-backend.boot
+++ b/src/interp/lisp-backend.boot
@@ -583,7 +583,7 @@ for x in [
-- general utility
['%hash, :'SXHASH],
['%equal, :'EQUAL],
- ['%tref, :'getShellEntry],
+ ['%tref, :'shellEntry],
['%sptreq, :'EQL], -- system pointer equality
['%lam, :'LAMBDA],
['%leave, :'RETURN],
diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot
index d98c966f..408ee6c8 100644
--- a/src/interp/nruncomp.boot
+++ b/src/interp/nruncomp.boot
@@ -365,7 +365,7 @@ consDomainForm(x,dc) ==
NRTdescendCodeTran(u,condList) ==
null u => nil
u is ['%list] => nil
- u is ['setShellEntry,.,i,a] =>
+ u is ['%store,['%tref,.,i],a] =>
null condList and a is ['CONS,fn,:.] =>
u.first := '%list
u.rest := nil
@@ -472,11 +472,11 @@ buildFunctor($definition is [name,:args],sig,code,$locals,$e) ==
NRTdescendCodeTran(storeOperationCode,nil) --side effects storeOperationCode
codePart2:=
argStuffCode :=
- [[$setelt,'$,i,v] for i in $NRTbase.. for v in $FormalMapVariableList
+ [['%store,['%tref,'$,i],v] for i in $NRTbase.. for v in $FormalMapVariableList
for arg in args]
if MEMQ($NRTaddForm,$locals) then
addargname := $FormalMapVariableList.(POSN1($NRTaddForm,$locals))
- argStuffCode := [[$setelt,'$,5,addargname],:argStuffCode]
+ argStuffCode := [['%store,['%tref,'$,5],addargname],:argStuffCode]
[['stuffDomainSlots,'$],:argStuffCode,
:predBitVectorCode2,storeOperationCode]
@@ -492,8 +492,8 @@ buildFunctor($definition is [name,:args],sig,code,$locals,$e) ==
--CODE: part 1
codePart1:= [setVector0Code, slot3Code,:slamCode] where
- setVector0Code:=[$setelt,"$",0,"dv$"]
- slot3Code := [$setelt,"$",3,"pv$"]
+ setVector0Code:=['%store,['%tref,"$",0],"dv$"]
+ slot3Code := ['%store,['%tref,"$",3],"pv$"]
slamCode:=
isCategoryPackageName name => nil
[NRTaddToSlam($definition,"$")]
diff --git a/src/interp/nrunfast.boot b/src/interp/nrunfast.boot
index f0532e58..a51288f8 100644
--- a/src/interp/nrunfast.boot
+++ b/src/interp/nrunfast.boot
@@ -96,7 +96,7 @@ evalSlotDomain(u,dollar) ==
integer? u =>
y := dollar.u
vector? y => y
- y is ["setShellEntry",:.] => eval y
+ y is ['%store,:.] => eval y
--lazy domains need to marked; this is dangerous?
y is [v,:.] =>
vector? v => lazyDomainSet(y,dollar,u) --old style has [$,code,:lazyt]
diff --git a/src/interp/showimp.boot b/src/interp/showimp.boot
index 42164485..2708ab34 100644
--- a/src/interp/showimp.boot
+++ b/src/interp/showimp.boot
@@ -197,11 +197,11 @@ getDomainRefName(dom,nam) ==
not integer? nam => nam
slot := dom.nam
vector? slot => slot.0
- slot is ["setShellEntry",:.] =>
+ slot is ['%store,:.] =>
getDomainRefName(dom,getDomainSeteltForm slot)
slot
-getDomainSeteltForm ["setShellEntry",.,.,form] ==
+getDomainSeteltForm ['%store,.,form] ==
form is ['evalSlotDomain,u,d] => devaluateSlotDomain(u,d)
vector? form => systemError()
form
diff --git a/src/interp/sys-macros.lisp b/src/interp/sys-macros.lisp
index 0e2ec836..31aa11b7 100644
--- a/src/interp/sys-macros.lisp
+++ b/src/interp/sys-macros.lisp
@@ -1262,3 +1262,6 @@
(defmacro |getShellEntry| (dollar n)
`(svref ,dollar ,n))
+
+(defmacro |shellEntry| (dollar n)
+ `(svref ,dollar ,n))
diff --git a/src/interp/wi1.boot b/src/interp/wi1.boot
index 08de7a26..e71a9ece 100644
--- a/src/interp/wi1.boot
+++ b/src/interp/wi1.boot
@@ -587,7 +587,7 @@ setqSingle(id,val,m,E) ==
if (k:=NRTassocIndex(id))
then
$markFreeStack := [id,:$markFreeStack]
- form:=["setShellEntry","$",k,x]
+ form:=['%store,['%tref,"$",k],x]
else form:=
["%LET",id,x]
[form,m',e']
@@ -1217,7 +1217,7 @@ compDefineCategory2(form,signature,specialCases,body,m,e,
[['devaluate,u] for u in sargl]]],body]
body:=
['PROG1,["%LET",g:= gensym(),body],
- ["setShellEntry",g,0,mkConstructor $functorForm]]
+ ['%store,['%tref,g,0],mkConstructor $functorForm]]
fun:= compile [op',['LAM,sargl,body]]
-- 5. give operator a 'modemap property
diff --git a/src/interp/wi2.boot b/src/interp/wi2.boot
index 0c5d7ec5..1f79c307 100644
--- a/src/interp/wi2.boot
+++ b/src/interp/wi2.boot
@@ -73,7 +73,6 @@ compDefineFunctor1(df, m,$e,$prefix,$formalArgList) ==
--prevents CheckVector from printing out same message twice
$getDomainCode: local -- code for getting views
$insideFunctorIfTrue: local:= true
- $setelt: local := "setShellEntry"
$genSDVar: local:= 0
originale:= $e
[$op,:argl]:= form
@@ -1067,8 +1066,8 @@ doItLet1 item ==
qe(6,$e)
code is ["%LET",:.] =>
rhsCode:= rhs'
- op := "setShellEntry"
- wiReplaceNode(item,[op,'$,NRTgetLocalIndex lhs,rhsCode], 16)
+ op := '%store
+ wiReplaceNode(item,[op,['%tref,'$,NRTgetLocalIndex lhs],rhsCode], 16)
wiReplaceNode(item, code, 18)
rhsOfLetIsDomainForm code ==