I am trying to understand how JVM code is executed by JVM.
let's say I write this Java code:
public class Hello { public static void main(String args[]) { int i = 42; String hello ="World"; System.out.println(hello + i); } }
This is the bytecode generated (using the eclipse plugin):
// class version 50.0 (50) // access flags 33 public class cmpe296/Hello { // compiled from: Hello.java // access flags 1 public <init>()V L0 LINENUMBER 3 L0 ALOAD 0 INVOKESPECIAL java/lang/Object.<init>()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 "World" 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 }
This is the only information about java code. But I'm interested in tracking the life cycle of this Java code. that is, when I define: int i = 42 , which is called by C ++ - the JVM implementation method (open jdk).
Is there any tool for analyzing Java code from top to bottom (before generating assembler)?
In particular, my question is:
- Like bytecode interpreted by JVM
- What C ++ code is being called?
I find here: google openjdk code
source share