comparison src/share/vm/oops/markOop.inline.hpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 74ee0db180fa
children
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2006, 2012, 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.
24 24
25 #ifndef SHARE_VM_OOPS_MARKOOP_INLINE_HPP 25 #ifndef SHARE_VM_OOPS_MARKOOP_INLINE_HPP
26 #define SHARE_VM_OOPS_MARKOOP_INLINE_HPP 26 #define SHARE_VM_OOPS_MARKOOP_INLINE_HPP
27 27
28 #include "oops/klass.hpp" 28 #include "oops/klass.hpp"
29 #include "oops/klassOop.hpp"
30 #include "oops/markOop.hpp" 29 #include "oops/markOop.hpp"
31 #include "runtime/globals.hpp" 30 #include "runtime/globals.hpp"
32 31
33 // Should this header be preserved during GC (when biased locking is enabled)? 32 // Should this header be preserved during GC (when biased locking is enabled)?
34 inline bool markOopDesc::must_be_preserved_with_bias(oop obj_containing_mark) const { 33 inline bool markOopDesc::must_be_preserved_with_bias(oop obj_containing_mark) const {
82 return must_be_preserved_with_bias_for_promotion_failure(obj_containing_mark); 81 return must_be_preserved_with_bias_for_promotion_failure(obj_containing_mark);
83 } 82 }
84 83
85 84
86 // Same as must_be_preserved_with_bias_for_promotion_failure() except that 85 // Same as must_be_preserved_with_bias_for_promotion_failure() except that
87 // it takes a klassOop argument, instead of the object of which this is the mark word. 86 // it takes a Klass* argument, instead of the object of which this is the mark word.
88 inline bool markOopDesc::must_be_preserved_with_bias_for_cms_scavenge(klassOop klass_of_obj_containing_mark) const { 87 inline bool markOopDesc::must_be_preserved_with_bias_for_cms_scavenge(Klass* klass_of_obj_containing_mark) const {
89 assert(UseBiasedLocking, "unexpected"); 88 assert(UseBiasedLocking, "unexpected");
90 // CMS scavenges preserve mark words in similar fashion to promotion failures; see above 89 // CMS scavenges preserve mark words in similar fashion to promotion failures; see above
91 if (has_bias_pattern() || 90 if (has_bias_pattern() ||
92 klass_of_obj_containing_mark->klass_part()->prototype_header()->has_bias_pattern()) { 91 klass_of_obj_containing_mark->prototype_header()->has_bias_pattern()) {
93 return true; 92 return true;
94 } 93 }
95 return (!is_unlocked() || !has_no_hash()); 94 return (!is_unlocked() || !has_no_hash());
96 } 95 }
97 96
98 // Same as must_be_preserved_for_promotion_failure() except that 97 // Same as must_be_preserved_for_promotion_failure() except that
99 // it takes a klassOop argument, instead of the object of which this is the mark word. 98 // it takes a Klass* argument, instead of the object of which this is the mark word.
100 inline bool markOopDesc::must_be_preserved_for_cms_scavenge(klassOop klass_of_obj_containing_mark) const { 99 inline bool markOopDesc::must_be_preserved_for_cms_scavenge(Klass* klass_of_obj_containing_mark) const {
101 if (!UseBiasedLocking) 100 if (!UseBiasedLocking)
102 return (!is_unlocked() || !has_no_hash()); 101 return (!is_unlocked() || !has_no_hash());
103 return must_be_preserved_with_bias_for_cms_scavenge(klass_of_obj_containing_mark); 102 return must_be_preserved_with_bias_for_cms_scavenge(klass_of_obj_containing_mark);
104 } 103 }
105 104
106 inline markOop markOopDesc::prototype_for_object(oop obj) { 105 inline markOop markOopDesc::prototype_for_object(oop obj) {
107 #ifdef ASSERT 106 #ifdef ASSERT
108 markOop prototype_header = obj->klass()->klass_part()->prototype_header(); 107 markOop prototype_header = obj->klass()->prototype_header();
109 assert(prototype_header == prototype() || prototype_header->has_bias_pattern(), "corrupt prototype header"); 108 assert(prototype_header == prototype() || prototype_header->has_bias_pattern(), "corrupt prototype header");
110 #endif 109 #endif
111 return obj->klass()->klass_part()->prototype_header(); 110 return obj->klass()->prototype_header();
112 } 111 }
113 112
114 #endif // SHARE_VM_OOPS_MARKOOP_INLINE_HPP 113 #endif // SHARE_VM_OOPS_MARKOOP_INLINE_HPP