791 SignatureStream ss(signature);
792 while (!ss.at_return_type()) {
793 oop mirror = get_mirror_from_signature(method, &ss, CHECK_(objArrayHandle()));
794 mirrors->obj_at_put(index++, mirror);
795 ss.next();
796 }
797 assert(index == parameter_count, "invalid parameter count");
798 if (return_type != NULL) {
799 // Collect return type as well
800 assert(ss.at_return_type(), "return type should be present");
801 *return_type = get_mirror_from_signature(method, &ss, CHECK_(objArrayHandle()));
802 }
803 return mirrors;
804 }
805
806 static objArrayHandle get_exception_types(const methodHandle& method, TRAPS) {
807 return method->resolved_checked_exceptions(THREAD);
808 }
809
810 static Handle new_type(Symbol* signature, Klass* k, TRAPS) {
811 // Basic types
812 BasicType type = vmSymbols::signature_type(signature);
813 if (type != T_OBJECT) {
814 return Handle(THREAD, Universe::java_mirror(type));
815 }
816
817 Klass* result =
818 SystemDictionary::resolve_or_fail(signature,
819 Handle(THREAD, k->class_loader()),
820 Handle(THREAD, k->protection_domain()),
821 true, CHECK_(Handle()));
822
823 if (log_is_enabled(Debug, class, resolve)) {
824 trace_class_resolution(result);
825 }
826
827 oop nt = result->java_mirror();
828 return Handle(THREAD, nt);
829 }
830
831
832 oop Reflection::new_method(const methodHandle& method, bool for_constant_pool_access, TRAPS) {
|
791 SignatureStream ss(signature);
792 while (!ss.at_return_type()) {
793 oop mirror = get_mirror_from_signature(method, &ss, CHECK_(objArrayHandle()));
794 mirrors->obj_at_put(index++, mirror);
795 ss.next();
796 }
797 assert(index == parameter_count, "invalid parameter count");
798 if (return_type != NULL) {
799 // Collect return type as well
800 assert(ss.at_return_type(), "return type should be present");
801 *return_type = get_mirror_from_signature(method, &ss, CHECK_(objArrayHandle()));
802 }
803 return mirrors;
804 }
805
806 static objArrayHandle get_exception_types(const methodHandle& method, TRAPS) {
807 return method->resolved_checked_exceptions(THREAD);
808 }
809
810 static Handle new_type(Symbol* signature, Klass* k, TRAPS) {
811 SignatureStream ss(signature, false);
812 // Basic types
813 BasicType type = ss.is_reference() ? T_OBJECT : ss.type();
814 if (type != T_OBJECT) {
815 return Handle(THREAD, Universe::java_mirror(type));
816 }
817
818 Klass* result =
819 SystemDictionary::resolve_or_fail(signature,
820 Handle(THREAD, k->class_loader()),
821 Handle(THREAD, k->protection_domain()),
822 true, CHECK_(Handle()));
823
824 if (log_is_enabled(Debug, class, resolve)) {
825 trace_class_resolution(result);
826 }
827
828 oop nt = result->java_mirror();
829 return Handle(THREAD, nt);
830 }
831
832
833 oop Reflection::new_method(const methodHandle& method, bool for_constant_pool_access, TRAPS) {
|