title: Understanding the Java code life-cycle in JVM from Top to Bottom
body: <p>I am trying to understand how a java code is executed by the JVM.</p>
  <p>say, I write this java code:</p>
  <pre><code>public class Hello {
  
      public static void main(String  args[])
      {
          int i = 42;
          String hello =&quot;World&quot;;
          System.out.println(hello + i);
      }
  }
  </code></pre>
  <p>This is the bytecode generated (using eclipse plugin):</p>
  <pre><code>// class version 50.0 (50)
  // access flags 33
  public class cmpe296/Hello {
  
    // compiled from: Hello.java
  
    // access flags 1
    public &lt;init&gt;()V
     L0
      LINENUMBER 3 L0
      ALOAD 0
      INVOKESPECIAL java/lang/Object.&lt;init&gt;()V
      RETURN
     L1
      LOCALVARIABLE this Lcmpe296/Hello; L0 L1 0
      MAXSTACK = 1
      MAXLOCALS = 1
  
    // access flags 9
    public static main([Ljava/lang/String;)V
     L0
      LINENUMBER 7 L0
      LDC &quot;World&quot;
      ASTORE 1
     L1
      LINENUMBER 8 L1
      GETSTATIC java/lang/System.out : Ljava/io/PrintStream;
      ALOAD 1
      INVOKEVIRTUAL java/io/PrintStream.println(Ljava/lang/String;)V
     L2
      LINENUMBER 9 L2
      RETURN
     L3
      LOCALVARIABLE args [Ljava/lang/String; L0 L3 0
      LOCALVARIABLE hello Ljava/lang/String; L1 L3 1
      MAXSTACK = 2
      MAXLOCALS = 2
  }
  </code></pre>
  <p>This is the only information I get about the java code. But I am interested in tracking the life cycle of this java code. i.e. say when I define: <code>int i = 42</code>, which c++ method of the JVM (open jdk) implementation is invoked.</p>
  <p>Is there any tool available to analyze the Java code from top to bottom (till assembly language generation)?</p>
  <h1>Specifically my question is:</h1>
  <ol>
  <li>How is bytecode interpreted by the JVM</li>
  <li>Which c++ code is invoked?</li>
  </ol>
  <p>I am finding stuff here: <a href="http://www.google.com/codesearch/p?hl=en#Y_pa0sa9c2w/src/cpu/x86/vm/interpreter_x86.hpp&amp;q=int&amp;exact_package=http://hg.openjdk.java.net/jdk7/build/hotspot&amp;d=0" rel="nofollow noreferrer">Google code of openjdk</a></p>