2012/8/6 Jimmy O'Regan <[email protected]>

> On 6 August 2012 20:28, Mikel Artetxe <[email protected]> wrote:
> > On Mon, Aug 6, 2012 at 4:41 PM, Jimmy O'Regan <[email protected]> wrote:
> >>>
> > As for apertium-es-ast, the bytecode is generated without any problem,
> but
> > then I get the following error when trying to load it:
> >
> > Exception in thread "Thread-25" java.lang.ClassFormatError: Invalid
> method
> > Code length 66654 in class file
> transfer_classes/apertium_es_ast_es_ast_t1x
> >
> > I suspect that the problem is related to my code that generates the
> bytecode
> > directly through BCEL (or perhaps it's a bug in BCEL itself, I did have a
> > similar problem that happened to be caused by a BCEL bug...). So, well, I
> > will try to fix it...
>
> The older version of lttoolbox-java gives:
>
> Compiling: javac -cp
> /Users/jim/Apertium/lttoolbox-java/dist/lttoolbox.jar
> ./apertium_es_ast_es_ast_t1x.java
> ./apertium_es_ast_es_ast_t1x.java:20071: code too large
>         public void rule98__proclise__prnpro__prnpro__haber__verb(Writer
> out,
> TransferWord word1, String blank1, TransferWord word2, String blank2,
> TransferWord word3, String blank3, TransferWord word4, String blank4,
> TransferWord word5) throws IOException
>                     ^
> ./apertium_es_ast_es_ast_t1x.java:39390: code too large
>


Its a limitation in the Java bytecode format itself:
A method can have only 64k bytecode instructions.

A workaround would be to split the code up in several methods.
However, I think we first should look if the rule could be simplified or
something. as 64 thousand bytecode instructuions probably means the rule
contains over 5000-10000 comparisons and invocations, which I'd is way too
much


Jimmy, could you pastebin ./apertium_es_ast_es_ast_t1x.java somewhere so we
could have a look.




>         public void
> rule120__proclise__prnpro__prnpro__haber__verbir__a__inf_ger(Writer
> out, TransferWord word1, String blank1, TransferWord word2, String
> blank2, TransferWord word3, String blank3, TransferWord word4, String
> blank4, TransferWord word5, String blank5, TransferWord word6, String
> blank6, TransferWord word7) throws IOException
>
> ...if that helps at all.
>
>
It helps, thx :-)

Jacob

-- 
Jacob Nordfalk <http://profiles.google.com/jacob.nordfalk>
javabog.dk
Androidudvikler og -underviser på
IHK<http://cv.ihk.dk/diplomuddannelser/itd/vf/MAU>og
Lund&Bendsen <https://www.lundogbendsen.dk/undervisning/beskrivelse/LB1809/>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to