src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp
changeset 57777 90ead0febf56
parent 50380 bec342339138
child 57811 947252a54b98
equal deleted inserted replaced
57774:21dccfac0ec5 57777:90ead0febf56
    94   if (UseBiasedLocking) {
    94   if (UseBiasedLocking) {
    95     biased_locking_enter(obj, hdr, Z_R1_scratch, Z_R0_scratch, done, &slow_case);
    95     biased_locking_enter(obj, hdr, Z_R1_scratch, Z_R0_scratch, done, &slow_case);
    96   }
    96   }
    97 
    97 
    98   // and mark it as unlocked.
    98   // and mark it as unlocked.
    99   z_oill(hdr, markOopDesc::unlocked_value);
    99   z_oill(hdr, markWord::unlocked_value);
   100   // Save unlocked object header into the displaced header location on the stack.
   100   // Save unlocked object header into the displaced header location on the stack.
   101   z_stg(hdr, Address(disp_hdr, (intptr_t)0));
   101   z_stg(hdr, Address(disp_hdr, (intptr_t)0));
   102   // Test if object header is still the same (i.e. unlocked), and if so, store the
   102   // Test if object header is still the same (i.e. unlocked), and if so, store the
   103   // displaced header address in the object header. If it is not the same, get the
   103   // displaced header address in the object header. If it is not the same, get the
   104   // object header instead.
   104   // object header instead.
   113   }
   113   }
   114   branch_optimized(Assembler::bcondEqual, done);
   114   branch_optimized(Assembler::bcondEqual, done);
   115   // If the object header was not the same, it is now in the hdr register.
   115   // If the object header was not the same, it is now in the hdr register.
   116   // => Test if it is a stack pointer into the same stack (recursive locking), i.e.:
   116   // => Test if it is a stack pointer into the same stack (recursive locking), i.e.:
   117   //
   117   //
   118   // 1) (hdr & markOopDesc::lock_mask_in_place) == 0
   118   // 1) (hdr & markWord::lock_mask_in_place) == 0
   119   // 2) rsp <= hdr
   119   // 2) rsp <= hdr
   120   // 3) hdr <= rsp + page_size
   120   // 3) hdr <= rsp + page_size
   121   //
   121   //
   122   // These 3 tests can be done by evaluating the following expression:
   122   // These 3 tests can be done by evaluating the following expression:
   123   //
   123   //
   124   // (hdr - Z_SP) & (~(page_size-1) | markOopDesc::lock_mask_in_place)
   124   // (hdr - Z_SP) & (~(page_size-1) | markWord::lock_mask_in_place)
   125   //
   125   //
   126   // assuming both the stack pointer and page_size have their least
   126   // assuming both the stack pointer and page_size have their least
   127   // significant 2 bits cleared and page_size is a power of 2
   127   // significant 2 bits cleared and page_size is a power of 2
   128   z_sgr(hdr, Z_SP);
   128   z_sgr(hdr, Z_SP);
   129 
   129 
   130   load_const_optimized(Z_R0_scratch, (~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place));
   130   load_const_optimized(Z_R0_scratch, (~(os::vm_page_size()-1) | markWord::lock_mask_in_place));
   131   z_ngr(hdr, Z_R0_scratch); // AND sets CC (result eq/ne 0).
   131   z_ngr(hdr, Z_R0_scratch); // AND sets CC (result eq/ne 0).
   132   // For recursive locking, the result is zero. => Save it in the displaced header
   132   // For recursive locking, the result is zero. => Save it in the displaced header
   133   // location (NULL in the displaced hdr location indicates recursive locking).
   133   // location (NULL in the displaced hdr location indicates recursive locking).
   134   z_stg(hdr, Address(disp_hdr, (intptr_t)0));
   134   z_stg(hdr, Address(disp_hdr, (intptr_t)0));
   135   // Otherwise we don't care about the result and handle locking via runtime call.
   135   // Otherwise we don't care about the result and handle locking via runtime call.
   190   if (UseBiasedLocking && !len->is_valid()) {
   190   if (UseBiasedLocking && !len->is_valid()) {
   191     assert_different_registers(obj, klass, len, t1);
   191     assert_different_registers(obj, klass, len, t1);
   192     z_lg(t1, Address(klass, Klass::prototype_header_offset()));
   192     z_lg(t1, Address(klass, Klass::prototype_header_offset()));
   193   } else {
   193   } else {
   194     // This assumes that all prototype bits fit in an int32_t.
   194     // This assumes that all prototype bits fit in an int32_t.
   195     load_const_optimized(t1, (intx)markOopDesc::prototype());
   195     load_const_optimized(t1, (intx)markWord::prototype().value());
   196   }
   196   }
   197   z_stg(t1, Address(obj, oopDesc::mark_offset_in_bytes()));
   197   z_stg(t1, Address(obj, oopDesc::mark_offset_in_bytes()));
   198 
   198 
   199   if (len->is_valid()) {
   199   if (len->is_valid()) {
   200     // Length will be in the klass gap, if one exists.
   200     // Length will be in the klass gap, if one exists.