3751 __ z_brne(slow_case);
3752
3753 // Get instance_size in InstanceKlass (scaled to a count of bytes).
3754 Register Rsize = offset;
3755 const int mask = 1 << Klass::_lh_instance_slow_path_bit;
3756 __ z_llgf(Rsize, Address(iklass, Klass::layout_helper_offset()));
3757 __ z_tmll(Rsize, mask);
3758 __ z_btrue(slow_case);
3759
3760 // Allocate the instance
3761 // 1) Try to allocate in the TLAB.
3762 // 2) If the above fails (or is not applicable), go to a slow case
3763 // (creates a new TLAB, etc.).
3764 // Note: compared to other architectures, s390's implementation always goes
3765 // to the slow path if TLAB is used and fails.
3766 if (UseTLAB) {
3767 Register RoldTopValue = RallocatedObject;
3768 Register RnewTopValue = tmp;
3769 __ z_lg(RoldTopValue, Address(Z_thread, JavaThread::tlab_top_offset()));
3770 __ load_address(RnewTopValue, Address(RoldTopValue, Rsize));
3771 __ z_cg(RnewTopValue, Address(Z_thread, JavaThread::tlab_end_offset()));
3772 __ z_brh(slow_case);
3773 __ z_stg(RnewTopValue, Address(Z_thread, JavaThread::tlab_top_offset()));
3774
3775 Register RobjectFields = tmp;
3776 Register Rzero = Z_R1_scratch;
3777 __ clear_reg(Rzero, true /*whole reg*/, false); // Load 0L into Rzero. Don't set CC.
3778
3779 if (!ZeroTLAB) {
3780 // The object is initialized before the header. If the object size is
3781 // zero, go directly to the header initialization.
3782 __ z_aghi(Rsize, (int)-sizeof(oopDesc)); // Subtract header size, set CC.
3783 __ z_bre(initialize_header); // Jump if size of fields is zero.
3784
3785 // Initialize object fields.
3786 // See documentation for MVCLE instruction!!!
3787 assert(RobjectFields->encoding() % 2 == 0, "RobjectFields must be an even register");
3788 assert(Rsize->encoding() == (RobjectFields->encoding()+1),
3789 "RobjectFields and Rsize must be a register pair");
3790 assert(Rzero->encoding() % 2 == 1, "Rzero must be an odd register");
3791
|
3751 __ z_brne(slow_case);
3752
3753 // Get instance_size in InstanceKlass (scaled to a count of bytes).
3754 Register Rsize = offset;
3755 const int mask = 1 << Klass::_lh_instance_slow_path_bit;
3756 __ z_llgf(Rsize, Address(iklass, Klass::layout_helper_offset()));
3757 __ z_tmll(Rsize, mask);
3758 __ z_btrue(slow_case);
3759
3760 // Allocate the instance
3761 // 1) Try to allocate in the TLAB.
3762 // 2) If the above fails (or is not applicable), go to a slow case
3763 // (creates a new TLAB, etc.).
3764 // Note: compared to other architectures, s390's implementation always goes
3765 // to the slow path if TLAB is used and fails.
3766 if (UseTLAB) {
3767 Register RoldTopValue = RallocatedObject;
3768 Register RnewTopValue = tmp;
3769 __ z_lg(RoldTopValue, Address(Z_thread, JavaThread::tlab_top_offset()));
3770 __ load_address(RnewTopValue, Address(RoldTopValue, Rsize));
3771 __ z_cg(RnewTopValue, Address(Z_thread, JavaThread::tlab_current_end_offset()));
3772 __ z_brh(slow_case);
3773 __ z_stg(RnewTopValue, Address(Z_thread, JavaThread::tlab_top_offset()));
3774
3775 Register RobjectFields = tmp;
3776 Register Rzero = Z_R1_scratch;
3777 __ clear_reg(Rzero, true /*whole reg*/, false); // Load 0L into Rzero. Don't set CC.
3778
3779 if (!ZeroTLAB) {
3780 // The object is initialized before the header. If the object size is
3781 // zero, go directly to the header initialization.
3782 __ z_aghi(Rsize, (int)-sizeof(oopDesc)); // Subtract header size, set CC.
3783 __ z_bre(initialize_header); // Jump if size of fields is zero.
3784
3785 // Initialize object fields.
3786 // See documentation for MVCLE instruction!!!
3787 assert(RobjectFields->encoding() % 2 == 0, "RobjectFields must be an even register");
3788 assert(Rsize->encoding() == (RobjectFields->encoding()+1),
3789 "RobjectFields and Rsize must be a register pair");
3790 assert(Rzero->encoding() % 2 == 1, "Rzero must be an odd register");
3791
|