Re: [rvm-research] Call-Site Information

Michael Bond <[email protected]> Fri, 10 Jun 2016 19:06:47 -0400
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <[email protected]>
Hi Shoaib,

This sounds like the expected behavior: the value in an object's 
MiscHeader is preserved even after GC copies it. Are you wanting 
something else to happen? (If so, try modifying how copying in GC works; 
there are method that you can implement/modify called "postCopyAlloc" or 
something like that to modify what's in the MiscHeader.)

If I'm missing the point, can you say what's the high-level thing you're 
trying to do? Maybe people on this list will have suggestions for what's 
the best way to do that.

Cheers,
Mike

On 06/10/2016 01:29 PM, Shoaib Akram wrote:
> Thanks Mike! I used the patch to encode the static allocation site ids 
> in the object header. I added instrumentation code to both the 
> baseline compiler and the optimizing compiler 
> (BaselineCompilerImpl.java and 
> opt/hir2lir/ExpandRuntimeServices.java), wherever new allocations are 
> being handled. But for some objects, the allocation site id in 
> MiscHeader at the end of the execution of programs is still the same 
> value I used during initialization. I understand this happening for 
> objects in the boot space But I don't see why this is happening to 
> objects in the mature and the large space. Am I missing something?
>
> On Wed, May 25, 2016 at 4:10 AM, Michael Bond 
> <[email protected] <mailto:[email protected]>> wrote:
>
>     Hi Shoaib,
>
>     Yes, this is definitely possible. There are two different ways to
>     do it:
>
>     (1) Insert instrumentation at compile time that "knows" the static
>     allocation site. For example, during compile time, assign a unique
>     integer for every allocation site, and generate instrumentation
>     that writes that integer into the object header.
>
>     (2) Insert instrumentation at compile time that figures out the
>     allocation site at run time. It can do this by looking at the
>     frame pointer and compiled method ID as you say; it gets a little
>     bit complex with optimized code and inlining.
>
>     My group's patch for calling context profiling
>     (https://sourceforge.net/p/jikesrvm/research-archive/44/) has code
>     related to both approaches.
>
>     One gotcha: There's an issue in Jikes RVM (<=3.1.3, at least) such
>     that if the left-most word (by default, this'll be the MiscHeader
>     word) has the least-significant bit as 1 instead of 0, Jikes RVM
>     will crash (at least with certain GCs?). You can avoid this by
>     making sure it's always 0 or by putting the MiscHeader to the
>     right of the TIB pointer; see our Octet patch for an example of
>     the latter (https://sourceforge.net/p/jikesrvm/research-archive/43/).
>
>     Regarding your question about calling into Jikes RVM from MMTk:
>     this is definitely possible, but it's required to go through a
>     specific interface. See classes in org.mmtk.vm such as
>     org.mmtk.vm.Barriers (an abstract method that has a Jikes
>     RVM-specific implementation). You can add your own method to own
>     of the these classes; the method can access Jikes RVM stuff but be
>     called from MMTk.
>
>     Cheers,
>     Mike
>
>
>     On 05/24/2016 02:28 PM, Shoaib Akram wrote:
>>     Hi All,
>>
>>     Hello from PerformanceLab @ Ghent University in Belgium. I want
>>     to ask if there is support in JikesRVM to identify the call-site
>>     of an allocation. Suppose I have the code below:
>>
>>     1  public IntersectionState() {
>>     2       stack = new StackNode[MAX_STACK_SIZE * 2];
>>     3      for (int i = 0; i < stack.length; i++)
>>     4            stack[i] = new StackNode();
>>     5        rstack = new float[53 * 256];
>>     6    }
>>
>>     Each time a new object is allocated (line no. 4 above), I want to
>>     store the call-site information (line 4) in the header of the
>>     object. Is it possible to get the unique identity of the method
>>     and index within the method, where a new object is being
>>     allocated from?
>>
>>     There are some routines in runtime/Magic.java that let you get
>>     the current frame pointer or the id of the compiled method, but I
>>     am not sure if they usable from within MMTk(?) Does anyone know
>>     an an easy way to get the site information at allocation time?
>>
>>     Thanks in advance!
>>
>>     -- 
>>     *Shoaib Akram*
>>     *ELIS - Gent University*
>>     *Belgium*
>>
>>
>>     ------------------------------------------------------------------------------
>>     Mobile security can be enabling, not merely restricting. Employees who
>>     bring their own devices (BYOD) to work are irked by the imposition of MDM
>>     restrictions. Mobile Device Manager Plus allows you to control only the
>>     apps on BYO-devices by containerizing them, leaving personal data untouched!
>>     https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
>>
>>
>>     _______________________________________________
>>     Jikesrvm-researchers mailing list
>>     [email protected]
>>     <mailto:[email protected]>
>>     https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
>
>
>     ------------------------------------------------------------------------------
>     Mobile security can be enabling, not merely restricting. Employees who
>     bring their own devices (BYOD) to work are irked by the imposition
>     of MDM
>     restrictions. Mobile Device Manager Plus allows you to control
>     only the
>     apps on BYO-devices by containerizing them, leaving personal data
>     untouched!
>     https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
>     _______________________________________________
>     Jikesrvm-researchers mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
>
>
>
>
> -- 
> *Shoaib Akram*
> *ELIS - Gent University*
> *Belgium*
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
>
>
> _______________________________________________
> Jikesrvm-researchers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e

_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers