Mercurial > hg > graal-jvmci-8
comparison src/share/vm/c1/c1_GraphBuilder.cpp @ 18003:dda2ae6f9557
8046542: [I.finalize() calls from methods compiled by C1 do not cause IllegalAccessError on Sparc
Summary: call to Object.finalize() sometimes allowed by compilers on array type
Reviewed-by: iveresov, vlivanov
author | roland |
---|---|
date | Wed, 02 Jul 2014 22:54:18 +0200 |
parents | 45e59fae8f2b |
children | ee1c924763d2 |
comparison
equal
deleted
inserted
replaced
18002:dad84b3f55a5 | 18003:dda2ae6f9557 |
---|---|
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 || |