hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.hpp
changeset 35862 411842d0c882
parent 33784 e4fcaa6095dc
child 42598 45562c0473fb
equal deleted inserted replaced
35853:9cffac525e28 35862:411842d0c882
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    56 
    56 
    57   virtual bool has_write_ref_pre_barrier() { return true; }
    57   virtual bool has_write_ref_pre_barrier() { return true; }
    58 
    58 
    59   // We export this to make it available in cases where the static
    59   // We export this to make it available in cases where the static
    60   // type of the barrier set is known.  Note that it is non-virtual.
    60   // type of the barrier set is known.  Note that it is non-virtual.
    61   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {
    61   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal);
    62     T heap_oop = oopDesc::load_heap_oop(field);
       
    63     if (!oopDesc::is_null(heap_oop)) {
       
    64       enqueue(oopDesc::decode_heap_oop(heap_oop));
       
    65     }
       
    66   }
       
    67 
    62 
    68   // These are the more general virtual versions.
    63   // These are the more general virtual versions.
    69   virtual void write_ref_field_pre_work(oop* field, oop new_val) {
    64   inline virtual void write_ref_field_pre_work(oop* field, oop new_val);
    70     inline_write_ref_field_pre(field, new_val);
    65   inline virtual void write_ref_field_pre_work(narrowOop* field, oop new_val);
    71   }
       
    72   virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) {
       
    73     inline_write_ref_field_pre(field, new_val);
       
    74   }
       
    75   virtual void write_ref_field_pre_work(void* field, oop new_val) {
    66   virtual void write_ref_field_pre_work(void* field, oop new_val) {
    76     guarantee(false, "Not needed");
    67     guarantee(false, "Not needed");
    77   }
    68   }
    78 
    69 
    79   template <class T> void write_ref_array_pre_work(T* dst, int count);
    70   template <class T> void write_ref_array_pre_work(T* dst, int count);
    96   bool is_card_claimed(size_t card_index) {
    87   bool is_card_claimed(size_t card_index) {
    97     jbyte val = _byte_map[card_index];
    88     jbyte val = _byte_map[card_index];
    98     return (val & (clean_card_mask_val() | claimed_card_val())) == claimed_card_val();
    89     return (val & (clean_card_mask_val() | claimed_card_val())) == claimed_card_val();
    99   }
    90   }
   100 
    91 
   101   void set_card_claimed(size_t card_index) {
    92   inline void set_card_claimed(size_t card_index);
   102       jbyte val = _byte_map[card_index];
       
   103       if (val == clean_card_val()) {
       
   104         val = (jbyte)claimed_card_val();
       
   105       } else {
       
   106         val |= (jbyte)claimed_card_val();
       
   107       }
       
   108       _byte_map[card_index] = val;
       
   109   }
       
   110 
    93 
   111   void verify_g1_young_region(MemRegion mr) PRODUCT_RETURN;
    94   void verify_g1_young_region(MemRegion mr) PRODUCT_RETURN;
   112   void g1_mark_as_young(const MemRegion& mr);
    95   void g1_mark_as_young(const MemRegion& mr);
   113 
    96 
   114   bool mark_card_deferred(size_t card_index);
    97   bool mark_card_deferred(size_t card_index);