< prev index next >

src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp

Print this page




 256       cmp_and_brx_short(t1, var_size_in_bytes, Assembler::equal, Assembler::pt, ok);
 257     } else {
 258       cmp_and_brx_short(t1, con_size_in_bytes, Assembler::equal, Assembler::pt, ok);
 259     }
 260     stop("bad size in initialize_object");
 261     should_not_reach_here();
 262 
 263     bind(ok);
 264   }
 265 
 266 #endif
 267 
 268   if (!(UseTLAB && ZeroTLAB && is_tlab_allocated)) {
 269     // initialize body
 270     const int threshold = 5 * HeapWordSize;              // approximate break even point for code size
 271     if (var_size_in_bytes != noreg) {
 272       // use a loop
 273       add(obj, hdr_size_in_bytes, t1);               // compute address of first element
 274       sub(var_size_in_bytes, hdr_size_in_bytes, t2); // compute size of body
 275       initialize_body(t1, t2);
 276 #ifndef _LP64
 277     } else if (con_size_in_bytes < threshold * 2) {
 278       // on v9 we can do double word stores to fill twice as much space.
 279       assert(hdr_size_in_bytes % 8 == 0, "double word aligned");
 280       assert(con_size_in_bytes % 8 == 0, "double word aligned");
 281       for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += 2 * HeapWordSize) stx(G0, obj, i);
 282 #endif
 283     } else if (con_size_in_bytes <= threshold) {
 284       // use explicit NULL stores
 285       for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += HeapWordSize)     st_ptr(G0, obj, i);
 286     } else if (con_size_in_bytes > hdr_size_in_bytes) {
 287       // use a loop
 288       const Register base  = t1;
 289       const Register index = t2;
 290       add(obj, hdr_size_in_bytes, base);               // compute address of first element
 291       // compute index = number of words to clear
 292       set(con_size_in_bytes - hdr_size_in_bytes, index);
 293       initialize_body(base, index);
 294     }
 295   }
 296 
 297   if (CURRENT_ENV->dtrace_alloc_probes()) {
 298     assert(obj == O0, "must be");
 299     call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)),
 300          relocInfo::runtime_call_type);
 301     delayed()->nop();
 302   }




 256       cmp_and_brx_short(t1, var_size_in_bytes, Assembler::equal, Assembler::pt, ok);
 257     } else {
 258       cmp_and_brx_short(t1, con_size_in_bytes, Assembler::equal, Assembler::pt, ok);
 259     }
 260     stop("bad size in initialize_object");
 261     should_not_reach_here();
 262 
 263     bind(ok);
 264   }
 265 
 266 #endif
 267 
 268   if (!(UseTLAB && ZeroTLAB && is_tlab_allocated)) {
 269     // initialize body
 270     const int threshold = 5 * HeapWordSize;              // approximate break even point for code size
 271     if (var_size_in_bytes != noreg) {
 272       // use a loop
 273       add(obj, hdr_size_in_bytes, t1);               // compute address of first element
 274       sub(var_size_in_bytes, hdr_size_in_bytes, t2); // compute size of body
 275       initialize_body(t1, t2);







 276     } else if (con_size_in_bytes <= threshold) {
 277       // use explicit NULL stores
 278       for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += HeapWordSize)     st_ptr(G0, obj, i);
 279     } else if (con_size_in_bytes > hdr_size_in_bytes) {
 280       // use a loop
 281       const Register base  = t1;
 282       const Register index = t2;
 283       add(obj, hdr_size_in_bytes, base);               // compute address of first element
 284       // compute index = number of words to clear
 285       set(con_size_in_bytes - hdr_size_in_bytes, index);
 286       initialize_body(base, index);
 287     }
 288   }
 289 
 290   if (CURRENT_ENV->dtrace_alloc_probes()) {
 291     assert(obj == O0, "must be");
 292     call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)),
 293          relocInfo::runtime_call_type);
 294     delayed()->nop();
 295   }


< prev index next >