[rvm-research] Find a Compiled Method

View: New views
4 Messages — Rating Filter:   Alert me  

[rvm-research] Find a Compiled Method

by Alejandro Taboada :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I'm using baseline Compiler and I trying to find if there are some previous compilation of this method. How can I do that?

For now I'm using VM_EntrypointHelper.getCompiledMethod(clazz, allocMethodName, allocMethodDescriptor); but this only works for internal methods.

Thanks


--
Alejandro Taboada (ataboada@...)

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Jikesrvm-researchers mailing list
Jikesrvm-researchers@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers

Re: [rvm-research] Find a Compiled Method

by Ian Rogers (nabble) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alejandro,

2009/6/23 Alejandro Taboada <ataboada@...>:

> Hi,
> I'm using baseline Compiler and I trying to find if there are some previous
> compilation of this method. How can I do that?
>
> For now I'm using VM_EntrypointHelper.getCompiledMethod(clazz,
> allocMethodName, allocMethodDescriptor); but this only works for internal
> methods.
>
> Thanks
>
>
> --
> Alejandro Taboada (ataboada@...)

firstly, you are using an old version of Jikes RVM so it is well worth
you upgrading. If you would like the ability to run the latest
applications, as a true 64bit VM on Intel Linux or on Windows, and run
benchmarks like DaCapo eclipse 5% faster, I would recommend checking
out MRP [1]. To get the compiled method associated with a method you
need to go via the class loader. In MRP there is a helper method in
MethodReference called findOrCreate (there is similar in the RVM if
you go via MemberReference and do some casting), to then get the
associated Method you can do:

// create a reference to the method you want
MethodReference fooBarRef =
MethodReference.findOrCreate(Atom.findOrCreateAscii("foo"),
Atom.findOrCreateAscii("bar"), Atom.findOrCreateAscii("()V"));
// resolve the reference to ensure it is loaded
RVMMethod fooBar = fooBarRef.resolve();
// get the actual compiled method
CompiledMethod fooBarCM = fooBar.getCurrentCompiledMethod();

If you are only using the baseline compiler then there will only ever
be 1 version of a compiled method. If you are using the optimizing
compiler and adaptive optimization system then there can be multiple
compiled methods that are all stored in the class
org.jikesrvm.compilers.common.CompiledMethods. You can iterate over
the compiled methods in there and each compiled method has a back link
to its original method.

Regards,
Ian

[1] http://mrp.codehaus.org/

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Jikesrvm-researchers mailing list
Jikesrvm-researchers@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers

Re: [rvm-research] Find a Compiled Method

by David P Grove :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alejandro Taboada <ataboada@...> wrote on 06/23/2009 12:48:16 AM:
>
> For now I'm using VM_EntrypointHelper.getCompiledMethod(clazz,
> allocMethodName, allocMethodDescriptor); but this only works for
> internal methods.

You might want to take at look at org.jikesrvm.compilers.common.CompiledMethods.  This class holds pointers to all compiled methods in the system, so you could do a fairly straightforward iteration over the CompiledMethod objects comparing their Method object to the one you are looking for.

--dave

------------------------------------------------------------------------------

_______________________________________________
Jikesrvm-researchers mailing list
Jikesrvm-researchers@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers


Re: [rvm-research] Find a Compiled Method

by Alejandro Taboada :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks! I already fix it! :)



On Tue, Jun 23, 2009 at 10:54 PM, David P Grove <groved@...> wrote:

Alejandro Taboada <ataboada@...> wrote on 06/23/2009 12:48:16 AM:


>
> For now I'm using VM_EntrypointHelper.getCompiledMethod(clazz,
> allocMethodName, allocMethodDescriptor); but this only works for
> internal methods.

You might want to take at look at org.jikesrvm.compilers.common.CompiledMethods.  This class holds pointers to all compiled methods in the system, so you could do a fairly straightforward iteration over the CompiledMethod objects comparing their Method object to the one you are looking for.

--dave


------------------------------------------------------------------------------

_______________________________________________
Jikesrvm-researchers mailing list
Jikesrvm-researchers@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers




--
Alejandro Taboada (ataboada@...)

------------------------------------------------------------------------------

_______________________________________________
Jikesrvm-researchers mailing list
Jikesrvm-researchers@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers