1991 // The UseInlineCaches only controls dispatch to invokevirtuals for |
1991 // The UseInlineCaches only controls dispatch to invokevirtuals for |
1992 // loaded classes which we weren't able to statically bind. |
1992 // loaded classes which we weren't able to statically bind. |
1993 if (!UseInlineCaches && is_loaded && code == Bytecodes::_invokevirtual |
1993 if (!UseInlineCaches && is_loaded && code == Bytecodes::_invokevirtual |
1994 && !target->can_be_statically_bound()) { |
1994 && !target->can_be_statically_bound()) { |
1995 // Find a vtable index if one is available |
1995 // Find a vtable index if one is available |
1996 vtable_index = target->resolve_vtable_index(calling_klass, callee_holder); |
1996 // For arrays, callee_holder is Object. Resolving the call with |
|
1997 // Object would allow an illegal call to finalize() on an |
|
1998 // array. We use holder instead: illegal calls to finalize() won't |
|
1999 // be compiled as vtable calls (IC call resolution will catch the |
|
2000 // illegal call) and the few legal calls on array types won't be |
|
2001 // either. |
|
2002 vtable_index = target->resolve_vtable_index(calling_klass, holder); |
1997 } |
2003 } |
1998 #endif |
2004 #endif |
1999 |
2005 |
2000 if (recv != NULL && |
2006 if (recv != NULL && |
2001 (code == Bytecodes::_invokespecial || |
2007 (code == Bytecodes::_invokespecial || |