< prev index next >

src/hotspot/cpu/s390/templateTable_s390.cpp

Print this page
rev 49264 : [mq]: event-only


3865   __ z_brne(slow_case);
3866 
3867   // Get instance_size in InstanceKlass (scaled to a count of bytes).
3868   Register Rsize = offset;
3869   const int mask = 1 << Klass::_lh_instance_slow_path_bit;
3870   __ z_llgf(Rsize, Address(iklass, Klass::layout_helper_offset()));
3871   __ z_tmll(Rsize, mask);
3872   __ z_btrue(slow_case);
3873 
3874   // Allocate the instance
3875   // 1) Try to allocate in the TLAB.
3876   // 2) If the above fails (or is not applicable), go to a slow case
3877   // (creates a new TLAB, etc.).
3878   // Note: compared to other architectures, s390's implementation always goes
3879   // to the slow path if TLAB is used and fails.
3880   if (UseTLAB) {
3881     Register RoldTopValue = RallocatedObject;
3882     Register RnewTopValue = tmp;
3883     __ z_lg(RoldTopValue, Address(Z_thread, JavaThread::tlab_top_offset()));
3884     __ load_address(RnewTopValue, Address(RoldTopValue, Rsize));
3885     __ z_cg(RnewTopValue, Address(Z_thread, JavaThread::tlab_end_offset()));
3886     __ z_brh(slow_case);
3887     __ z_stg(RnewTopValue, Address(Z_thread, JavaThread::tlab_top_offset()));
3888 
3889     Register RobjectFields = tmp;
3890     Register Rzero = Z_R1_scratch;
3891     __ clear_reg(Rzero, true /*whole reg*/, false); // Load 0L into Rzero. Don't set CC.
3892 
3893     if (!ZeroTLAB) {
3894       // The object is initialized before the header. If the object size is
3895       // zero, go directly to the header initialization.
3896       __ z_aghi(Rsize, (int)-sizeof(oopDesc)); // Subtract header size, set CC.
3897       __ z_bre(initialize_header);             // Jump if size of fields is zero.
3898 
3899       // Initialize object fields.
3900       // See documentation for MVCLE instruction!!!
3901       assert(RobjectFields->encoding() % 2 == 0, "RobjectFields must be an even register");
3902       assert(Rsize->encoding() == (RobjectFields->encoding()+1),
3903              "RobjectFields and Rsize must be a register pair");
3904       assert(Rzero->encoding() % 2 == 1, "Rzero must be an odd register");
3905 




3865   __ z_brne(slow_case);
3866 
3867   // Get instance_size in InstanceKlass (scaled to a count of bytes).
3868   Register Rsize = offset;
3869   const int mask = 1 << Klass::_lh_instance_slow_path_bit;
3870   __ z_llgf(Rsize, Address(iklass, Klass::layout_helper_offset()));
3871   __ z_tmll(Rsize, mask);
3872   __ z_btrue(slow_case);
3873 
3874   // Allocate the instance
3875   // 1) Try to allocate in the TLAB.
3876   // 2) If the above fails (or is not applicable), go to a slow case
3877   // (creates a new TLAB, etc.).
3878   // Note: compared to other architectures, s390's implementation always goes
3879   // to the slow path if TLAB is used and fails.
3880   if (UseTLAB) {
3881     Register RoldTopValue = RallocatedObject;
3882     Register RnewTopValue = tmp;
3883     __ z_lg(RoldTopValue, Address(Z_thread, JavaThread::tlab_top_offset()));
3884     __ load_address(RnewTopValue, Address(RoldTopValue, Rsize));
3885     __ z_cg(RnewTopValue, Address(Z_thread, JavaThread::tlab_current_end_offset()));
3886     __ z_brh(slow_case);
3887     __ z_stg(RnewTopValue, Address(Z_thread, JavaThread::tlab_top_offset()));
3888 
3889     Register RobjectFields = tmp;
3890     Register Rzero = Z_R1_scratch;
3891     __ clear_reg(Rzero, true /*whole reg*/, false); // Load 0L into Rzero. Don't set CC.
3892 
3893     if (!ZeroTLAB) {
3894       // The object is initialized before the header. If the object size is
3895       // zero, go directly to the header initialization.
3896       __ z_aghi(Rsize, (int)-sizeof(oopDesc)); // Subtract header size, set CC.
3897       __ z_bre(initialize_header);             // Jump if size of fields is zero.
3898 
3899       // Initialize object fields.
3900       // See documentation for MVCLE instruction!!!
3901       assert(RobjectFields->encoding() % 2 == 0, "RobjectFields must be an even register");
3902       assert(Rsize->encoding() == (RobjectFields->encoding()+1),
3903              "RobjectFields and Rsize must be a register pair");
3904       assert(Rzero->encoding() % 2 == 1, "Rzero must be an odd register");
3905 


< prev index next >