20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/javaClasses.hpp"
27 #include "classfile/dictionary.hpp"
28 #include "classfile/systemDictionary.hpp"
29 #include "classfile/vmSymbols.hpp"
30 #include "gc_implementation/shared/markSweep.inline.hpp"
31 #include "gc_interface/collectedHeap.inline.hpp"
32 #include "memory/heapInspection.hpp"
33 #include "memory/metadataFactory.hpp"
34 #include "memory/oopFactory.hpp"
35 #include "memory/resourceArea.hpp"
36 #include "oops/instanceKlass.hpp"
37 #include "oops/klass.inline.hpp"
38 #include "oops/oop.inline2.hpp"
39 #include "runtime/atomic.hpp"
40 #include "utilities/stack.hpp"
41 #include "utilities/macros.hpp"
42 #if INCLUDE_ALL_GCS
43 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
44 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
45 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
46 #endif // INCLUDE_ALL_GCS
47
48 void Klass::set_name(Symbol* n) {
49 _name = n;
50 if (_name != NULL) _name->increment_refcount();
51 }
52
53 bool Klass::is_subclass_of(const Klass* k) const {
54 // Run up the super chain and check
55 if (this == k) return true;
56
57 Klass* t = const_cast<Klass*>(this)->super();
58
59 while (t != NULL) {
151 set_super(NULL);
152 for (juint i = 0; i < Klass::primary_super_limit(); i++) {
153 _primary_supers[i] = NULL;
154 }
155 set_secondary_supers(NULL);
156 set_secondary_super_cache(NULL);
157 _primary_supers[0] = k;
158 set_super_check_offset(in_bytes(primary_supers_offset()));
159
160 set_java_mirror(NULL);
161 set_modifier_flags(0);
162 set_layout_helper(Klass::_lh_neutral_value);
163 set_name(NULL);
164 AccessFlags af;
165 af.set_flags(0);
166 set_access_flags(af);
167 set_subklass(NULL);
168 set_next_sibling(NULL);
169 set_next_link(NULL);
170 set_alloc_count(0);
171 TRACE_SET_KLASS_TRACE_ID(this, 0);
172
173 set_prototype_header(markOopDesc::prototype());
174 set_biased_lock_revocation_count(0);
175 set_last_biased_lock_bulk_revocation_time(0);
176
177 // The klass doesn't have any references at this point.
178 clear_modified_oops();
179 clear_accumulated_modified_oops();
180 }
181
182 jint Klass::array_layout_helper(BasicType etype) {
183 assert(etype >= T_BOOLEAN && etype <= T_OBJECT, "valid etype");
184 // Note that T_ARRAY is not allowed here.
185 int hsize = arrayOopDesc::base_offset_in_bytes(etype);
186 int esize = type2aelembytes(etype);
187 bool isobj = (etype == T_OBJECT);
188 int tag = isobj ? _lh_array_tag_obj_value : _lh_array_tag_type_value;
189 int lh = array_layout_helper(tag, hsize, etype, exact_log2(esize));
190
191 assert(lh < (int)_lh_neutral_value, "must look like an array layout");
|
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/javaClasses.hpp"
27 #include "classfile/dictionary.hpp"
28 #include "classfile/systemDictionary.hpp"
29 #include "classfile/vmSymbols.hpp"
30 #include "gc_implementation/shared/markSweep.inline.hpp"
31 #include "gc_interface/collectedHeap.inline.hpp"
32 #include "memory/heapInspection.hpp"
33 #include "memory/metadataFactory.hpp"
34 #include "memory/oopFactory.hpp"
35 #include "memory/resourceArea.hpp"
36 #include "oops/instanceKlass.hpp"
37 #include "oops/klass.inline.hpp"
38 #include "oops/oop.inline2.hpp"
39 #include "runtime/atomic.hpp"
40 #include "trace/traceMacros.hpp"
41 #include "utilities/stack.hpp"
42 #include "utilities/macros.hpp"
43 #if INCLUDE_ALL_GCS
44 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
45 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
46 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
47 #endif // INCLUDE_ALL_GCS
48
49 void Klass::set_name(Symbol* n) {
50 _name = n;
51 if (_name != NULL) _name->increment_refcount();
52 }
53
54 bool Klass::is_subclass_of(const Klass* k) const {
55 // Run up the super chain and check
56 if (this == k) return true;
57
58 Klass* t = const_cast<Klass*>(this)->super();
59
60 while (t != NULL) {
152 set_super(NULL);
153 for (juint i = 0; i < Klass::primary_super_limit(); i++) {
154 _primary_supers[i] = NULL;
155 }
156 set_secondary_supers(NULL);
157 set_secondary_super_cache(NULL);
158 _primary_supers[0] = k;
159 set_super_check_offset(in_bytes(primary_supers_offset()));
160
161 set_java_mirror(NULL);
162 set_modifier_flags(0);
163 set_layout_helper(Klass::_lh_neutral_value);
164 set_name(NULL);
165 AccessFlags af;
166 af.set_flags(0);
167 set_access_flags(af);
168 set_subklass(NULL);
169 set_next_sibling(NULL);
170 set_next_link(NULL);
171 set_alloc_count(0);
172 TRACE_INIT_ID(this);
173
174 set_prototype_header(markOopDesc::prototype());
175 set_biased_lock_revocation_count(0);
176 set_last_biased_lock_bulk_revocation_time(0);
177
178 // The klass doesn't have any references at this point.
179 clear_modified_oops();
180 clear_accumulated_modified_oops();
181 }
182
183 jint Klass::array_layout_helper(BasicType etype) {
184 assert(etype >= T_BOOLEAN && etype <= T_OBJECT, "valid etype");
185 // Note that T_ARRAY is not allowed here.
186 int hsize = arrayOopDesc::base_offset_in_bytes(etype);
187 int esize = type2aelembytes(etype);
188 bool isobj = (etype == T_OBJECT);
189 int tag = isobj ? _lh_array_tag_obj_value : _lh_array_tag_type_value;
190 int lh = array_layout_helper(tag, hsize, etype, exact_log2(esize));
191
192 assert(lh < (int)_lh_neutral_value, "must look like an array layout");
|