New reference implementation taylanbayirli@xxxxxx (29 Aug 2015 17:38 UTC)
Re: New reference implementation Per Bothner (29 Aug 2015 20:23 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (29 Aug 2015 21:38 UTC)
Re: New reference implementation Per Bothner (30 Aug 2015 09:20 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (30 Aug 2015 10:45 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (31 Aug 2015 21:22 UTC)
Re: New reference implementation Per Bothner (31 Aug 2015 22:11 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (01 Sep 2015 08:44 UTC)
Re: New reference implementation Per Bothner (01 Sep 2015 10:44 UTC)
Re: New reference implementation John Cowan (30 Aug 2015 01:24 UTC)
Re: New reference implementation Arthur A. Gleckler (30 Aug 2015 04:35 UTC)
Re: New reference implementation John Cowan (30 Aug 2015 17:10 UTC)
Re: New reference implementation Per Bothner (30 Aug 2015 05:06 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (30 Aug 2015 08:06 UTC)
Re: New reference implementation Per Bothner (30 Aug 2015 08:25 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (30 Aug 2015 08:49 UTC)
Re: New reference implementation Per Bothner (30 Aug 2015 09:33 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (30 Aug 2015 12:35 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (22 Sep 2015 21:27 UTC)
Re: New reference implementation Per Bothner (24 Sep 2015 00:25 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (24 Sep 2015 08:26 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (26 Sep 2015 11:49 UTC)
Re: New reference implementation Per Bothner (28 Sep 2015 17:47 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (28 Sep 2015 19:54 UTC)
Re: New reference implementation Per Bothner (02 Oct 2015 06:07 UTC)
Re: New reference implementation Per Bothner (02 Oct 2015 06:36 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (02 Oct 2015 09:39 UTC)
Re: New reference implementation Per Bothner (06 Oct 2015 21:13 UTC)
Re: New reference implementation taylanbayirli@xxxxxx (07 Oct 2015 09:17 UTC)

Re: New reference implementation Per Bothner 31 Aug 2015 22:11 UTC


On 08/31/2015 11:22 PM, Taylan Ulrich Bayırlı/Kammer wrote:
> Other than that, I would be thankful if you could lend a hand on the
> following exception I'm getting from the "formatst.scm" test, when I put
> my SRFI-64 implementation to gnu/kawa/slib/testing.scm:
>
> --- snip from 'make check' output ---
> [PASS] srfi-109/($string$ X ($format$ ~w ($splice$ (list x y))) Y)
> [PASS] srfi-109/(quote ($string$ X ($format$ ~w ($splice$ (list x y))) ($format$ ~w) Y))
> [PASS] srfi-109/($string$ X ($format$ ~w ($splice$ (list x y))) ($format$ ~w) Y)
> %%%% Test suite end: srfi-109
> # of expected passes      64
> ../bin/kawa.sh "./formatst.scm"
> Exception in thread "main" java.lang.ClassFormatError: Invalid method Code length 76496 in class file formatst
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
> 	at gnu.bytecode.ArrayClassLoader.loadClass(ArrayClassLoader.java:125)
> 	at gnu.expr.ModuleExp.evalToClass(ModuleExp.java:135)
> 	at gnu.expr.ModuleExp.evalModule1(ModuleExp.java:259)
> 	at kawa.Shell.compileSource(Shell.java:560)
> 	at kawa.Shell.runFile(Shell.java:528)
> 	at kawa.Shell.runFileOrClass(Shell.java:447)
> 	at kawa.repl.main(repl.java:881)
> Makefile:590: recipe for target 'check-format' failed
> make[1]: *** [check-format] Error 1
> make[1]: Leaving directory '/home/taylan/tmp/kawa-2.0/testsuite'
> Makefile:460: recipe for target 'check-recursive' failed
> make: *** [check-recursive] Error 1
> --- end snip ---
>
> Google tells me the "Invalid method Code length" exception is about some
> method-size limit of the JVM, but I don't know what in my implementation
> might cause that; I certainly don't have any excessively huge lambdas.
> Could it be due to the output of some macro?  How can I best debug this?
>
> The exact file I have at gnu/kawa/slib/testing.scm is attached (needed
> module boilerplate and some minor tweaks).

This is indeed a very annoying bug/limitation in the JVM.  Everyone
hates it, but the powers-that-be keep putting off fixing it.
Basically the length of the bytecode for a single method is limited to 64k.
(There are other 16-bit limitations, too.)

This is also a Kawa bug: At the very least the compiler should abort with
an informative error message rather than create an excessively-big method.
Better would be to re-write the code to split the method into multiple
methods - but that is difficult.

In the case the problem i the "run" method generated for the formatst class.
This corresponds to module-level actions of the module - which in this
case is almost all of it.  When using my version of testing.zip it is
barely within the limit, at 60219 bytes.  Your version pushes it above the limit,
to 74710 bytes.  I haven't looked at why yet - I assume your version generates
more "verbose" expansions of the macros.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/