< prev index next >

src/share/vm/oops/instanceRefKlass.inline.hpp

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP
  26 #define SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP
  27 
  28 #include "classfile/javaClasses.hpp"
  29 #include "memory/referenceProcessor.hpp"
  30 #include "oops/instanceRefKlass.hpp"
  31 #include "oops/instanceKlass.inline.hpp"

  32 #include "oops/oop.inline.hpp"
  33 #include "utilities/debug.hpp"
  34 #include "utilities/globalDefinitions.hpp"
  35 #include "utilities/macros.hpp"
  36 
  37 template <bool nv, typename T, class OopClosureType, class Contains>
  38 void InstanceRefKlass::oop_oop_iterate_ref_processing_specialized(oop obj, OopClosureType* closure, Contains& contains) {
  39   T* disc_addr = (T*)java_lang_ref_Reference::discovered_addr(obj);
  40   if (closure->apply_to_weak_ref_discovered_field()) {
  41     Devirtualizer<nv>::do_oop(closure, disc_addr);
  42   }
  43 
  44   T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
  45   T heap_oop = oopDesc::load_heap_oop(referent_addr);
  46   ReferenceProcessor* rp = closure->_ref_processor;
  47   if (!oopDesc::is_null(heap_oop)) {
  48     oop referent = oopDesc::decode_heap_oop_not_null(heap_oop);
  49     if (!referent->is_gc_marked() && (rp != NULL) &&
  50         rp->discover_reference(obj, reference_type())) {
  51       return;




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP
  26 #define SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP
  27 
  28 #include "classfile/javaClasses.hpp"
  29 #include "gc/shared/referenceProcessor.hpp"

  30 #include "oops/instanceKlass.inline.hpp"
  31 #include "oops/instanceRefKlass.hpp"
  32 #include "oops/oop.inline.hpp"
  33 #include "utilities/debug.hpp"
  34 #include "utilities/globalDefinitions.hpp"
  35 #include "utilities/macros.hpp"
  36 
  37 template <bool nv, typename T, class OopClosureType, class Contains>
  38 void InstanceRefKlass::oop_oop_iterate_ref_processing_specialized(oop obj, OopClosureType* closure, Contains& contains) {
  39   T* disc_addr = (T*)java_lang_ref_Reference::discovered_addr(obj);
  40   if (closure->apply_to_weak_ref_discovered_field()) {
  41     Devirtualizer<nv>::do_oop(closure, disc_addr);
  42   }
  43 
  44   T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
  45   T heap_oop = oopDesc::load_heap_oop(referent_addr);
  46   ReferenceProcessor* rp = closure->_ref_processor;
  47   if (!oopDesc::is_null(heap_oop)) {
  48     oop referent = oopDesc::decode_heap_oop_not_null(heap_oop);
  49     if (!referent->is_gc_marked() && (rp != NULL) &&
  50         rp->discover_reference(obj, reference_type())) {
  51       return;


< prev index next >