Skip to main content

JVM Design

3 replies [Last post]
daveb1975
Offline
Joined: 2005-02-15

Hi,

I'm am currently involved in a project on the j2sdk. Could any of you please tell me if there exists any design or documentation for the j2sdk source code. Any information you may have discovered while working on various j2sdk releases would be very helplful.

Thanks in advance,

David.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
peterkessler
Offline
Joined: 2004-10-27

What kinds of things do you want to know about?

We have don't have as much internal documentation as you'd like, but we do have some slide sets we made up as documentation, training materials for various groups, etc. Mostly what we have is the code, and the history of the code, and the various experiments (some wins, some losses) that either did or did not make it into the product.

I can probably answer some of your questions myself, and I can probably find other engineers to answer the rest of your questions (about the VM).

I hope that helps.

daveb1975
Offline
Joined: 2005-02-15

Thanks for your reply,

I am looking for information on the Jvm of the J2SDK 1.4.1.(or other versions) Specifically, I need information on what code is used when constructors and methods are called during runtime. I wish to take the information such as class name, object name, method details from the Jvm when it runs. Any slide sets or documentation you have would be very helpful towards this project.

Thanks again,

David.

batemana
Offline
Joined: 2003-06-17

You may not need HotSpot details to do what you want. If I interprete your reply correctly then you might be looking to get a stack trace and find out who is creating certain objects or invoking certain methods. To get this type of information there is tools interface in the VM called the JVM Tools Interface (or JVM TI). You can find the spec for it here:

http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html

JVM TI is new in JDK5.0 and didn't exist in 1.4.1. There was an older interface called JVMPI that pre-dated JVM TI. It may be suitable for what you are doing but it's deprecated now and is slated to be removed in mustang.

If you are interested in getting into the detail on this then check out the demo directory in JDK5.0. In the jvmti sub-directory you'll find some useful examples and sample code. The mtrace example uses byte-code instrumentation to instrument method calls so that you can see what is being called. This one should be easy to modify get a complete stack trace to see where the method is called from. This directory also has the source code to the HPROF sample profiler. If you go through the code you'll that use the same byte-code instrument module as the mtrace example is used to instrument object constructors at class load time. This instrumentation is to used to call into the tool to record where the object was created.