4381
4382 // Allocate the instance:
4383 // If TLAB is enabled:
4384 // Try to allocate in the TLAB.
4385 // If fails, go to the slow path.
4386 // Else If inline contiguous allocations are enabled:
4387 // Try to allocate in eden.
4388 // If fails due to heap end, go to slow path.
4389 //
4390 // If TLAB is enabled OR inline contiguous is enabled:
4391 // Initialize the allocation.
4392 // Exit.
4393 //
4394 // Go to slow path.
4395 if (UseTLAB) {
4396 const Register Rtlab_top = R1_tmp;
4397 const Register Rtlab_end = R2_tmp;
4398 assert_different_registers(Robj, Rsize, Rklass, Rtlab_top, Rtlab_end);
4399
4400 __ ldr(Robj, Address(Rthread, JavaThread::tlab_top_offset()));
4401 __ ldr(Rtlab_end, Address(Rthread, in_bytes(JavaThread::tlab_current_end_offset())));
4402 __ add(Rtlab_top, Robj, Rsize);
4403 __ cmp(Rtlab_top, Rtlab_end);
4404 __ b(slow_case, hi);
4405 __ str(Rtlab_top, Address(Rthread, JavaThread::tlab_top_offset()));
4406 if (ZeroTLAB) {
4407 // the fields have been already cleared
4408 __ b(initialize_header);
4409 } else {
4410 // initialize both the header and fields
4411 __ b(initialize_object);
4412 }
4413 } else {
4414 // Allocation in the shared Eden, if allowed.
4415 if (allow_shared_alloc) {
4416 const Register Rheap_top_addr = R2_tmp;
4417 const Register Rheap_top = R5_tmp;
4418 const Register Rheap_end = Rtemp;
4419 assert_different_registers(Robj, Rklass, Rsize, Rheap_top_addr, Rheap_top, Rheap_end, LR);
4420
4421 // heap_end now (re)loaded in the loop since also used as a scratch register in the CAS
|
4381
4382 // Allocate the instance:
4383 // If TLAB is enabled:
4384 // Try to allocate in the TLAB.
4385 // If fails, go to the slow path.
4386 // Else If inline contiguous allocations are enabled:
4387 // Try to allocate in eden.
4388 // If fails due to heap end, go to slow path.
4389 //
4390 // If TLAB is enabled OR inline contiguous is enabled:
4391 // Initialize the allocation.
4392 // Exit.
4393 //
4394 // Go to slow path.
4395 if (UseTLAB) {
4396 const Register Rtlab_top = R1_tmp;
4397 const Register Rtlab_end = R2_tmp;
4398 assert_different_registers(Robj, Rsize, Rklass, Rtlab_top, Rtlab_end);
4399
4400 __ ldr(Robj, Address(Rthread, JavaThread::tlab_top_offset()));
4401 __ ldr(Rtlab_end, Address(Rthread, in_bytes(JavaThread::tlab_fast_path_end_offset())));
4402 __ add(Rtlab_top, Robj, Rsize);
4403 __ cmp(Rtlab_top, Rtlab_end);
4404 __ b(slow_case, hi);
4405 __ str(Rtlab_top, Address(Rthread, JavaThread::tlab_top_offset()));
4406 if (ZeroTLAB) {
4407 // the fields have been already cleared
4408 __ b(initialize_header);
4409 } else {
4410 // initialize both the header and fields
4411 __ b(initialize_object);
4412 }
4413 } else {
4414 // Allocation in the shared Eden, if allowed.
4415 if (allow_shared_alloc) {
4416 const Register Rheap_top_addr = R2_tmp;
4417 const Register Rheap_top = R5_tmp;
4418 const Register Rheap_end = Rtemp;
4419 assert_different_registers(Robj, Rklass, Rsize, Rheap_top_addr, Rheap_top, Rheap_end, LR);
4420
4421 // heap_end now (re)loaded in the loop since also used as a scratch register in the CAS
|