1573 return sig_is_loaded;
1574 }
1575
1576 bool Method::has_unloaded_classes_in_signature(const methodHandle& m, TRAPS) {
1577 Handle class_loader(THREAD, m->method_holder()->class_loader());
1578 Handle protection_domain(THREAD, m->method_holder()->protection_domain());
1579 ResourceMark rm(THREAD);
1580 Symbol* signature = m->signature();
1581 for(SignatureStream ss(signature); !ss.is_done(); ss.next()) {
1582 if (ss.type() == T_OBJECT) {
1583 Symbol* name = ss.as_symbol_or_null();
1584 if (name == NULL) return true;
1585 Klass* klass = SystemDictionary::find(name, class_loader, protection_domain, THREAD);
1586 if (klass == NULL) return true;
1587 }
1588 }
1589 return false;
1590 }
1591
1592 // Exposed so field engineers can debug VM
1593 void Method::print_short_name(outputStream* st) {
1594 ResourceMark rm;
1595 #ifdef PRODUCT
1596 st->print(" %s::", method_holder()->external_name());
1597 #else
1598 st->print(" %s::", method_holder()->internal_name());
1599 #endif
1600 name()->print_symbol_on(st);
1601 if (WizardMode) signature()->print_symbol_on(st);
1602 else if (MethodHandles::is_signature_polymorphic(intrinsic_id()))
1603 MethodHandles::print_as_basic_type_signature_on(st, signature(), true);
1604 }
1605
1606 // Comparer for sorting an object array containing
1607 // Method*s.
1608 static int method_comparator(Method* a, Method* b) {
1609 return a->name()->fast_compare(b->name());
1610 }
1611
1612 // This is only done during class loading, so it is OK to assume method_idnum matches the methods() array
1613 // default_methods also uses this without the ordering for fast find_method
1638 outputStream* _st;
1639 bool _use_separator;
1640
1641 void type_name(const char* name) {
1642 if (_use_separator) _st->print(", ");
1643 _st->print("%s", name);
1644 _use_separator = true;
1645 }
1646
1647 public:
1648 SignatureTypePrinter(Symbol* signature, outputStream* st) : SignatureTypeNames(signature) {
1649 _st = st;
1650 _use_separator = false;
1651 }
1652
1653 void print_parameters() { _use_separator = false; iterate_parameters(); }
1654 void print_returntype() { _use_separator = false; iterate_returntype(); }
1655 };
1656
1657
1658 void Method::print_name(outputStream* st) {
1659 Thread *thread = Thread::current();
1660 ResourceMark rm(thread);
1661 st->print("%s ", is_static() ? "static" : "virtual");
1662 if (WizardMode) {
1663 st->print("%s.", method_holder()->internal_name());
1664 name()->print_symbol_on(st);
1665 signature()->print_symbol_on(st);
1666 } else {
1667 SignatureTypePrinter sig(signature(), st);
1668 sig.print_returntype();
1669 st->print(" %s.", method_holder()->internal_name());
1670 name()->print_symbol_on(st);
1671 st->print("(");
1672 sig.print_parameters();
1673 st->print(")");
1674 }
1675 }
1676 #endif // !PRODUCT || INCLUDE_JVMTI
1677
1678
|
1573 return sig_is_loaded;
1574 }
1575
1576 bool Method::has_unloaded_classes_in_signature(const methodHandle& m, TRAPS) {
1577 Handle class_loader(THREAD, m->method_holder()->class_loader());
1578 Handle protection_domain(THREAD, m->method_holder()->protection_domain());
1579 ResourceMark rm(THREAD);
1580 Symbol* signature = m->signature();
1581 for(SignatureStream ss(signature); !ss.is_done(); ss.next()) {
1582 if (ss.type() == T_OBJECT) {
1583 Symbol* name = ss.as_symbol_or_null();
1584 if (name == NULL) return true;
1585 Klass* klass = SystemDictionary::find(name, class_loader, protection_domain, THREAD);
1586 if (klass == NULL) return true;
1587 }
1588 }
1589 return false;
1590 }
1591
1592 // Exposed so field engineers can debug VM
1593 void Method::print_short_name(outputStream* st) const {
1594 ResourceMark rm;
1595 #ifdef PRODUCT
1596 st->print(" %s::", method_holder()->external_name());
1597 #else
1598 st->print(" %s::", method_holder()->internal_name());
1599 #endif
1600 name()->print_symbol_on(st);
1601 if (WizardMode) signature()->print_symbol_on(st);
1602 else if (MethodHandles::is_signature_polymorphic(intrinsic_id()))
1603 MethodHandles::print_as_basic_type_signature_on(st, signature(), true);
1604 }
1605
1606 // Comparer for sorting an object array containing
1607 // Method*s.
1608 static int method_comparator(Method* a, Method* b) {
1609 return a->name()->fast_compare(b->name());
1610 }
1611
1612 // This is only done during class loading, so it is OK to assume method_idnum matches the methods() array
1613 // default_methods also uses this without the ordering for fast find_method
1638 outputStream* _st;
1639 bool _use_separator;
1640
1641 void type_name(const char* name) {
1642 if (_use_separator) _st->print(", ");
1643 _st->print("%s", name);
1644 _use_separator = true;
1645 }
1646
1647 public:
1648 SignatureTypePrinter(Symbol* signature, outputStream* st) : SignatureTypeNames(signature) {
1649 _st = st;
1650 _use_separator = false;
1651 }
1652
1653 void print_parameters() { _use_separator = false; iterate_parameters(); }
1654 void print_returntype() { _use_separator = false; iterate_returntype(); }
1655 };
1656
1657
1658 void Method::print_name(outputStream* st) const {
1659 Thread *thread = Thread::current();
1660 ResourceMark rm(thread);
1661 st->print("%s ", is_static() ? "static" : "virtual");
1662 if (WizardMode) {
1663 st->print("%s.", method_holder()->internal_name());
1664 name()->print_symbol_on(st);
1665 signature()->print_symbol_on(st);
1666 } else {
1667 SignatureTypePrinter sig(signature(), st);
1668 sig.print_returntype();
1669 st->print(" %s.", method_holder()->internal_name());
1670 name()->print_symbol_on(st);
1671 st->print("(");
1672 sig.print_parameters();
1673 st->print(")");
1674 }
1675 }
1676 #endif // !PRODUCT || INCLUDE_JVMTI
1677
1678
|