< prev index next >

src/cpu/sparc/vm/templateTable_sparc.cpp

Print this page
rev 7209 : [mq]: inccms


3292   __ ldub(RinstanceKlass, in_bytes(InstanceKlass::init_state_offset()), G3_scratch);
3293   __ cmp(G3_scratch, InstanceKlass::fully_initialized);
3294   __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
3295   __ delayed()->ld(RinstanceKlass, in_bytes(Klass::layout_helper_offset()), Roffset);
3296 
3297   // get instance_size in InstanceKlass (already aligned)
3298   //__ ld(RinstanceKlass, in_bytes(Klass::layout_helper_offset()), Roffset);
3299 
3300   // make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class
3301   __ btst(Klass::_lh_instance_slow_path_bit, Roffset);
3302   __ br(Assembler::notZero, false, Assembler::pn, slow_case);
3303   __ delayed()->nop();
3304 
3305   // allocate the instance
3306   // 1) Try to allocate in the TLAB
3307   // 2) if fail, and the TLAB is not full enough to discard, allocate in the shared Eden
3308   // 3) if the above fails (or is not applicable), go to a slow case
3309   // (creates a new TLAB, etc.)
3310 
3311   const bool allow_shared_alloc =
3312     Universe::heap()->supports_inline_contig_alloc() && !CMSIncrementalMode;
3313 
3314   if(UseTLAB) {
3315     Register RoldTopValue = RallocatedObject;
3316     Register RtlabWasteLimitValue = G3_scratch;
3317     Register RnewTopValue = G1_scratch;
3318     Register RendValue = Rscratch;
3319     Register RfreeValue = RnewTopValue;
3320 
3321     // check if we can allocate in the TLAB
3322     __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_top_offset()), RoldTopValue); // sets up RalocatedObject
3323     __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_end_offset()), RendValue);
3324     __ add(RoldTopValue, Roffset, RnewTopValue);
3325 
3326     // if there is enough space, we do not CAS and do not clear
3327     __ cmp(RnewTopValue, RendValue);
3328     if(ZeroTLAB) {
3329       // the fields have already been cleared
3330       __ brx(Assembler::lessEqualUnsigned, true, Assembler::pt, initialize_header);
3331     } else {
3332       // initialize both the header and fields




3292   __ ldub(RinstanceKlass, in_bytes(InstanceKlass::init_state_offset()), G3_scratch);
3293   __ cmp(G3_scratch, InstanceKlass::fully_initialized);
3294   __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
3295   __ delayed()->ld(RinstanceKlass, in_bytes(Klass::layout_helper_offset()), Roffset);
3296 
3297   // get instance_size in InstanceKlass (already aligned)
3298   //__ ld(RinstanceKlass, in_bytes(Klass::layout_helper_offset()), Roffset);
3299 
3300   // make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class
3301   __ btst(Klass::_lh_instance_slow_path_bit, Roffset);
3302   __ br(Assembler::notZero, false, Assembler::pn, slow_case);
3303   __ delayed()->nop();
3304 
3305   // allocate the instance
3306   // 1) Try to allocate in the TLAB
3307   // 2) if fail, and the TLAB is not full enough to discard, allocate in the shared Eden
3308   // 3) if the above fails (or is not applicable), go to a slow case
3309   // (creates a new TLAB, etc.)
3310 
3311   const bool allow_shared_alloc =
3312     Universe::heap()->supports_inline_contig_alloc();
3313 
3314   if(UseTLAB) {
3315     Register RoldTopValue = RallocatedObject;
3316     Register RtlabWasteLimitValue = G3_scratch;
3317     Register RnewTopValue = G1_scratch;
3318     Register RendValue = Rscratch;
3319     Register RfreeValue = RnewTopValue;
3320 
3321     // check if we can allocate in the TLAB
3322     __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_top_offset()), RoldTopValue); // sets up RalocatedObject
3323     __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_end_offset()), RendValue);
3324     __ add(RoldTopValue, Roffset, RnewTopValue);
3325 
3326     // if there is enough space, we do not CAS and do not clear
3327     __ cmp(RnewTopValue, RendValue);
3328     if(ZeroTLAB) {
3329       // the fields have already been cleared
3330       __ brx(Assembler::lessEqualUnsigned, true, Assembler::pt, initialize_header);
3331     } else {
3332       // initialize both the header and fields


< prev index next >