8006267: InterfaceMethod_ref should allow invokestatic and invokespecial

Lambda changes; spec 0.6.2 - Allow static invokestatic and invokespecial calls to InterfaceMethod_ref

Reviewed-by: dholmes, acorn
This commit is contained in:
Bharadwaj Yadavalli 2013-04-18 08:05:35 -07:00
parent 54b7ae1ff9
commit f63b13e379
4 changed files with 44 additions and 12 deletions

View file

@ -187,6 +187,11 @@ oop MethodHandles::init_method_MemberName(oop mname_oop, Method* m, bool do_disp
flags |= IS_CONSTRUCTOR | (JVM_REF_invokeSpecial << REFERENCE_KIND_SHIFT);
} else if (mods.is_static()) {
flags |= IS_METHOD | (JVM_REF_invokeStatic << REFERENCE_KIND_SHIFT);
// Check if this method is a lambda method that is generated as
// private static method.
if (m->is_private() && m->method_holder()->is_interface()) {
vmindex = klassItable::compute_itable_index(m);
}
} else if (receiver_limit != mklass &&
!receiver_limit->is_subtype_of(mklass)) {
return NULL; // bad receiver limit