964 const LinkInfo& link_info, |
964 const LinkInfo& link_info, |
965 bool initialize_class, TRAPS) { |
965 bool initialize_class, TRAPS) { |
966 methodHandle resolved_method = linktime_resolve_static_method(link_info, CHECK); |
966 methodHandle resolved_method = linktime_resolve_static_method(link_info, CHECK); |
967 |
967 |
968 // The resolved class can change as a result of this resolution. |
968 // The resolved class can change as a result of this resolution. |
969 KlassHandle resolved_klass = KlassHandle(THREAD, resolved_method->method_holder()); |
969 KlassHandle resolved_klass(THREAD, resolved_method->method_holder()); |
970 |
970 |
971 Method* save_resolved_method = resolved_method(); |
|
972 // Initialize klass (this should only happen if everything is ok) |
971 // Initialize klass (this should only happen if everything is ok) |
973 if (initialize_class && resolved_klass->should_be_initialized()) { |
972 if (initialize_class && resolved_klass->should_be_initialized()) { |
974 resolved_klass->initialize(CHECK); |
973 resolved_klass->initialize(CHECK); |
975 // Use updated LinkInfo (to reresolve with resolved_klass as method_holder?) |
974 // Use updated LinkInfo to reresolve with resolved method holder |
976 LinkInfo new_info(resolved_klass, link_info.name(), link_info.signature(), |
975 LinkInfo new_info(resolved_klass, link_info.name(), link_info.signature(), |
977 link_info.current_klass(), |
976 link_info.current_klass(), |
978 link_info.check_access() ? LinkInfo::needs_access_check : LinkInfo::skip_access_check); |
977 link_info.check_access() ? LinkInfo::needs_access_check : LinkInfo::skip_access_check); |
979 resolved_method = linktime_resolve_static_method(new_info, CHECK); |
978 resolved_method = linktime_resolve_static_method(new_info, CHECK); |
980 } |
979 } |
981 |
980 |
982 assert(save_resolved_method == resolved_method(), "does this change?"); |
|
983 // setup result |
981 // setup result |
984 result.set_static(resolved_klass, resolved_method, CHECK); |
982 result.set_static(resolved_klass, resolved_method, CHECK); |
985 } |
983 } |
986 |
984 |
987 // throws linktime exceptions |
985 // throws linktime exceptions |