This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Code generation problem?
- From: Per Bothner <per at bothner dot com>
- To: Dominique Boucher <dominique dot boucher at nuecho dot com>
- Cc: Kawa List <kawa at sources dot redhat dot com>
- Date: Sun, 09 Dec 2007 17:24:43 -0800
- Subject: Re: Code generation problem?
- References: <003201c8390d$111a1820$a081a8c0@lelouch>
Dominique Boucher wrote:
What do you think? What is the rationale about that optimization?
[I’m using an old version of Kawa (pre 1.8), so this problem may have been
fixed by now. I just wanted to know your opinion on all this.]
I checked in a fix for this. The fix is to move the non-capturing
function "out" so it uses the module class's frame.
I don't know if that will help you if you're using an old version.
You can try my patch, but it might not apply cleanly. Alternatively,
you can try you this patch to "disable" the optimizaton, courtesy
of Dead Ferreyra of Merced Systems.
Index: gnu/expr/LambdaExp.java
===================================================================
RCS file: /usr/local/cvsroot/kawa/src/gnu/expr/LambdaExp.java,v
retrieving revision 1.1.2.17
diff -u -r1.1.2.17 LambdaExp.java
--- gnu/expr/LambdaExp.java 10 Mar 2006 00:11:10 -0000 1.1.2.17
+++ gnu/expr/LambdaExp.java 17 Aug 2007 19:44:41 -0000
@@ -569,7 +569,7 @@
else
{
fname = fname + "$Fn" + ++comp.localFieldIndex;
- if (! getNeedsClosureEnv())
+ if (! getNeedsClosureEnv() && comp.curLambda.heapFrame == null)
fflags = (fflags | Access.STATIC) & ~Access.FINAL;
}
ClassType frameType = getOwningLambda().getHeapFrameType();
--
--Per Bothner
per@bothner.com http://per.bothner.com/