harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Shimansky <gshiman...@gmail.com>
Subject Re: [drlvm] verification of classfile format
Date Thu, 06 Jul 2006 18:07:46 GMT
On Thursday 06 July 2006 20:26 Geir Magnusson Jr wrote:
> As part of the work surrounding the HARMONY-677 (r419557), getting DRLVM
> to deal with Java5 classfile format,  I noticed that DRLVM doesn't
> appear to give a hoot what version of the classfile it's chewing on.  It
> just goes until something blows up.

It does check the class file version in bootstrap class loader 
(vm/vmcore/src/class_support/Class_File_Loader.cpp) and can throw 
UnsupportedClassVersionError. The constant CLASSFILE_MAJOR_MAX is defined in 
vm/vmcore/include/Class.h.

> I was comparing to j9, which gives a UnsupportedClassVersionError.
> DRLVM should do the same of course, and it makes me worry what else it
> outght to be doing - if we don't understand the version of the class
> file, how can we read it dependably?

For some reason I don't really know the constant was changed to 49 as if VM 
did support class files of version 1.5. Maybe it was the first step to 
support 1.5 classes :)

> I was reading down through j.l.ClassLoader and natives, and given the
> dearth of comments, didn't quite grok where a good place to start doing
> some verification would be...  Maybe I missed it.  Can anyone give me a
> hint?

I think it should happen in bootstrap class loader since it is the place where 
class file parsing is done anyway. So the place is in VM native code, not 
kernel classes.

-- 
Gregory Shimansky, Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message