< prev index next >

src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp

Print this page




  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "asm/macroAssembler.inline.hpp"
  28 #include "registerSaver_s390.hpp"
  29 #include "gc/g1/g1CardTable.hpp"
  30 #include "gc/g1/g1BarrierSet.hpp"
  31 #include "gc/g1/g1BarrierSetAssembler.hpp"

  32 #include "gc/g1/heapRegion.hpp"
  33 #include "gc/shared/collectedHeap.hpp"
  34 #include "runtime/thread.hpp"
  35 #include "interpreter/interp_masm.hpp"
  36 
  37 #define __ masm->
  38 
  39 #define BLOCK_COMMENT(str) if (PrintAssembly) __ block_comment(str)
  40 
  41 void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators,
  42                                                             Register addr, Register count) {
  43   bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0;
  44 
  45   // With G1, don't generate the call if we statically know that the target is uninitialized.
  46   if (!dest_uninitialized) {
  47     // Is marking active?
  48     Label filtered;
  49     assert_different_registers(addr,  Z_R0_scratch);  // would be destroyed by push_frame()
  50     assert_different_registers(count, Z_R0_scratch);  // would be destroyed by push_frame()
  51     Register Rtmp1 = Z_R0_scratch;
  52     const int active_offset = in_bytes(JavaThread::satb_mark_queue_offset() +
  53                                        SATBMarkQueue::byte_offset_of_active());
  54     if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
  55       __ load_and_test_int(Rtmp1, Address(Z_thread, active_offset));
  56     } else {
  57       guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
  58       __ load_and_test_byte(Rtmp1, Address(Z_thread, active_offset));
  59     }
  60     __ z_bre(filtered); // Activity indicator is zero, so there is no marking going on currently.
  61 
  62     RegisterSaver::save_live_registers(masm, RegisterSaver::arg_registers); // Creates frame.
  63 
  64     if (UseCompressedOops) {
  65       __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSet::write_ref_array_pre_narrow_oop_entry), addr, count);
  66     } else {
  67       __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSet::write_ref_array_pre_oop_entry), addr, count);
  68     }
  69 
  70     RegisterSaver::restore_live_registers(masm, RegisterSaver::arg_registers);
  71 
  72     __ bind(filtered);
  73   }


  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "asm/macroAssembler.inline.hpp"
  28 #include "registerSaver_s390.hpp"
  29 #include "gc/g1/g1CardTable.hpp"
  30 #include "gc/g1/g1BarrierSet.hpp"
  31 #include "gc/g1/g1BarrierSetAssembler.hpp"
  32 #include "gc/g1/g1ThreadLocalData.hpp"
  33 #include "gc/g1/heapRegion.hpp"
  34 #include "gc/shared/collectedHeap.hpp"

  35 #include "interpreter/interp_masm.hpp"
  36 
  37 #define __ masm->
  38 
  39 #define BLOCK_COMMENT(str) if (PrintAssembly) __ block_comment(str)
  40 
  41 void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators,
  42                                                             Register addr, Register count) {
  43   bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0;
  44 
  45   // With G1, don't generate the call if we statically know that the target is uninitialized.
  46   if (!dest_uninitialized) {
  47     // Is marking active?
  48     Label filtered;
  49     assert_different_registers(addr,  Z_R0_scratch);  // would be destroyed by push_frame()
  50     assert_different_registers(count, Z_R0_scratch);  // would be destroyed by push_frame()
  51     Register Rtmp1 = Z_R0_scratch;
  52     const int active_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());

  53     if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
  54       __ load_and_test_int(Rtmp1, Address(Z_thread, active_offset));
  55     } else {
  56       guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
  57       __ load_and_test_byte(Rtmp1, Address(Z_thread, active_offset));
  58     }
  59     __ z_bre(filtered); // Activity indicator is zero, so there is no marking going on currently.
  60 
  61     RegisterSaver::save_live_registers(masm, RegisterSaver::arg_registers); // Creates frame.
  62 
  63     if (UseCompressedOops) {
  64       __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSet::write_ref_array_pre_narrow_oop_entry), addr, count);
  65     } else {
  66       __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSet::write_ref_array_pre_oop_entry), addr, count);
  67     }
  68 
  69     RegisterSaver::restore_live_registers(masm, RegisterSaver::arg_registers);
  70 
  71     __ bind(filtered);
  72   }
< prev index next >