« Return to Thread: [rvm-research] Find a Compiled Method

Re: [rvm-research] Find a Compiled Method

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

Reply to Author | View in Thread

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

 « Return to Thread: [rvm-research] Find a Compiled Method