< prev index next >

src/cpu/sparc/vm/macroAssembler_sparc.cpp

Print this page
rev 7209 : [mq]: inccms


3179     bind(ok);
3180     restore();
3181   }
3182 #endif
3183 }
3184 
3185 
3186 void MacroAssembler::eden_allocate(
3187   Register obj,                        // result: pointer to object after successful allocation
3188   Register var_size_in_bytes,          // object size in bytes if unknown at compile time; invalid otherwise
3189   int      con_size_in_bytes,          // object size in bytes if   known at compile time
3190   Register t1,                         // temp register
3191   Register t2,                         // temp register
3192   Label&   slow_case                   // continuation point if fast allocation fails
3193 ){
3194   // make sure arguments make sense
3195   assert_different_registers(obj, var_size_in_bytes, t1, t2);
3196   assert(0 <= con_size_in_bytes && Assembler::is_simm13(con_size_in_bytes), "illegal object size");
3197   assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0, "object size is not multiple of alignment");
3198 
3199   if (CMSIncrementalMode || !Universe::heap()->supports_inline_contig_alloc()) {
3200     // No allocation in the shared eden.
3201     ba(slow_case);
3202     delayed()->nop();
3203   } else {
3204     // get eden boundaries
3205     // note: we need both top & top_addr!
3206     const Register top_addr = t1;
3207     const Register end      = t2;
3208 
3209     CollectedHeap* ch = Universe::heap();
3210     set((intx)ch->top_addr(), top_addr);
3211     intx delta = (intx)ch->end_addr() - (intx)ch->top_addr();
3212     ld_ptr(top_addr, delta, end);
3213     ld_ptr(top_addr, 0, obj);
3214 
3215     // try to allocate
3216     Label retry;
3217     bind(retry);
3218 #ifdef ASSERT
3219     // make sure eden top is properly aligned


3314     delayed()->nop();
3315     STOP("updated TLAB free is not properly aligned");
3316     bind(L);
3317   }
3318 #endif // ASSERT
3319 
3320   // update the tlab top pointer
3321   st_ptr(free, G2_thread, in_bytes(JavaThread::tlab_top_offset()));
3322   verify_tlab();
3323 }
3324 
3325 
3326 void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case) {
3327   Register top = O0;
3328   Register t1 = G1;
3329   Register t2 = G3;
3330   Register t3 = O1;
3331   assert_different_registers(top, t1, t2, t3, G4, G5 /* preserve G4 and G5 */);
3332   Label do_refill, discard_tlab;
3333 
3334   if (CMSIncrementalMode || !Universe::heap()->supports_inline_contig_alloc()) {
3335     // No allocation in the shared eden.
3336     ba(slow_case);
3337     delayed()->nop();
3338   }
3339 
3340   ld_ptr(G2_thread, in_bytes(JavaThread::tlab_top_offset()), top);
3341   ld_ptr(G2_thread, in_bytes(JavaThread::tlab_end_offset()), t1);
3342   ld_ptr(G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset()), t2);
3343 
3344   // calculate amount of free space
3345   sub(t1, top, t1);
3346   srl_ptr(t1, LogHeapWordSize, t1);
3347 
3348   // Retain tlab and allocate object in shared space if
3349   // the amount free in the tlab is too large to discard.
3350   cmp(t1, t2);
3351   brx(Assembler::lessEqual, false, Assembler::pt, discard_tlab);
3352 
3353   // increment waste limit to prevent getting stuck on this slow path
3354   delayed()->add(t2, ThreadLocalAllocBuffer::refill_waste_limit_increment(), t2);




3179     bind(ok);
3180     restore();
3181   }
3182 #endif
3183 }
3184 
3185 
3186 void MacroAssembler::eden_allocate(
3187   Register obj,                        // result: pointer to object after successful allocation
3188   Register var_size_in_bytes,          // object size in bytes if unknown at compile time; invalid otherwise
3189   int      con_size_in_bytes,          // object size in bytes if   known at compile time
3190   Register t1,                         // temp register
3191   Register t2,                         // temp register
3192   Label&   slow_case                   // continuation point if fast allocation fails
3193 ){
3194   // make sure arguments make sense
3195   assert_different_registers(obj, var_size_in_bytes, t1, t2);
3196   assert(0 <= con_size_in_bytes && Assembler::is_simm13(con_size_in_bytes), "illegal object size");
3197   assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0, "object size is not multiple of alignment");
3198 
3199   if (!Universe::heap()->supports_inline_contig_alloc()) {
3200     // No allocation in the shared eden.
3201     ba(slow_case);
3202     delayed()->nop();
3203   } else {
3204     // get eden boundaries
3205     // note: we need both top & top_addr!
3206     const Register top_addr = t1;
3207     const Register end      = t2;
3208 
3209     CollectedHeap* ch = Universe::heap();
3210     set((intx)ch->top_addr(), top_addr);
3211     intx delta = (intx)ch->end_addr() - (intx)ch->top_addr();
3212     ld_ptr(top_addr, delta, end);
3213     ld_ptr(top_addr, 0, obj);
3214 
3215     // try to allocate
3216     Label retry;
3217     bind(retry);
3218 #ifdef ASSERT
3219     // make sure eden top is properly aligned


3314     delayed()->nop();
3315     STOP("updated TLAB free is not properly aligned");
3316     bind(L);
3317   }
3318 #endif // ASSERT
3319 
3320   // update the tlab top pointer
3321   st_ptr(free, G2_thread, in_bytes(JavaThread::tlab_top_offset()));
3322   verify_tlab();
3323 }
3324 
3325 
3326 void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case) {
3327   Register top = O0;
3328   Register t1 = G1;
3329   Register t2 = G3;
3330   Register t3 = O1;
3331   assert_different_registers(top, t1, t2, t3, G4, G5 /* preserve G4 and G5 */);
3332   Label do_refill, discard_tlab;
3333 
3334   if (!Universe::heap()->supports_inline_contig_alloc()) {
3335     // No allocation in the shared eden.
3336     ba(slow_case);
3337     delayed()->nop();
3338   }
3339 
3340   ld_ptr(G2_thread, in_bytes(JavaThread::tlab_top_offset()), top);
3341   ld_ptr(G2_thread, in_bytes(JavaThread::tlab_end_offset()), t1);
3342   ld_ptr(G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset()), t2);
3343 
3344   // calculate amount of free space
3345   sub(t1, top, t1);
3346   srl_ptr(t1, LogHeapWordSize, t1);
3347 
3348   // Retain tlab and allocate object in shared space if
3349   // the amount free in the tlab is too large to discard.
3350   cmp(t1, t2);
3351   brx(Assembler::lessEqual, false, Assembler::pt, discard_tlab);
3352 
3353   // increment waste limit to prevent getting stuck on this slow path
3354   delayed()->add(t2, ThreadLocalAllocBuffer::refill_waste_limit_increment(), t2);


< prev index next >