本文整理汇总了C++中oop::partially_loaded方法的典型用法代码示例。如果您正苦于以下问题:C++ oop::partially_loaded方法的具体用法?C++ oop::partially_loaded怎么用?C++ oop::partially_loaded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oop
的用法示例。
在下文中一共展示了oop::partially_loaded方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oop_verify_on
void constMethodKlass::oop_verify_on(oop obj, outputStream* st) {
Klass::oop_verify_on(obj, st);
guarantee(obj->is_constMethod(), "object must be constMethod");
constMethodOop m = constMethodOop(obj);
guarantee(m->is_perm(), "should be in permspace");
// Verification can occur during oop construction before the method or
// other fields have been initialized.
if (!obj->partially_loaded()) {
guarantee(m->method()->is_perm(), "should be in permspace");
guarantee(m->method()->is_method(), "should be method");
typeArrayOop stackmap_data = m->stackmap_data();
guarantee(stackmap_data == NULL ||
stackmap_data->is_perm(), "should be in permspace");
guarantee(m->exception_table()->is_perm(), "should be in permspace");
guarantee(m->exception_table()->is_typeArray(), "should be type array");
address m_end = (address)((oop*) m + m->size());
address compressed_table_start = m->code_end();
guarantee(compressed_table_start <= m_end, "invalid method layout");
address compressed_table_end = compressed_table_start;
// Verify line number table
if (m->has_linenumber_table()) {
CompressedLineNumberReadStream stream(m->compressed_linenumber_table());
while (stream.read_pair()) {
guarantee(stream.bci() >= 0 && stream.bci() <= m->code_size(), "invalid bci in line number table");
}
compressed_table_end += stream.position();
}
guarantee(compressed_table_end <= m_end, "invalid method layout");
// Verify checked exceptions and local variable tables
if (m->has_checked_exceptions()) {
u2* addr = m->checked_exceptions_length_addr();
guarantee(*addr > 0 && (address) addr >= compressed_table_end && (address) addr < m_end, "invalid method layout");
}
if (m->has_localvariable_table()) {
u2* addr = m->localvariable_table_length_addr();
guarantee(*addr > 0 && (address) addr >= compressed_table_end && (address) addr < m_end, "invalid method layout");
}
// Check compressed_table_end relative to uncompressed_table_start
u2* uncompressed_table_start;
if (m->has_localvariable_table()) {
uncompressed_table_start = (u2*) m->localvariable_table_start();
} else {
if (m->has_checked_exceptions()) {
uncompressed_table_start = (u2*) m->checked_exceptions_start();
} else {
uncompressed_table_start = (u2*) m_end;
}
}
int gap = (intptr_t) uncompressed_table_start - (intptr_t) compressed_table_end;
int max_gap = align_object_size(1)*BytesPerWord;
guarantee(gap >= 0 && gap < max_gap, "invalid method layout");
}
}
示例2: oop_verify_on
void arrayKlassKlass::oop_verify_on(oop obj, outputStream* st) {
klassKlass::oop_verify_on(obj, st);
arrayKlass* ak = arrayKlass::cast(klassOop(obj));
if (!obj->partially_loaded()) {
if (ak->lower_dimension())
guarantee(ak->lower_dimension()->klass(), "should have a class");
if (ak->higher_dimension())
guarantee(ak->higher_dimension()->klass(), "should have a class");
}
}
示例3: oop_verify_on
void instanceKlassKlass::oop_verify_on(oop obj, outputStream* st) {
klassKlass::oop_verify_on(obj, st);
if (!obj->partially_loaded()) {
Thread *thread = Thread::current();
instanceKlass* ik = instanceKlass::cast(klassOop(obj));
// Avoid redundant verifies
if (ik->_verify_count == Universe::verify_count()) return;
ik->_verify_count = Universe::verify_count();
// Verify that klass is present in SystemDictionary
if (ik->is_loaded()) {
symbolHandle h_name (thread, ik->name());
Handle h_loader (thread, ik->class_loader());
SystemDictionary::verify_obj_klass_present(obj, h_name, h_loader);
}
// Verify static fields
VerifyFieldClosure blk;
ik->iterate_static_fields(&blk);
// Verify vtables
if (ik->is_linked()) {
ResourceMark rm(thread);
// $$$ This used to be done only for m/s collections. Doing it
// always seemed a valid generalization. (DLD -- 6/00)
ik->vtable()->verify(st);
}
// Verify oop map cache
if (ik->oop_map_cache() != NULL) {
ik->oop_map_cache()->verify();
}
// Verify first subklass
if (ik->subklass_oop() != NULL) {
guarantee(ik->subklass_oop()->is_perm(), "should be in permspace");
guarantee(ik->subklass_oop()->is_klass(), "should be klass");
}
// Verify siblings
klassOop super = ik->super();
Klass* sib = ik->next_sibling();
int sib_count = 0;
while (sib != NULL) {
if (sib == ik) {
fatal1("subclass cycle of length %d", sib_count);
}
if (sib_count >= 100000) {
fatal1("suspiciously long subclass list %d", sib_count);
}
guarantee(sib->as_klassOop()->is_klass(), "should be klass");
guarantee(sib->as_klassOop()->is_perm(), "should be in permspace");
guarantee(sib->super() == super, "siblings should have same superklass");
sib = sib->next_sibling();
}
// Verify implementor field
if (ik->implementor() != NULL) {
guarantee(ik->is_interface(), "only interfaces should have implementor set");
guarantee(ik->nof_implementors() == 1, "should only have one implementor");
klassOop im = ik->implementor();
guarantee(im->is_perm(), "should be in permspace");
guarantee(im->is_klass(), "should be klass");
guarantee(!Klass::cast(klassOop(im))->is_interface(), "implementors cannot be interfaces");
}
// Verify local interfaces
objArrayOop local_interfaces = ik->local_interfaces();
guarantee(local_interfaces->is_perm(), "should be in permspace");
guarantee(local_interfaces->is_objArray(), "should be obj array");
int j;
for (j = 0; j < local_interfaces->length(); j++) {
oop e = local_interfaces->obj_at(j);
guarantee(e->is_klass() && Klass::cast(klassOop(e))->is_interface(), "invalid local interface");
}
// Verify transitive interfaces
objArrayOop transitive_interfaces = ik->transitive_interfaces();
guarantee(transitive_interfaces->is_perm(), "should be in permspace");
guarantee(transitive_interfaces->is_objArray(), "should be obj array");
for (j = 0; j < transitive_interfaces->length(); j++) {
oop e = transitive_interfaces->obj_at(j);
guarantee(e->is_klass() && Klass::cast(klassOop(e))->is_interface(), "invalid transitive interface");
}
// Verify methods
objArrayOop methods = ik->methods();
guarantee(methods->is_perm(), "should be in permspace");
guarantee(methods->is_objArray(), "should be obj array");
for (j = 0; j < methods->length(); j++) {
guarantee(methods->obj_at(j)->is_method(), "non-method in methods array");
}
for (j = 0; j < methods->length() - 1; j++) {
methodOop m1 = methodOop(methods->obj_at(j));
methodOop m2 = methodOop(methods->obj_at(j + 1));
guarantee(m1->name()->fast_compare(m2->name()) <= 0, "methods not sorted correctly");
}
// Verify method ordering
//.........这里部分代码省略.........