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 / October 2003

Tip: Looking for answers? Try searching our database.

Lots of Oolong questions...

Thread view: 
My full name - 15 Oct 2003 23:01 GMT
Hi,

I recently bought the book from Engel (programming the JVM) and I would
like to have some infos about Oolong.

Oolong permits to generate easily a ClassFile. One of my questions is:
will all the Oolong programs generate valid class files. Or is it
possible to have a valid Oolong program which will generate an invalid
class file.

For example a oolong program which will not detect a Stack overflow, but
I suppose that the JVM will identify this badly constructed class file ?

Could you also give me an example of a right program oolong which
generates an invalid class file ?

In the same idea, what is the algorithm used by oolong to check that the
oolong program is valid. Is it only a syntactic check or will it also
check the semantic of the instructions inside the program ?

Where (aside the book of Engel) can I find more information
(explanations) about Oolong and how it operates ?
Is there an official site for oolong users ? (or at least for Jasmin
users).

What are the advantages of using Oolong rather than using some libraries
like BCEL ?

Finally, what are the main differences between Oolong and Jasmin ?

Thanks in advance.
Chris Uppal - 17 Oct 2003 11:13 GMT
> Oolong permits to generate easily a ClassFile. One of my questions is:
> will all the Oolong programs generate valid class files. Or is it
> possible to have a valid Oolong program which will generate an invalid
> class file.

Without actually trying, I'd expect that Oolong would make it difficult or
impossible to create structurally invalid classfiles (e.g. all the constant
pool references would be valid).  However it's easy enough to create classfiles
that fail the deeper analysis in "verification" -- for instance methods that:
   declare too few locals.
   return the wrong type
   call a method the wrong type parameters
   ...etc..

E.g:
--------------
.class public super TestX
.super java/lang/Object

.method public <init> ()V
.limit stack 1
.limit locals 1
   aload_0
   invokespecial java/lang/Object/<init> ()V
   return
.end method

.method public static main ([Ljava/lang/String;)V
.limit stack 2
.limit locals 1
   getstatic java/lang/System/out Ljava/io/PrintStream;
   bipush 33
   invokevirtual java/io/PrintStream/println (Ljava/lang/String;)V
   return
.end method
--------------

which creates a classfile that fails verification because it's calling a method
with the wrong type parameter on the stack.

> In the same idea, what is the algorithm used by oolong to check that the
> oolong program is valid. Is it only a syntactic check or will it also
> check the semantic of the instructions inside the program ?

The semantic validity of the programs is *your* affair -- if you want a
compiler
that looks after that for you then use java ;-)

> Where (aside the book of Engel) can I find more information
> (explanations) about Oolong and how it operates ?
> Is there an official site for oolong users ?

I don't know of any.  (The book itself recommends this newsgroup ;-)

> What are the advantages of using Oolong rather than using some libraries
> like BCEL ?

Oolong is a (low-level) file-based programming language that generates
classfiles.  BCEL is a library for bytecode analysis and manipulation.  To
drive Oolong you use a text editor, to drive BCEL you write Java code.  Which
do you want to do ?

   -- 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.