3273 // If fails due to heap end, go to slow path.
3274 //
3275 // If TLAB is enabled OR inline contiguous is enabled:
3276 // Initialize the allocation.
3277 // Exit.
3278 //
3279 // Go to slow path.
3280
3281 const bool allow_shared_alloc =
3282 Universe::heap()->supports_inline_contig_alloc();
3283
3284 if(UseTLAB) {
3285 Register RoldTopValue = RallocatedObject;
3286 Register RtlabWasteLimitValue = G3_scratch;
3287 Register RnewTopValue = G1_scratch;
3288 Register RendValue = Rscratch;
3289 Register RfreeValue = RnewTopValue;
3290
3291 // check if we can allocate in the TLAB
3292 __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_top_offset()), RoldTopValue); // sets up RalocatedObject
3293 __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_end_offset()), RendValue);
3294 __ add(RoldTopValue, Roffset, RnewTopValue);
3295
3296 // if there is enough space, we do not CAS and do not clear
3297 __ cmp(RnewTopValue, RendValue);
3298 if(ZeroTLAB) {
3299 // the fields have already been cleared
3300 __ brx(Assembler::lessEqualUnsigned, true, Assembler::pt, initialize_header);
3301 } else {
3302 // initialize both the header and fields
3303 __ brx(Assembler::lessEqualUnsigned, true, Assembler::pt, initialize_object);
3304 }
3305 __ delayed()->st_ptr(RnewTopValue, G2_thread, in_bytes(JavaThread::tlab_top_offset()));
3306
3307 // Allocation does not fit in the TLAB.
3308 __ ba_short(slow_case);
3309 } else {
3310 // Allocation in the shared Eden
3311 if (allow_shared_alloc) {
3312 Register RoldTopValue = G1_scratch;
3313 Register RtopAddr = G3_scratch;
|
3273 // If fails due to heap end, go to slow path.
3274 //
3275 // If TLAB is enabled OR inline contiguous is enabled:
3276 // Initialize the allocation.
3277 // Exit.
3278 //
3279 // Go to slow path.
3280
3281 const bool allow_shared_alloc =
3282 Universe::heap()->supports_inline_contig_alloc();
3283
3284 if(UseTLAB) {
3285 Register RoldTopValue = RallocatedObject;
3286 Register RtlabWasteLimitValue = G3_scratch;
3287 Register RnewTopValue = G1_scratch;
3288 Register RendValue = Rscratch;
3289 Register RfreeValue = RnewTopValue;
3290
3291 // check if we can allocate in the TLAB
3292 __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_top_offset()), RoldTopValue); // sets up RalocatedObject
3293 __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_current_end_offset()), RendValue);
3294 __ add(RoldTopValue, Roffset, RnewTopValue);
3295
3296 // if there is enough space, we do not CAS and do not clear
3297 __ cmp(RnewTopValue, RendValue);
3298 if(ZeroTLAB) {
3299 // the fields have already been cleared
3300 __ brx(Assembler::lessEqualUnsigned, true, Assembler::pt, initialize_header);
3301 } else {
3302 // initialize both the header and fields
3303 __ brx(Assembler::lessEqualUnsigned, true, Assembler::pt, initialize_object);
3304 }
3305 __ delayed()->st_ptr(RnewTopValue, G2_thread, in_bytes(JavaThread::tlab_top_offset()));
3306
3307 // Allocation does not fit in the TLAB.
3308 __ ba_short(slow_case);
3309 } else {
3310 // Allocation in the shared Eden
3311 if (allow_shared_alloc) {
3312 Register RoldTopValue = G1_scratch;
3313 Register RtopAddr = G3_scratch;
|