argument of invokevirtual
  Home FAQ Contact Sign in
comp.lang.java.machine only
 
Advanced search
POPULAR GROUPS

more...

 Up
argument of invokevirtual         

Group: comp.lang.java.machine · Group Profile
Author: Toby Kim
Date: Aug 22, 2006 06:57

Hi.
While I'm writing codes on call graph construction of Java programs,
I've got a question.
I'm wondering how the class name in the argument of invokevirtual is
determined.
Is it the name of a class containing the method definition?

The code snippet (1) is compiled into the bytecode (2).
Neither printStackTrace() nor equals() are not defined in the
AWTException.
But the class name of the first invokevirtual is AWTException,
whereas the class name of the second invokevirtual is Object. Why is
that?
I'd appreciate it if you'd let me know how the class name of
invokevirtual is determined.

(1)
java.awt.AWTException e1 = new java.awt.AWTException("1");
java.awt.AWTException e2 = new java.awt.AWTException("2");
e1.printStackTrace();
e1.equals(e2);

(2)
aload_1
invokevirtual #6; //Method java/awt/AWTException.printStackTrace:()V
aload_1
aload_2
invokevirtual #7; //Method
java/lang/Object.equals:(Ljava/lang/Object;)Z

Thanks.

Regards,
Toby Kim
2 Comments
diggit! del.icio.us! reddit!