426 }
427 }
428 if (k != this_cp->pool_holder()) {
429 // only print something if the classes are different
430 if (source_file != NULL) {
431 log_debug(class, resolve)("%s %s %s:%d",
432 this_cp->pool_holder()->external_name(),
433 k->external_name(), source_file, line_number);
434 } else {
435 log_debug(class, resolve)("%s %s",
436 this_cp->pool_holder()->external_name(),
437 k->external_name());
438 }
439 }
440 }
441
442 void check_value_types_consistency(const constantPoolHandle& this_cp, Klass* resolved_klass, TRAPS) {
443 bool opinion0 = resolved_klass->is_value();
444 bool opinion1 = this_cp->pool_holder()->is_declared_value_type(resolved_klass->name());
445 if (opinion0 != opinion1) {
446 THROW(vmSymbols::java_lang_IncompatibleClassChangeError());
447 }
448 }
449
450 Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which,
451 bool save_resolution_error, TRAPS) {
452 assert(THREAD->is_Java_thread(), "must be a Java thread");
453
454 // A resolved constantPool entry will contain a Klass*, otherwise a Symbol*.
455 // It is not safe to rely on the tag bit's here, since we don't have a lock, and
456 // the entry and tag is not updated atomicly.
457 CPKlassSlot kslot = this_cp->klass_slot_at(which);
458 int resolved_klass_index = kslot.resolved_klass_index();
459 int name_index = kslot.name_index();
460 assert(this_cp->tag_at(name_index).is_symbol(), "sanity");
461
462 Klass* klass = this_cp->resolved_klasses()->at(resolved_klass_index);
463 if (klass != NULL) {
464 return klass;
465 }
466
|
426 }
427 }
428 if (k != this_cp->pool_holder()) {
429 // only print something if the classes are different
430 if (source_file != NULL) {
431 log_debug(class, resolve)("%s %s %s:%d",
432 this_cp->pool_holder()->external_name(),
433 k->external_name(), source_file, line_number);
434 } else {
435 log_debug(class, resolve)("%s %s",
436 this_cp->pool_holder()->external_name(),
437 k->external_name());
438 }
439 }
440 }
441
442 void check_value_types_consistency(const constantPoolHandle& this_cp, Klass* resolved_klass, TRAPS) {
443 bool opinion0 = resolved_klass->is_value();
444 bool opinion1 = this_cp->pool_holder()->is_declared_value_type(resolved_klass->name());
445 if (opinion0 != opinion1) {
446 ResourceMark rm;
447 stringStream ss;
448 ss.print("constant pool %s inconsistent value type: %s",
449 this_cp->pool_holder()->external_name(), resolved_klass->external_name());
450 THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), ss.as_string());
451 }
452 }
453
454 Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which,
455 bool save_resolution_error, TRAPS) {
456 assert(THREAD->is_Java_thread(), "must be a Java thread");
457
458 // A resolved constantPool entry will contain a Klass*, otherwise a Symbol*.
459 // It is not safe to rely on the tag bit's here, since we don't have a lock, and
460 // the entry and tag is not updated atomicly.
461 CPKlassSlot kslot = this_cp->klass_slot_at(which);
462 int resolved_klass_index = kslot.resolved_klass_index();
463 int name_index = kslot.name_index();
464 assert(this_cp->tag_at(name_index).is_symbol(), "sanity");
465
466 Klass* klass = this_cp->resolved_klasses()->at(resolved_klass_index);
467 if (klass != NULL) {
468 return klass;
469 }
470
|