Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / February 2004

Tip: Looking for answers? Try searching our database.

1.5.0 Bytecode Compatibility

Thread view: 
Benji Smith - 06 Feb 2004 21:21 GMT
Most of the language changes in the new 1.5.0 Beta seem to be changes
that could be implemented pretty simply by the compiler, without any
changes made to the bytecode format.

So, I'm curious...if I compile code that uses the new 1.5.0 features,
can I subsequently execute those bytecode in the 1.4.2_03 JVM?
Michael Amling - 07 Feb 2004 03:01 GMT
> Most of the language changes in the new 1.5.0 Beta seem to be changes
> that could be implemented pretty simply by the compiler, without any
> changes made to the bytecode format.
>
> So, I'm curious...if I compile code that uses the new 1.5.0 features,
> can I subsequently execute those bytecode in the 1.4.2_03 JVM?

  I haven't looked, but even if the bytecodes haven't changed (and I
suspect they haven't), there's a danger that a builtin class in 1.5 may
not exist in 1.4 or may not have all the fields or methods that 1.5 has.

--Mike Amling
Chris Uppal - 07 Feb 2004 10:40 GMT
> So, I'm curious...if I compile code that uses the new 1.5.0 features,
> can I subsequently execute those bytecode in the 1.4.2_03 JVM?

All the new semantics is realized through tricks that work just as well on
pre-1.5 JVMs.  A few new attributes have been added, but that's completely
downwards compatible.

However, from a post by Neil Grafter on c.l.j.programmer:

   You can translate 1.5-style classfiles into 1.4-style classfiles
   by discarding the stackmaps and changing the version number.
   Almost.  Class literals generate a single bytecode instruction
   (ldc) in 1.5, and that must be translated into the mass of code
   that was used in previous releases.

So I suspect that (if the feature makes it into the final release) code
compiled with -target 1.5 may not be able to run on a 1.4 JVM (but then, I
don't suppose it would anyway given the version number checking).

   -- chris


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.