Duplicated lines in src/share/vm/interpreter/linkResolver.cpp

Dr Andrew John Hughes ahughes at redhat.com
Mon Dec 19 17:38:43 PST 2011


On 14:58 Mon 19 Dec     , Peter B. Kessler wrote:
> I was reading src/share/vm/interpreter/linkResolver.cpp, and noticed
> 
>        789 void LinkResolver::runtime_resolve_virtual_method(CallInfo& result,
>        790                                                   methodHandle resolved_method,
>        791                                                   KlassHandle resolved_klass,
>        792                                                   Handle recv,
>        793                                                   KlassHandle recv_klass,
>        794                                                   bool check_null_and_abstract,
>        795                                                   TRAPS) {
>        ....
>        808   // Virtual methods cannot be resolved before its klass has been linked, for otherwise the methodOop's
>        809   // has not been rewritten, and the vtable initialized.
>        810   assert(instanceKlass::cast(resolved_method->method_holder())->is_linked(), "must be linked");
>        811
>        812   // Virtual methods cannot be resolved before its klass has been linked, for otherwise the methodOop's
>        813   // has not been rewritten, and the vtable initialized. Make sure to do this after the nullcheck, since
>        814   // a missing receiver might result in a bogus lookup.
>        815   assert(instanceKlass::cast(resolved_method->method_holder())->is_linked(), "must be linked");
> 
> The comments are different, but the asserts are the same.  Nothing happens between them that could change the value of the predicate, so one assert is enough.  (I don't actually see the nullcheck that the second comment refers to, but maybe I just missed it.)
> 
> Fixing this is really low priority, but if someone found themselves in this code they could clean it up.
> 
> 			... peter

My guess would be it's probably a merge issue, where a slightly different version of the same fix
has come in from two different places.
-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20111220/e467cfa8/attachment.bin 


More information about the hotspot-runtime-dev mailing list