de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Problems with "Method Code Too Large" errors again!
PostPosted: Wed Jun 22, 2016 8:33 pm 
Offline
Veteran
User avatar
I had this problem once before, and there was a workaround back then, however I was hoping this would have been fixed by now as it was quite a while ago and the script I am having trouble with this time is already broken up a LOT into "blocks" and lots of def "xxx" = functions to try and prevent this happening. I can't see a way to break it up further as it is far from a "normal" linear script where this is easy ("run part 1, run part 2, etc.").

The error:
Code:
Error in simulation (maybe not a real error) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during class generation: Method code too large!

java.lang.RuntimeException: Method code too large!
   at org.objectweb.asm.MethodWriter.a(Unknown Source)
   at org.objectweb.asm.ClassWriter.toByteArray(Unknown Source)
   at org.codehaus.groovy.control.CompilationUnit$14.call(CompilationUnit.java:788)
   at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1027)
   at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:564)
   at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:542)
   at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:519)
   at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
   at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
   at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:244)
   at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:202)
   at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:212)
   at ss.desktop.EditorFrame.threadedTest(EditorFrame.java:900)
   at ss.desktop.EditorFrame.access$24(EditorFrame.java:892)
   at ss.desktop.EditorFrame$32.run(EditorFrame.java:871)


Of course the biggest problem is that the above gives me no idea what I need to fix, unless this is really still a hardcoded "script size" limit. Right now, the script stands at 9546 lines of code and the file is 268kb.

Worryingly, it seems that removing any 25 lines or so of code "fixes" the error (I also note this drops the file size to 268kb). I was thinking I just had a function that was way too long (there are a couple of those) and I could find a way to trim them down more efficiently, but the fact that just making the file a bit smaller by removing any random code (as long as the missing code doesn't cause an error) makes me worried I in fact have no coding errors but it is a "file size" issue that is causing this!

PLEASE tell me this is fixable, as I've been working on this very special script literally for several *years* now and the idea it could have all been a waste of time due to code limits meaning I'd never being able to finish it (since it still needs another thousand lines of code or so) makes me want to curl up and cry! :(


Top
 Profile Send private message 
 
 Re: Problems with "Method Code Too Large" errors again!
PostPosted: Wed Jun 22, 2016 8:54 pm 
Offline
Site Admin
User avatar
Can you send me the code of this script, it'll be the easier way to debug ?


Top
 Profile Send private message 
 
 Re: Problems with "Method Code Too Large" errors again!
PostPosted: Thu Jun 23, 2016 4:00 pm 
Offline
Veteran
User avatar
I think I've "fixed" it by using the same workaround Doti suggested in an older thread. If anyone has this same issue, I suggest searching the forum for "Method Code Too Large" for a way around this annoying limitation (that is apparently a Java bug, not a SexScript one!).

The workaround should work easily for 90% of scripts... it's just very complicated non-linear ones that it might not work with, but if I could get it to work with the mess of crazy code in this script of mine, I bet most scripters will be able to get around it too!


Top
 Profile Send private message 
 
 Re: Problems with "Method Code Too Large" errors again!
PostPosted: Thu Jun 23, 2016 6:42 pm 
Offline
Site Admin
User avatar
It's here.

Possibly, this will diseapear in a future version of Java (9 ? 10 ?).


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.