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