jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doshi, Rutvik" <Rutvik.Do...@ca.com>
Subject RE: getting index to this
Date Sun, 22 Sep 2002 19:44:38 GMT
Hi Abel,
 
Your assumption is right for all methods except "Static methods". Static methods do not keep
a reference to the "this" object in its Local Variables table. Positions 0 to N-1 would point
to the parameter's list for static methods and 1 to N for all others.

Regards
Rutvik
-----Original Message-----
From: Abel Wang
To: BCEL Users List
Sent: 9/21/2002 12:58 AM
Subject: Re: getting index to this

Hi BCEL users, thanks for all the help you guys have provided!

Ok, one last question:

I'm trying to get the index of the parameters in a specific method call.
Is
there any easy way to do this?

What I'm currently doing is I've parsed an object using ClassParser into
a
JavaClass.  From there, I can get the Method object of a particular
method
in that class.  I then parse the method name to get the names of the
parameters in the method's parameter list.  I then get the
LocalVariableTable from the Method object, going through all the
variables
until I find the ones whose names match the variable names in the method
parameter list.  And from there, I can get the index.  However, I just
ran
across a case where the method parameter list names do not match the
names
in the LocalVariable table.  So, I guess my question is, what would be
the
right way to do this?  Can I assume that position 0 in the
LocalVariableTable points to this, and 1 to N (N being the number of
parameters in the method) points to LocalVariable objects of the
parameter
list?

Thanks!!!

--Abel



----- Original Message -----
From: "Laurent Martelli" <laurent@bearteam.org>
To: "BCEL Users List" <bcel-user@jakarta.apache.org>
Sent: Friday, September 20, 2002 3:16 AM
Subject: Re: getting index to this


> >>>>> "Abel" == Abel Wang <abelw@nvisionsoftware.net> writes:
> Use the ALOAD_0 instruction to push the this pointer on the stack.



--
To unsubscribe, e-mail:
<mailto:bcel-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:bcel-user-help@jakarta.apache.org>



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message