comparison src/share/vm/oops/klass.cpp @ 12355:cefad50507d8

Merge with hs25-b53
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 11 Oct 2013 10:38:03 +0200
parents 6b0fd0964b87 b2e698d2276c
children d8041d695d19
comparison
equal deleted inserted replaced
12058:ccb4f2af2319 12355:cefad50507d8
137 #endif 137 #endif
138 ShouldNotReachHere(); 138 ShouldNotReachHere();
139 return NULL; 139 return NULL;
140 } 140 }
141 141
142 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) throw() {
143 return Metaspace::allocate(loader_data, word_size, /*read_only*/false, 143 return Metaspace::allocate(loader_data, word_size, /*read_only*/false,
144 MetaspaceObj::ClassType, CHECK_NULL); 144 MetaspaceObj::ClassType, CHECK_NULL);
145 } 145 }
146 146
147 Klass::Klass() { 147 Klass::Klass() {
672 guarantee(obj->klass()->is_klass(), "klass field is not a klass"); 672 guarantee(obj->klass()->is_klass(), "klass field is not a klass");
673 } 673 }
674 674
675 #ifndef PRODUCT 675 #ifndef PRODUCT
676 676
677 void Klass::verify_vtable_index(int i) { 677 bool Klass::verify_vtable_index(int i) {
678 if (oop_is_instance()) { 678 if (oop_is_instance()) {
679 assert(i>=0 && i<((InstanceKlass*)this)->vtable_length()/vtableEntry::size(), "index out of bounds"); 679 int limit = ((InstanceKlass*)this)->vtable_length()/vtableEntry::size();
680 assert(i >= 0 && i < limit, err_msg("index %d out of bounds %d", i, limit));
680 } else { 681 } else {
681 assert(oop_is_array(), "Must be"); 682 assert(oop_is_array(), "Must be");
682 assert(i>=0 && i<((ArrayKlass*)this)->vtable_length()/vtableEntry::size(), "index out of bounds"); 683 int limit = ((ArrayKlass*)this)->vtable_length()/vtableEntry::size();
683 } 684 assert(i >= 0 && i < limit, err_msg("index %d out of bounds %d", i, limit));
685 }
686 return true;
687 }
688
689 bool Klass::verify_itable_index(int i) {
690 assert(oop_is_instance(), "");
691 int method_count = klassItable::method_count_for_interface(this);
692 assert(i >= 0 && i < method_count, "index out of bounds");
693 return true;
684 } 694 }
685 695
686 #endif 696 #endif