This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Android REPL - add* syntax-sugar not available in constructor
On 01/29/2012 02:42 AM, teyc wrote:
Per Bothner wrote:
But what is puzzling is why Invoke.applyN is called at runtime.
The "pre-compiler" is supposed to call CompileInvoke#validateApplyInvoke
- and this should be called by eval, when if the bytecode compiler
is unavailable. Mapping "xxx:" to "addXxx" is supposed to be handled
by the CompiledBuildObject#findNamedMember and #buildSetter methods.
It looks like compilerAvailable #f and alwaysCompile #f triggers the error,
even on the desktop version.
Thanks - that made it easier to debug.
The problem appears to be the
if (! comp.mustCompile
near the beginning of validateApplyInvoke in CompileInvoke.java.
I don't remember why that's there - probably in an effort to speed up
compilation. Now that we do so many important transformations in this
method that no longer is appropriate. (Note that some functionality
is difficult to do at run-time, at least in a way that's compatible
with how it gets done at compile-time. Overload resolution is the
obvious one.)
Note that "compilerAvailable" and "alwaysCompile" are a misnomer.
We always do most of "compile" - the question is whether with the
final result of compilation we generate+load byetcode, or whether
we interpret the (heavy-massaged) Expression tree.
--
--Per Bothner
per@bothner.com http://per.bothner.com/