Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Size of constructors

Reply
Thread Tools

Size of constructors

 
 
Michael Borgwardt
Guest
Posts: n/a
 
      05-14-2004
Dale King wrote:
>>No, it's per method. Here's a list of all restrictions imposed by
>>the class file format:

>
> http://java.sun.com/docs/books/vmspe...doc.html#88659
>
> Andbe aware that the 1.5 VM is supposed to remove many of those
> restrictions. I don't have any of the details and I'm not online
> right now to point to the information, but it is in the docs for
> 1.5 somewhere.


I can't find it anywhere in the release notes:
http://java.sun.com/j2se/1.5.0/docs/.../features.html

But according to JSR 202 it should be in there:
http://www.jcp.org/en/jsr/detail?id=202

But there doesn't seem to be an actual specification of the
changes anywhere. Or am I too stupid to find it?
 
Reply With Quote
 
 
 
 
Chris Uppal
Guest
Posts: n/a
 
      05-14-2004
Michael Borgwardt wrote:

> > Andbe aware that the 1.5 VM is supposed to remove many of those
> > restrictions. I don't have any of the details and I'm not online
> > right now to point to the information, but it is in the docs for
> > 1.5 somewhere.

> [...]
> But there doesn't seem to be an actual specification of the
> changes anywhere. Or am I too stupid to find it?


I've looked unsuccessfully too.

It'll obviously require a breaking change to the .CLASS file format. FWIW, my
home brewed classfile parser works fine on all the files in the 1.5.0(beta1)
rt.jar so they are apparently all in "old" format.

Also given a moderately large method:

public class Big
{
public int[]
method()
{
return new int[]
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
[...snipped...]
99980,99981,99982,99983,99984,99985,99986,99987,99 988,99989,
99990,99991,99992,99993,99994,99995,99996,99997,99 998,99999
};
}
}

Trying to compile it with:

javac -source 1.5 -target 1.5 Big.java

fails with a "too many constants" error.

Doesn't prove anything of course -- I want to see the /spec/ -- but I doubt if
it's implemented in this beta.

-- chris


 
Reply With Quote
 
 
 
 
Neal Gafter
Guest
Posts: n/a
 
      05-14-2004
Dale King wrote:
> And be aware that the 1.5 VM is supposed to remove many of those
> restrictions. I don't have any of the details and I'm not online
> right now to point to the information, but it is in the docs for
> 1.5 somewhere.


JDK1.5 does not relax any of the limits.

 
Reply With Quote
 
Dale King
Guest
Posts: n/a
 
      04-15-2006
Hello, Michael Borgwardt !
You wrote:

> FISH wrote:
>
> >>>There is a limit IIRC on the size of methods in Java

bytecode (64k?).
> >>>Apart from that I don't think there's a limit, as such

> >
> >
> >>That limit would come from 16 bit jump offsets in byte code.

If they
> >>are signed, that would limit you to 32K. You would never

write code
> >>this long manually. But you might generate it mechanically.

> >
> >
> > Its been so long since I did any hacking around with class

file
> > generation that I must admit I have totally forgotten what

the
> > limits are. I know that *somewhere* there is a 64k limit

caused,
> > as you noted, by a 16 bit unsigned value in the class

structure -
> > it may indeed be the entire class itself is limited to 64k.

>
> No, it's per method. Here's a list of all restrictions imposed

by
> the class file format:
>
>

http://java.sun.com/docs/books/vmspe...html/ClassFile.
oc.html#88659

Andbe aware that the 1.5 VM is supposed to remove many of those
restrictions. I don't have any of the details and I'm not online
right now to point to the information, but it is in the docs for
1.5 somewhere.
--
Dale King
My Blog: http://daleking.homedns.org/Blog
 
Reply With Quote
 
Dale King
Guest
Posts: n/a
 
      04-15-2006
Hello, Michael Borgwardt !
You wrote:

> Dale King wrote:
> >>No, it's per method. Here's a list of all restrictions

imposed by
> >>the class file format:

> >
> >

http://java.sun.com/docs/books/vmspe...html/ClassFile.
oc.html#88659
> >
> > Andbe aware that the 1.5 VM is supposed to remove many of

those
> > restrictions. I don't have any of the details and I'm not

online
> > right now to point to the information, but it is in the docs

for
> > 1.5 somewhere.

>
> I can't find it anywhere in the release notes:
> http://java.sun.com/j2se/1.5.0/docs/.../features.html
>
> But according to JSR 202 it should be in there:
> http://www.jcp.org/en/jsr/detail?id=202
>
> But there doesn't seem to be an actual specification of the
> changes anywhere. Or am I too stupid to find it?


I guess I stand corrected (actually I'm sitting corrected). My
information about it being in 1.5 is out of date. Obviously from
JSR202 it was originally supposed to be in 1.5, but unfortunately
1.5 is a moving target. If you look at the release history of the
contents for 1.5 (JSR 176) you will see that it was in, taken
out, put back in, and then finally taken back out again. Guess i
just hadn't kept up with the changes in this regard.
--
Dale King
My Blog: http://daleking.homedns.org/Blog
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
reg constructors/copy constructors inheritance srp113 C++ 3 02-17-2009 04:01 PM
Is the possible to have all the public constructors of the publicbase class as the constructors of a derived class? Peng Yu C++ 5 09-19-2008 10:19 AM
compiler synthesized constructors/copy constructors/assignment operators Jess C++ 5 06-07-2007 11:09 AM
Copy constructors, de/constructors and reference counts Jeremy Smith C++ 2 08-02-2006 11:25 PM
Constructors that call other Constructors Dave Rudolf C++ 12 02-06-2004 03:26 PM



Advertisments