Re: [rvm-research] Doubts Regarding Jikes Stack Layout for BaseLine Compiler

Michael Bond <[email protected]>
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <[email protected]>
Hi Pushparaj,

asm.comment(...) performs *compile-time* printing. It can't know the 
run-time value of SP.

To print the run-time value of SP, you can do something like the following:

(1) Create an "instrumentation" method in some class (like 
RuntimeEntrypoints) that will get called from the compiled code:

   @Entrypoint
   static void myInstrumentation(Address value) {
     VM.sysWriteln("Run-time value = ", value);
   }

(2) Add a field to Entrypoints that's a handle to the above 
instrumentation method.

(3) Wherever you're currently modifying the baseline compiler to try to 
print SP, do something like this:

     asm.emitPUSH_Reg(SP);
     genParameterRegisterLoad(asm, 1);
asm.emitCALL_Abs(Magic.getTocPointer().plus(Entrypoints.myInstrumentationMethod.getOffset()));

That'll generate code that calls your instrumentation method at run 
time, with one parameter: the run-time value of SP.

Cheers,
Mike

On 04/19/2013 02:18 PM, Pushparaj Motamari wrote:
> Dear all,
>
> I would like to know how to print the current value of a register . Like
> asm.comment("Text");
> when I try to print asm.comment(SP) ,it is just printing as ESP ..
> when I execute the command ..rvm -X:base:mc=true
>
> Thank You
>
> Pushparaj Motamari
> Instituto Superior Technico -Portugal
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
>
>
> _______________________________________________
> Jikesrvm-researchers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.