1.1 --- a/src/share/vm/interpreter/linkResolver.cpp Wed Oct 16 11:48:03 2013 -0700 1.2 +++ b/src/share/vm/interpreter/linkResolver.cpp Thu Oct 17 10:58:45 2013 -0700 1.3 @@ -1,5 +1,6 @@ 1.4 /* 1.5 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -158,6 +159,22 @@ 1.11 index = vt->index_of_miranda(resolved_method->name(), 1.12 resolved_method->signature()); 1.13 kind = CallInfo::vtable_call; 1.14 + } else if (resolved_method->has_vtable_index()) { 1.15 + // Can occur if an interface redeclares a method of Object. 1.16 + 1.17 +#ifdef ASSERT 1.18 + // Ensure that this is really the case. 1.19 + KlassHandle object_klass = SystemDictionary::Object_klass(); 1.20 + Method * object_resolved_method = object_klass()->vtable()->method_at(index); 1.21 + assert(object_resolved_method->name() == resolved_method->name(), 1.22 + err_msg("Object and interface method names should match at vtable index %d, %s != %s", 1.23 + index, object_resolved_method->name()->as_C_string(), resolved_method->name()->as_C_string())); 1.24 + assert(object_resolved_method->signature() == resolved_method->signature(), 1.25 + err_msg("Object and interface method signatures should match at vtable index %d, %s != %s", 1.26 + index, object_resolved_method->signature()->as_C_string(), resolved_method->signature()->as_C_string())); 1.27 +#endif // ASSERT 1.28 + 1.29 + kind = CallInfo::vtable_call; 1.30 } else { 1.31 // A regular interface call. 1.32 kind = CallInfo::itable_call;