participate


Generics - New ClassFile format?
<<   Back to Forum  |   Give us Feedback
This topic has 13 replies on 1 page.
rreyelts
Posts:568
Registered: 11/12/97
New ClassFile format?   
Aug 4, 2003 6:45 PM

 
The very end of the generics specification included with ea2.2 states that the class file format changes are specified in a document that is "attached to this specification as a separated document". I can't seem to find any document that details those changes. Where can I get this information? I need it to improve a tool that I've written that parses Java classfiles. Please don't tell me that I need to read through the compiler source code.

God bless,
-Toby Reyelts
 
gafter
Posts:669
Registered: 6/25/98
Re: New ClassFile format?   
Aug 4, 2003 8:17 PM (reply 1 of 13)  (In reply to original post )

 
The very end of the generics specification included
with ea2.2 states that the class file format changes
are specified in a document that is "attached to this
specification as a separated document". I can't seem
to find any document that details those changes. Where
can I get this information? I need it to improve a
tool that I've written that parses Java classfiles.
Please don't tell me that I need to read through the
compiler source code.

I'm afraid reading the compiler source code won't help, as most of the VM changes aren't implemented in it yet. You will have to wait for the community review of JSR202 (which is imminent) or perhaps the public review to get a copy of the proposed spec. Here are the highlights:

(1) CLDC-style verifier tables required starting in classfile version 49 (-target 1.5); jsr/ret instructions no longer allowed.

(2) class, field, and method names can include almost any unicode character, not just valid Java identifiers

(3) New flag bits for "synthetic", "enum" (for enum types and enumeration constants), "varargs" (for a varargs method), and "bridge" (for compiler-generated bridge methods).

(4) New class file attributes for JSR175.

(5) ldc instruction can reference a class in the constant pool, to support class literals.
 
fredastaire
Posts:97
Registered: 1/3/00
Re: New ClassFile format?   
Aug 5, 2003 8:55 AM (reply 2 of 13)  (In reply to #1 )

 
http://cscott.net/Projects/GJ/#bugs
documents the signature changes for generics and varargs, at least.
 
rreyelts
Posts:568
Registered: 11/12/97
Re: New ClassFile format?   
Aug 5, 2003 9:20 AM (reply 3 of 13)  (In reply to #2 )

 
Thanks for the info Scott. Does the grammar replace that for the current grammar defined for field and method descriptors, or is it attached as some separate attribute? At least when the compiler was supposed to generate code that would target pre1.5 vm's, this couldn't have replaced the existing descriptor grammar. Do you (or Neal) know how likely this is to change?

God bless,
-Toby Reyelts
 
fredastaire
Posts:97
Registered: 1/3/00
Re: New ClassFile format?   
Aug 5, 2003 9:26 AM (reply 4 of 13)  (In reply to #3 )

 
This was described in the original prototype 1.0 spec document.
The original type-erased (non-parameterized) "descriptors" are still present on methods, fields, and classes. But a new "Signature" attribute has also been
added, which contains extended descriptors with the grammar specified at my site.
 
fredastaire
Posts:97
Registered: 1/3/00
Re: New ClassFile format?   
Aug 5, 2003 9:36 AM (reply 5 of 13)  (In reply to #4 )

 
I just expanded the description at the URL above to better describe this. I'd forgotten that the context for the grammar has been removed from the new spec.
 
rreyelts
Posts:568
Registered: 11/12/97
Re: New ClassFile format?   
Aug 5, 2003 10:14 AM (reply 6 of 13)  (In reply to #5 )

 
Thanks. Btw, where did you glean this info from?

God bless,
-Toby Reyelts
 
fredastaire
Posts:97
Registered: 1/3/00
Re: New ClassFile format?   
Aug 5, 2003 10:18 AM (reply 7 of 13)  (In reply to #6 )

 
Starting from the description in the 1.0 spec, I wrote sinjp, a javap workalike for generic methods. I published my first "corrected" version of the signature grammar addressing problems I found while implementing sinjp. Then I've just kept updating both to keep them working with the different prototype versions as they were released. "Reverse-engineering."
 
rreyelts
Posts:568
Registered: 11/12/97
Re: New ClassFile format?   
Aug 5, 2003 11:04 AM (reply 8 of 13)  (In reply to #7 )

 
Humm... I wasn't aware that the changes were specified in the original spec. Too bad they haven't been available since then.

God bless,
-Toby Reyelts
 
gafter
Posts:669
Registered: 6/25/98
Re: New ClassFile format?   
Aug 5, 2003 12:44 PM (reply 9 of 13)  (In reply to #2 )

 
http://cscott.net/Projects/GJ/#bugs
documents the signature changes for generics and
varargs, at least.

No, the marker attribute for varargs will NOT be in 1.5. It is just
a transitional thing for the prototype.
 
rreyelts
Posts:568
Registered: 11/12/97
Re: New ClassFile format?   
Aug 5, 2003 1:09 PM (reply 10 of 13)  (In reply to #9 )

 
Ok Neal,

You could just give us the current draft instead of keeping us guessing. =)

God bless,
-Toby Reyelts
 
gafter
Posts:669
Registered: 6/25/98
Re: New ClassFile format?   
Aug 5, 2003 6:03 PM (reply 11 of 13)  (In reply to #10 )

 
OK, the next prototype will include copies of the rough draft specs for JSRs 14 175 201 and 202.
 
rreyelts
Posts:568
Registered: 11/12/97
Re: New ClassFile format?   
Aug 7, 2003 9:01 AM (reply 12 of 13)  (In reply to #11 )

 
Thank you!

God bless,
-Toby Reyelts
 
fredastaire
Posts:97
Registered: 1/3/00
Re: New ClassFile format?   
Aug 7, 2003 10:53 AM (reply 13 of 13)  (In reply to #9 )

 
No, the marker attribute for varargs will NOT be in
1.5. It is just
a transitional thing for the prototype.

Corrected in my documentation.
 
This topic has 13 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 27
  • Guests : 138

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums