Help with generating library call

Rohit Arul Raj rohitarulraj at gmail.com
Sun Aug 27 16:27:18 UTC 2017


On Wed, Aug 2, 2017 at 9:02 PM, Rohit Arul Raj <rohitarulraj at gmail.com> wrote:
> On Mon, Jul 31, 2017 at 1:48 PM, Andrew Haley <aph at redhat.com> wrote:
>> On 31/07/17 05:33, Rohit Arul Raj wrote:
>>> Can any one point me in the right direction? Any reference to similar
>>> implementation of any other C or Math library function will be
>>> helpful?

Hi All,

I got the call to 'memset' working, needed to save xmm0 & xmm1 registers also.
Now for object initialization, instead of generating loop code I am
using call to 'memset'. To confirm that all the objects gets
initialized through 'memset', i tried to print out the objects/array
sizes just before the call to memset/loop code.
{
      __ push (rdi);
      __ push (rsi);
      __ push (rax);
      __ push (rdx);
      __ subptr(rsp, 8);
      __ movptr (rsi, rdx);
      __ movb (Address(rsp, 0), 73);
      __ movb (Address(rsp, 1), 110);
      __ movb (Address(rsp, 2), 58);
      __ movb (Address(rsp, 3), 37);
      __ movb (Address(rsp, 4), 100);
      __ movb (Address(rsp, 5), 10);
      __ movb (Address(rsp, 6), 0);
      __ movptr (rdi, rsp);
      __ call_VM_leaf (CAST_FROM_FN_PTR(address, printf), rdi, rsi);
      __ addptr(rsp, 8);
      __ pop (rdx);
      __ pop (rax);
      __ pop (rsi);
      __ pop (rdi);
}

I printed the object/array sizes that get initialized from the
following functions:

a) From the interpreter:
       src/cpu/x86/vm/templateTable_x86_64.cpp:
        Function:void TemplateTable::_new()

b) From the compiler:
   src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
   i) C1_MacroAssembler::initialize_object (const object sizes).
   ii) C1_MacroAssembler::initialize_body (for arrays and variable
object sizes).

   src/cpu/x86/vm/macroAssembler_x86.cpp
   iii)  void MacroAssembler::clear_mem

But the overall total bytes initialized by adding all the above,
accounts for only 30% of the total created bytes taken from GC log.

Is there anywhere else in the code where the memory gets initialized
which I might have missed? Any other suggestions?

Thanks in advance,
Rohit


More information about the hotspot-dev mailing list