Accessing parameters from a methodHandle
manasthakur17 at gmail.com
Thu Nov 26 12:51:59 UTC 2015
Yes, essentially I was trying to iterate over the parameters of a method in C2. I thought it would be accessible via Method* itself; however, your answer solves the problem. Thanks!
> On 26-Nov-2015, at 6:02 PM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
> Can you elaborate what problem are you trying to solve?
> It sounds like you want to iterate over all parameters of a compiled method in C2.
> methodHandle is a Handle for Method* which an internal representation of a Java method. It doesn't provide any way to extract actual argument representation during compilation.
> During parsing you can use GraphKit::method(), ciMethod::arg_size(), and GraphKit::argument(int i) to operate on arguments of a method being parsed. See opto/library_call.cpp for examples.
> Best regards,
> Vladimir Ivanov
> (BCC: hotspot-dev at openjdk.java.net)
> On 11/26/15 3:22 PM, Manas Thakur wrote:
>> Hello all,
>> I would like to know how to access the parameter nodes (in sequence) from a methodHandle. I could find that in “opto/parse1.cpp”, “ParmNodes” are constructed by determining the “arg_size”. However, this variable doesn’t match the actual number of parameters passed to the corresponding Java method. Any suggestions?
More information about the hotspot-dev