Ridiculously low restrictions on class files

Jacob Wieland wieland at testingtech.com
Mon Apr 18 08:30:39 UTC 2016


Hello folks,

is there any plan in the future to get rid of the ridiculously low barriers
restricting the current class-format that seem to be a relic from a
different (low-memory) age and are not very future-proof?

Up till now, I have run into the following shortcomings that, at the
moment, a lot of annoying workarounds have to be found for:
- only 64KB per method (with no way of knowing how much source code will
produce how much byte-code, this is a nightmare when generating Java source
code)
  => especially for the anonymous constructor, if a class has a lot of
members. As the initialization needs to be split into methods called by the
constructor, it is no longer possible to declare these fields final, even
though they should be
- only 64K class members
- only 64K constant pool (which is especially annoying when using inner
classes as for each such class, a constant seems to be reserved)
 => need to split code of methods containing constants into lots of
runnable-wrappers

Alternatively, javac could be amended to generate byte-code according to
the class-restrictions so that every correct Java source code is also
compileable, but this is probably a higher feat of engineering than
"simply" raising the barriers.

BR,

Jacob Wieland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20160418/f17ce23f/attachment-0001.html>


More information about the compiler-dev mailing list