Request for reviews (M): 7059037: Use BIS for zeroing on T4

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu Aug 25 10:50:19 PDT 2011


Thank you, Christian

Christian Thalinger wrote:
> On Aug 25, 2011, at 2:52 AM, Vladimir Kozlov wrote:
> 
>> http://cr.openjdk.java.net/~kvn/7059037/webrev
>>
>> 7059037: Use BIS for zeroing on T4
>>
>> On T4 BIS to the beginning of cache line always zeros it. Use it for zeroing new
>> allocated java objects. The main code is in MacroAssembler::bis_zeroing() and is
>> used by C2 generated code (ClearArray), runtime (Copy::fill_to_aligned_words())
>> and template interpreter (TemplateTable::_new()). New stub zero_aligned_words
>> was added to use in runtime.
>>
>> BIS is used only for objects bigger than BlkZeroingLowLimit (2Kbyte) since it
>> requires membar. 2Hb was selected based on microbenchmark results.
>>
>> I also added wrasi(Reg, immI) instruction which I used during development.
>> VM_Version::has_mru_blk_init() is replaced with has_blk_zeroing() since original
>> was not used.
>> Zap new object in CollectedHeap::allocate_from_tlab_slow() instead of zeroing it
>> since it will be cleaned later in init_obj().
>> Fixed call sites of check_for_bad_heap_word_value() where klass is not
>> initialized to avoid the verification failure.
>>
> 
> src/cpu/sparc/vm/assembler_sparc.cpp:
> 
> +   int cach_line_size = VM_Version::prefetch_data_size();
> 
> I guess this should be cache_line_size.

Fixed.

> 
> +   // Use BIS zeroing only for big arrays since it requires membar.
> +   if (Assembler::is_simm13(blk_zero_size)) { // < 4096
> +     cmp(count, blk_zero_size);
> +   } else {
> +     set(blk_zero_size, temp);
> +     cmp(count, temp);
> +   }
> 
> You could use ensure_simm13_or_reg here:
> 
>   cmp(count, ensure_simm13_or_reg(blk_zero_size, temp));
> 
> but I think you have to add a cmp(Register s1, RegisterOrConstant s2).

I will keep it as it is. I don't want to add new method for just one case.

> 
> +   // Clean the beginning of space upto next cache line.
> 
> There is a space missing:  "up to".

Fixed.

> 
> Otherwise this looks good.
> 
> 
> A side question:  what's the difference between using reg_to_register_object($tmp$$reg) and $tmp$$Register?  What does:

I think reg_to_register_object() was implemented before $tmp$$Register. I copied 
code from original clear_array() which is very old. I will switch to 
$tmp$$Register form.

> 
>   assert(L5->encoding() == R_L5_enc && G1->encoding() == R_G1_enc, "right coding");
> 
> in reg_to_register_object actually check for?

It is old code which verifies that encoding() produces correct result.

Thanks,
Vlaidmir

> 
> -- Christian


More information about the hotspot-compiler-dev mailing list