Skip to main content

Mastering Mustang!

Posted by calvinaustin on December 9, 2004 at 12:25 AM PST

You've got your mustang source snapshot, and have hopefully built your own test JDK. But how can you navigate through the source code? Some things are intuitive, others are the result of years of source changes, integrations and build environment updates.

Perhaps the most complex area to understand is the hotspot source tree, or what
we refer to as the hotspot workspace. The hotspot source probably contains the most OS dependent code in the platform and so is split into chip specific, os specific and common code.

The current layout is


For example most of the interface code between the hotspot JVM and the Linux is in cpu/os/linux/vm directory, this is where we initialize and map the linux threads library to Java threads.

However when you start looking through the share directory you will see a vm directory that contains a collection of unusual directories. You may be able to work out what some do from the contents, however some of the others are a little more cryptic. Here is a mini description of that directory.

adlc, architecture description language compiler. a compile tool that converts .ad files to c++ code for the C2/server compiler.
The ad language is akin to assemble and maps the machine specific instructions to the server compiler framework.

asm, an assembler used to emit code into a codebuffer for the compiler

c1, the client compiler code.

ci, the compiler interface

code, implements caches to store hotspot generated code. compiled methods, runtime hooks and others

compiler, manages compiler tasks and associated support

gc_implementation, contains implementation specifics for the parallel and CMS garbage collectors

gc_interface, the interface between the hotspot and its garbage collector

interpreter, the hotspot interpreter that converts bytecodes to machine instructions with no jit compilation

libadt, abstract data type support classes

memory, core garbage collector classes, also contains the generational train collector

oops, (object oriented pointers) mapping between Java data and code and hotspot internal c++ data structures

opto, c2/server compiler implemention

prims, jvm interface code jvmti, jni

runtime, core JVM, includes bytecode verifier
services, low memory detector and other hotspot services

utilities, misc classes used throughout the vm.

Related Topics >>