Sagewire Logo

65535 bytes method code limit?

5 Message(s) by 5 Author(s) originally posted in java machine


From: aloha.kakuikanu Date:   Thursday, March 01, 2007
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? Are not 16 bit
integers relics of the past century?


From: Chris Uppal Date:   Thursday, March 01, 2007
wrote in message:

"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? Are not 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 class file 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


From: Florian Weimer Date:   Friday, March 02, 2007
* aloha kakuikanu:

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 do not know if one
exists), or a compiler that doesn't 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.)


From: Roedy Green Date:   Friday, May 25, 2007
On 1 Mar 2007 13:24:13 -0800, "aloha.kakuikanu"
wrote in message, quoted or indirectly quoted someone
who said :

Perhaps I'm missing some magic JVM parameter setting? Are not 16 bit
integers relics of the past century?



Nope. Using 32 bit addressing'd double the size of a class file.
It is rare to blow the limit unless you are mechanically generating
code.
--

Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com


From: glen herrmannsfeldt Date:   Thursday, May 31, 2007
wrote in message:
On 1 Mar 2007 13:24:13 -0800, "aloha.kakuikanu"
wrote in message, quoted or indirectly quoted someone

Perhaps I'm missing some magic JVM parameter setting? Are not 16 bit
integers relics of the past century?

Nope. Using 32 bit addressing'd double the size of a class file.
It is rare to blow the limit unless you are mechanically generating
code.



If you used an escape or prefix code for larger addresses it would not
double the size. I believe that might've been part of the
design, but was never (as far as I know) implemented. Yes, it is
exactly mechanically generated code that needs this.

(The IBM z/OS system only allows code below the 2GB bar. There
has been discussion on the need for this restriction, but again
it is only machine generated code that is likely to cause problems.)

-- glen



Next Message: JVM errors


Blogs related to 65535 bytes method code limit?

RU.CISCO FAQ
Связано это с тем, что если byte-count исчерпывается в процессе передачи пакета, пакет все равно передается до конца - то есть реальная занимаемая полоса будет больше. Все, что написано выше - не более чем некие теоретические выкладки ...

RU.CISCO FAQ
NB! на разных платформах, могут проблемы с byte order. (Alexander Kefeli) Дело в том что на Cisco обратный (по отношению к Intel) порядок байт в целых числах. Отсюда мораль на интеле надо конвертить. ...

Increasing broadband connection
That's it, now dont worry about the Hour Limit, neither the reserve ticket time, and what better, u can also download simultaneously, just follow the same procedure for the different rapidshare links[/code] another method to cheat ...

65535 bytes method code limit?
comp.lang.java.machine: 65535 bytes method code limit?

JC101-2C: A simple counter (for smart card developers)
This comes from the fact that all integral values in Java are signed, so “ FF FF ” is not 65535, but -1. The corrected version of the method is shown below (we also have forbidden a debit of 0, because it does not make much sense): ...

65535 bytes method code limit?
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 ...


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional