AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

65535 bytes method code limit?

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware
View previous topic :: View next topic  
Author Message
aloha.kakuikanu
Guest





PostPosted: Fri Mar 02, 2007 3:24 am    Post subject: 65535 bytes method code limit? Reply with quote



I'm getting:

"The code of method mTokens() is exceeding the 65535 bytes limit"

The method is antlr generated, so I struggle to find any workaround.
Perhaps I'm missing some magic JVM parameter setting? Aren't 16 bit
integers relics of the past century?
Back to top
Chris Uppal
Guest





PostPosted: Fri Mar 02, 2007 4:04 am    Post subject: Re: 65535 bytes method code limit? Reply with quote



aloha.kakuikanu wrote:

Quote:
"The code of method mTokens() is exceeding the 65535 bytes limit"

The method is antlr generated, so I struggle to find any workaround.
Perhaps I'm missing some magic JVM parameter setting? Aren't 16 bit
integers relics of the past century?

It's a hard limit in Java, I'm afraid. No way around it (with current versions
of Java) because it's a limit of the classfile format itself, rather than a
limit of the Java compiler, or of the JVM.

(Actually, the limit in the classfile is rather more complicated than that, and
you can, structurally, have more than 64K bytes of bytecode per method, but
there are various auxiliary structures in the classfile which do have a 64K
limits.)

-- chris
Back to top
Florian Weimer
Guest





PostPosted: Fri Mar 02, 2007 6:45 pm    Post subject: Re: 65535 bytes method code limit? Reply with quote



* aloha kakuikanu:

Quote:
I'm getting:

"The code of method mTokens() is exceeding the 65535 bytes limit"

The method is antlr generated, so I struggle to find any workaround.
Perhaps I'm missing some magic JVM parameter setting?

Anything that compiles to class files in a straightforward way will
hit this limit, as Chris explained.

There are basically two workarounds: Use a compiler that synthesizes
additional classes to work around the limit (I don't know if one
exists), or a compiler that does not compile to class files, such as
an earlier GCJ version. The latter approach might work if your
intention is to get the code running. (Nowadays, GCJ uses class files
as well.)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.