Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/systemDictionary.cpp @ 8840:cd3089a56438
8009731: Confusing error message for loader constraint violation
Summary: Fix text, overwritten type and holder for resolved method
Reviewed-by: coleenp, dcubed, minqi, dholmes
author | acorn |
---|---|
date | Wed, 27 Mar 2013 14:10:59 -0400 |
parents | 1fc4d4768b90 |
children | d886ac1dfd36 |
comparison
equal
deleted
inserted
replaced
8823:23f2d309e855 | 8840:cd3089a56438 |
---|---|
2183 // SystemDictionary::check_signature_loaders(sig, l1, l2) | 2183 // SystemDictionary::check_signature_loaders(sig, l1, l2) |
2184 // | 2184 // |
2185 // Make sure all class components (including arrays) in the given | 2185 // Make sure all class components (including arrays) in the given |
2186 // signature will be resolved to the same class in both loaders. | 2186 // signature will be resolved to the same class in both loaders. |
2187 // Returns the name of the type that failed a loader constraint check, or | 2187 // Returns the name of the type that failed a loader constraint check, or |
2188 // NULL if no constraint failed. The returned C string needs cleaning up | 2188 // NULL if no constraint failed. No exception except OOME is thrown. |
2189 // with a ResourceMark in the caller. No exception except OOME is thrown. | |
2190 // Arrays are not added to the loader constraint table, their elements are. | 2189 // Arrays are not added to the loader constraint table, their elements are. |
2191 char* SystemDictionary::check_signature_loaders(Symbol* signature, | 2190 Symbol* SystemDictionary::check_signature_loaders(Symbol* signature, |
2192 Handle loader1, Handle loader2, | 2191 Handle loader1, Handle loader2, |
2193 bool is_method, TRAPS) { | 2192 bool is_method, TRAPS) { |
2194 // Nothing to do if loaders are the same. | 2193 // Nothing to do if loaders are the same. |
2195 if (loader1() == loader2()) { | 2194 if (loader1() == loader2()) { |
2196 return NULL; | 2195 return NULL; |
2197 } | 2196 } |
2198 | 2197 |
2199 ResourceMark rm(THREAD); | |
2200 SignatureStream sig_strm(signature, is_method); | 2198 SignatureStream sig_strm(signature, is_method); |
2201 while (!sig_strm.is_done()) { | 2199 while (!sig_strm.is_done()) { |
2202 if (sig_strm.is_object()) { | 2200 if (sig_strm.is_object()) { |
2203 Symbol* s = sig_strm.as_symbol(CHECK_NULL); | 2201 Symbol* sig = sig_strm.as_symbol(CHECK_NULL); |
2204 Symbol* sig = s; | |
2205 if (!add_loader_constraint(sig, loader1, loader2, THREAD)) { | 2202 if (!add_loader_constraint(sig, loader1, loader2, THREAD)) { |
2206 return sig->as_C_string(); | 2203 return sig; |
2207 } | 2204 } |
2208 } | 2205 } |
2209 sig_strm.next(); | 2206 sig_strm.next(); |
2210 } | 2207 } |
2211 return NULL; | 2208 return NULL; |