comparison src/share/vm/oops/klass.cpp @ 10408:836a62f43af9

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Wed, 19 Jun 2013 10:45:56 +0200
parents b9a918201d47 f2110083203d
children 6b0fd0964b87
comparison
equal deleted inserted replaced
10086:e0fb8a213650 10408:836a62f43af9
35 #include "memory/resourceArea.hpp" 35 #include "memory/resourceArea.hpp"
36 #include "oops/instanceKlass.hpp" 36 #include "oops/instanceKlass.hpp"
37 #include "oops/klass.inline.hpp" 37 #include "oops/klass.inline.hpp"
38 #include "oops/oop.inline2.hpp" 38 #include "oops/oop.inline2.hpp"
39 #include "runtime/atomic.hpp" 39 #include "runtime/atomic.hpp"
40 #include "trace/traceMacros.hpp"
40 #include "utilities/stack.hpp" 41 #include "utilities/stack.hpp"
41 #include "utilities/macros.hpp" 42 #include "utilities/macros.hpp"
42 #if INCLUDE_ALL_GCS 43 #if INCLUDE_ALL_GCS
43 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp" 44 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
44 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp" 45 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
48 void Klass::set_name(Symbol* n) { 49 void Klass::set_name(Symbol* n) {
49 _name = n; 50 _name = n;
50 if (_name != NULL) _name->increment_refcount(); 51 if (_name != NULL) _name->increment_refcount();
51 } 52 }
52 53
53 bool Klass::is_subclass_of(Klass* k) const { 54 bool Klass::is_subclass_of(const Klass* k) const {
54 // Run up the super chain and check 55 // Run up the super chain and check
55 if (this == k) return true; 56 if (this == k) return true;
56 57
57 Klass* t = const_cast<Klass*>(this)->super(); 58 Klass* t = const_cast<Klass*>(this)->super();
58 59
138 return NULL; 139 return NULL;
139 } 140 }
140 141
141 void* Klass::operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) { 142 void* Klass::operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) {
142 return Metaspace::allocate(loader_data, word_size, /*read_only*/false, 143 return Metaspace::allocate(loader_data, word_size, /*read_only*/false,
143 Metaspace::ClassType, CHECK_NULL); 144 MetaspaceObj::ClassType, CHECK_NULL);
144 } 145 }
145 146
146 Klass::Klass() { 147 Klass::Klass() {
147 Klass* k = this; 148 Klass* k = this;
148 149
166 set_access_flags(af); 167 set_access_flags(af);
167 set_subklass(NULL); 168 set_subklass(NULL);
168 set_next_sibling(NULL); 169 set_next_sibling(NULL);
169 set_next_link(NULL); 170 set_next_link(NULL);
170 set_alloc_count(0); 171 set_alloc_count(0);
171 TRACE_SET_KLASS_TRACE_ID(this, 0); 172 TRACE_INIT_ID(this);
172 173
173 set_prototype_header(markOopDesc::prototype()); 174 set_prototype_header(markOopDesc::prototype());
174 set_biased_lock_revocation_count(0); 175 set_biased_lock_revocation_count(0);
175 set_last_biased_lock_bulk_revocation_time(0); 176 set_last_biased_lock_bulk_revocation_time(0);
176 177
509 510
510 // Add to null class loader list first before creating the mirror 511 // Add to null class loader list first before creating the mirror
511 // (same order as class file parsing) 512 // (same order as class file parsing)
512 loader_data->add_class(this); 513 loader_data->add_class(this);
513 514
514 // Recreate the class mirror 515 // Recreate the class mirror. The protection_domain is always null for
515 java_lang_Class::create_mirror(this, CHECK); 516 // boot loader, for now.
517 java_lang_Class::create_mirror(this, Handle(NULL), CHECK);
516 } 518 }
517 519
518 Klass* Klass::array_klass_or_null(int rank) { 520 Klass* Klass::array_klass_or_null(int rank) {
519 EXCEPTION_MARK; 521 EXCEPTION_MARK;
520 // No exception can be thrown by array_klass_impl when called with or_null == true. 522 // No exception can be thrown by array_klass_impl when called with or_null == true.