diff options
author | dos-reis <gdr@axiomatics.org> | 2009-03-01 07:15:10 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2009-03-01 07:15:10 +0000 |
commit | 18e478cfb26865634334253465dbda7e67dd8699 (patch) | |
tree | 191a334631bbde6905c7ac3fdc98eb9ea75902e3 /src/interp/compiler.boot | |
parent | c42526006076b88ff2755f33eb1defd2e455e67e (diff) | |
download | open-axiom-18e478cfb26865634334253465dbda7e67dd8699.tar.gz |
* interp/compiler.boot (compTopLevel): Initialize list of
optimizable domain constructors.
(processInlineRequest): New.
* interp/define.boot (spadCompileOrSetq): Tidy.
(mutateToNothing): New.
(doIt): Use it. Add support for inline directives.
* interp/fnewmeta.lisp (PARSE-Inline): New.
* interp/metalex.lisp (KEYWORDS): Include 'inline'.
Diffstat (limited to 'src/interp/compiler.boot')
-rw-r--r-- | src/interp/compiler.boot | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index ae68d089..7f903248 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -93,10 +93,12 @@ $compileOnlyCertainItems := [] compTopLevel: (%Form,%Mode,%Env) -> %Maybe %Triple compTopLevel(x,m,e) == ---+ signals that target is derived from lhs-- see NRTmakeSlot1Info + -- signals that target is derived from lhs-- see NRTmakeSlot1Info $NRTderivedTargetIfTrue: local := false $killOptimizeIfTrue: local:= false $forceAdd: local:= false + -- start with a base list of domains we may inline. + $optimizableConstructorNames: local := $SystemInlinableConstructorNames x is ["DEF",:.] or x is ["where",["DEF",:.],:.] => ([val,mode,.]:= compOrCroak(x,m,e); [val,mode,e]) --keep old environment after top level function defs @@ -829,7 +831,7 @@ setqSingle(id,val,m,E) == addBinding(id,newProplist,e') if isDomainForm(val,e') then if isDomainInScope(id,e') then - stackWarning("domain valued variable %1b has been reassigned within its scope",[id]) + stackWarning('"domain valued variable %1b has been reassigned within its scope",[id]) e':= augModemapsFromDomain1(id,val,e') --all we do now is to allocate a slot number for lhs --e.g. the %LET form below will be changed by putInLocalDomainReferences @@ -1911,6 +1913,27 @@ compMatch(["%Match",subject,altBlock],m,e) == --% +--% Inline Requests +--% + +++ We are processing a capsule and `t is nominated in an inline +++ directive. This means that the compiler can `bypass' the usual +++ indirect call through domain interface and attempt to resolve +++ modemap references. +++ Concretely, this means that `t is evaluated. +processInlineRequest(t,e) == + T := compOrCroak(t,$EmptyMode,e) + not isCategoryForm(T.mode,e) => + stackAndThrow('"%1b does not designate a domain",[t]) + atom T.expr => + stackWarning('"inline request for type variable %1bp is meaningless",[t]) + T.expr is [ctor] => + $optimizableConstructorNames := [ctor,:$optimizableConstructorNames] + -- Don't try too hard; the current domain evaluation is insane. + stackWarning('"Ignoring inline arequest for non-niladic type %1bp",[t]) + + +--% --% ITERATORS --% |