Resolving a methodOop from a constantPool-index

Keith McGuigan Keith.McGuigan at Sun.COM
Tue Jan 8 15:00:30 PST 2008


Something like this: (?)

Use constantPoolOop::field_or_method_at() to get the the 
class/name_and_type index pair.  Use constantPoolOop::klass_at() to get 
the instanceKlass.  Use constantPoolOop::name_and_type_at() to get the 
indices for the method name and the method signature, then get the 
corresponding symbolOops for the name and signature (with symbol_at()). 
  You can then call instanceKlass::find_method() on the retrieved class 
with the method name and signature to get your methodOop.

Does that help?  This kind-of assumes that initialization is done, the 
class is loaded, etc., etc.  It can be trickier if that isn't the case.

--
- Keith

Peter Helfer wrote:
> Quick question: how to resolve a methodOop, given a constantPool-Index, 
> and the constantPoolHandle.. ?
> 
> Thanks, Peter



More information about the hotspot-runtime-dev mailing list